Skip to content
Browse the help center

Contacts and messages API

Examples for sending WhatsApp text, media and template messages, creating and updating contacts, and reading conversations with the ChatFlow GO API.

3 min read

This page shows how to use the most common ChatFlow GO API endpoints, with copy-and-paste curl examples. Replace acme.chatflowgo.com with your workspace address and wacrm_live_xxx with your key. If you are new to the API, start with the Public API overview.

Send a message

POST /api/v1/messages sends a WhatsApp message to a phone number. Scope: messages:send.

Pass the number in E.164 format (a +, the country code, then the number). ChatFlow GO finds or creates the contact and conversation for you, then sends.

Text

curl -X POST https://acme.chatflowgo.com/api/v1/messages \
  -H "Authorization: Bearer wacrm_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{ "to": "+14155550123", "type": "text", "text": "Hi Jane, your order has shipped!" }'

type defaults to text, so you can leave it out for plain text.

Template

Outside the 24-hour customer service window, only an approved template reaches the customer. Pass the template's name, its exact language code and the values for its variables in order:

curl -X POST https://acme.chatflowgo.com/api/v1/messages \
  -H "Authorization: Bearer wacrm_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
        "to": "+14155550123",
        "type": "template",
        "template": {
          "name": "order_update",
          "language": "en_US",
          "params": ["A123"]
        }
      }'

The language code must match the template in Meta exactly: en_US and en are different. See Template approval and categories.

Image, video, document or audio

curl -X POST https://acme.chatflowgo.com/api/v1/messages \
  -H "Authorization: Bearer wacrm_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
        "to": "+14155550123",
        "type": "document",
        "media_url": "https://cdn.example.com/invoices/A123.pdf",
        "filename": "Invoice-A123.pdf",
        "text": "Here is your invoice"
      }'
  • type is image, video, document or audio.
  • media_url must be a public HTTPS link, because Meta downloads the file when it sends.
  • text becomes the caption. filename sets the name shown for documents.

To reply to a specific message, add "reply_to_message_id": "<message id>". The message must be in the same conversation.

Response

A successful send returns 201:

{
  "data": {
    "message_id": "…",
    "whatsapp_message_id": "wamid.…",
    "conversation_id": "…",
    "contact_id": "…",
    "contact_created": true
  }
}

The message also appears in the shared inbox, marked as sent by the API.

Send errors

CodeStatusWhat to do
whatsapp_not_configured400Connect a WhatsApp number to the workspace
meta_error502Meta rejected the send. The message explains why, for example the 24-hour window has closed
template_malformed500The template parameters don't match the template. Check the variables

See Messages not delivering for common Meta errors.

Contacts

GET /api/v1/contacts. Scope: contacts:read. Newest first, paginated.

curl "https://acme.chatflowgo.com/api/v1/contacts?search=jane&limit=20" \
  -H "Authorization: Bearer wacrm_live_xxx"
  • ?search= matches the name or phone number.
  • ?tag=<tagId> returns only contacts with that tag.

Each contact looks like this:

{
  "id": "…",
  "phone": "+14155550123",
  "name": "Jane Doe",
  "email": null,
  "company": "Acme",
  "avatar_url": null,
  "tags": [{ "id": "…", "name": "vip", "color": "#3b82f6" }],
  "created_at": "…",
  "updated_at": "…"
}

Create (find-or-create)

POST /api/v1/contacts. Scope: contacts:write. Only phone is required.

curl -X POST https://acme.chatflowgo.com/api/v1/contacts \
  -H "Authorization: Bearer wacrm_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
        "phone": "+14155550123",
        "name": "Jane Doe",
        "email": "jane@example.com",
        "company": "Acme",
        "tags": ["newsletter", "vip"]
      }'

If a contact with that phone already exists, you get 200 with the existing contact. A new contact returns 201. Tags are given by name and created if they don't exist yet. Contacts count toward your plan's contact limit.

Read and update

curl -X PATCH https://acme.chatflowgo.com/api/v1/contacts/CONTACT_ID \
  -H "Authorization: Bearer wacrm_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{ "company": "Acme Ltd", "tags": ["customer"] }'

PATCH changes only the fields you send (name, email, company). Sending tags replaces the contact's tags with the list you send. Use GET /api/v1/contacts/{id} to read one contact.

Conversations and message history

List conversations, optionally filtered by status (open, pending or closed) or contact. Scope: conversations:read.

curl "https://acme.chatflowgo.com/api/v1/conversations?status=open" \
  -H "Authorization: Bearer wacrm_live_xxx"

Each conversation includes its status, assigned_agent_id, last_message_text, last_message_at, unread_count and the contact with its tags.

Read a conversation's messages, newest first. Scope: messages:read.

curl "https://acme.chatflowgo.com/api/v1/conversations/CONVERSATION_ID/messages?limit=50" \
  -H "Authorization: Bearer wacrm_live_xxx"

Each message includes direction (inbound or outbound), content_type, content_text, media_url, template_name, whatsapp_message_id and status, which is the delivery state.

Broadcasts

To message many people at once, use POST /api/v1/broadcasts (scope broadcasts:send) with up to 1,000 recipients per request, then poll GET /api/v1/broadcasts/{id} for progress. Template broadcasts reach everyone. Free-form broadcasts only reach people inside their 24-hour window, and the rest are counted as skipped.

Was this page helpful?

Still need help?

Our team answers every message.

Contact support