Users
Update preferences
Partially update the authenticated user's preferences.
PATCH /users/me/preferences
Partially updates the user's preferences. All fields are optional. The API changes only the fields you send and keeps all other fields as they are. Returns the full, updated preferences object.
Authentication: Bearer token · Permission:
account:write · Rate limit: default (120 / 60s)Request body
All fields optional.
appearance
string
Theme preference. One of
auto, light, dark.notifications.email.productUpdates
boolean
Receive product-update emails.
notifications.email.promotional
boolean
Receive promotional emails.
{
"appearance": "dark",
"notifications": { "email": { "promotional": false } }
}
Request
curl -X PATCH https://api.twominutereports.com/v1/users/me/preferences \
-H "Authorization: Bearer tmrc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{ "appearance": "dark", "notifications": { "email": { "promotional": false } } }'
Response
{
"success": true,
"data": {
"appearance": "dark",
"notifications": {
"email": { "productUpdates": true, "promotional": false }
}
}
}
{
"success": false,
"error": { "code": "BAD_REQUEST", "message": "Validation error: Invalid option: expected one of \"auto\"|\"light\"|\"dark\" at \"appearance\"" }
}
{
"success": false,
"error": { "code": "UNAUTHORIZED", "message": "Invalid or expired session" }
}