A customer
Wherever the API asks for a customer, give their number with its country code, or their WhatsApp username id (user_id in customer, for example IN.1626…). A customer who uses a WhatsApp username may not share their number: their phone is then null.
One chat, both directions
GET /v1/contacts/{customer}/messages answers the chat newest first: your messages (campaigns, replies, templates) and theirs, each with its direction (in or out), type, text, media_id, status, time and campaign_id. Read older pages with cursor (the next_cursor of the page before).
Assign, close, reopen
POST /v1/chats/{customer}/assign with a member_id from GET /v1/team gives the chat to that person. close marks it Done; reopen brings it back (the customer writing again reopens it too). The same rules as the Inbox in the app.
Notes and saved replies
GET and POST /v1/contacts/{customer}/notes read and add notes. Notes are never sent to the customer. GET /v1/saved-replies lists your saved replies.
Files
Upload a file once withPOST /v1/media (multipart, the field file) and send it as many times as you like with media_id — in a file, a template header or a sticker.