# Pombo recipes

Each recipe shows the MCP tool calls (preferred), the CLI and the REST requests. MCP lines are a tool's name followed by its JSON arguments. REST paths are under `https://pombo-flame.vercel.app/api/v1` with `Authorization: Bearer $POMBO_KEY`; bodies are JSON. Ids are uuids you read from an earlier call; never invent one.

## 1. Upload media, then schedule or queue a post

Queued and scheduled posts need at least one file; a draft doesn't.

MCP (no filesystem: pass a public https `url`, or `content_base64` for a small file):

```text
list_channels {}
upload_media {"url": "https://example.com/reel.mp4", "alt_text": "Pouring a flat white"}
create_post {"channel_ids": ["<instagram channel id>"], "body": "Flat white, slow pour.", "type": "reel", "media": [{"asset_id": "<media id>"}], "action": "queue"}
```

`"action": "queue"` takes the channel's next free posting time. For a fixed time use `"action": "schedule"` and `"scheduled_at": "2026-11-12T18:30:00-03:00"`. Check the result's `status` and `scheduled_at` and tell the user when it will go out, in the channel's time zone. In a workspace that requires approval an editor's post comes back `pending_approval`.

To see the free slots before choosing: `list_queue_slots {"channel": "<channel id>"}` returns `slots` and `next` (the next free times, UTC).

CLI (uploads local files for you):

```sh
pombo channels --json
pombo queue slots --channel <channel id>
pombo posts create --channel <channel id> --text "Flat white, slow pour." --type reel --media ./reel.mp4 --queue --json
pombo posts create --channel <channel id> --text "Flat white, slow pour." --media <media id> --at 2026-11-12T18:30:00-03:00 --json
```

REST:

```text
POST /media          {"url": "https://example.com/reel.mp4", "alt_text": "Pouring a flat white"}
POST /posts          {"channel_ids": ["<channel id>"], "body": "…", "type": "reel", "media": [{"asset_id": "<media id>"}], "action": "queue"}
```

Send an `Idempotency-Key` header on `POST /posts` (MCP: `idempotency_key`) so a retry never creates the post twice.

## 2. One post, different captions per network

`platform_options` sets a caption per network on create; YouTube also takes a title, description, visibility and a custom `thumbnail` (`{"asset_id": "<uploaded JPEG or PNG, 2 MB or less>"}`; YouTube only takes it from phone-verified channels, and the video still goes out if it refuses).

```text
create_post {"channel_ids": ["<instagram id>", "<facebook id>", "<youtube id>"], "body": "New menu is live 🍂", "media": [{"asset_id": "<video id>"}], "action": "draft", "platform_options": {"facebook": {"caption": "Our autumn menu is live. Book a table at the link."}, "youtube": {"title": "Autumn menu 2026", "visibility": "public"}}}
```

```sh
pombo posts create --channel <instagram id> --channel <facebook id> --text "New menu is live 🍂" --media <video id> --caption-for facebook="Our autumn menu is live." --yt-title "Autumn menu 2026" --draft --json
```

## 3. Find the best times to post, then schedule

`get_insights` returns, per channel, `audience[].best_times`: `timezone`, the `window` it measured, and `top`, up to 3 slots of `weekday` (0 = Monday) and `hour`, best average engagements first, each with at least 2 measured posts. A new channel may have none: fall back to its queue (`"action": "queue"`).

```text
get_insights {"range": "30d", "channel": "<channel id>"}
create_post {"channel_ids": ["<channel id>"], "body": "…", "media": [{"asset_id": "<media id>"}], "action": "schedule", "scheduled_at": "2026-11-13T19:00:00-03:00"}
```

Turn the slot into the next future date-time in `best_times.timezone` yourself, and say it back to the user ("Thursday 19:00 São Paulo time") before scheduling. Remember: queue slots number weekdays from Sunday (0 = Sunday), best times from Monday.

```sh
pombo insights --range 30d --channel <channel id> --json
pombo posts create --channel <channel id> --text "…" --media <media id> --at 2026-11-13T19:00:00-03:00 --json
```

REST: `GET /insights?range=30d&channel=<id>`, then `POST /posts`.

## 4. Reply to unanswered comments with saved replies

Needs Pro or Team, `community:read` and `community:write`. Replies are public and go out as the real account: show every proposed reply and get a yes first.

```text
list_community_items {"status": "unanswered", "kind": "comment", "sort": "old", "limit": 20}
list_saved_replies {}
reply_to_comment {"id": "<item id>", "saved_reply_id": "<saved reply id>"}
reply_to_comment {"id": "<item id>", "text": "Thank you, see you Saturday!"}
resolve_comments {"ids": ["<item id>", "<item id>"]}
```

