Docs / API reference

API keys

Manage API keys programmatically, for example to issue short-lived keys from CI. See Authentication for how keys, scopes and roles interact.

The API key object

NameTypeDescription
idstringUnique ID, prefixed key_. This identifies the key; it is not the secret.
objectstringAlways api_key.
namestringDisplay name.
scopeenumREAD or READ_WRITE.
prefixstringFirst characters of the secret, to recognise it in your configuration.
createdBystringUser the key acts as.
lastUsedAtstring | nullLast authenticated request, accurate to a minute.
expiresAtstring | nullWhen the key stops working, or null for no expiry.
createdAtstringISO 8601 timestamp.
API key object
{
  "id": "key_8m3x7q2k",
  "object": "api_key",
  "name": "ci-deploy",
  "scope": "READ_WRITE",
  "prefix": "ak_live_4f9c",
  "createdBy": "usr_2m9x4k7q",
  "lastUsedAt": "2026-11-18T14:58:31Z",
  "expiresAt": null,
  "createdAt": "2026-08-12T09:00:00Z"
}

Endpoints

MethodPathDescription
GET/api-keysList API keys
POST/api-keysCreate an API key
GET/api-keys/{keyId}Retrieve an API key
POST/api-keys/{keyId}/rotateRotate the secret
DELETE/api-keys/{keyId}Revoke an API key

List API keys

GET/api-keys

Returns your keys. OWNER and ADMIN see every key in the organization; pass createdBy to filter.

Parameters

NameInTypeDescription
createdByquerystringFilter by user ID.

Request

curl https://api.apipods.com/v1/api-keys \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

200 OK
{
  "object": "list",
  "data": [
    {
      "id": "key_8m3x7q2k",
      "object": "api_key",
      "name": "ci-deploy",
      "scope": "READ_WRITE",
      "prefix": "ak_live_4f9c",
      "createdBy": "usr_2m9x4k7q",
      "lastUsedAt": "2026-11-18T14:58:31Z",
      "expiresAt": null,
      "createdAt": "2026-08-12T09:00:00Z"
    }
  ],
  "hasMore": false,
  "nextCursor": null
}

Create an API key

POST/api-keys

Creates a key acting as the calling user. The full key is in secret and is returned only in this response. A VIEWER can only create READ keys.

Warning: Store the secret in a secrets manager immediately. It cannot be retrieved again.

Parameters

NameInTypeDescription
namerequiredbodystringDisplay name.
scoperequiredbodyenumREAD or READ_WRITE.
expiresAtbodystringISO 8601 timestamp, at most 1 year ahead. Omit for no expiry.

Request

curl -X POST https://api.apipods.com/v1/api-keys \
  -H "Authorization: Bearer $APIPODS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "ci-deploy",
    "scope": "READ_WRITE",
    "expiresAt": "2027-02-18T00:00:00Z"
  }'

Response

201 Created
{
  "id": "key_8m3x7q2k",
  "object": "api_key",
  "name": "ci-deploy",
  "scope": "READ_WRITE",
  "prefix": "ak_live_4f9c",
  "createdBy": "usr_2m9x4k7q",
  "lastUsedAt": null,
  "expiresAt": "2027-02-18T00:00:00Z",
  "createdAt": "2026-11-18T16:00:00Z",
  "secret": "ak_live_4f9c…"
}
StatusWhen
403insufficient_role: a VIEWER requested READ_WRITE.

Retrieve an API key

GET/api-keys/{keyId}

Returns key metadata. Use GET /api-keys/current to inspect the key making the request.

Parameters

NameInTypeDescription
keyIdrequiredpathstringThe key ID, or current.

Request

curl https://api.apipods.com/v1/api-keys/key_8m3x7q2k \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

200 OK
{
  "id": "key_8m3x7q2k",
  "object": "api_key",
  "name": "ci-deploy",
  "scope": "READ_WRITE",
  "prefix": "ak_live_4f9c",
  "createdBy": "usr_2m9x4k7q",
  "lastUsedAt": "2026-11-18T14:58:31Z",
  "expiresAt": null,
  "createdAt": "2026-08-12T09:00:00Z"
}

Rotate an API key

POST/api-keys/{keyId}/rotate

Issues a new secret for the same key ID. The old secret keeps working for 24 hours so you can deploy the new one without downtime.

Parameters

NameInTypeDescription
keyIdrequiredpathstringThe key ID.

Request

curl -X POST https://api.apipods.com/v1/api-keys/key_8m3x7q2k/rotate \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

200 OK
{
  "id": "key_8m3x7q2k",
  "object": "api_key",
  "name": "ci-deploy",
  "scope": "READ_WRITE",
  "prefix": "ak_live_9b2e",
  "createdBy": "usr_2m9x4k7q",
  "lastUsedAt": "2026-11-18T14:58:31Z",
  "expiresAt": null,
  "createdAt": "2026-08-12T09:00:00Z",
  "secret": "ak_live_9b2e…",
  "previousSecretExpiresAt": "2026-11-19T16:05:00Z"
}

Revoke an API key

DELETE/api-keys/{keyId}

Revokes the key immediately, including any previous secret still valid after a rotation. Requests with it fail with 401 revoked_api_key. Running resources are not affected.

Parameters

NameInTypeDescription
keyIdrequiredpathstringThe key ID.

Request

curl -X DELETE https://api.apipods.com/v1/api-keys/key_8m3x7q2k \
  -H "Authorization: Bearer $APIPODS_API_KEY"

Response

Returns 204 No Content with an empty body.