Skip to main content
Retrieve all inbound messages that have not been read yet (readAt IS NULL) for the connected number. Each item includes the conversation-level unread count.

Endpoint

GET https://pilotstatus.com.br/v1/messages/unread
Requires a number-scoped API key (ps_*) in the x-api-key header. Tenant-scoped keys return 403.

Query parameters

page
integer
default:"1"
Page number (≥ 1).
pageSize
integer
default:"30"
Results per page (1–100).
There is no date-range filter on this endpoint; it returns all currently unread inbound messages.

PII mode effect

The response depends on the PII mode configured for the number (set via PATCH /api/whatsapp-numbers/[id]):
PII modeEffect
STORE_INDEFINITE (default)All unread messages returned.
STORE_X_DAYSOnly unread messages created within the last N days are returned (messages outside the retention window have already been hard-deleted by the daily job).
RELAY_ONLYReturns an empty list (messages: [], total: 0) and includes a notice: "PII_RELAY_ONLY" field. No message data is stored for this number.

Example

curl "https://pilotstatus.com.br/v1/messages/unread?page=1&pageSize=30" \
  -H "x-api-key: ps_your_key_here"

Message object fields

id
string
required
Pilot Status internal message ID.
conversationId
string
required
ID of the parent conversation.
conversationUnreadCount
integer
required
Total unread message count for that conversation.
direction
string
required
Always "INBOUND" for this endpoint.
type
string
required
text, image, audio, video, document, location, contacts, sticker, or reaction.
content
string | null
Message text or caption when available.
from
string
required
Sender in E.164 format.
fromName
string | null
Sender display name (resolved from the conversation) when available.
media
object | null
Media descriptor { provider, id, url, mimeType, fileName } when the message carries media; null for text.
  • media.provider"META", "EVO", or "EVO_GO" — the provider that delivered the media.
  • media.idMeta media id. Set on META numbers — pass it to GET /v1/media/{mediaId} to download the bytes; null on Evolution.
  • media.url — Direct download URL when available. META inbound media is mirrored to S3 (so META messages usually carry both id and url); Evolution provides its own link. Best-effort — may be null.
  • media.mimeType — Media MIME type when known (may be null).
  • media.fileName — Media file name when known (may be null).
readAt
null
required
null for unread messages (always null for results from this endpoint).
createdAt
string
required
ISO 8601 — when the message was received.

Common errors

  • 400 NUMBER_NOT_FOUND — the API key is not bound to a WhatsApp number.
  • 401 — missing or invalid x-api-key header.
  • 403 — tenant-scoped key used (number-scoped key required).