Skip to main content
PATCH
/
api-keys
/
{keyId}
Update an API key
curl --request PATCH \
  --url https://app.autoposting.ai/api-proxy/api-keys/{keyId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Updated Key Name",
  "expiresAt": "2025-01-01T00:00:00Z"
}
'
{
  "success": true,
  "data": {
    "id": "key_01HXYZ",
    "name": "Updated Key Name",
    "scopes": [
      "posts:read",
      "posts:write",
      "brands:read"
    ],
    "expiresAt": "2025-01-01T00:00:00Z",
    "updatedAt": "2024-01-10T00:00:00Z"
  }
}

Authorizations

Authorization
string
header
required

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

Path Parameters

keyId
string
required

Identifier of the API key.

Example:

"key_01HXYZ"

Body

application/json
name
string

New display name.

Example:

"Updated Key Name"

expiresAt
string<date-time> | null

New expiry datetime. Set to null to remove expiry.

Example:

"2025-01-01T00:00:00Z"

Response

API key updated.

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.