Authentication

Every request is made with an API key that belongs to one workspace. Each key carries its own rules: what it may do, where it may post, how many credits it may spend, and whether its posts publish directly, wait for approval or stay drafts.

API keys

Owners and admins create keys in the dashboard under Developers, API keys. A key looks like kea_live_ followed by 40 random characters and is shown in full only once, when it is created. Postkea stores only a hash.

  • Rotate a key to issue a new secret with the same settings; the old secret stops working immediately.
  • Revoke a key when it is no longer needed, or set an expiry when you create it.
  • Keys cannot create other keys, invite people or change billing. Those actions need a signed-in dashboard session.

Sending the key

Send the key in one of three ways. They are checked in this order:

FieldDescription
Authorization: Bearer kea_live_...The standard way. Use it whenever you can set headers.
x-api-key: kea_live_...For tools that only support a custom header. x-access-key works too.
?api_key=kea_live_...For MCP connectors and webhooks tools that cannot set headers at all. access_key works too.
# Header (recommended)
curl https://postkea.com/api/v1/me -H "Authorization: Bearer $POSTKEA_API_KEY"

# Alternative header
curl https://postkea.com/api/v1/me -H "x-api-key: $POSTKEA_API_KEY"

# Query parameter, for clients that cannot set headers
curl "https://postkea.com/api/v1/me?api_key=$POSTKEA_API_KEY"
Query parameters end up in browser history, proxy logs and analytics. Use the query form only where headers are impossible, and never put a key in front end code.

Posting policies

The policy decides what happens when a key creates a post, whatever mode the request asks for:

ValueDescription
autoPosts publish, schedule or queue exactly as requested.
approvalPosts wait in the approval queue (status pending_approval) until a teammate approves them in the dashboard. Approving schedules the post, or publishes it right away when its time has passed.
draftEvery post is saved as a draft. Nothing is scheduled or published.

This is how you let an agent work freely without the risk of an accidental post: give Claude or Codex a key with the approval or draft policy. The create response always tells you where the post went. Key settings:

NameTypeDescription
namerequiredstringShown in logs, approvals and the audit log.
postPolicyauto | approval | draftauto, approval or draft, as described above.Default: auto
scopesstring[]What the key may call. An empty list means full access within the workspace.Default: []
allowedPlatformsstring[] | nullOnly these networks can be posted to, for example ["linkedin", "x"]. Posting elsewhere returns 403 forbidden.
creditLimitinteger | nullLifetime credit budget for this key. When it runs out, calls that cost credits return 402 insufficient_credits.
expiresInDaysinteger | nullThe key stops working after this many days.
kindstandard | agentUse agent for keys you hand to AI agents so they are easy to spot in the dashboard.Default: standard
A key for an agent
{
  "name": "Claude Code",
  "postPolicy": "approval",
  "scopes": [
    "posts:read",
    "posts:write",
    "accounts:read",
    "scrape"
  ],
  "allowedPlatforms": [
    "linkedin",
    "x"
  ],
  "creditLimit": 500,
  "kind": "agent"
}

Scopes

Scopes narrow a key to parts of the API. A request outside the key's scopes returns 403 forbidden with the missing scope in the message.

ValueDescription
posts:readRead posts, the queue, the calendar, ideas, templates, tags and feeds, list media, and validate posts.
posts:writeCreate, edit, schedule, cancel, retry, approve and delete posts, repurpose content, and manage ideas, templates, tags and feeds.
accounts:readList accounts, profiles and posting schedules, and run platform helpers.
accounts:writeConnect and disconnect accounts, manage profiles, OAuth apps and connect links.
media:writeUpload, import, transform, edit and delete media.
scrapeRun scraping operations, batches, pipelines and monitors.
downloadStart and read video downloads.
analytics:readRead analytics, best times and exports.
inbox:readRead comments, mentions and direct messages.
inbox:writeReply, hide, delete, send messages and manage comment automations.
aiCaptions, rewrites, translations, hashtags, replies, ideas, summaries, alt text and images.
automationsCreate, change and run automations.
webhooksManage webhook endpoints and deliveries.
linksShort links and link-in-bio pages.

A few endpoints need no scope, for example GET /v1/me, GET /v1/usage and reading jobs.

Credit budgets

Every key counts the credits it has spent. With a creditLimit, the key stops before it would go over its budget, even when the workspace still has credits. The workspace balance always applies on top. Check the remaining balance and the key's own numbers with GET /v1/me.

When a key's budget is spent
{
  "success": false,
  "error": {
    "code": "insufficient_credits",
    "message": "This API key has a budget of 500 credits and 3 are left.",
    "details": {
      "required": 5,
      "remaining": 3
    },
    "retryable": false
  },
  "requestId": "req_9Kd2x"
}

Request logs

Every API and MCP request is logged for 30 days with the key, source (api, mcp or dashboard), status, duration and credits. Read them in Developers, Logs, or filter them by apiKeyId, source, status and platform:

curl "https://postkea.com/api/v1/logs?limit=50" \
  -H "Authorization: Bearer $POSTKEA_API_KEY"