Make an API key
Only a signed-in person with a fresh second factor can make a key; an API key answers `person_required`.
Only a signed-in person with a fresh second factor can make a key; an API key answers person_required. The secret is answered once and stored only as a SHA-256 hash. A closed organization (closeOrganisation) makes no keys: conflict until it is reopened. An unknown or inaccessible project answers not_found.
For people only: a signed-in person with a fresh second factor makes this call, from the dashboard. Any API key is refused with person_required.
Request
curl -X POST "https://api.pod.mapier.ai/v1/keys" \
-H "Authorization: Bearer $POD_PERSON_TOKEN" \
-H "Content-Type: application/json" \
-d '{"project":"prj_3ahrz6dmv29gqy5ckt18fp","name":"example","mode":"test","scopes":["sandboxes:read"]}'Parameters
| Name | In | Type | Required | What it is |
|---|---|---|---|---|
Idempotency-Key | header | string | No | Makes a repeat of this call safe for 24 hours. |
Body
| Field | Type | Required | What it is |
|---|---|---|---|
project | string | Yes | |
name | string | Yes | |
mode | "test" | "live" | Yes | |
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 | |
expires_at | string | null | No |
Answer
201. The key and its secret, shown this once.
{
"key": {
"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
},
"secret": "pod_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dm"
}| Field | Type | Always | What it is |
|---|---|---|---|
key | ApiKey | Yes | |
secret | string | Yes | Shown once. Stored by Pod only as a SHA-256 hash. |
Errors
The refusals this call is known for: invalid, person_required, forbidden, not_found, conflict, quota_exceeded. 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.create({ … }) |
| Python | pod.keys.create(…) |
| mpod | mpod sandboxes keys create |