Make a short-lived token a browser holds for one end user
Answers a token (`pod_eu_…`) your server hands to your user's browser.
Answers a token (pod_eu_…) your server hands to your user's browser. Sent as a bearer token, it sees and drives only this end user's sandboxes (or only sandbox), with the scopes named, which are at most sandboxes:read, sandboxes:exec, files:read and files:write and never more than the caller holds. It lives ttl_s seconds, 30 to 3600 (900 by default), and cannot be renewed: make another. Everything else, creates and deletes included, stays on your server with your key. Pod signs it and stores nothing of it, so the answer is a secret sent with Cache-Control: no-store, the call takes no Idempotency-Key, and asking twice makes two tokens. A cell checks it without calling the account service; revokeEndUserTokens, a suspension or a deletion refuses every token of the end user within seconds. A suspended or deleted end user is conflict or not_found.
A key with the end_users:write scope.
Request
curl -X POST "https://api.pod.mapier.ai/v1/end_users/enu_3ahrz6dmv29gqy5ckt18fp/tokens" \
-H "Authorization: Bearer $POD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"scopes":["sandboxes:read"]}'Parameters
| Name | In | Type | Required | What it is |
|---|---|---|---|---|
end_user_id | path | string | Yes |
Body
| Field | Type | Required | What it is |
|---|---|---|---|
scopes | "sandboxes:read" | "sandboxes:exec" | "files:read" | "files:write"[] | No | All four by default, narrowed to what the caller holds. |
ttl_s | integer | No | Default 900. From 30 to 3600. |
sandbox | string | No | Only this sandbox of the end user. One that is not the end user's is not_found. |
Answer
201. The token, shown this once.
{
"token": "pod_3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dmv29gqy5ckt18fpx4bjs07enw3ahrz6dmv29gqy5ckt18fp",
"end_user": "enu_3ahrz6dmv29gqy5ckt18fp",
"scopes": ["sandboxes:read"],
"sandbox": null,
"issued_at": "2026-11-23T12:00:00.000Z",
"expires_at": "2026-11-23T12:00:00.000Z"
}| Field | Type | Always | What it is |
|---|---|---|---|
token | string | Yes | Signed by Pod and stored nowhere. A secret for its life. |
end_user | string | Yes | |
scopes | "sandboxes:read" | "sandboxes:exec" | "files:read" | "files:write"[] | Yes | |
sandbox | string | null | Yes | |
issued_at | string | Yes | RFC 3339 in UTC with milliseconds, for example 2026-11-23T17:04:05.123Z. |
expires_at | string | Yes | RFC 3339 in UTC with milliseconds, for example 2026-11-23T17:04:05.123Z. |
Errors
The refusals this call is known for: invalid, forbidden, not_found, conflict. 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.endUsers.createToken(id, { … }) |
| Python | pod.end_users.create_token(id, …) |