Skip to main content

Update user preferences (partial)

Updates user's localization and display preferences.

## Authorization
- Users can update their own preferences
- Admins can update anyone's preferences
- Managers (broker, photographer) can update their team's preferences

## Behavior
- PATCH semantics: only provided fields are updated
- Validates field values (e.g., date_time_format must be friendly/us/uk)
- Returns updated preferences with defaults applied

## Valid Values
- date_time_format: "friendly" | "us" | "uk"
- timezone: Any valid IANA timezone (e.g., "America/New_York")
- language: BCP 47 language tag (e.g., "en-US")
- measurement_unit: "imperial" | "metric"
- theme: "light" | "dark" | "system"

## Examples
```json
PATCH /api/v1/users/{user_id}/preferences
{
"date_time_format": "us",
"timezone": "America/New_York"
}

Response: {
"date_time_format": "us",
"timezone": "America/New_York",
"language": "en-US",
"measurement_unit": "imperial",
"theme": "system"
}
```
MethodPath
PATCH/api/v1/users/{user_id}/preferences

Primary host: https://valara.cloud (legacy alias: https://dash.jacoballenmedia.com).

Parameters

NameInRequiredTypeDescription
user_idpathyesstring

Request body

(no request body)

Response

null

Responses

StatusDescription
200Preferences updated successfully
400Invalid preference value (see error codes)
401Authentication required (see error codes)
403Not authorized to update this user's preferences (see error codes)
404User not found (see error codes)
422Validation Error (see error codes)

Examples

curl

curl -X PATCH "https://valara.cloud/api/v1/users/{user_id}/preferences" \
-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}/preferences",
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())

See also