Skip to content
Sign in Waitlist
Docs/API reference/Preferences/Save preferences

Save preferences

PUT /v1/preferences scope write

Changes the preferences. Partial (only what is sent changes) and strict (an unknown field or value returns 422 invalid_field). Returns the full preferences. With email true, the server emails postSent, postFailed, scheduledFail, the weeklySummary (Mondays at 08:00, America/Sao_Paulo) and newComment (batched, at most one email per hour); with panel true, the event goes to the notification center (GET /v1/notifications).

HeadersAuthorization: Bearer praeko_… and X-Praeko-Contract: en. Always send both.

Request body

JSON. Required fields must be sent; the others can be left out. A field that is not in the table is rejected. Strict: an unknown field or value returns 422 invalid_field. Partial: only what you send changes.

Field Type Description
theme (optional) string Dashboard theme. Values: light, dark, system.
language (optional) string Dashboard language. Values: pt-BR, en.
notifications (optional) object Notifications per event. Only the events you send change.
notifications.postSent (optional) object Where to notify this event.
notifications.postSent.email (optional) boolean Notify by email.
notifications.postSent.panel (optional) boolean Notify in the dashboard.
notifications.postFailed (optional) object Where to notify this event.
notifications.postFailed.email (optional) boolean Notify by email.
notifications.postFailed.panel (optional) boolean Notify in the dashboard.
notifications.scheduledFail (optional) object Where to notify this event.
notifications.scheduledFail.email (optional) boolean Notify by email.
notifications.scheduledFail.panel (optional) boolean Notify in the dashboard.
notifications.weeklySummary (optional) object Where to notify this event.
notifications.weeklySummary.email (optional) boolean Notify by email.
notifications.weeklySummary.panel (optional) boolean Notify in the dashboard.
notifications.newComment (optional) object Where to notify this event.
notifications.newComment.email (optional) boolean Notify by email.
notifications.newComment.panel (optional) boolean Notify in the dashboard.
Body example
{
  "theme": "dark",
  "language": "pt-BR",
  "notifications": {
    "postFailed": {
      "email": true,
      "panel": true
    },
    "weeklySummary": {
      "email": false
    }
  }
}

Example

curl -X PUT "https://praeko.app/v1/preferences" \
  -H "Authorization: Bearer $PRAEKO_KEY" \
  -H "X-Praeko-Contract: en" \
  -H "Content-Type: application/json" \
  -d '{
  "theme": "dark",
  "language": "pt-BR",
  "notifications": {
    "postFailed": {
      "email": true,
      "panel": true
    },
    "weeklySummary": {
      "email": false
    }
  }
}'

Response

Success status When
200 Success.
Response 200
{
  "theme": "dark",
  "language": "pt-BR",
  "notifications": {
    "postSent": {
      "email": false,
      "panel": true
    },
    "postFailed": {
      "email": true,
      "panel": true
    },
    "scheduledFail": {
      "email": false,
      "panel": true
    },
    "weeklySummary": {
      "email": false,
      "panel": true
    },
    "newComment": {
      "email": false,
      "panel": true
    }
  }
}

Errors

Status code When
400 empty_body The request body is empty.
400 invalid_json The request body is not a JSON object.
413 body_too_large The request body is larger than 1 MB.
422 invalid_field Unknown field, event, channel or value.

Errors on any route

Status code When
401 unauthorized The Authorization: Bearer … header is missing.
401 invalid_api_key The key does not exist.
401 revoked_api_key The key has been revoked.
401 expired_api_key The key has expired.
403 forbidden The key's scope is not enough for this route (see the scope badge).
429 rate_limited The per-minute request limit was exceeded.

The body of every error is { "error": { "code", "message", "details"? } }. See all error codes.

Try it

Try it

The live test uses your key and your account. It stays off when you are not signed in.

Sign in to try it
Question or mistake on this page? contato@praeko.appView .md

Type to search pages, routes and error codes.