PostStreamDocs
Open app
Docs menu
← All docs

Reference

The technical details behind the agent layer. For the full machine-readable REST spec, see the OpenAPI / Swagger link under Endpoints.

Tools & permissions

Every tool a connected agent can call, and the permission the token must include:

ToolWhat it doesScopeExample prompt
list_accountsList your connected social accountsaccounts:read“Which social accounts do I have connected?”
schedule_postWrite a post and schedule it for a date/time (or save a draft)posts:write“Draft a LinkedIn post about our new feature and schedule it for Tuesday 9am.”
update_postReschedule, re-target or edit a draft/scheduled postposts:write“Move my Tuesday post to Thursday and add Instagram to it.”
cancel_postCancel a scheduled post or delete a draftposts:write“Cancel the post scheduled for tomorrow morning.”
retry_postRetry a post that failed on one or more accountsposts:write“The LinkedIn post failed — try sending it again.”
list_queueSee what's in your scheduled queueposts:read“What's scheduled to go out this week?”
check_post_statusCheck a post's per-account statusposts:read“Did my morning post actually publish everywhere?”
explain_failureExplain why a post failed (the real reason)posts:read“Why did yesterday's Instagram post fail?”
connect_accountGet the link to connect a new social accountaccounts:read“I want to add my TikTok account.”

Scopes

Scopes use a resource:action vocabulary. You pick them when creating a token (or approve them on the consent screen). Grant the least that does the job.

ScopeGrants
posts:readSee your posts, drafts, and scheduled queue, and why a post failed.
posts:writeCreate, reschedule, edit, cancel, and retry posts and drafts.
accounts:readSee your connected social accounts and get the link to connect a new one.
media:readList media you've uploaded.
media:writeUpload new media for use in posts.
analytics:readRead post performance analytics.

Authentication

Two ways for an agent to authenticate, both tied to your account and your chosen scopes:

  • Personal Access Token — a psk_live_… string you create in Settings → AI agents and paste into your app. Sent as Authorization: Bearer psk_live_…. Shown once; store it safely.
  • OAuth 2.1 (one-click Connect) — no pasted secret. The client registers itself, you approve scopes on a consent screen, and it receives a short-lived pso_mcp_… access token plus a refresh token it rotates automatically. Revoke from Connected agents in Settings → AI agents.

Either way, every request is re-checked: valid token, active subscription (or whitelist), and the specific scope the tool needs.

Endpoints

EndpointWhat it is
POST https://mcp.poststreamai.com/mcpThe MCP endpoint (JSON-RPC 2.0, Streamable-HTTP). This is what a URL-only client connects to.
GET https://mcp.poststreamai.com/.well-known/oauth-protected-resourceTells a client which authorization server to use for the one-click Connect flow.
https://api.poststreamai.comREST backend base URL. The connector calls these endpoints on your behalf; you normally don't call them directly.

Developers who want the full REST surface: the live spec is at https://api.poststreamai.com/swagger-ui.html ↗ (interactive) and /v3/api-docs ↗ (OpenAPI JSON).

Errors

StatusMeaningFix
401Token is missing, invalid, revoked, or the subscription lapsed.Re-copy the token; check it isn't revoked; confirm the plan is active. For OAuth, refresh or reconnect.
402 TIER_UPGRADE_REQUIREDNo active subscription (and email not whitelisted).Subscribe, or ask an admin to whitelist the email.
403 INSUFFICIENT_SCOPEThe token lacks the scope this tool needs.Create a new token with the right scope (e.g. posts:write), or re-consent with more scopes.
429Rate limit exceeded.Back off and retry after a short pause.

Rate limits

Agent requests are rate-limited per token. Normal interactive use won't hit the limit; a script that loops hard might. On a 429, pause and retry.

Troubleshooting

SymptomLikely cause & fix
Agent doesn't list any PostStream toolsThe app didn't fully restart, or the config JSON is invalid (often a trailing comma). Restart the app; validate the JSON.
"token is invalid, revoked, or the subscription has lapsed"Wrong or revoked token, lapsed plan, or the client is pointed at the MCP server URL instead of the API URL. Re-copy the token; check Settings → AI agents.
Worked yesterday, 401 todayOAuth access token expired (client should refresh), you hit Disconnect, or the subscription lapsed.
"command not found: npx"Node.js isn't installed or isn't on PATH. Install Node 20+ and restart the app.
Behind a corporate proxynpx must reach the npm registry once. If blocked, use the URL-only method instead.