<id>:<secret>) with the site URL; add its Content API key as well to use the content.* operations. Things to know before you write:
- Plans. Self-hosted Ghost has the whole API. On Ghost(Pro), custom integrations come with the Publisher plan and up, not Starter; the Content API works on every plan.
- Bodies. Pass the fields of one object (
title,html,status…); the plugin sends them in Ghost’s{ "posts": [ ... ] }format. Ghost stores content as Lexical: sendhtmlwithsource: "html"to have Ghost convert it. - Edits need the
updated_atyou last read: a stale value answers 409, so two edits never overwrite each other. - Publishing and email.
status: "published"puts a post on the live site. Updating a post to published with thenewsletterquery value emails it to members, which can’t be taken back. Both are markeddestructive. - Staff. An integration key can list users and roles and send invites; editing or deleting a staff user needs a staff access token of an Administrator.
- Webhooks. Ghost signs each delivery with HMAC-SHA256 of the raw body plus a timestamp, in
X-Ghost-Signature: sha256=<hex>, t=<ms>, using the webhook’s secret. The plugin checks it before handling post, page, tag, member and site events. Ghost 6.45 and later name the event in the body; on older releases add?event=<name>(for example?event=post.published) to the webhook’s target URL so the plugin can route it. The signature does not cover that query value, so on older releases a delivery captured in its five-minute window could be resent under another event name that takes the same record (for examplepost.addedaspost.deleted). Upgrade to 6.45+ where you can; otherwise check the record against Ghost before acting on an event where the type matters.
- 82 typed API operations
- 29 incoming webhook event types
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the Ghost API key before the first call: More: API Key
pnpm corsair setup --plugin=ghost --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
List postsWebhooks
This plugin registers 29 webhook event types. Configure the provider to POST to your Corsair HTTP handler, then usewebhookHooks on the plugin factory.
See Webhooks for every event path and payload shape, and Webhooks concept for routing.
What’s next
API reference
Every
ghost.api.* operation with input and output types.Webhooks
Event paths, payloads, and
webhookHooks examples.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.