Revoke an API key
The key is refused everywhere within 60 seconds.
DELETE/v1/keys/{key_id}
The key is refused everywhere within 60 seconds. A repeat is a no-op.
A key with the keys:write scope.
Request
curl -X DELETE "https://api.pod.mapier.ai/v1/keys/key_3ahrz6dmv29gqy5ckt18fp" \
-H "Authorization: Bearer $POD_API_KEY"Parameters
| Name | In | Type | Required | What it is |
|---|---|---|---|---|
key_id | path | string | Yes | |
Idempotency-Key | header | string | No | Makes a repeat of this call safe for 24 hours. |
Answer
200. The key, with revoked_at set.
{
"id": "key_3ahrz6dmv29gqy5ckt18fp",
"name": "example",
"project": "prj_3ahrz6dmv29gqy5ckt18fp",
"mode": "test",
"class": "person",
"scopes": ["sandboxes:read"],
"last_four": "example",
"created_by": "example",
"created_at": "2026-11-23T12:00:00.000Z",
"expires_at": null,
"revoked_at": null,
"service": null,
"billing_mark": null,
"parent_sandbox": null,
"parent_scopes": null,
"last_used_at": null,
"rotated_at": null,
"previous_secret_until": null
}| Field | Type | Always | What it is |
|---|---|---|---|
id | string | Yes | |
name | string | Yes | |
project | string | Yes | |
mode | "test" | "live" | Yes | |
class | "person" | "service_grant" | "sandbox" | Yes | person: made by a person. service_grant: a connected service's. sandbox: made for one sandbox, to use from inside it. |
scopes | "sandboxes:read" | "sandboxes:write" | "sandboxes:exec" | "files:read" | "files:write" | "snapshots:write" | "usage:read" | "keys:write" | "projects:write" | "members:read" | "end_users:read" | "end_users:write" | "screen:read" | "screen:write" | "webhooks:read" | "webhooks:write" | "permissions:read" | "permissions:write" | "permissions:records" | "ci:read" | "ci:write" | "network:read" | "network:write"[] | Yes | |
last_four | string | Yes | |
created_by | string | Yes | The identity account that made the key. |
created_at | string | Yes | RFC 3339 in UTC with milliseconds, for example 2026-11-23T17:04:05.123Z. |
expires_at | string | null | Yes | |
revoked_at | string | null | Yes | |
service | string | null | Yes | For a service grant, the service, such as pod-ci. |
billing_mark | string | null | Yes | |
parent_sandbox | string | null | Yes | For a sandbox key, its sandbox; it is accepted only from there. |
parent_scopes | "sandboxes:read" | "sandboxes:write" | "sandboxes:exec" | "files:read" | "files:write" | "snapshots:write" | "usage:read" | "keys:write" | "projects:write" | "members:read" | "end_users:read" | "end_users:write" | "screen:read" | "screen:write" | "webhooks:read" | "webhooks:write" | "permissions:read" | "permissions:write" | "permissions:records" | "ci:read" | "ci:write" | "network:read" | "network:write"[] | null | Yes | For a sandbox key, the scopes its maker held when it was made; it holds no more. |
last_used_at | string | null | Yes | When the key was last used, to the minute; null if never. Calls the gateway answered reach it in batches, so it can trail by a few minutes. |
rotated_at | string | null | Yes | When the key last got a new secret (rotateKey); null if never. |
previous_secret_until | string | null | Yes | After a rotation, when the old secret stops working; null when it already has. |
Errors
The refusals this call is known for: not_found. Any call can also answer unauthorized, rate_limited, unavailable or internal; the error list says what each means and when to send the call again.
In the SDKs
| Client | Call |
|---|---|
| TypeScript | pod.keys.revoke(id) |
| Python | pod.keys.revoke(id) |
| mpod | mpod sandboxes keys revoke <key> |