API quickstart
From an API key to a published post in six calls.
Last updated 7 November 2026
Basics
- Base URL
https://api.postboba.com/v1. JSON in camelCase; times in RFC 3339. - IDs are prefixed so you always know what you hold:
brd_brand,acc_account,dst_destination,med_media,pst_post,tgt_one destination of a post. - Lists take
?limit=and&cursor=and return{ data, nextCursor }. - Unknown fields are rejected with
400 unknown_field, so a typo never silently changes what happens.
The API is described in OpenAPI 3.1. The full interactive reference will be published at api.postboba.com/docs; this page covers the calls you need first.
Authentication
Send an API key as a bearer token. Keys start with pb_live_, or pb_test_ for test mode, where a simulator stands in for the platforms and nothing leaves our servers. Give each key only the scopes it needs, for example posts:write and posts:publish.
curl https://api.postboba.com/v1/me \
-H "Authorization: Bearer pb_test_…"MCP clients and third-party apps sign in with OAuth 2.1 instead; see MCP.
Connect an account
A person connects each social account on the platform’s own sign-in page. Start a connect session and send them the link; from MCP, the AI agent hands the link to the person.
{ "brandId": "brd_…", "platform": "instagram" }
→ { "connectSessionId": "…", "authorizeUrl": "https://…" }Then GET /v1/accounts lists accounts with their destinations (Pages, channels, profiles), health and today’s limits.
Upload media
Ask for an upload URL, PUT the file to it, then mark it complete. We probe the file and tell you which platforms it fits.
{ "brandId": "brd_…", "filename": "shop.jpg", "contentType": "image/jpeg", "sizeBytes": 482113 }
→ { "mediaId": "med_…", "uploadUrl": "https://…", "uploadHeaders": { … } }Already hosted? POST /v1/media/imports with a public URL does the download for you.
Create a draft
One post, one target per destination. Each target can change the text and carries that platform’s settings. Creating a post never publishes it.
{
"brandId": "brd_…",
"text": "New opening hours from Monday: 8 am to 9 pm.",
"mediaIds": ["med_…"],
"targets": [
{ "destinationId": "dst_ig…", "instagram": { "type": "feed" } },
{ "destinationId": "dst_fb…", "facebook": { "type": "feed" } },
{ "destinationId": "dst_x…", "text": "Open 8am to 9pm daily from Monday." }
]
}
→ 201 { "id": "pst_…", "status": "draft", "targets": [ … ] }Want to check first? POST /v1/posts/validate takes the same body, writes nothing, and returns the issues for each destination.
Publish
when is required: "now", { "at": "2026-12-01T09:00:00+08:00" } (1 minute to 9 months ahead), or "next_slot" to use each destination’s posting slots. The Idempotency-Key header is required: a retry with the same key returns the first answer instead of posting again.
curl https://api.postboba.com/v1/posts/pst_…/publish \
-H "Authorization: Bearer pb_test_…" \
-H "Idempotency-Key: hours-update-1" \
-H "Content-Type: application/json" \
-d '{ "when": "now" }'Approvals
Some targets wait in awaiting_approval: YouTube and X (the platforms require a person’s consent on every post), TikTok Direct Post, and any brand set to approve each post. The response includes an approvalUrl for the person to open and approve. Approving needs a signed-in person; API keys and AI agents can’t approve.
Status and webhooks
Each target moves through queued, uploading, processing and ends published (with url), sent_to_inbox (TikTok drafts), failed (with an error) or canceled. Poll GET /v1/posts/{id} no faster than every 10 seconds, or add a webhook endpoint.
Webhooks follow the Standard Webhooks spec: webhook-id, webhook-timestamp and webhook-signature headers, signed with your endpoint’s whsec_ secret. Events include post.target.published, post.target.failed, post.target.sent_to_inbox, post.approval_requested and account.reconnect_required.
Errors
Errors are RFC 9457 problem details with a stable code, a human detail, and an action your code or AI agent can follow.
{
"status": 409,
"code": "account_reconnect_required",
"detail": "TikTok rejected the stored token. Reconnect the account; scheduled posts are kept.",
"action": "reconnect_account",
"retryable": false,
"requestId": "req_…"
}Actions: fix_request, reconnect_account, wait_and_retry, check_status_before_retry, ask_user, upgrade_plan, contact_support.
Limits
Rate limits are per credential, with RateLimit-* headers and Retry-After on 429. Platform limits (posts per day, TikTok pending drafts, YouTube uploads) are checked before publishing and shown by GET /v1/destinations/{id}/limits. Per-platform rules are on the platform pages.
MCP
The MCP server at https://api.postboba.com/mcp exposes the same operations as tools, with OAuth 2.1 sign-in. Setup for each client and the full tool list are on the MCP page.