跳到主要内容

Retrieve messages

GET 

/messages

Retrieve messages for your account. This endpoint is a superset of GET /api/v1/contacts/messages and supports the same contact and messageIds lookup modes plus a campaign-level filter.

Exactly one selector must be provided: campaignId, messageIds, channelUserId, or contactId. Providing more than one returns HTTP 400.


Mode 1 — Fetch by campaign (campaignId provided)

Retrieve all messages sent by a specific campaign, paginated oldest-first. The channel parameter is not required for this mode.

GET /api/v1/messages?campaignId=12324&size=20


Mode 2 — Fetch specific messages by ID (messageIds provided)

Provide a comma-separated list of up to 20 message IDs to retrieve those exact messages. Messages not found or belonging to a different account are silently excluded. No pagination metadata is returned in this mode.

GET /api/v1/messages?messageIds=msg-uuid-001,msg-uuid-002


Mode 3 — Paginated contact history (channelUserId or contactId provided)

Retrieve the full message history for a single contact. Requires channel. Exactly one of channelUserId or contactId must be provided — they are mutually exclusive.

Supported channel slugs: WHATSAPP, APPLEMB, VIBER, SMS, TELEGRAM, RBM

GET /api/v1/messages?channel=VIBER&channelUserId=33749677215&size=20

Request

Responses

Messages retrieved successfully