Nyilvános API

Hitelesítés és jogosultságok

API-kulcs, MCP-kulcs, OAuth-token: melyik mire való, hogyan készíted el, és mit jelentenek a scope-ok.

The three credentials

TypePrefixWhere you use itWhere it comes from
API keypsty_…REST API and the command-line toolSettings → Developers
MCP keypsty_mcp_…MCP server, for chat clientsSettings → Developers
OAuth tokenpos_…When an app acts on someone else's behalfAt the end of the OAuth flow
REST keys and MCP keys are not interchangeable

The MCP server deliberately rejects REST keys that start with psty_ and explains why. If a chat client cannot connect, this is the most common reason.

The API key

You create the key in Posty, on the Settings → Developers page. You don't need to write to us, and there's no approval process. The key is shown once, at the moment you create it. You cannot retrieve it later.

Every request sends the key in the Authorization header. The key is the header's entire value:

curl https://api.posty.hu/public/v1/integrations \
  -H "Authorization: psty_a_kulcsod"

An OAuth token, however, has a Bearer prefix:

curl https://api.posty.hu/public/v1/integrations \
  -H "Authorization: Bearer pos_a_tokened"

Permissions

You can restrict the key: only allow the operations it actually needs. These are the scopes, and the https://api.posty.hu/public/v1/status response lists them too.

ScopeWhat it allows
posts:readRead the calendar and posts.
posts:draftCreate, edit, and delete drafts.
posts:publishSchedule and publish immediately, and move a post out of draft.
channels:readRead channels, groups, and settings schemas.
channels:writeStart connecting a channel.
media:writeUpload to the media library.
analytics:readRead statistics.

MCP has two scopes: mcp:read and mcp:write.

Give as little as possible

An agent that creates drafts only needs posts:read and posts:draft. Then if something goes wrong, the worst that can happen is an unnecessary draft, not a post that went out to a real audience.

Choosing a workspace

If a key belongs to more than one workspace, the showorg header selects which one the call applies to:

curl https://api.posty.hu/public/v1/integrations \
  -H "Authorization: psty_a_kulcsod" \
  -H "showorg: <munkaterulet-azonosito>"

401 and 403

CodeWhat it meansWhat to do
401The credential is missing, wrong, expired, or has been revoked.Check that the key is the entire Authorization header value, with no Bearer. Also check that you haven't rotated it in the meantime.
403Authentication is fine, but the permission is not enough.The response names the missing scope and the key owner's current role. Check both.
A 403 is usually about the user

The permission a key carries moves with its owner's current role. If someone is demoted or removed from the workspace, their key immediately has only as much access as they do. When a key that worked yesterday returns a 403 today, it is almost always this.

Key management

  • Put it in an environment variable or a secret manager, not in the code, and not in version control.
  • If it ended up somewhere it shouldn't, rotate it on the Settings → Developers page. Rotation is immediate. The old key gets a 401 on the next call.
  • You don't even need to copy a key for the command-line tool: posty auth:login stores the credential on your machine. See the CLI authentication page.
  • Never send us the API key by email. We don't need it.
Is something missing from this page? Email [email protected] or use the form on the Help page.