Make or find an end user by your own id for it

Answers the end user of the project with this `ref`, making it the first time (`201`); every later call with the same `ref` answers the same end user (`200`).

POST/v1/end_users

Answers the end user of the project with this ref, making it the first time (201); every later call with the same ref answers the same end user (200). The ref is your own id for your user: Pod keeps it, shows it back and never reads it. A key makes end users in its own project; a person names the project. A new end user is a trust domain of its own (trust_domain: end_user), as Pod Console's customers are. An end user made under the earlier default shares the organization's (trust_domain: organisation) and keeps it. display_name, metadata and tags are kept when the end user is made; a later call with the same ref answers the end user as it is, and updateEndUser changes them. A deleted end user's ref makes a new one.

A key with the end_users:write scope.

Request

curl -X POST "https://api.pod.mapier.ai/v1/end_users" \
  -H "Authorization: Bearer $POD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ref":"example"}'

Parameters

NameInTypeRequiredWhat it is
Idempotency-KeyheaderstringNoMakes a repeat of this call safe for 24 hours.

Body

FieldTypeRequiredWhat it is
refstringYesYour own id for your user. Pod keeps it and shows it back; it never reads it.
display_namestringNoThe name you show for your user. Pod keeps it and shows it back; it never reads it.
metadataEndUserMetadataNoUp to 16 string values of your own. Pod keeps them and shows them back; it never reads them.
tagsstring[]No
projectstringNoThe key's own project by default, and the only one it may name. A person must name one.

Answer

200. The end user, found.

201. The end user, made.

200
{
  "id": "enu_3ahrz6dmv29gqy5ckt18fp",
  "project": "prj_3ahrz6dmv29gqy5ckt18fp",
  "ref": "example",
  "trust_domain": "organisation",
  "created_at": "2026-11-23T12:00:00.000Z",
  "limits": {
    "max_sandboxes": {
      "value": 0,
      "from": "end_user"
    },
    "max_awake": {
      "value": 0,
      "from": "end_user"
    }
  },
  "spend_cap": {
    "amount_cents": null,
    "on_reach": "refuse",
    "from": "end_user",
    "currency": "example",
    "period": "example",
    "spent_cents": null,
    "reached": false
  },
  "display_name": null,
  "metadata": {},
  "tags": ["example"],
  "state": "active",
  "suspended_at": null,
  "policy": {
    "wakes_per_hour": null,
    "idle_s": null,
    "max_size": null,
    "max_vcpu": null
  },
  "tokens_valid_after": null
}
FieldTypeAlwaysWhat it is
idstringYes
projectstringYes
refstringYesYour own id for your user. Pod keeps it and shows it back; it never reads it.
trust_domain"organisation" | "end_user"YesWhose trust domain the end user's sandboxes share: the organization's, or one of the end user's own, so no processor core switches between two end users without the processor's mitigations.
created_atstringYesRFC 3339 in UTC with milliseconds, for example 2026-11-23T17:04:05.123Z.
limitsEndUserLimitsYes
spend_capEndUserSpendCapYes
display_namestring | nullYes
metadataEndUserMetadataYesUp to 16 string values of your own. Pod keeps them and shows them back; it never reads them.
tagsstring[]Yes
state"active" | "suspended" | "deleted"Yessuspended: creates, wakes and tokens refused (account_restricted, limit: end_user). deleted: gone; its sandboxes are deleted.
suspended_atstring | nullYes
policyEndUserPolicyYesWhat every sandbox of the end user is held to; null fields hold nothing. Set with updateEndUser.
tokens_valid_afterstring | nullYesTokens made before this time are refused (revokeEndUserTokens).

Errors

The refusals this call is known for: invalid, forbidden, 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

ClientCall
TypeScriptpod.endUsers.create(ref)
Pythonpod.end_users.create(ref)