Workspace

Schedule posts with the API

Create a key, then use posts:write and posts:publish on the posts route to schedule, publish now, or retry a job.

Who it is for

Use this when a trusted tool should create posts in one workspace. API keys are on Pro, Agency, and Scale. Free and Creator do not include them.

Before you start

  • Create the key first. The screen steps are in Create an API key.
  • Send the secret as a bearer token on Authorization. The posts route is /api/v1/posts.
  • Pro allows 2 active keys, Agency allows 10, and Scale has no key cap. A plan without keys returns "API keys are not included in your current plan. Upgrade to unlock API access."

Steps

  1. Create the key

    In the sidebar, open More, then click API Keys. Under Create key, name it and click Create API key.

    Name the key, review the scope checkboxes, and click Create API key. The default scopes omit posts:publish and queue:write so a new key can schedule without publishing now.

    The API Keys page with the create form.
  2. Copy the secret once

    Copy the key when it is shown. The page says the key is shown once.

    Add posts:publish only when the key must publish immediately. Add queue:write only when it must retry or cancel jobs.

    A newly created API key on the API Keys page.
  3. Schedule or publish now

    POST /api/v1/posts requires posts:write. The body needs workspaceId and at least one target, with socialAccountId and format. text and title are optional. scheduledAt is an ISO datetime.

    Leave publishNow off and set scheduledAt at least one minute ahead. The post and its job are Scheduled, and Posts shows them on the Scheduled tab. Set publishNow to true only on a key that also has posts:publish. That queues the post now. Posts labels the job Ready to send. A missing future time returns "Scheduled posts require a future scheduledAt time."

    The Posts page on the Scheduled tab.
  4. Edit, cancel, read the queue, and retry

    PATCH /api/v1/posts/{post id} updates caption, variants, media, and scheduledAt for pending channels. DELETE /api/v1/posts/{post id}?pendingOnly=true cancels remaining jobs and leaves published channels alone. POST /api/v1/queue/{job id}/cancel cancels one pending job. PATCH /api/v1/posts/{post id}/schedule moves pending jobs to a new time.

    GET /api/v1/queue requires queue:read. Pass workspaceId, and status if you want one state: SCHEDULED, QUEUED, PUBLISHING, PUBLISHED, RETRYING, FAILED, DEAD_LETTER, or CANCELED. The list is capped at 250 jobs.

    POST /api/v1/queue/{job id}/retry requires queue:write. Only failed, dead-letter, or retrying jobs can be retried. Scheduled or queued jobs cannot be forced early. Retry never moves scheduledAt into the past or present for a future job.

    View publishing details with the Try again button on a failed post.

What the fields mean

posts:write. Required to create a post on /api/v1/posts. It does not allow publishNow by itself.

posts:publish. Required only when publishNow is true. Without it the response is 403 and "API key missing scope: posts:publish".

scheduledAt. ISO datetime at least one minute ahead when you are not publishing now.

publishNow. True queues the post immediately and does not keep the scheduled time. False schedules it.

workspaceId. Required. A key tied to one workspace cannot write a different workspace. That error is "API key is not scoped to this workspace."

queue:read and queue:write. queue:read lists jobs. queue:write retries or cancels one job.

Zapier and n8n

PostTempo does not ship a Zapier app or an n8n node. Those tools call the same /api/v1/posts route with the bearer key. Use a key that has posts:write and does not have posts:publish when the zap or flow should only schedule.

The walkthroughs are Zapier social workflow and n8n social workflow.

Let an AI agent post

Pro includes 2 API keys, Agency includes 10, and Scale has no key cap. Those three plans also include the agent API. POST /api/v1/ai/generate requires the scope ai:generate. The Create API key button does not add ai:generate, so a key from that button can schedule posts and cannot call the generate route.

Give the agent posts:write. Leave posts:publish off when a person must be the one to publish now. The button on API Keys includes posts:publish, so use POST /api/api-keys with a shorter scopes list for that agent.

An API key cannot send a post for review. That call is signed in, and it requires Owner, Admin, or Editor, as described in Review approvals. Approve records the decision and does not create a publish job. If a content check blocks the caption, the posts route returns an error and does not queue a job.

Tips and troubleshooting

  • GET /api/v1/accounts with accounts:read lists the connected accounts, including the ids you put in targets.
  • A target account must be connected in that workspace. Otherwise the route says one or more selected social accounts are not connected.
  • If the plan later loses API access, PostTempo turns the key off.

What to do next

Next step

Continue with Create and switch workspaces.

Back to the Workspace hubHelp Center home

Schedule posts with the API | PostTempo Help