# Pombo reference: auth, scopes, limits, errors, tools

The live, complete versions: MCP `tools/list` (only the tools the key's scopes allow), `https://pombo-flame.vercel.app/api/v1/openapi.json`, `pombo <command> --help`, and the docs as plain text at `https://pombo-flame.vercel.app/llms-full.txt`. When this file and those disagree, trust those.

## Auth

- **API key:** Settings → API → Create key. Sent as `Authorization: Bearer pombo_…`. One key belongs to one workspace, has scopes and may expire. Owners and admins of a Pro or Team workspace can create keys.
- **MCP OAuth:** clients that sign in (Claude.ai, Claude Desktop, ChatGPT, Gemini CLI, Copilot Studio) need only the URL `https://pombo-flame.vercel.app/api/mcp`. The user logs in to Pombo, picks a workspace and the permissions; the connection shows in Settings → API → Connected apps and can be revoked there. Access tokens (`pombo_oat_…`) last 1 hour and refresh themselves.
- **CLI:** `pombo login` opens the browser (OAuth with PKCE); `pombo login --device` shows a code to enter on another device (SSH, servers); `pombo login --with-key` takes a pasted key; `pombo login --scopes posts:read,posts:write` asks for less. In CI set `POMBO_API_KEY`. `pombo whoami` shows what's in use; `pombo logout` revokes it.
- A Free workspace connects and lists tools, but every call answers `plan_required`.

## Scopes

Ask for the fewest that do the job.

| Scope | Lets the agent |
| --- | --- |
| `account:read` | Read the account, workspace, plan and members |
| `channels:read` | Read channels and posting times |
| `channels:write` | Change channel settings and posting times (owners and admins) |
| `posts:read` | Read posts and team notes |
| `posts:write` | Create, edit, delete and publish posts |
| `posts:approve` | Approve posts or send them back (Team plan) |
| `media:read` | Read the media library |
| `media:write` | Upload and delete media |
| `tags:read` | Read tags |
| `tags:write` | Add, rename and delete tags |
| `insights:read` | Read insights, best times, hashtag performance and the scheduled report |
| `insights:write` | Manage the scheduled email report (owners and admins on Pro or Team; outside addresses confirm by email first) |
| `community:read` | Read comments, mentions, saved replies and the comment score |
| `community:write` | Reply to comments, resolve them, manage saved replies |
| `messages:read` | Read Instagram and Facebook Page direct messages |
| `messages:write` | Reply to DMs and mark them read or done |
| `ideas:read` | Read ideas and templates |
| `ideas:write` | Create, change, move and delete ideas and templates |
| `inbox:read` | Read the Inbox (what needs the user) |
| `sharing:read` | List client review links and client report links (owners and admins, Pro or Team), and link-in-bio pages |
| `sharing:write` | Create and turn off client review and report links (a review link also needs `posts:read`, and `posts:approve` to let the client approve); create, change and delete link-in-bio pages |
| `ai:write` | Use the AI writer (1 AI credit per call) |
| `webhooks:read` | Read webhook endpoints and their deliveries (owners and admins) |
| `webhooks:write` | Add, change, test and delete webhooks and rotate their secrets (owners and admins) |
| `feeds:read` | Read followed feeds, collections and articles |
| `feeds:write` | Follow and remove feeds, manage collections, mark articles read and dismiss them |
| `workspace:transfer` | Hand the workspace to another owner or admin (the paying owner only; opt-in, never in a default grant). Only when the user asks for it in so many words |

## Rate limits

All of a user's keys and connections share 300 requests per 15 minutes, 3,000 per 24 hours and 30,000 per 30 days. A `429` carries `Retry-After` (seconds) and the code `rate_limited`: wait that long, don't retry in a loop. Page through lists with `next_cursor` (pass it back as `cursor`) instead of asking for everything again. Replies to comments and DMs also have a per-5-minute cap.

## Error codes

| HTTP | Code | What to do |
| --- | --- | --- |
| 400 | `bad_request` | Malformed JSON, body over 100,000 bytes or a bad `Idempotency-Key`: fix the request |
| 401 | `unauthorized` | Key missing, wrong, revoked or expired: ask the user to reconnect or create a key |
| 403 | `insufficient_scope` | The key lacks the scope named in the message: the user creates a key with it |
| 403 | `forbidden` | The user's role can't do this (an editor changing channel settings or approving) |
| 403 | `plan_required` | Needs Pro or Team, or (with `feature`) a plan feature such as approvals on Team |
| 404 | `not_found` | No such id in this workspace: re-list instead of guessing |
| 405 | `method_not_allowed` | Wrong method for the path; see `Allow` |
| 409 | `conflict` | The post's state doesn't allow it, a channel needs reconnecting, or approving would move a late post (`would_move_to`) |
| 409 | `channel_held` | The channel is on hold beyond the plan's limits; drafts and deleting still work |
| 422 | `validation_failed` | Bad input; `field` names it |
| 424 | `upstream_failed` | The network refused or didn't confirm a reply; nothing recorded. Check before resending |
| 429 | `rate_limited` | Wait `Retry-After` seconds |
| 500 | `internal_error` | Pombo failed; nothing was posted. Try once more later |

The CLI exits 0 on success, 1 on an API error (printed as `Error: <code>: <message>`, or JSON on stderr with `--json`) and 2 on a usage error.

## Post states

`draft` (no time), `queued` (next free slot or a set time), `pending_approval`, `publishing`, `published`, `failed`, `reminded` (Notify me posts the user posts by hand; mark them with `mark_post_posted`). Edit drafts, queued and failed posts with `update_post`; published posts can't change.

## MCP tools by job

| Job | Tools |
| --- | --- |
| Account and channels | `get_account`, `list_channels`, `get_channel`, `update_channel`, `get_default_channels`, `set_default_channels` (your own channels pre-ticked on a new post) |
| Posting times | `list_queue_slots`, `add_queue_slots`, `replace_queue_slots`, `remove_queue_slot` |
| Posts | `list_posts`, `get_post`, `create_post`, `update_post`, `delete_post`, `publish_post`, `mark_post_posted`, `list_post_notes`, `add_post_note` |
| Media | `upload_media`, `list_media`, `get_media`, `delete_media` |
| Tags | `list_tags`, `create_tag`, `rename_tag`, `delete_tag` |
| Insights | `get_insights`, `list_insight_posts`, `get_insights_series`, `get_insights_hashtags` |
| Scheduled report | `get_insights_report`, `save_insights_report`, `add_insights_report_recipient`, `remove_insights_report_recipient`, `test_insights_report`, `set_my_insights_report`, `delete_insights_report` |
| Comments | `list_community_items`, `get_community_item`, `reply_to_comment`, `like_comment`, `resolve_comments`, `reopen_comments`, `get_comment_score` |
| Saved replies | `list_saved_replies`, `create_saved_reply`, `update_saved_reply`, `delete_saved_reply` |
| Direct messages | `list_conversations`, `get_conversation`, `list_messages`, `reply_to_message`, `react_to_message`, `mark_conversations` |
| Approvals | `list_approvals`, `approve_post`, `request_changes` |
| Client review links | `list_review_links`, `create_review_link` (anyone with the link sees the posts: confirm first; the url is shown once), `revoke_review_link` |
| Client report links | `list_report_links`, `create_report_link` (anyone with the link sees those channels' Insights: confirm first; the url is shown once), `revoke_report_link` |
| Ideas and templates | `list_ideas`, `list_idea_groups`, `get_idea`, `create_idea`, `update_idea`, `delete_idea`, `list_templates`, `get_template`, `create_template`, `update_template`, `delete_template` |
| Search | `search` (posts, drafts, ideas, templates, comments and DMs; needs any one of their read scopes) |
| Inbox | `get_inbox` |
| AI writer | `ai_generate`, `ai_rewrite`, `ai_ideas`, `ai_reply_suggestions` |

Each tool mirrors one REST operation with the same fields; `create_post`, `create_idea`, `create_template`, `reply_to_comment` and `reply_to_message` take an `idempotency_key`, and sending the same one again returns the first result instead of acting twice.

## CLI equivalents

| MCP tool | CLI |
| --- | --- |
| `get_account` | `pombo whoami` |
| `list_channels` | `pombo channels` |
| `list_queue_slots` | `pombo queue slots --channel <id>` |
| `get_default_channels` | `pombo channels defaults` |
| `set_default_channels` | `pombo channels set-defaults <channel id>...` |
| `create_post` | `pombo posts create --channel <id> --text "…" [--draft \| --queue \| --at <iso>]` |
| `update_post` | `pombo posts update <id> --text "…"` |
| `publish_post` | `pombo posts publish <id>` |
| `upload_media` | `pombo media upload <file or https link> --alt "…"` |
| `get_insights` | `pombo insights --range 7d` |
| `get_insights_hashtags` | `pombo insights hashtags --range 30d` |
| `save_insights_report` | `pombo reports set --frequency weekly --member <user id>` |
| `add_insights_report_recipient` | `pombo reports add <email>` |
| `list_community_items` | `pombo community list --status unanswered` |
| `reply_to_comment` | `pombo community reply <id> --saved <saved reply id>` |
| `list_approvals` | `pombo approvals list` |
| `approve_post` | `pombo approvals approve <id> --seen <updated_at>` |
| `create_review_link` | `pombo review-links create --name "Acme" --days 30` |
| `create_report_link` | `pombo report-links create --name "Acme" --channel <id> --range lastmonth` |
| `list_ideas` | `pombo ideas list --group todo` (each idea has `used_in`: posts made from it) |
| `search` | `pombo search <words> --type post,draft` |
| `get_inbox` | `pombo inbox` |
| `ai_generate` | `pombo ai generate --topic "…" --network instagram` |
