Update User
Update an existing user's profile fields.
PATCH
/api/v1/users/{id}Updates one or more fields of an existing user. This is a partial update (PATCH semantics) — only the fields included in the request body are modified; omitted fields retain their current values.
Note
To replace a user entirely, use
PUT /api/v1/users/{id} (coming in v2).Immutable Fields
The following fields cannot be changed after creation:
id— system-assigned, globally uniquecreatedAt— set at creation time
Email Uniqueness
If you update email, the new address must not be in use by any other user in your organization. A 409 Conflict is returned otherwise.
Path Parameters * required
| Name | Type | Required | Description |
|---|---|---|---|
| id* | string | ✓ | The unique identifier of the user (e.g. usr_abc123). |
Request Headers
| Header | Type | Required | Description |
|---|---|---|---|
| Authorization* | string | ✓ | Bearer token. Format: Bearer <token>. Requires users:write scope. |
| Content-Type* | string | ✓ | Must be application/json. |
Request Body
Content-Type: application/json
All fields are optional. Only provided fields will be updated.
{
"name": "Alice Smith",
"role": "admin",
"metadata": { "department": "engineering" }
}
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | — | Full display name of the user. |
| string | — | Primary email address. Must be unique within the organization. | |
| role | string | — | User role. Allowed values: member, admin, viewer. |
| metadata | object | — | Arbitrary key-value pairs for application use. Max 16 keys. |
Responses
| Status | Description |
|---|---|
| 200 | User updated successfully. Returns the updated user object. |
| 400 | Validation error. Check the errors array for field details. |
| 401 | Unauthorized. Missing or invalid token. |
| 403 | Forbidden. Token does not have users:write scope. |
| 404 | User not found. |
| 409 | Conflict. The new email address is already used by another user. |
Examples
curl -X PATCH "https://api.example.com/v1/users/usr_abc123" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Alice Smith", "role": "admin"}'
const updated = await fetch('/api/v1/users/usr_abc123', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({ name: 'Alice Smith', role: 'admin' }),
}).then(r => r.json());
console.log(updated.updatedAt);
import requests
r = requests.patch(
'https://api.example.com/v1/users/usr_abc123',
headers={'Authorization': 'Bearer YOUR_TOKEN'},
json={'name': 'Alice Smith', 'role': 'admin'}
)
print(r.json()['updatedAt'])