On this page

API basics

What every call to the Postsure API has in common: the address, the key, JSON, errors, safe retries and pages.

Base URL

Every call goes to one host, and every API path starts with /v1: https://api.postsure.dev/v1.

For example, GET /v1/accounts is https://api.postsure.dev/v1/accounts. The MCP server for AI tools is outside /v1, on its own host: https://mcp.postsure.dev/mcp. See MCP server.

Your API key

Send your key in the Authorization header of every call, as Bearer <key>. Keys start with ps_live_. Get yours in the web app, under Developers → API keys.

curl https://api.postsure.dev/v1/accounts \  -H "Authorization: Bearer $POSTSURE_KEY"

Without a good key, the answer is 401 with one of these errors:

ErrorMessageWhen
missing_api_keySend your API key as: Authorization: Bearer <key>There is no key, or no Bearer before it.
invalid_api_keyThis API key is not valid or was revoked.The key is wrong, or it was revoked.

A key belongs to one workspace. Each call sees only that workspace: its accounts, posts, media and webhooks. Keep the key secret, like a password: anyone who has it can post to your accounts.

Make and revoke keys

You make and revoke API keys in the web app, under Developers → API keys.

Keys for some accounts

A key can use every account of your workspace, or only some accounts. You choose when you make the key: the web app sends the accounts in limit.account_ids, at most 100. The limit cannot change later, so make a new key instead.

A key for some accounts:

Health check

GET /v1/health needs no API key. Use it to check that the API is up.

curl

curl https://api.postsure.dev/v1/health

Example response200

{  "status": "ok"}

200 with "status": "ok" means the API is up. 503 with "status": "degraded" means a part of the service it needs is down. The answer also has telegram and discord, the state of Postsure's bots on those networks. They never change status.

JSON and snake_case

Ids and times

Errors

Every error answer has the same shape, except the health check's 503. error is a short code for your program to check. message is the reason in plain English, for people.

A body that is not valid400

{  "error": "invalid_request",  "message": "The request body is not valid.",  "issues": [    {      "path": "account_ids",      "message": "Too small: expected array to have >=1 items"    },    {      "path": "text",      "message": "Too small: expected string to have >=1 characters"    }  ]}

Some errors have one more field:

issues
With most invalid_request answers: what is wrong in the request. Each item has a path, the key you sent, and a message.
accounts
With account_not_active and media_permission_missing: the accounts to reconnect, each with its id, username, status and reason.
post_id
With queue_unavailable: the post that was saved.
retry_at
With rate_limited, when you connect a Bluesky account: when to try again, if known.

Common error codes

StatusErrorWhat it means
400invalid_requestThe body, the query or a header is not valid. Most of these answers have issues, which says what.
400bad_requestThe body is not valid JSON.
400unknown_accountunknown_mediaAn account id or a media id in the body is not in your workspace.
400text_too_longThe text is too long for one of the accounts. The message names the account and its limit.
400media_not_supportedA network does not take the post's files. The message says why.
400invalid_cursorThe cursor is not from this list.
401missing_api_keyinvalid_api_keyNo API key, or a wrong or revoked one.
404not_foundNothing with this id in your workspace, or no such path.
409account_not_activeAn account of the post must be reconnected, or it is disabled. accounts lists them.
413payload_too_largeThe body is over 4,000,000 bytes.
503queue_unavailableThe post was saved but not queued. Send the same request again, with the same Idempotency-Key.

The API reference lists every error of every call.

Retry a request safely

A call can time out, or its answer can get lost on the way. Then you do not know if Postsure saved the post. Send POST /v1/posts with an Idempotency-Key header, and you can send it again safely.

KEY=$(uuidgen)curl https://api.postsure.dev/v1/posts \  -H "Authorization: Bearer $POSTSURE_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: $KEY" \  -d '{"account_ids": ["<account id>"], "text": "Hello from Postsure!"}'# No answer? Run the same curl again. $KEY stays the same.

Example response202

{  "id": "cmgwb1n6e000bl808v5j0k8ry",  "status": "queued",  "text": "Hello from Postsure!",  "idempotency_key": "4f9d2c7e-8b1a-4e3f-9a6d-2c5b7e1f0a3d",  "created_at": "2026-10-18T12:00:00.000Z"}

Lists and pages

GET /v1/posts lists your posts, newest first, one page at a time:

curl "https://api.postsure.dev/v1/posts?limit=2" \  -H "Authorization: Bearer $POSTSURE_KEY"

A page with limit=2200

{  "data": [    {      "id": "cmh0q4z2k0007l708c1d2e3f4",      "status": "queued",      "created_at": "2026-10-18T12:05:00.000Z",      "targets": [        {          "account": {            "network": "x",            "username": "postsure_demo"          },          "status": "queued",          "url": null        }      ]    },    {      "id": "cmgwb1n6e000bl808v5j0k8ry",      "status": "published",      "created_at": "2026-10-18T12:00:00.000Z",      "targets": [        {          "account": {            "network": "x",            "username": "postsure_demo"          },          "status": "published",          "url": "https://x.com/postsure_demo/status/1979234567890123456"        }      ]    }  ],  "next_cursor": "cmgwb1n6e000bl808v5j0k8ry"}

GET /v1/accounts has no pages: it answers with all your accounts at once, in data, newest first. A webhook's deliveries (GET /v1/webhooks/{id}/deliveries) page like posts, with limit and cursor.

Limits