Settings API

Manage user preferences and account settings programmatically.


Update Profile

PATCH/v1/user/settings

Updates the authenticated user's settings.

{ "theme": "dark", "notifications": { "email": true, "push": false } }

Authentication

Every request to the Settings API must include a valid session. Pass your token in theAuthorization: Bearer <token> header. The endpoint only mutates settings for the authenticated user, so you never need to send a user id — the account is derived from the session. A missing or expired token returns 401 Unauthorized.

Supported Fields

The request body accepts the following top-level preferences:

  • theme — "dark" or "light". Applies across web and mobile.
  • notifications.email — whether transactional and summary emails are sent to the account inbox.
  • notifications.push — whether in-browser and mobile push alerts are delivered.

Fields you omit are left unchanged. To reset a preference to its default, send it asnull. Unknown fields are ignored rather than rejected, which keeps the API forward-compatible as new settings are added.

Example Request

curl -X PATCH https://routeradiant.com/api/v1/user/settings \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{"theme":"light","notifications":{"email":true,"push":true}}'

Errors

  • 401 — missing, expired, or invalid session token.
  • 422 — body is not valid JSON or a field has an unsupported value.
  • 429 — too many requests; retry after the value in the Retry-After header.

Because settings changes affect the account immediately, persist them client-side before sending so the UI can reflect the new value without waiting for a refresh.