Customer communications
Read the messages DV sends and receives for your brand, follow the support requests the WhatsApp bot raised for your customers, and approve or reject them, as the dashboard Communications inbox does. Reads need the opt-in communications:read scope. Deciding a request needs the separate opt-in communications:write scope, which does not include reads.
A message shows no phone number, email address or raw template variable. A template message shows the template filled with the variables DV sent. Another brand's message or request is never returned, and another brand's request id is a 404 like a missing one.
Read messages
GET /v1/communications/messages (scope communications:read) pages your brand's messages, newest first. Narrow the list with:
| Parameter | Meaning |
|---|---|
awb | Only messages about that shipment's order. An unknown AWB lists nothing. |
channel | whatsapp, sms or email. |
direction | inbound (from the customer) or outbound. |
state | Messages a provider report shows in that delivery state: sent, delivered, read or failed. |
from, to | A time window, from inclusive and to exclusive, at most 92 days apart. |
Each message has a sender (customer, bot, agent, brand_user or system), its text and, for an outbound message, the furthest delivery state a provider report has shown and when (state_at). A page with a next_cursor has more; send it back with the same filters, or the request is a 400 invalid-cursor.
GET /v1/communications/shipments/{shipment_id} (scope communications:read) returns one shipment's conversation: every message about its order in time order, oldest first, and the requests raised about it. At most the newest 200 messages are returned; complete is false when older ones exist.
Follow customer requests
When a customer asks for something such as a re-attempt, the bot raises a request, asks the customer to confirm by button, and then either sends it to the courier itself or waits for you, depending on your settings. A request to cancel or return a shipment is never sent by the bot: it waits for a person.
GET /v1/communications/requests (scope communications:read) lists requests, most recently updated first. Filter by status, intent, courier_id and a creation window (from, to, at most 92 days). With courier_id a page can hold fewer requests than limit while next_cursor is set; follow it until it is null.
status moves through proposed, awaiting_customer, confirmed, sent_to_courier and courier_acked, or ends in rejected, failed or resolved. open is a request waiting for support.
GET /v1/communications/requests/{request_id} (scope communications:read) returns the request with the values the bot resolved (fields, such as the re-attempt date), its decision trail oldest first (events) and the courier's answer (courier_result: acknowledged, or failed with the courier's reason).
Approve or reject a request
POST /v1/communications/requests/{request_id}/decision (scope communications:write) takes {"decision": "approve"} or {"decision": "reject"}.
approvesends a request the customer has confirmed to the courier, as the key's user, and answers with the final request:courier_acked, orfailedwith the courier's reason. A request the customer has not confirmed is a409conflict.rejectcloses a live request so the bot never sends it. Rejecting a rejected request returns it unchanged; a request that already finished is a409.
Send a Message-Id so a retry replays the first answer instead of deciding twice.
Events
Subscribe a webhook endpoint to communication.message.received, communication.message.status, communication.request.created, communication.request.updated and communication.request.decided. They are listed with their payloads in the Webhooks guide.