Update user profile (partial)
Updates user profile with partial data (only provided fields are modified).
## Authorization
- **Users**: Can update own profile only
- **Admins**: Can update any user profile
- Attempting to update another user's profile without admin role returns 403
## Behavior
- PATCH semantics: only fields provided in request are updated
- Accepts both snake_case and camelCase field names
- Validates user exists before update
- Checks permissions (own profile or admin)
- Updates Better Auth users collection
- Returns updated user data
## Updatable Fields (Non-Admin)
- Personal info: name, first_name, last_name, phone, avatar_url
- Display contact: display_name, display_email, title, tagline
- Brokerage: brokerage_name, office_name, license info
- Biography and social profiles
- Location: city, state
## Admin-Only Fields
- email, role, is_active, email_verified, account_status
- (Use PUT /users/{user_id} for admin updates)
## Performance
- **Timeout**: 10 seconds
- **Database calls**: 3 queries (user lookup, permission check, update)
## Examples
```json
PATCH /api/v1/users/abc123
{
"displayName": "John D.",
"title": "Senior Real Estate Agent",
"cellPhone": "+1-555-0123"
}
```
| Method | Path |
|---|---|
PATCH | /api/v1/users/{user_id} |
Primary host: https://valara.cloud (legacy alias: https://dash.jacoballenmedia.com).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
user_id | path | yes | string |
Request body
(no request body)
Response
null
Responses
| Status | Description |
|---|---|
200 | User updated successfully |
401 | Authentication required (see error codes) |
403 | Forbidden - cannot update another user's profile (see error codes) |
404 | User not found (see error codes) |
422 | Validation Error (see error codes) |
500 | Server error - update failed (see error codes) |
Examples
curl
curl -X PATCH "https://valara.cloud/api/v1/users/{user_id}" \
-H "Authorization: Bearer $VALARA_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Idempotency-Key: $(uuidgen)"
Python
import os
import uuid
import httpx
res = httpx.request(
"PATCH",
"https://valara.cloud/api/v1/users/{user_id}",
headers={
"Authorization": f"Bearer {os.environ['VALARA_API_KEY']}",
"Content-Type": "application/json",
"X-Idempotency-Key": str(uuid.uuid4()),
},
)
res.raise_for_status()
print(res.json())