Current User
These endpoints allow you to retrieve and update the profile of the currently authenticated user. All requests require a valid Bearer token obtained from the authentication flow.
Get current user
Retrieve the profile of the currently authenticated user, including their tenant memberships and active workspace.
Response fields
- Name
id- Type
- string
- Description
Unique identifier for the user (UUID).
- Name
email- Type
- string
- Description
The user's email address.
- Name
first_name- Type
- string
- Description
The user's first name.
- Name
last_name- Type
- string
- Description
The user's last name.
- Name
type- Type
- string
- Description
The user type. One of
user,admin, oragent.
- Name
locale- Type
- string
- Description
The user's preferred locale (e.g.
fr_FR,en_US).
- Name
timezone- Type
- string
- Description
The user's timezone (e.g.
Europe/Paris).
- Name
tenants- Type
- array
- Description
List of tenants the user belongs to, each with
id,name,slug, andshort_id.
- Name
current_tenant- Type
- object
- Description
The tenant the user is currently acting within.
- Name
current_workspace- Type
- object
- Description
The workspace the user is currently active in.
curl https://your-sphere.example.com/auth/api/v1/auth/user \
-H "Authorization: Bearer {token}"
Response
{
"data": {
"id": "9e1a2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"email": "alice@acme.com",
"first_name": "Alice",
"last_name": "Martin",
"type": "user",
"locale": "fr_FR",
"timezone": "Europe/Paris",
"tenants": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Acme Corp",
"slug": "acme",
"short_id": "acme-corp"
}
],
"current_tenant": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Acme Corp",
"slug": "acme",
"short_id": "acme-corp"
},
"current_workspace": {
"id": "w1a2b3c4-d5e6-f7a8-b9c0-d1e2f3a4b5c6",
"name": "General",
"slug": "general"
}
}
}
Update current user profile
Update the profile of the currently authenticated user. Only the provided fields will be updated.
Request body
- Name
first_name- Type
- string
- Description
The user's first name.
- Name
last_name- Type
- string
- Description
The user's last name.
- Name
locale- Type
- string
- Description
The user's preferred locale (e.g.
fr_FR,en_US).
- Name
timezone- Type
- string
- Description
The user's timezone (e.g.
Europe/Paris,America/New_York).
curl -X PATCH https://your-sphere.example.com/auth/api/v1/auth/user \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Alice",
"last_name": "Dupont",
"locale": "en_US"
}'
Response
{
"data": {
"id": "9e1a2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"email": "alice@acme.com",
"first_name": "Alice",
"last_name": "Dupont",
"type": "user",
"locale": "en_US",
"timezone": "Europe/Paris"
}
}
Update timezone
Update the timezone of the currently authenticated user. This is a dedicated endpoint for timezone-only updates, useful for automatic timezone detection on the client side.
Request body
- Name
timezone- Type
- string
- Description
A valid IANA timezone identifier (e.g.
Europe/Paris,America/New_York,Asia/Tokyo).
curl -X PUT https://your-sphere.example.com/auth/api/v1/auth/user/timezone \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"timezone": "America/New_York"
}'
Response
{
"data": {
"id": "9e1a2b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"email": "alice@acme.com",
"first_name": "Alice",
"last_name": "Martin",
"type": "user",
"locale": "fr_FR",
"timezone": "America/New_York"
}
}