Delivery · updatePreferences
Change delivery preferences
PATCH /v1/preferences
Send only what changes. Quiet hours are a daily window in the member's time zone when deliveries are held (events always; asks only with quietAsks); null turns them off. locale (en, pt-BR) sets the language of the member's notifications and emails.
- Who may call it
- any signed-in human
- Server
- https://api.logu.dev
Request body#
Content type application/json (required).
The delivery settings that change. Strict.
| Field | Type | Required | Notes |
|---|---|---|---|
emailAsks | boolean | optional | |
quietHours | object | null | optional | |
quietHours.start | string | required | pattern ^([01]\d|2[0-3]):[0-5]\d$ |
quietHours.end | string | required | pattern ^([01]\d|2[0-3]):[0-5]\d$ |
quietHours.timeZone | string | required | |
quietAsks | boolean | optional | |
locale | "en" | "pt-BR" | optional |
{
"quietHours": {
"start": "22:00",
"end": "07:00",
"timeZone": "America/Sao_Paulo"
}
}
Example#
curl -s -X PATCH "https://api.logu.dev/v1/preferences" \
-H "Authorization: Bearer $LOGU_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"quietHours":{"start":"22:00","end":"07:00","timeZone":"America/Sao_Paulo"}}'
Responses#
200
The preferences.
{
"emailAsks": true,
"quietHours": {
"start": "22:00",
"end": "07:00",
"timeZone": "America/Sao_Paulo"
},
"quietAsks": false,
"locale": "pt-BR",
"emailAvailable": true
}
Response fields
| Field | Type | Required | Notes |
|---|---|---|---|
emailAsks | boolean | required | |
quietHours | QuietHours | null | required | |
quietHours.start | string | required | pattern ^([01]\d|2[0-3]):[0-5]\d$ |
quietHours.end | string | required | pattern ^([01]\d|2[0-3]):[0-5]\d$ |
quietHours.timeZone | string | required | |
quietAsks | boolean | required | |
locale | "en" | "pt-BR" | null | required | The language of the member's push, browser notifications, Telegram and Slack messages and emails (en, pt-BR); null means English. The app sends its own on sign-in and when it changes. |
emailAvailable | boolean | required | Whether this server can send email (else emailAsks does nothing). |
Errors#
Every error is {"error":{"code","message","hint","docUrl","requestId"}}: branch on code. See Errors.
| Status | Code | Meaning |
|---|---|---|
| 400 | bad_request | The request is malformed or a field is invalid (see issues). |
| 400 | unknown_field | The body has a field the endpoint doesn't know (often a typo or snake_case). |
| 401 | unauthorized | No credentials, or the API key or session is invalid or revoked. |
| 403 | forbidden | The caller is authenticated but may not do this (wrong role, or an API key on a human-only endpoint). |
| 500 | internal_error | Something went wrong on Logu's side. |