LoguDocs
Open Logu

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.

FieldTypeRequiredNotes
emailAsksbooleanoptional
quietHoursobject | nulloptional
quietHours.startstringrequiredpattern ^([01]\d|2[0-3]):[0-5]\d$
quietHours.endstringrequiredpattern ^([01]\d|2[0-3]):[0-5]\d$
quietHours.timeZonestringrequired
quietAsksbooleanoptional
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
FieldTypeRequiredNotes
emailAsksbooleanrequired
quietHoursQuietHours | nullrequired
quietHours.startstringrequiredpattern ^([01]\d|2[0-3]):[0-5]\d$
quietHours.endstringrequiredpattern ^([01]\d|2[0-3]):[0-5]\d$
quietHours.timeZonestringrequired
quietAsksbooleanrequired
locale"en" | "pt-BR" | nullrequiredThe 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.
emailAvailablebooleanrequiredWhether this server can send email (else emailAsks does nothing).

Errors#

Every error is {"error":{"code","message","hint","docUrl","requestId"}}: branch on code. See Errors.

StatusCodeMeaning
400bad_requestThe request is malformed or a field is invalid (see issues).
400unknown_fieldThe body has a field the endpoint doesn't know (often a typo or snake_case).
401unauthorizedNo credentials, or the API key or session is invalid or revoked.
403forbiddenThe caller is authenticated but may not do this (wrong role, or an API key on a human-only endpoint).
500internal_errorSomething went wrong on Logu's side.