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
| Field | Type | Required | Description |
|---|---|---|---|
email | string | No | New email address |
password | string | No | New password |
data | object | No | User metadata to update |
All fields are optional. Only provided fields will be updated.
Response
Returns the updated user information.
| Field | Type | Description |
|---|---|---|
id | string | User UUID |
email | string | User email address |
emailConfirmedAt | string | Email confirmation timestamp |
createdAt | string | Account creation timestamp |
updatedAt | string | Last update timestamp |
userMetadata | object | User-defined metadata |
appMetadata | object | Application-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 Code | Error | Description |
|---|---|---|
| 400 | Invalid request | Invalid email format or weak password |
| 401 | Unauthorized | Invalid 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