Authentication
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:
# 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"const res = await fetch("https://postkea.com/api/v1/me", {
headers: { Authorization: `Bearer ${process.env.POSTKEA_API_KEY}` },
});
const { data } = await res.json();
console.log(data);import os, requests
r = requests.get(
"https://postkea.com/api/v1/me",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
)
data = r.json()["data"]
print(data)Posting policies
The policy decides what happens when a key creates a post, whatever mode the request asks for:
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:
{
"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.
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.
{
"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"const res = await fetch("https://postkea.com/api/v1/logs?limit=50", {
headers: { Authorization: `Bearer ${process.env.POSTKEA_API_KEY}` },
});
const { data: logs } = await res.json();
console.log(logs);import os, requests
r = requests.get(
"https://postkea.com/api/v1/logs",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
params={
"limit": 50,
},
)
logs = r.json()["data"]
print(logs)