Skip to main content

Update User

Update the current authenticated user's information.

Endpoint​

PUT /api/v3/auth/user

Description​

Updates information for the currently authenticated user. Can update email, password, and user metadata.

Authentication​

Requires Bearer token authentication.

Authorization: Bearer {access_token}

Request Body​

FieldTypeRequiredDescription
emailstringNoNew email address
passwordstringNoNew password
dataobjectNoUser metadata to update

All fields are optional. Only provided fields will be updated.

Response​

Returns the updated user information.

FieldTypeDescription
idstringUser UUID
emailstringUser email address
emailConfirmedAtstringEmail confirmation timestamp
createdAtstringAccount creation timestamp
updatedAtstringLast update timestamp
userMetadataobjectUser-defined metadata
appMetadataobjectApplication-defined metadata

Usage​

Update User Metadata​

import requests

headers = {"Authorization": f"Bearer {access_token}"}

response = requests.put(
"https://cadenza-api-uat.algo724.com/api/v3/auth/user",
headers=headers,
json={
"data": {
"name": "John Doe",
"company": "Acme Corp"
}
}
)

user = response.json()["data"]

Update Password​

response = requests.put(
"https://cadenza-api-uat.algo724.com/api/v3/auth/user",
headers=headers,
json={
"password": "new-secure-password"
}
)

Update Email​

response = requests.put(
"https://cadenza-api-uat.algo724.com/api/v3/auth/user",
headers=headers,
json={
"email": "newemail@example.com"
}
)
curl -X PUT https://cadenza-api-uat.algo724.com/api/v3/auth/user \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "Content-Type: application/json" \
-d '{"data": {"name": "John Doe"}}'

Example Response​

{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "user@example.com",
"emailConfirmedAt": "2024-01-15T10:00:00Z",
"phone": null,
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-16T14:30:00Z",
"userMetadata": {
"name": "John Doe",
"company": "Acme Corp"
},
"appMetadata": {
"provider": "email"
}
},
"success": true,
"errno": 0,
"error": null
}

Error Responses​

HTTP CodeErrorDescription
400Invalid requestInvalid email format or weak password
401UnauthorizedInvalid or expired access token

Example Error​

{
"data": null,
"success": false,
"errno": -100004,
"error": "Password must be at least 6 characters"
}

Notes​

  • Email changes may require confirmation depending on environment settings
  • Password updates take effect immediately
  • User metadata is merged with existing metadata (not replaced)
  • Only the user can update their own information