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.

POST/v1/end_users/{end_user_id}/tokens

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

NameInTypeRequiredWhat it is
end_user_idpathstringYes

Body

FieldTypeRequiredWhat it is
scopes"sandboxes:read" | "sandboxes:exec" | "files:read" | "files:write"[]NoAll four by default, narrowed to what the caller holds.
ttl_sintegerNoDefault 900. From 30 to 3600.
sandboxstringNoOnly this sandbox of the end user. One that is not the end user's is not_found.

Answer

201. The token, shown this once.

201
{
  "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"
}
FieldTypeAlwaysWhat it is
tokenstringYesSigned by Pod and stored nowhere. A secret for its life.
end_userstringYes
scopes"sandboxes:read" | "sandboxes:exec" | "files:read" | "files:write"[]Yes
sandboxstring | nullYes
issued_atstringYesRFC 3339 in UTC with milliseconds, for example 2026-11-23T17:04:05.123Z.
expires_atstringYesRFC 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

ClientCall
TypeScriptpod.endUsers.createToken(id, { … })
Pythonpod.end_users.create_token(id, …)