PT EN

Caixa de entrada

URL base: $CONSUMER_API

O objecto

idstring · obrigatório
tenant_idstring · obrigatório
intent_idstring · obrigatório
event_typestring · obrigatório
template_keystring · opcional
titlestring · obrigatório
bodystring · obrigatório
resource_typestring · opcional
resource_idstring · opcional
created_atstring (date-time) · obrigatório
read_atstring (date-time) · opcional
archived_atstring (date-time) · opcional
O objecto
{
  "id": "not_2WyblSmD5mK7ZwWz32AntEotfiw",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "intent_id": "int_22Gr1MqNzCoLNQG9VCg3dYIRdQg",
  "event_type": "event type",
  "template_key": "template key",
  "title": "Fuga na Rua 3",
  "body": "Leitura confirmada no local.",
  "resource_type": "resource type",
  "resource_id": "res_2iAXhMsJzmqPnY6X5cMTJ6OBTSG",
  "created_at": "2026-11-19T09:30:00Z",
  "read_at": "2026-11-19T09:30:00Z",
  "archived_at": "2026-11-19T09:30:00Z"
}

Listar a caixa de entrada

Registos

GET /inbox

Returns the in-app messages addressed to the signed-in person across every utility, newest first, one cursor page at a time. Only messages with both a title and a body are listed, and archived messages are hidden unless include_archived is true. The caller must be a consumer identity that is not bound to a tenant; a staff or tenant-bound token receives 403. No account permission is needed, since the inbox belongs to the person.

Parâmetros

limitinteger · consulta · opcional

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

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

unread_onlyboolean · consulta · opcional · predefinição false

When true, return only messages that have not been marked read; accepts Go boolean strings (true, false, 1, 0, t, f) and returns 400 for anything else.

include_archivedboolean · consulta · opcional · predefinição false

When true, also return archived messages, which are hidden by default; accepts Go boolean strings and returns 400 for anything else.

Devolve

200 The caller's inbox messages

Mostrar atributos
dataarray of NotificationInboxItem · obrigatório

Inbox messages addressed to the caller, newest first.

Mostrar atributos filhos
idstring · obrigatório
tenant_idstring · obrigatório
intent_idstring · obrigatório
event_typestring · obrigatório
template_keystring · opcional
titlestring · obrigatório
bodystring · obrigatório
resource_typestring · opcional
resource_idstring · opcional
created_atstring (date-time) · obrigatório
read_atstring (date-time) · opcional
archived_atstring (date-time) · opcional
has_moreboolean · obrigatório

True when another page follows; pass next_cursor as after to read it.

next_cursorstring · opcional

Opaque cursor for the next page; present only when has_more is true.

Erros 400 · 401 · 403

curl -X GET "$CONSUMER_API/inbox" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "data": [
    {
      "id": "not_2WyblSmD5mK7ZwWz32AntEotfiw",
      "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
      "intent_id": "int_22Gr1MqNzCoLNQG9VCg3dYIRdQg",
      "event_type": "event type",
      "template_key": "template key",
      "title": "Fuga na Rua 3",
      "body": "Leitura confirmada no local.",
      "resource_type": "resource type",
      "resource_id": "res_2iAXhMsJzmqPnY6X5cMTJ6OBTSG",
      "created_at": "2026-11-19T09:30:00Z",
      "read_at": "2026-11-19T09:30:00Z",
      "archived_at": "2026-11-19T09:30:00Z"
    }
  ],
  "has_more": true,
  "next_cursor": "next cursor"
}

Marcar uma mensagem como lida

Registos

POST /inbox/{id}/read

Sets the read time on a message in the caller's own inbox and returns the updated message. The call is idempotent: a message already read keeps its original read time. A message addressed to anyone else, or that does not exist, returns 404. The caller must be a consumer identity that is not bound to a tenant.

Parâmetros

idstring · caminho · obrigatório

Identifier of a message in the caller's inbox.

Devolve

200 Updated inbox message

Mostrar atributos
idstring · obrigatório
tenant_idstring · obrigatório
intent_idstring · obrigatório
event_typestring · obrigatório
template_keystring · opcional
titlestring · obrigatório
bodystring · obrigatório
resource_typestring · opcional
resource_idstring · opcional
created_atstring (date-time) · obrigatório
read_atstring (date-time) · opcional
archived_atstring (date-time) · opcional

Erros 401 · 403 · 404

curl -X POST "$CONSUMER_API/inbox/{id}/read" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "id": "not_2WyblSmD5mK7ZwWz32AntEotfiw",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "intent_id": "int_22Gr1MqNzCoLNQG9VCg3dYIRdQg",
  "event_type": "event type",
  "template_key": "template key",
  "title": "Fuga na Rua 3",
  "body": "Leitura confirmada no local.",
  "resource_type": "resource type",
  "resource_id": "res_2iAXhMsJzmqPnY6X5cMTJ6OBTSG",
  "created_at": "2026-11-19T09:30:00Z",
  "read_at": "2026-11-19T09:30:00Z",
  "archived_at": "2026-11-19T09:30:00Z"
}

Arquivar uma mensagem

Registos

POST /inbox/{id}/archive

Sets the archive time on a message in the caller's own inbox and returns the updated message; archived messages are hidden from the inbox list unless include_archived is set. Archiving does not mark the message read, and repeating the call keeps the original archive time. A message addressed to anyone else, or that does not exist, returns 404. The caller must be a consumer identity that is not bound to a tenant.

Parâmetros

idstring · caminho · obrigatório

Identifier of a message in the caller's inbox.

Devolve

200 Updated inbox message

Mostrar atributos
idstring · obrigatório
tenant_idstring · obrigatório
intent_idstring · obrigatório
event_typestring · obrigatório
template_keystring · opcional
titlestring · obrigatório
bodystring · obrigatório
resource_typestring · opcional
resource_idstring · opcional
created_atstring (date-time) · obrigatório
read_atstring (date-time) · opcional
archived_atstring (date-time) · opcional

Erros 401 · 403 · 404

curl -X POST "$CONSUMER_API/inbox/{id}/archive" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "id": "not_2WyblSmD5mK7ZwWz32AntEotfiw",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "intent_id": "int_22Gr1MqNzCoLNQG9VCg3dYIRdQg",
  "event_type": "event type",
  "template_key": "template key",
  "title": "Fuga na Rua 3",
  "body": "Leitura confirmada no local.",
  "resource_type": "resource type",
  "resource_id": "res_2iAXhMsJzmqPnY6X5cMTJ6OBTSG",
  "created_at": "2026-11-19T09:30:00Z",
  "read_at": "2026-11-19T09:30:00Z",
  "archived_at": "2026-11-19T09:30:00Z"
}