Skip to main content
POST
/
api-keys
Create an API key
curl --request POST \
  --url https://app.autoposting.ai/api-proxy/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "CI/CD Pipeline Key",
  "scopes": [
    "posts:read",
    "posts:write",
    "brands:read"
  ],
  "expiresAt": "2023-11-07T05:31:56Z"
}
'
{
  "success": true,
  "data": {
    "id": "key_01HXYZ",
    "name": "CI/CD Pipeline Key",
    "key": "ap_live_abc123xyz789...",
    "scopes": [
      "posts:read",
      "posts:write",
      "brands:read"
    ],
    "expiresAt": null,
    "createdAt": "2024-01-01T00:00:00Z"
  }
}

Authorizations

Authorization
string
header
required

API key as Authorization: Bearer sk-social-...

Body

application/json
name
string
required

Human-readable label for the key.

Example:

"CI/CD Pipeline Key"

scopes
enum<string>[]
required

Permission scopes granted to this key.

Available options:
posts:read,
posts:write,
brands:read,
brands:write,
clips:read,
clips:write,
carousels:read,
carousels:write,
agents:read,
agents:write,
kbs:read,
kbs:write,
usage:read
Example:
["posts:read", "posts:write", "brands:read"]
expiresAt
string<date-time> | null

ISO 8601 expiry datetime. If omitted, the key does not expire.

Response

API key created.

success
boolean
Example:

true

data
object

An API key and its metadata. The full key field is present only in the create response; list responses include keyHint instead.