requests.
Replace
YOUR_API_KEY, WORKSPACE_ID, ACCOUNT_ID and POST_ID with your own values. The ids are numbers. In Node.js, save a block as a .mjs file and run it with node.Get a key
- Open Settings → API and click New key.
- Name it, for example “Quickstart”. Under Start from, choose Pick myself, then click Next: check what it can do.
- Set Workspaces to Read, Social accounts to Read and Posts to Schedule & publish. Leave the rest at No access. The key then has
workspaces:read,accounts:read,posts:read,posts:create,posts:update,posts:scheduleandposts:publish. - Click Create API Key and copy the key. It’s shown once.
Authorization: Bearer YOUR_API_KEY.
1. List your workspaces
This read checks the key and gives you the workspace’sid and timezone.
Response
timezone. Use this workspace’s id as WORKSPACE_ID.
2. Find the account to post to
Response
workspace_id is your workspace, whose needs_reconnect is false and whose plan_allows_posting is true (on Free outside a first week, new posts go to 2 accounts and the others are refused with "limit": "free_accounts"). Its id is ACCOUNT_ID.
3. Save a draft
A draft is saved in PostSyncer and goes nowhere. This one is text only, for one account.201 with the post (shortened here):
Response
platforms has one row per account, each with its own status. The post’s id is POST_ID.
4. Schedule it
Update the post withschedule_type: "schedule" and a time. This needs posts:update and posts:schedule.
Response
- An update sends the full
contentagain. What you leave out, such asaccounts, keeps what the post has. schedule_foris read in the workspace’s timezone. To give the time in another one, add"timezone": "America/New_York"toschedule_for. It applies to this post only, and answers still show times in the workspace’s timezone.- The time must be in the future, or the API answers
422.
5. Check the post
Response
SCHEDULED for 09:00 on 15 March 2030, and its X row is PENDING: not sent yet. The row’s posted_on is a list of the times it went out, such as ["2030-03-15 09:00"], so it’s empty for now. When it goes out, the post ends PUBLISHED, PARTIALLY_FAILED or FAILED. Core concepts has every status.
6. See it on the calendar
In the app, switch to this workspace and open the calendar on March 2030. The post is on 15 March at 09:00. To remove it, delete it in the app, or callDELETE /posts/{id} with a key that has posts:delete. It was never sent, so nothing changes on X.
Next steps
Core concepts
Workspaces, accounts, posts, platform rows and statuses.
Test safely
Drafts, draft-only keys, test accounts and what can’t be undone.
Create a post
Media, threads, first comments, repeats and settings per network.
Webhooks
Hear when a post is published or fails.