PT EN

Preferências de notificação

URL base: $BUSINESS_API

O objecto

idstring · obrigatório
recipient_typestring · obrigatório
recipient_idstring · obrigatório
consent_statusstring · obrigatório

um de granted, withdrawn, required_notice_only

preferred_localestring · opcional

um de pt-MZ, en-US

eventsobject · opcional
channelsobject · opcional
quiet_hours_startstring · opcional
quiet_hours_endstring · opcional
timezonestring · opcional

IANA time zone for the recipient's quiet hours

O objecto
{
  "id": "not_25JciZ96OjFmw7Nk8jrG0JbC4zp",
  "recipient_type": "recipient type",
  "recipient_id": "rec_2Fj2I5VC2F9MUXfa4XBWM39egPf",
  "consent_status": "granted",
  "preferred_locale": "pt-MZ",
  "events": {
    "key": true
  },
  "channels": {
    "key": true
  },
  "quiet_hours_start": "quiet hours start",
  "quiet_hours_end": "quiet hours end",
  "timezone": "Africa/Maputo"
}

Listar preferências de notificação

Registos

GET /notification-preferences

Returns the recorded communication preferences of the tenant's recipients: consent status, preferred locale, per-event and per-channel choices, quiet hours and time zone. The optional recipient_type and recipient_id query values narrow the list, and results use cursor pagination. Requires the notifications:read permission.

Parâmetros

limitinteger · consulta · opcional

Maximum resources to return (default 20, maximum 100).

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

Devolve

200 Utility-scoped, channel-neutral preferences

Mostrar atributos
dataarray of NotificationPreference · opcional
Mostrar atributos filhos
idstring · obrigatório
recipient_typestring · obrigatório
recipient_idstring · obrigatório
consent_statusstring · obrigatório

um de granted, withdrawn, required_notice_only

preferred_localestring · opcional

um de pt-MZ, en-US

eventsobject · opcional
channelsobject · opcional
quiet_hours_startstring · opcional
quiet_hours_endstring · opcional
timezonestring · opcional

IANA time zone for the recipient's quiet hours

has_moreboolean · opcional
next_cursorstring · opcional

Permissões notifications:read · Funções: admin, customer_service, owner

curl -X GET "$BUSINESS_API/notification-preferences" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "data": [
    {
      "id": "not_25JciZ96OjFmw7Nk8jrG0JbC4zp",
      "recipient_type": "recipient type",
      "recipient_id": "rec_2Fj2I5VC2F9MUXfa4XBWM39egPf",
      "consent_status": "granted",
      "preferred_locale": "pt-MZ",
      "events": {
        "key": true
      },
      "channels": {
        "key": true
      },
      "quiet_hours_start": "quiet hours start",
      "quiet_hours_end": "quiet hours end",
      "timezone": "Africa/Maputo"
    }
  ],
  "has_more": true,
  "next_cursor": "next cursor"
}

Actualizar uma preferência de notificação

Registos

PATCH /notification-preferences

Record a recipient's consent, channel and event choices, locale, or quiet hours

Requires notifications:write. The change is written to the audit log.

Corpo application/json

recipient_typestring · obrigatório
recipient_idstring · obrigatório
consent_statusstring · obrigatório

um de granted, withdrawn, required_notice_only

preferred_localestring · opcional

um de pt-MZ, en-US

eventsobject · opcional

Per-event delivery choices

channelsobject · opcional

Per-channel delivery choices for email, push, and in_app

quiet_hours_startstring · opcional
quiet_hours_endstring · opcional
timezonestring · opcional

IANA time zone required when quiet hours are set

Devolve

200 Stored preference

Mostrar atributos
idstring · obrigatório
recipient_typestring · obrigatório
recipient_idstring · obrigatório
consent_statusstring · obrigatório

um de granted, withdrawn, required_notice_only

preferred_localestring · opcional

um de pt-MZ, en-US

eventsobject · opcional
channelsobject · opcional
quiet_hours_startstring · opcional
quiet_hours_endstring · opcional
timezonestring · opcional

IANA time zone for the recipient's quiet hours

Erros 400 · 403

Permissões notifications:write · Funções: admin, customer_service, owner

curl -X PATCH "$BUSINESS_API/notification-preferences" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "recipient_type": "recipient type",
  "recipient_id": "rec_2Fj2I5VC2F9MUXfa4XBWM39egPf",
  "consent_status": "granted",
  "preferred_locale": "pt-MZ",
  "events": {
    "key": true
  },
  "channels": {
    "key": true
  },
  "quiet_hours_start": "quiet hours start",
  "quiet_hours_end": "quiet hours end",
  "timezone": "Africa/Maputo"
}'
Resposta 200
{
  "id": "not_25JciZ96OjFmw7Nk8jrG0JbC4zp",
  "recipient_type": "recipient type",
  "recipient_id": "rec_2Fj2I5VC2F9MUXfa4XBWM39egPf",
  "consent_status": "granted",
  "preferred_locale": "pt-MZ",
  "events": {
    "key": true
  },
  "channels": {
    "key": true
  },
  "quiet_hours_start": "quiet hours start",
  "quiet_hours_end": "quiet hours end",
  "timezone": "Africa/Maputo"
}