Skip to content
Torii docs

Update current user profile

PATCH
/_torii/users/me
curl --request PATCH \
--url https://your-app.torii.so/_torii/users/me \
--header 'Content-Type: application/json' \
--data '{ "firstName": "Ada", "lastName": "Lovelace", "locale": "en", "unsafeMetadata": { "onboardingStep": 2 } }'
Media type application/json

PATCH body for updating an end-user. Every field is tri-state: omit the key entirely to leave the field unchanged, send a non-null value to set it, or send JSON null to clear it.

object
firstName

New first (given) name. Send null to clear; omit to leave unchanged.

string | null
Example
Ada
lastName

New last (family) name. Send null to clear; omit to leave unchanged.

string | null
Example
Lovelace
locale

New preferred locale. Send null to clear; omit to leave unchanged.

string | null
Allowed values: en da
unsafeMetadata

Deep-merges into the user’s unsafe metadata (a key set to null removes it); omit to leave unchanged. Merged result max 512 bytes.

object
key
additional properties
any
Example
{
"onboardingStep": 2
}

OK

Media type application/json
object
user
required

An end-user belonging to one of your environments.

object
id
required

Unique identifier for this user.

string format: uuid
environmentId
required

Identifier of the environment this user belongs to.

string format: uuid
name

Full display name on the profile, if any.

string | null
firstName

First (given) name on the profile, if any.

string | null
lastName

Last (family) name on the profile, if any.

string | null
locale

Preferred locale for emails and UI messages.

string | null
Allowed values: en da
status
required

Lifecycle status of the user (e.g. active, banned).

string
Allowed values: active banned deleted
createdAt
required

When this user was created (ISO-8601 UTC).

string format: date-time
updatedAt
required

When this user was last modified (ISO-8601 UTC).

string format: date-time
email

Primary email on the profile, if any. Not guaranteed to be verified.

string | null
emailVerifiedAt

When this user’s primary email was verified, if it has been verified.

string | null format: date-time
deletedAt

When this user was deleted, if soft-deleted. Null for active users.

string | null format: date-time
publicMetadata
required

Public metadata: readable by the SDK, writable only server-side.

object
key
additional properties
any
unsafeMetadata
required

Unsafe metadata: readable and writable by the end-user via the SDK.

object
key
additional properties
any
session
required

Current session state: status + any blocking gates the user must clear before the session activates.

object
status
required

Whether the session is active or pending gate completion.

string
Allowed values: ACTIVE PENDING
gates
required

Authentication-critical gates the user must complete before the session activates.

Array<object>

Authentication-critical gate the user must pass before the session activates.

object
key
required

Stable wire identifier; customer apps key gateUrls against this.

string
Allowed values: LEGAL_ACCEPTANCE EMAIL_VERIFICATION
currentGate
One of:

Authentication-critical gate the user must pass before the session activates.

object
key
required

Stable wire identifier; customer apps key gateUrls against this.

string
Allowed values: LEGAL_ACCEPTANCE EMAIL_VERIFICATION
organizations
required
Array<object>
object
id
required
string format: uuid
name
required
string
role
required

Caller’s role key in this org (e.g. admin | member).

string
roleName

Human-readable display name of the caller’s role, from the org’s bound role set.

string | null
Example
{
"user": {
"id": "01931a73-8b00-7000-8000-000000000000",
"environmentId": "01931a72-0000-7000-8000-000000000000",
"name": "Ada Lovelace",
"firstName": "Ada",
"lastName": "Lovelace",
"locale": "en",
"status": "active",
"createdAt": "2026-05-16T09:30:00Z",
"updatedAt": "2026-05-16T10:00:00Z",
"email": "ada@example.com",
"emailVerifiedAt": "2026-05-16T09:35:00Z",
"deletedAt": "2026-05-20T12:00:00Z",
"publicMetadata": {
"plan": "pro"
},
"unsafeMetadata": {
"onboardingStep": 2
}
},
"session": {
"status": "ACTIVE",
"gates": [
{
"key": "LEGAL_ACCEPTANCE"
}
],
"currentGate": {
"key": "LEGAL_ACCEPTANCE"
}
}
}