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.
Name Type Description idstring Unique ID, prefixed key_. This identifies the key; it is not the secret. objectstring Always api_key. namestring Display name. scopeenum READ or READ_WRITE.prefixstring First characters of the secret, to recognise it in your configuration. createdBystring User the key acts as. lastUsedAtstring | null Last authenticated request, accurate to a minute. expiresAtstring | null When the key stops working, or null for no expiry. createdAtstring ISO 8601 timestamp.
API key object Copy
{
"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"
}GET /api-keys
Returns your keys. OWNER and ADMIN see every key in the organization; pass createdBy to filter.
Parameters Name In Type Description createdByquery string Filter by user ID.
Request curl https://api.apipods.com/v1/api-keys \
-H "Authorization: Bearer $APIPODS_API_KEY" Response 200 OK Copy
{
"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
}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 Name In Type Description namerequired body string Display name. scoperequired body enum READ or READ_WRITE.expiresAtbody string ISO 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 Copy
{
"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…"
}Status When 403insufficient_role: a VIEWER requested READ_WRITE.
GET /api-keys/{keyId}
Returns key metadata. Use GET /api-keys/current to inspect the key making the request.
Parameters Name In Type Description keyIdrequired path string The key ID, or current.
Request curl https://api.apipods.com/v1/api-keys/key_8m3x7q2k \
-H "Authorization: Bearer $APIPODS_API_KEY" Response 200 OK Copy
{
"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"
}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 Name In Type Description keyIdrequired path string The 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 Copy
{
"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"
}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 Name In Type Description keyIdrequired path string The 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.