- Reply only to items whose `can_reply` is true (Instagram, Facebook Page and YouTube comments can be; mentions and some items can't). Facebook Page comments can also be liked: `like_comment {"id": "<item id>", "liked": true}`; Instagram's and YouTube's APIs can't like comments.
- `ai_reply_suggestions {"comment_id": "<item id>"}` drafts replies in the account's voice (1 AI credit); still confirm before sending.
- Create a saved reply the user wants to reuse: `create_saved_reply {"name": "Thanks", "body": "Thank you so much! 💛"}`.

```sh
pombo community list --status unanswered --kind comment --json
pombo saved-replies list --json
pombo community reply <item id> --saved <saved reply id>
pombo community resolve <item id> <item id>
```

REST: `GET /community/items?status=unanswered`, `GET /saved-replies`, `POST /community/items/{id}/reply` with `{"saved_reply_id": "…"}` or `{"text": "…"}`.

Direct messages work the same way with `list_conversations {"status": "open", "unread": true}`, `list_messages {"id": "<conversation id>"}` and `reply_to_message {"id": "<conversation id>", "text": "…"}`; replies are only possible within 24 hours of the person's last message (`can_reply`).

## 5. Weekly insights summary

```text
get_insights {"range": "7d"}
list_insight_posts {"range": "7d", "sort": "engagements", "dir": "desc", "page_size": 5}
get_insights_series {"metric": "reach", "range": "30d"}
get_comment_score {}
```

Report: `summary` (posts, reactions, comments and engagement rate as `value`, `previous` and `change`; followers as `total` and `gained`), each channel's own numbers in `channel_summaries` (reach, views and the rest its network has), the top 3 posts with their numbers, and anything that stands out. YouTube numbers sit in their own section; never add subscribers to followers. A custom range (`from`/`to`) needs Pro or Team.

```sh
pombo insights --range 7d --json
pombo insights posts --range 7d --sort engagements --dir desc --page-size 5 --json
```

REST: `GET /insights?range=7d`, `GET /insights/posts?range=7d&sort=engagements`.

## 6. Ideas into posts

Ideas are the cards on the Create board; `group` is the column (`unassigned`, `todo`, `done` and the rest: `list_idea_groups {}` lists every group's key).

```text
list_ideas {"group": "todo"}
get_idea {"id": "<idea id>"}
create_post {"channel_ids": ["<channel id>"], "body": "<the idea's body, edited with the user>", "media": [{"asset_id": "<asset_id from the idea's media>"}], "action": "draft"}
update_idea {"id": "<idea id>", "group": "done"}
```

Capture a new idea: `create_idea {"title": "Behind the counter", "body": "Show the 6am bake", "group": "todo"}`. `ai_ideas {"business": "Neighbourhood café", "audience": "Remote workers"}` suggests ideas (1 AI credit); save the ones the user likes with `create_idea`.

```sh
pombo ideas list --group todo --json
pombo ideas get <idea id> --json
pombo posts create --channel <channel id> --text "…" --media <media id> --draft --json
pombo ideas update <idea id> --group done
```

## 7. Approvals (Team plan)

Owners, and admins unless only owners may approve. `seen` is the post's `updated_at` as you showed it, so nobody approves a version they didn't read.

```text
list_approvals {"state": "pending"}
get_post {"id": "<post id>"}
approve_post {"id": "<post id>", "seen": "<updated_at>"}
request_changes {"id": "<post id>", "note": "Swap the photo for the latte art one", "seen": "<updated_at>"}
```

If the requested time has passed, `approve_post` answers `conflict` with `would_move_to`; ask the user, then call again with `"move_to_next_slot": true`.

```sh
pombo approvals list --json
pombo approvals approve <post id> --seen <updated_at>
pombo approvals request-changes <post id> --note "Swap the photo" --seen <updated_at>
```

REST: `GET /approvals`, `POST /posts/{id}/approve`, `POST /posts/{id}/request-changes`.

## 8. Search, then act on what you find

`search` looks through posts, drafts, ideas, templates, comments and direct messages at once. Every word must appear (as the start of a word, 2+ characters); accents and case don't matter. Each type is searched only when the key has its read scope (`posts:read`, `ideas:read`, `community:read`, `messages:read`); templates, comments and messages need Pro or Team. Results come best match first within each type, with `type`, `id`, `title`, `snippet`, `status`, `at`, `channel_id`, `parent_id` (a comment's post, a message's conversation) and `url`.

```text
search {"q": "autumn menu", "type": ["post", "draft"], "limit": 5}
get_post {"id": "<id from the result>"}
update_post {"id": "<id from the result>", "action": "schedule", "scheduled_at": "2026-11-20T09:00:00-03:00"}
```

```sh
pombo search "autumn menu" --type post,draft --limit 5 --json
pombo posts update <post id> --at 2026-11-20T09:00:00-03:00
```

REST: `GET /search?q=autumn+menu&type=post,draft`.

## 9. Publish now (only on explicit request)

Only when the user said to publish now and confirmed the post and channel. Only a queued post can be published now: queue or schedule a draft first (`update_post` with `"action": "queue"`), else the call answers `conflict`.

```text
get_post {"id": "<post id>"}
publish_post {"id": "<post id>"}
```

```sh
pombo posts publish <post id>
```

REST: `POST /posts/{id}/publish`. It goes out within about a minute. Then `get_post` to confirm `status`; on `failed`, read the post's error and tell the user.
