On this page
Send posts
One call sends a post to one account or to many. This page covers text, threads, images and video, each network's options, scheduled posts and drafts, and how to retry one account.
Send a post
Send the ids of the accounts in account_ids, up to 20, and the text in text. For one account, send one id.
curl https://api.postsure.dev/v1/posts \ -H "Authorization: Bearer $POSTSURE_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "account_ids": ["<account id>", "<another account id>"], "text": "We just shipped a new release." }'const api = "https://api.postsure.dev";const headers = { Authorization: `Bearer ${process.env.POSTSURE_KEY}`, "Content-Type": "application/json",};const post = await fetch(`${api}/v1/posts`, { method: "POST", headers: { ...headers, "Idempotency-Key": crypto.randomUUID() }, body: JSON.stringify({ account_ids: ["<account id>", "<another account id>"], text: "We just shipped a new release.", }),}).then((r) => r.json());console.log(post.id, post.status);import os, uuidimport requestsapi = "https://api.postsure.dev"headers = {"Authorization": f"Bearer {os.environ['POSTSURE_KEY']}"}post = requests.post( f"{api}/v1/posts", headers={**headers, "Idempotency-Key": str(uuid.uuid4())}, json={ "account_ids": ["<account id>", "<another account id>"], "text": "We just shipped a new release.", },).json()print(post["id"], post["status"])Example response202
{ "id": "cmgwb1n6e000bl808v5j0k8ry", "status": "queued", "text": "We just shipped a new release.", "targets": [ { "account_id": "cmgw7k2xq0003l808x9f2h1ab", "account": { "network": "x", "username": "postsure_demo" }, "status": "queued", "url": null }, { "account_id": "cmgw7m4ta0005l808q3d7c2ze", "account": { "network": "x", "username": "postsure_news" }, "status": "queued", "url": null } ]}The Node.js and Python samples further down use the api and headers of this one.
202 means the post is saved and in the queue. Postsure sends it in the background, so the answer comes at once. Each account gets its own target, with its own status, live link and tries: one account can fail while another goes live. An account gets its posts one at a time, oldest first.
Get the post with GET /v1/posts/{id} to see the result, or add a webhook to hear when it is done. Receipts and retries explains each status.
Send a new Idempotency-Key with each new post. If the call fails or times out, send it again with the same key: you get back the post Postsure already saved, not a second one. API basics has more.
What Postsure checks
Before it saves a post, Postsure checks that:
- every account is in your workspace and is active,
- the text, or each part of a thread, fits every account's network,
- every network of the post takes its files,
- the network options are known and fit the kind of post.
If a check fails, the post is refused and nothing is saved. The answer has error, a code for your program, and message, what to do. A body that is not valid also lists each problem in issues:
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" } ]}An account that must be reconnected gets 409, with each account's status and reason:
An account that must be reconnected409
{ "error": "account_not_active", "message": "Some accounts must be reconnected before posting.", "accounts": [ { "id": "cmgw7m4ta0005l808q3d7c2ze", "username": "postsure_news", "status": "needs_reconnect", "reason": "X no longer accepts this connection. The user may have removed the app's access in X. Reconnect the account." } ]}These are the most common codes a new post can get. The API reference has every one.
| Code | Status | When |
|---|---|---|
invalid_request | 400 | A field is missing or not valid. issues names each one. |
unknown_account | 400 | An account id is not in your workspace. |
unknown_media | 400 | A media id is not in your workspace. |
text_too_long | 400 | The text, or a part of a thread, is too long for one of the networks. |
duplicate_part | 400 | Two parts of a thread have the same text, and the post has an X account. |
media_required | 400 | A network needs an image or a video, and the post has none. |
media_not_supported | 400 | A network does not take the files of the post. |
thread_not_supported | 400 | A network takes one post, not a thread. |
account_not_active | 409 | An account must be reconnected first. |
media_permission_missing | 409 | An X account must be reconnected before it can post images or videos. |
payload_too_large | 413 | The body is over 4,000,000 bytes. |
queue_unavailable | 503 | The post was saved but not queued. Send the same request again, with the same Idempotency-Key. |
A post can also be refused when it would go over a post limit: 429 daily_limit_reached, x_monthly_limit_reached or trial_limit_reached, or 400 x_link_not_allowed for a link in an X post. See When a limit is hit.
Threads
Send thread instead of text to post a thread: 2 to 25 parts, posted in order. Each part is a reply to the part before it. Send text or thread, not both.
curl https://api.postsure.dev/v1/posts \ -H "Authorization: Bearer $POSTSURE_KEY" \ -H "Content-Type: application/json" \ -d '{ "account_ids": ["<account id>"], "thread": [ {"text": "1/3 We just shipped threads."}, {"text": "2/3 Send a thread field with 2 to 25 parts."}, {"text": "3/3 Each part answers the one before it."} ] }'The post a moment later200
{ "id": "cmgwb1n6e000bl808v5j0k8ry", "status": "waiting", "retry_at": "2026-10-18T12:01:02.000Z", "targets": [ { "account": { "network": "x", "username": "postsure_demo" }, "status": "waiting", "error_reason": "Part 2 of 3: Could not reach X. We will try again at 2026-10-18T12:01:02Z.", "retry_at": "2026-10-18T12:01:02.000Z", "parts": [ { "position": 1, "status": "published", "url": "https://x.com/postsure_demo/status/1979234567890123460" }, { "position": 2, "status": "failed", "url": null, "error_reason": "Could not reach X." }, { "position": 3, "status": "queued", "url": null } ] } ]}Here part 1 is live. Postsure could not reach X for part 2, so the post is waiting. The next try, at retry_at, sends parts 2 and 3 only. A retry sends only the parts that are not live yet, so no part is posted twice.
- Each part is checked like
text, and can have its ownmedia_ids. - A thread goes to X, Bluesky, Telegram and Discord. The other networks take one post, not a thread: a post with one of their accounts is refused with
thread_not_supported. - X does not take the same text twice. When the post has an X account, two parts with the same text are refused with
duplicate_part: "Parts 1 and 3 of the thread have the same text. X does not allow posting the same text twice. Change one of them."
Long text
When text is too long for one of the accounts, if_too_long says what happens:
fail(the default)- The post is refused with
text_too_long, and nothing is saved. thread- The text is split into a thread of up to 25 parts. Each part ends with its number, like
1/4.
Postsure cuts at a paragraph break, else a line break, else the end of a sentence, else a space. It never cuts inside a link or an emoji. Images in media_ids stay on part 1. When every account can take the whole text, it goes out as one post. if_too_long works with text only, not with thread.
The thread goes to every account of the post, also to a paid X account that could take the whole text. To keep one long post there, send that account a post of its own.
Each network counts the text in its own way:
| Network | Most in one post | How it counts |
|---|---|---|
| X | 280 on a free account, 25,000 on a paid one | A link is 23. An emoji or a CJK character is 2. |
| Bluesky | 300 graphemes and 3,000 bytes in UTF-8 | An emoji family is 1 grapheme. A link counts in full. |
| Telegram | 4,096 in one message | An emoji is 2. |
| Discord | 2,000 in one message | An emoji is 2, as in JavaScript's String.length. |
The other networks have their own limits, for example 2,200 characters in an Instagram caption. A text over a limit is refused, and the message says how the network counted it:
A text too long for a free X account400
{ "error": "text_too_long", "message": "The text is 1000 characters as X counts them. X allows 280 on accounts without a paid X plan: @postsure_demo. Shorten the text, or send it with if_too_long: thread to post it as a thread."}Images and video
Upload each file first with POST /v1/media, then send its id in media_ids. Send the file as multipart/form-data, in the field file:
curl https://api.postsure.dev/v1/media \ -H "Authorization: Bearer $POSTSURE_KEY" \ -F "file=@launch.png"import { openAsBlob } from "node:fs";const form = new FormData();form.append("file", await openAsBlob("launch.png"), "launch.png");const media = await fetch(`${api}/v1/media`, { method: "POST", headers: { Authorization: headers.Authorization }, body: form,}).then((r) => r.json());console.log(media.id);with open("launch.png", "rb") as f: media = requests.post(f"{api}/v1/media", headers=headers, files={"file": f}).json()print(media["id"])Example response201
{ "id": "cmh0k3v8a0001l908w2n6d4rt", "kind": "image", "mime_type": "image/png", "size_bytes": 482113, "duration_ms": null, "source_url": null, "alt_text": null, "file_name": null, "created_at": "2026-10-18T11:58:40.120Z"}Postsure takes:
- JPEG, PNG and WEBP images, up to 20 MB,
- GIFs, up to 15 MB,
- MP4 and MOV videos, up to 100 MB,
- PDFs, up to 50 MB.
It reads the type from the file's first bytes, not from its name. Each network's own limits are checked later, when you send the post.
To upload from a link instead, send JSON with a url. It must be a public https address that answers with the file itself, with no redirect, within 10 seconds.
Add alt_text to say what an image or a GIF shows, for people who cannot see it: up to 1,000 characters. It is not for a video or a PDF. Postsure sends it with the image on X, Bluesky, Threads, Instagram feed posts, Facebook posts and Pinterest pins. Telegram and Discord do not get it, and neither does X when it does not take it: the post still goes out, and the receipt notes it in warnings. A LinkedIn post refuses a file with alt text today.
curl https://api.postsure.dev/v1/media \ -H "Authorization: Bearer $POSTSURE_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/photos/launch.jpg", "alt_text": "The team on stage, holding up the first printed Postsure poster." }'Example response201
{ "id": "cmh0k4c1f0002l908p7s3x9ka", "kind": "image", "mime_type": "image/jpeg", "size_bytes": 1203554, "source_url": "https://example.com/photos/launch.jpg", "alt_text": "The team on stage, holding up the first printed Postsure poster."}Then send the ids in media_ids. The files are shown in this order. A post takes up to 10 files, and each id only once. For a thread, send media_ids in each part instead.
curl https://api.postsure.dev/v1/posts \ -H "Authorization: Bearer $POSTSURE_KEY" \ -H "Content-Type: application/json" \ -d '{ "account_ids": ["<account id>"], "text": "Two photos from the launch.", "media_ids": ["<media id>", "<another media id>"] }'Example response202
{ "id": "cmgwb1n6e000bl808v5j0k8ry", "status": "queued", "text": "Two photos from the launch.", "media_ids": [ "cmh0k3v8a0001l908w2n6d4rt", "cmh0k4c1f0002l908p7s3x9ka" ]}Upload links
Sometimes a file cannot come through your code: for example, it is on the computer of a person who uses an AI tool. Make a one-time upload link for that person with POST /v1/media/upload-links. They open it in a browser, see a small Postsure page with your workspace's name, and pick one file.
curl -X POST https://api.postsure.dev/v1/media/upload-links \ -H "Authorization: Bearer $POSTSURE_KEY"Example response201
{ "url": "https://app.postsure.dev/upload/EXAMPLE_UPLOAD_CODE", "expires_at": "2026-10-18T12:13:40.120Z", "media_id": "cmh0k3v8a0001l908w2n6d4rt"}media_idis the id the file will get.GET /v1/media/{id}shows itsstate:waitinguntil the file arrives,readyonce it is saved, orexpiredif the link ended first. Only areadyfile can go inmedia_ids.- A link takes one file and ends 15 minutes after it is made. The file gets the same checks and size limits as
POST /v1/media. A refused file can be picked again. - Anyone who has the link can send one file to your workspace while it is open. Share it only with that person.
- A workspace can have 20 open links. One more gets
429too_many_upload_links, andRetry-Aftersays in how many seconds the oldest one ends.
What each network takes
Postsure checks each network's rules for files before it saves the post. A file a network does not take is refused with media_not_supported, and the message names the rule, for example "X takes up to 4 images in one post. This post has 5."
| Network | One post takes |
|---|---|
| X | Up to 4 JPEG, PNG or WEBP images of up to 5 MB each, or one GIF or one video alone. A video is 0.5 to 140 seconds long. |
| Bluesky | Up to 4 JPEG, PNG or WEBP images of up to 2,000,000 bytes each, or one MP4 video alone. No GIF. A video needs an account whose email is confirmed. |
| Telegram | One file, or an album of 2 to 10 photos and videos, or of 2 to 10 PDFs. A GIF goes alone. |
| Discord | Up to 10 images, GIFs and videos, each up to 20 MiB and 25 MiB in all. No PDF yet. |
| At least one file: one image, one video (a reel), or a carousel of 2 to 10 images and videos. A story is one image or one video. | |
| Threads | No file, one image, one video, or a carousel of 2 to 10 images and videos. |
| A text alone, up to 10 photos, or one video alone. A reel is one video of 3 to 90 seconds. A story is one photo, or one video of 3 to 60 seconds. | |
| TikTok | One video, or photos without a video. |
| YouTube | One MP4 or MOV video. |
| One image or one video. | |
| No file, up to 10 images, one video, or one PDF. Not mixed. |
Types, sizes, shapes and lengths have rules too. The API reference has each one.
Network options
Some networks take options of their own, in an object named after the network. Other networks ignore it, but Postsure always checks its form. Three of them are required when the post has an account on that network:
| Option | What it sets | Required |
|---|---|---|
telegram | silent (no sound), protect_content (no forwarding or saving), link_preview, and format: "html" for bold text and links. | No |
discord | allowed_mentions: the users, roles and @everyone the message may ping. Without it, nobody is pinged. | No |
instagram | type: post, reel or story. Also collaborators, a reel's cover, and trial_reel. | No |
facebook | type: post, reel or story. | No |
youtube | title and made_for_kids (both required), privacy, type (video or short), tags, category_id and thumbnail_media_id. | Yes |
tiktok | privacy (required). Also comments, duets, stitches, a video's cover frame, brand labels, and music on photos: each is off when not sent. | Yes |
linkedin | document_title: the title shown on a PDF post. | No |
pinterest | board_id (required), the pin's title and link, and a video pin's cover. | Yes |
TikTok asks apps to show the account's owner its Music Usage Confirmation before a post, and its Branded Content Policy when branded_content is on. Postsure has no screen for this, so your app must show them.
A YouTube post is one video, and the post text is its description:
curl https://api.postsure.dev/v1/posts \ -H "Authorization: Bearer $POSTSURE_KEY" \ -H "Content-Type: application/json" \ -d '{ "account_ids": ["<YouTube account id>"], "text": "How we bake our sourdough, from the starter to the oven.", "media_ids": ["<video media id>"], "youtube": { "title": "How we bake our sourdough", "privacy": "unlisted", "made_for_kids": false, "tags": ["sourdough", "home baking"], "category_id": "26", "thumbnail_media_id": "<image media id>" } }'Example response202
{ "id": "cmgwb1n6e000bl808v5j0k8ry", "status": "queued", "text": "How we bake our sourdough, from the starter to the oven.", "media_ids": [ "cmh0k5d2g0003l908q8t4y0lb" ], "youtube": { "title": "How we bake our sourdough", "privacy": "unlisted", "made_for_kids": false, "tags": [ "sourdough", "home baking" ], "category_id": "26", "thumbnail_media_id": "cmh0k7f5k0005l908s1v6a2nd" }, "targets": [ { "account_id": "cmh4b2m9r0002l808t5w8z3cy", "account": { "network": "youtube", "username": "Corner Bakery TV" }, "status": "queued" } ]}An Instagram reel with a cover image, two collaborators and a trial reel:
Request body
{ "account_ids": [ "cmh3a2m9r0002l808t5w8z3cy" ], "text": "Behind the scenes of the launch.", "media_ids": [ "cmh0k5d2g0003l908q8t4y0lb" ], "instagram": { "type": "reel", "cover_media_id": "cmh0k7f5k0005l908s1v6a2nd", "collaborators": [ "postsure_studio", "partner.co" ], "trial_reel": "manual" }}Postsure refuses an unknown option with invalid_request. It also refuses an option in camelCase, except in linkedin, where it drops it.
An unknown Telegram option400
{ "error": "invalid_request", "message": "The request body is not valid.", "issues": [ { "path": "telegram", "message": "Unknown Telegram option \"parse_mode\". The options are silent, protect_content, link_preview and format." } ]}Made with AI
Send "made_with_ai": true when AI made the post, for example when an agent wrote it. It is false when not sent. What Postsure does with it depends on the network:
| Network | With made_with_ai: true |
|---|---|
| X | Sends X's Made with AI disclosure. X shows a label on the post, also on a text-only one. On a thread, it goes with every part. |
| Sends Instagram's AI label, on every kind of post. | |
| YouTube | Marks the video as altered or synthetic content. Without made_with_ai, it is marked as not. |
| TikTok | Sends TikTok's AI-generated content label on a video. On a photo post, true is refused. |
| Taken, but not sent: LinkedIn has no AI label. | |
| Facebook, Threads, Pinterest | true is refused with invalid_request: Postsure cannot send their AI label yet. |
Scheduled posts
Send publish_at to send a post later instead of now. It is an ISO 8601 time with a time zone: Z, or an offset like +02:00. Postsure saves it in UTC.
curl https://api.postsure.dev/v1/posts \ -H "Authorization: Bearer $POSTSURE_KEY" \ -H "Content-Type: application/json" \ -d '{ "account_ids": ["<account id>"], "text": "Our new release is out today.", "publish_at": "2026-11-20T11:00:00+02:00" }'Example response202
{ "id": "cmgwb1n6e000bl808v5j0k8ry", "status": "scheduled", "publish_at": "2026-11-20T09:00:00.000Z", "text": "Our new release is out today."}The post is scheduled until then: nothing is sent, and no webhook either. At that time it becomes queued and goes out as any post. Postsure uses the account as it is then: an account removed since fails with its reason.
publish_at must be later than now and at most 365 days ahead. Else the post is refused with invalid_request, and issues says why:
publish_at is in the past.publish_at is more than 365 days ahead.publish_at must be an ISO 8601 time with a time zone, for example 2026-11-20T09:00:00Z or 2026-11-20T11:00:00+02:00.
To change its time, move it. To stop it, cancel it. To schedule a draft, send publish_at when you publish it.
Move a scheduled post
PATCH /v1/posts/{id} with publish_at alone moves a scheduled post to a new time:
curl -X PATCH https://api.postsure.dev/v1/posts/<post id> \ -H "Authorization: Bearer $POSTSURE_KEY" \ -H "Content-Type: application/json" \ -d '{"publish_at": "2026-11-20T14:00:00Z"}'Example response200
{ "id": "cmgwb1n6e000bl808v5j0k8ry", "status": "scheduled", "publish_at": "2026-11-20T14:00:00.000Z", "text": "Our new release is out today."}- The new time gets the same checks as at create: later than now, at most 365 days ahead, and with a time zone. The same time as now changes nothing.
- The post is then sent once, at its new time. It is not sent twice, and it is not dropped.
- A scheduled post takes
publish_atonly. Any other field gets409post_not_draft, and so does a move of acancelledpost. - Once its send has started (
queued,publishing,waitingor already sent), a post cannot move:409post_already_sending. A move and the start of the send never mix: either the post is sent at its new time, or the send started first and the move is refused. - The new time is checked against each account's daily limit and your workspace's X posts. A time with no room gets
429daily_limit_reachedorx_monthly_limit_reached, and the post keeps its time. - If the answer is
503queue_unavailable, the new time is saved, but the send at that time could not be set up. Send the same request again. Until then, a post moved to an earlier time is sent at its old time, late but once. - If the answer is
503billing_busy, your plan is being updated right now. Nothing changes, and the post keeps its time. Send the same request again after theRetry-Afterheader's seconds. - The move sends nothing, and no webhook or email either.
Drafts
Send "draft": true to save a post without sending it. A draft gets the same checks as any post, so it can be published as it is. Nothing sends it, and no webhook is sent for it, until you publish it. A retry with the same Idempotency-Key returns the draft as it is now. A draft takes no publish_at: it gets its time when you publish it.
Change a draft
PATCH /v1/posts/{id} changes a draft. Send only what changes:
curl -X PATCH https://api.postsure.dev/v1/posts/<post id> \ -H "Authorization: Bearer $POSTSURE_KEY" \ -H "Content-Type: application/json" \ -d '{"text": "Hello again from Postsure!", "media_ids": null}'Example response200
{ "id": "cmgwb1n6e000bl808v5j0k8ry", "status": "draft", "text": "Hello again from Postsure!", "media_ids": []}- A field you send replaces the draft's. A field you leave out keeps its value.
nullremoves an optional field, such asmedia_idsor a network's options. - A network's options are replaced whole, not merged.
- The changed draft gets every check of
POST /v1/posts. A change that fails one is refused with the same error, and the draft stays as it was. - Only a draft's content can change. Any other status gets
409post_not_draft: "Only a draft can be changed. This post is published." Ascheduledpost can only move. - A change takes no
Idempotency-Key: the same change sent twice gives the same draft. It cannot setdraft, and a draft takes nopublish_athere: schedule it when you publish it.
Publish a draft
POST /v1/posts/{id}/publish sends the draft. With no body, it is queued now. With publish_at in the body, it becomes scheduled for that time.
curl -X POST https://api.postsure.dev/v1/posts/<post id>/publish \ -H "Authorization: Bearer $POSTSURE_KEY"Example response202
{ "id": "cmgwb1n6e000bl808v5j0k8ry", "status": "queued", "text": "Hello again from Postsure!"}- Postsure checks the accounts again first. If one must be reconnected, the answer is
409account_not_active, and the post stays a draft. - A draft is published once. A post that is not a draft is returned as it is, with no error, and nothing is sent again.
Cancel a post
POST /v1/posts/{id}/cancel stops a post before its send starts. You can cancel:
- a
draft, - a
scheduledpost, - a
queuedpost whose send has not started on any account.
curl -X POST https://api.postsure.dev/v1/posts/<post id>/cancel \ -H "Authorization: Bearer $POSTSURE_KEY"Example response200
{ "id": "cmgwb1n6e000bl808v5j0k8ry", "status": "cancelled", "text": "Hello from Postsure!", "targets": [ { "account_id": "cmgw7k2xq0003l808x9f2h1ab", "account": { "network": "x", "username": "postsure_demo" }, "status": "cancelled", "url": null } ]}The post and all its targets become cancelled, and nothing sends it after that. Cancelling twice is safe: a cancelled post is returned as it is. No webhook is sent for a cancel.
Once the send has started (publishing, waiting), or the post is done, the cancel is refused with 409 post_already_sending, and the post stays as it is. Postsure never deletes a post on a network.
Retry or settle an account
Postsure never sends a failed or an unconfirmed post again by itself. You decide, one account at a time. Two calls act on one target of a post, by its id in targets[].id:
POST /v1/posts/{id}/targets/{targetId}/retrysends afailedtarget again, or anunconfirmedone after you checked the account.POST /v1/posts/{id}/targets/{targetId}/confirm-postedsays that anunconfirmedtarget's post is live.
Retry when the post itself is fine: after you reconnect the account, give a missing right, or wait for a limit to reset. When the text or a file must change, make a new post: only a draft can change. Why it failed says what to do for each error type.
Retry an account
curl -X POST https://api.postsure.dev/v1/posts/<post id>/targets/<target id>/retry \ -H "Authorization: Bearer $POSTSURE_KEY"Example response202
{ "id": "cmgwb1n6e000bl808v5j0k8ry", "status": "publishing", "sent_at": "2026-10-18T12:00:00.000Z", "targets": [ { "id": "cmgwb1n6f000cl808a2m4s9tw", "account_id": "cmgw7k2xq0003l808x9f2h1ab", "account": { "network": "x", "username": "postsure_demo" }, "status": "queued", "error_category": null, "error_reason": null, "attempts": [ { "number": 1, "outcome": "failed", "started_at": "2026-10-18T12:00:01.512Z", "finished_at": "2026-10-18T12:00:01.904Z" } ] } ]}- The target goes back in its account's line, behind the posts already there, as its next try. The post becomes
publishing. - The tries before it stay in
attempts, so the receipt shows each one.sent_atkeeps the first send time. - A thread sends only its parts that are not live yet. The first of them is a reply to the last live part.
- Two retries at the same moment make one try. A target that a retry already put back on its way is returned as it is now.
- When the try ends, the post sends its webhooks again, as any post does:
post.published,post.failedand the others.
A retry that is refused changes nothing:
| Code | Status | When |
|---|---|---|
invalid_request | 400 | The body is not valid. not_posted must be true or false, it needs checked_attempt, and no other field is taken. |
x_link_not_allowed | 400 | The target is an X account, and the text has a link. X posts take no link: make a new post without it. |
plan_required | 402 | Your workspace has no plan. Choose one, then retry. |
not_found | 404 | No post with this id in your workspace, or no target with this id on the post. |
target_not_failed | 409 | The target is not failed or unconfirmed. For example, it is published, or still being sent. |
target_unconfirmed | 409 | The target is unconfirmed, and the body has no not_posted. See An unconfirmed account. |
account_not_active | 409 | The account must be reconnected first, or it was removed. Connect it again, then retry. |
retry_too_soon | 409 | The network's limit for this account has not reset yet: retry after the time in the message. Or Postsure's last call may still be running. |
attempt_changed | 409 | checked_attempt is not the last attempt's number: the post was sent again after you checked. |
thread_cannot_continue | 409 | You confirmed a part of this thread is live, so the parts after it cannot be sent. See Confirm a post is live. |
billing_busy | 503 | Your plan is being updated right now. Send the same retry again after the Retry-After header's seconds. |
queue_unavailable | 503 | The target is back in its line, but its send did not start yet. It starts by itself within a few minutes. Sending the same retry again is safe: it is sent once. |
An unconfirmed account
An unconfirmed target may be live, so a plain retry of it is refused:
A retry with no check409
{ "error": "target_unconfirmed", "message": "Postsure sent this post to X but got no answer, so it may be live. Check the account on X first. If the post is not there, retry with { \"not_posted\": true }. If it is there, call confirm-posted instead."}Look at the account on the network first. If the post is not there, retry with not_posted. Send in checked_attempt the number of the last attempt you saw in attempts, or 0 if attempts is empty:
curl -X POST https://api.postsure.dev/v1/posts/<post id>/targets/<target id>/retry \ -H "Authorization: Bearer $POSTSURE_KEY" \ -H "Content-Type: application/json" \ -d '{"not_posted": true, "checked_attempt": 1}'- Check with care. If the post is there after all, this makes a second post. Bluesky is the one exception: Postsure first reads the post back by its saved record key, so a post that did go out is found and never made twice.
- If the post was sent again after you checked, your number is not the last attempt's any more. The retry gets
409attempt_changed: check again, then answer with the new number. - While Postsure's last call may still be running, the retry gets
409retry_too_soon, andretry_atsays when the answer is taken:
The last call may still be running409
{ "error": "retry_too_soon", "message": "Postsure's last call to X may still be running. Check the account again after 2026-10-19T12:16:00Z, then answer.", "retry_at": "2026-10-19T12:16:00.000Z"}If the post is there, confirm it instead.
Confirm a post is live
Call confirm-posted when you found the post of an unconfirmed target on the account. It takes no body.
curl -X POST https://api.postsure.dev/v1/posts/<post id>/targets/<target id>/confirm-posted \ -H "Authorization: Bearer $POSTSURE_KEY"Example response202
{ "id": "cmgwb1n6e000bl808v5j0k8ry", "status": "published", "targets": [ { "account_id": "cmgw7k2xq0003l808x9f2h1ab", "account": { "network": "x", "username": "postsure_demo" }, "status": "published", "url": "https://x.com/postsure_demo/status/1979234567890123456", "confirmed_at": null }, { "account_id": "cmgw7m4ta0005l808q3d7c2ze", "account": { "network": "x", "username": "postsure_news" }, "status": "published", "url": null, "confirmed_at": "2026-10-18T12:20:00.000Z", "status_text": "Published (you confirmed it)" } ]}- Nothing is sent, and the network is not called.
- The target becomes
published, withconfirmed_atand the status text "Published (you confirmed it)". It has no link and no post id: Postsure never got them. - In a thread whose later parts were never sent, those parts cannot be sent any more: Postsure needs the confirmed part's link to reply to it. The target becomes
failed, with the reason, and a retry of it gets409thread_cannot_continue. Post the rest on the network yourself. - The post's status changes as at the end of its send, with the same webhooks.
- It cannot be undone. A target confirmed before is returned as it is now. Any other target gets
409target_not_unconfirmed. - If the answer is
503queue_unavailable, the confirm is saved, but the post's status is not updated yet. It is updated by itself within a few minutes, with its webhook. Sending the same call again is safe.
List posts
GET /v1/posts lists the posts of your workspace, newest first unless you send sort. Each post is the same as GET /v1/posts/{id} returns it, with its result on each account. This one asks for the posts that failed or may be live, 50 a page:
curl "https://api.postsure.dev/v1/posts?status=failed,unconfirmed&limit=50" \ -H "Authorization: Bearer $POSTSURE_KEY"const params = new URLSearchParams({ status: "failed,unconfirmed", limit: "50" });for (;;) { const page = await fetch(`${api}/v1/posts?${params}`, { headers }).then((r) => r.json()); for (const p of page.data) console.log(p.id, p.status); if (!page.next_cursor) break; params.set("cursor", page.next_cursor);}params = {"status": "failed,unconfirmed", "limit": 50}while True: page = requests.get(f"{api}/v1/posts", headers=headers, params=params).json() for p in page["data"]: print(p["id"], p["status"]) if not page["next_cursor"]: break params["cursor"] = page["next_cursor"]Example response200
{ "data": [ { "id": "cmgwa9k2b0003l808h4j5k6m7", "status": "failed", "text": "Hello from Postsure!", "targets": [ { "account_id": "cmgw7k2xq0003l808x9f2h1ab", "account": { "network": "x", "username": "postsure_demo" }, "status": "failed", "url": null, "error_category": "content_policy", "error_reason": "X does not allow posting the same text twice." } ] } ], "next_cursor": null}status- One or more statuses, comma-separated (
status=failed,unconfirmed) or repeated. Not sent: every status. account_id- The posts sent, or to be sent, to this account.
profile_id- A client's id: the API calls a client a profile. Only the posts with at least one account of this client. An id that is not in your workspace gives an empty list.
network- One or more networks, like
xortelegram, comma-separated or repeated. Only the posts with at least one account of one of them. Not sent: every network. Withaccount_id, a post needs both: that account, and an account of the network. created_after,created_before- A range on
created_at, in ISO 8601 with a time zone.created_afterincludes the time itself;created_beforeleaves it out. send_time_after,send_time_before- A range on the send time, in ISO 8601 with a time zone.
send_time_afterincludes the time itself;send_time_beforeleaves it out, and must be later. The send time ispublish_atwhen the post has one, elsesent_at, elsecreated_at. A draft with nopublish_athas no send time, so it is left out when you send either one. q- Only the posts whose text has these characters, in any part of a thread, in any case. It is a simple search: the characters are matched as typed,
%and_too. 1 to 100 characters, with the spaces at the ends left out. limit- Posts on a page: 1 to 100, 20 when not sent. Over 100 is refused, not cut.
cursor- The
next_cursorof the page before, with the same filters.next_cursorisnullon the last page. sort- The order.
created_desc, the default: newest made first.send_time_asc: soonest send time first.send_time_desc: latest send time first. Posts with the same send time are inidorder. In both send-time orders, drafts come last, by when they were made: oldest first withsend_time_asc, newest first withsend_time_desc.
The filters combine. A post made between two pages never causes a gap or a repeat.
A next_cursor works only with its own sort: send the same sort with it. With another one, the call answers 400 invalid_cursor. In a send-time order, a post whose send time changes between two pages may move in the order.
Every field, limit and error is in the API reference.