# Postbing for AI agents

Postbing plans, writes and publishes SEO articles to a user's websites (WordPress, Shopify, Webflow, Ghost, Notion, Wix, Framer, a webhook or a hosted Postbing blog). This file tells an AI agent how to work with a user's Postbing account. Human docs: https://www.postbing.com/docs/api, https://www.postbing.com/docs/mcp, https://www.postbing.com/docs/cli.

## Pick a way in

1. **Remote MCP server (best for assistants):** `https://www.postbing.com/mcp` (Streamable HTTP). The user signs in with OAuth in the browser, no key to paste. Claude Code: `claude mcp add --transport http postbing https://www.postbing.com/mcp`
2. **REST API (best for code):** base `https://www.postbing.com/api/v1`, header `Authorization: Bearer pb_...`. OpenAPI 3.1: https://www.postbing.com/api/v1/openapi.json
3. **CLI (best for terminals and CI):** `npx postbing@latest login`, then `postbing --help`. `postbing mcp` runs a local stdio MCP server.

Access needs a paid Postbing plan. Rate limits are per key, from 30 to 600 requests a minute by plan.

## Rules for agents

- Start with `list_sites` (MCP) or `GET /sites`: every other call needs a `site_id` or an `article_id`.
- Never publish, unpublish or schedule unless the user asked for it. Creating a draft is safe.
- `generate_article` / `POST /articles/generate` spends one of the user's article credits. Say so before you do it. Saving the user's own text with `create_article` / `POST /articles` costs nothing.
- Writing takes a few minutes. Poll `get_article` / `GET /articles/{id}` until `status` is `draft`, `approved` or `scheduled`, or subscribe to the `article.generated` event.
- Publishing the same article again updates the same post; it never creates a duplicate.
- Send an `Idempotency-Key` header on REST POSTs you may retry.
- Errors are `{"error": {"code": "...", "message": "..."}}`. The message is a plain sentence you can relay to the user.
- Keys and tokens are secrets. Never print them back to the user or into files they share.

## Typical tasks

- Publish text you wrote: `create_article` then `publish_article`. REST: `POST /articles` then `POST /articles/{id}/publish`.
- Have Postbing write: `generate_article`, wait, then `publish_article`.
- See what is planned: `get_calendar` or `GET /sites/{id}/calendar`. Move one: `reschedule_article`.
- Steer the plan: `list_topics`, `add_topic`.
- Check performance: `get_results` (Google Search Console, when connected).
- Get notified: `create_webhook` or `POST /webhooks` with events such as `article.published` and `publish.failed`.

## MCP tools

- `list_sites` (read only): List the Postbing sites this API key can use, each with its connected publishing platform (WordPress, Shopify, Webflow, Ghost, Notion, webhook or the hosted Postbing blog), the connection status and the publish mode. Start here to get a site_id.
- `list_articles` (read only): List a site's articles, newest change first: id, title, status, scheduled date and live URL. Skipped (archived) articles are left out unless you ask for that status.
- `get_article` (read only): Read one article: title, slug, SEO title and description, tags, status, scheduled date, live URL and the full body.
- `create_article`: Save an article you wrote as a draft on a site. Nothing goes live and no article credit is used. Follow with publish_article to send it to the site's connected platform.
- `generate_article`: Ask Postbing to research and write an article for a keyword, in the site's voice and settings. Uses one article credit from the site owner's plan. Writing takes a few minutes: poll get_article until the status is draft.
- `update_article`: Change an article's title, body, SEO fields, slug, keyword or tags. Only the fields you send change, and the previous version is kept in the article's history. If the article is already live, the live post is updated on the site too.
- `publish_article`: Send an article to the site's connected platform. mode 'publish' (default) makes it live now and returns the live URL; on an article that is already live it pushes the latest text. mode 'schedule' publishes it on the given date. Publishing twice never creates a duplicate post.
- `unpublish_article`: Take a live article off the site (removed or moved to drafts there, depending on the platform). In Postbing it becomes a draft again and keeps its text.
- `list_integrations` (read only): List the publishing platforms Postbing can connect a site to.
- `test_connection`: Check that Postbing can still publish to a site: signs in and, where the platform allows it, creates and deletes a private test draft. Returns each step and what to fix. Needs admin access to the site.
- `list_topics` (read only): List a site's topics: the themes Postbing plans articles around, with how many keyword ideas and articles each has.
- `add_topic`: Add a topic to a site so Postbing plans articles around it. Adding a name that already exists returns the existing topic. Writes nothing and uses no credit.
- `get_calendar` (read only): List the articles on a site's calendar between two dates (default: the next 30 days): planned, written, scheduled and published, each with its date and status.
- `reschedule_article`: Move an unpublished article to another date on the calendar. Its status stays the same; an approved or scheduled article then publishes on the new date.
- `get_results` (read only): Google Search Console numbers for a site when it is connected: clicks, impressions, click rate and average position over the last days, with the change from the period before and the top search queries.
- `list_webhooks` (read only): List the webhook endpoints that receive this account's events (article.published, publish.failed and others).
- `create_webhook`: Send this account's events to an https address as signed JSON. Returns the signing secret once. Events: article.planned, article.generated, article.needs_review, article.approved, article.published, article.updated, article.unpublished, publish.failed, connection.broken, credits.low, or * for all.

## Events

`article.planned`, `article.generated`, `article.needs_review`, `article.approved`, `article.published`, `article.updated`, `article.unpublished`, `publish.failed`, `connection.broken`, `credits.low`. Signed with HMAC SHA-256 over `<timestamp>.<raw body>` in `X-Postbing-Signature: v1=...`. Details: https://www.postbing.com/docs/webhooks

## Contact

support@postbing.com