Developer Documentation

Build with Sprout

Sprout provides two REST APIs. Use the WhatsApp API Gateway to send messages out, and the Business API to read contacts and conversation history back. Choose the one that matches what you need to do.

WhatsApp API Gateway

REST · Bearer token · Read and write

Manage WhatsApp message templates, send approved template messages to recipients, and receive delivery, read and inbound-message webhook events.

  • Message template management
  • Send template messages
  • Message status webhooks
  • Incoming customer messages
Open the Gateway docs

Business API v1

REST · API key · Read-only

Pull your enterprise's contacts and leads, and the full conversation history for any contact, into your CRM, data warehouse or reporting tools.

  • List contacts and leads
  • Retrieve conversation history
  • Rich media, templates and call events
  • Self-service API keys
Open the Business API docs

Which API do I need?

What you want to doUse this API
Send a WhatsApp message to a customerWhatsApp API Gateway
Create, edit or delete a message templateWhatsApp API Gateway
Be notified the moment a message is delivered or readWhatsApp API Gateway (webhooks)
React to an incoming customer message in real timeWhatsApp API Gateway (webhooks)
Export your leads into a CRMBusiness API v1
Read the full chat transcript for a contactBusiness API v1
Back-fill past conversations for reportingBusiness API v1
The two APIs are separate products with separate base URLs and separate credentials. Neither one replaces the other.

Getting Started

  1. Choose your API Use the table above, or the menu beside this page.
  2. Get your credentials Request a bearer token for the Gateway, or create an API key for the Business API from the Sprout admin UI.
  3. Make your first call Copy a cURL example from any endpoint page and replace the placeholder values with your own.

Sprout WhatsApp API Gateway

Integrate WhatsApp messaging capabilities into external systems using a simplified REST API.

The Sprout WhatsApp API Gateway allows developers to manage WhatsApp message templates, send approved template messages, receive message-status updates and process incoming customer messages.

Main Capabilities

Message Template Management

Retrieve, create, edit and delete WhatsApp message templates.

Send Template Messages

Send approved WhatsApp message templates to recipients.

Message Status Updates

Receive asynchronous updates when messages are sent, delivered or read.

Incoming Customer Messages

Receive customer replies and message details through webhook events.

Getting Started

  1. Configure the Base URL Use the Sprout WhatsApp API Gateway base URL.
  2. Add Authentication Include the bearer token in the authorization header.
  3. Identify the Required IDs Use the WABA ID, phone number ID and template ID in the relevant endpoints.
  4. Manage Templates Retrieve, create, edit or delete WhatsApp templates.
  5. Send a Template Message Send an approved template using the phone number ID.
  6. Receive Webhook Events Receive status updates and incoming customer messages.

Base URL

All API requests must be sent through the Sprout WhatsApp API Gateway.

Host

app.hellosprout.ai

API Path

/whatsapp-gw/api

Full Base URL

https://app.hellosprout.ai/whatsapp-gw/api
All endpoint paths shown in this documentation must be added after the base URL.

Authentication

All API endpoints require bearer token authentication.

Required Headers

Authorization

Authorization: Bearer <AUTH_TOKEN>

Content Type

Content-Type: application/json
Request Authentication Token
Example request headers
curl 'https://app.hellosprout.ai/whatsapp-gw/api/<ENDPOINT>' \
  -H 'Authorization: Bearer <AUTH_TOKEN>' \
  -H 'Content-Type: application/json'

Identifiers and Terminology

The WhatsApp API Gateway uses the following identifiers in endpoint paths and request details.

WABA_ID

WhatsApp Business Account ID

Identifies the WhatsApp Business Account that owns the templates.

PHONE_NUMBER_ID

WhatsApp Business Phone Number ID

Identifies the connected business phone number used to send messages.

TEMPLATE_ID

Message Template ID

Identifies an individual WhatsApp message template.

Your own WABA ID and phone number ID are provided together with your authentication token.

List Templates

Retrieve the message templates available under a WhatsApp Business Account.

GET /<WABA_ID>/message_templates

Required Information

  • WhatsApp Business Account ID
  • Authorization bearer token

Response Information

The response may include:

Template name
Parameter format
Template components
Header details
Body text
Example parameter values
Buttons
Language
Status
Category
Template ID
Pagination cursors

Common Values

Languageen_US
StatusAPPROVED
CategoryMARKETING

Paging

Pagination information may include:

  • Before cursor
  • After cursor

Example Request

cURL
curl 'https://app.hellosprout.ai/whatsapp-gw/api/<WABA_ID>/message_templates' \
  -H 'Authorization: Bearer <AUTH_TOKEN>'

Example Response

JSON
{
  "data": [
    {
      "name": "text_params_button",
      "parameter_format": "NAMED",
      "components": [
        {
          "type": "HEADER",
          "format": "TEXT",
          "text": "sample_text"
        },
        {
          "type": "BODY",
          "text": "O {{name}}, chosen of fortune, Emrys and Morgana do summon thee...",
          "example": {
            "body_text_named_params": [
              {
                "param_name": "name",
                "example": "Arthur"
              },
              {
                "param_name": "bell_location",
                "example": "Avalon Tower"
              }
            ]
          }
        },
        {
          "type": "BUTTONS",
          "buttons": [
            {
              "type": "QUICK_REPLY",
              "text": "Turn Away"
            },
            {
              "type": "PHONE_NUMBER",
              "text": "Heed the Summons",
              "phone_number": "+94716925097"
            }
          ]
        }
      ],
      "language": "en_US",
      "status": "APPROVED",
      "category": "MARKETING",
      "id": "1308035194697923"
    }
  ],
  "paging": {
    "cursors": {
      "before": "cursor-string",
      "after": "cursor-string"
    }
  }
}

Create Template

Create a new WhatsApp message template under a WhatsApp Business Account.

POST /<WABA_ID>/message_templates

Request Body Fields

FieldTypeRequiredDescription
namestringYesTemplate name
categorystringYesUTILITY or MARKETING
languagestringYesLanguage code, for example en_US
parameter_formatstringYesNAMED
componentsarrayYesTemplate content

Supported Template Components

Header

  • Type
  • Format
  • Text

Body

  • Message text
  • Named parameters
  • Example parameter values

Footer

Includes footer text

Buttons

Quick reply button

Response

The response includes:

  • Template ID
  • Status
  • Category
A newly created template may return the status PENDING.

Example Request

JSON
{
  "name": "sample_text_template",
  "category": "UTILITY",
  "language": "en_US",
  "parameter_format": "NAMED",
  "components": [
    {
      "type": "HEADER",
      "format": "TEXT",
      "text": "Sample Header"
    },
    {
      "type": "BODY",
      "text": "Hello {{name}}, your order is ready.",
      "example": {
        "body_text_named_params": [
          {
            "param_name": "name",
            "example": "John"
          }
        ]
      }
    },
    {
      "type": "FOOTER",
      "text": "Thank you"
    },
    {
      "type": "BUTTONS",
      "buttons": [
        {
          "type": "QUICK_REPLY",
          "text": "Quick Reply Button"
        }
      ]
    }
  ]
}

Example Response

JSON
{
  "id": "987654321",
  "status": "PENDING",
  "category": "UTILITY"
}

Edit Template

Edit an existing WhatsApp message template.

POST /<TEMPLATE_ID>

Eligible Template Statuses

APPROVED REJECTED PAUSED

Editable Properties

  • Category
  • Components
  • Time-to-live

Important Editing Rules

  • Individual template components cannot be edited separately.
  • All components are replaced by the components included in the edit request.
  • The category of an approved template cannot be edited.
  • Approved templates can be edited up to 10 times within a 30-day period.
  • Approved templates can be edited once within a 24-hour period.
  • Rejected or paused templates can be edited an unlimited number of times.
  • After editing an approved or paused template, it will automatically be approved unless it fails template review.

Response

  • Success status
  • Template ID
  • Template name
  • Template category

Example Request

JSON
{
  "components": [
    {
      "type": "HEADER",
      "format": "TEXT",
      "text": "A Proclamation of Hidden Sorcery"
    },
    {
      "type": "BODY",
      "text": "Sample Edited Text."
    }
  ]
}

Example Response

JSON
{
  "success": true,
  "id": "889288737024431",
  "name": "text_only",
  "category": "MARKETING"
}

Delete Template

Delete a WhatsApp message template using its ID and name.

DELETE /<WABA_ID>/message_templates?hsm_id=<TEMPLATE_ID>&name=<TEMPLATE_NAME>

Required Query Information

hsm_id

Message Template ID

The unique ID of the message template.

name

Template Name

The name assigned to the message template.

Required Information

  • WhatsApp Business Account ID
  • Template ID
  • Template name
  • Authorization bearer token

Example Request

cURL
curl -X DELETE \
  'https://app.hellosprout.ai/whatsapp-gw/api/<WABA_ID>/message_templates?hsm_id=<TEMPLATE_ID>&name=<TEMPLATE_NAME>' \
  -H 'Authorization: Bearer <AUTH_TOKEN>'

Example Response

JSON
{
  "success": true
}

Send Template Message

Send a WhatsApp template message using the connected WhatsApp business phone number.

POST /<PHONE_NUMBER_ID>/messages

Request Body Fields

FieldTypeRequiredDescription
messaging_productstringYesMust be whatsapp
tostringYesRecipient number in E.164 format
typestringYesMust be template
templateobjectYesTemplate configuration

Template Configuration

NameThe approved template name.
Languageen_US
ComponentsContains the dynamic values required by the template.

Named Parameters

The documented body parameter includes:

  • Type
  • Parameter name
  • Text value

Named parameters allow the template to insert customer-specific content.

Response

  • Messaging product: the messaging platform used.
  • Contacts: the original recipient input and WhatsApp ID.
  • Messages: the message ID and message status.
The example message status is accepted. An accepted response means the gateway has taken the message. Actual delivery is confirmed later through webhook events.

Example Payload

JSON
{
  "messaging_product": "whatsapp",
  "to": "+94712345678",
  "type": "template",
  "template": {
    "name": "sample_text_template",
    "language": {
      "code": "en_US"
    },
    "components": [
      {
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "parameter_name": "name",
            "text": "John"
          },
          {
            "type": "text",
            "parameter_name": "name",
            "text": "sample_text"
          }
        ]
      }
    ]
  }
}

Example Response

JSON
{
  "messaging_product": "whatsapp",
  "contacts": [
    {
      "input": "+94716935097",
      "wa_id": "94716935097"
    }
  ],
  "messages": [
    {
      "id": "wamid.HBgLOTQ3MTY5MzUwOTcVAgARGBI4NkVDOTIzRjdCREFDNDRBRDUA",
      "message_status": "accepted"
    }
  ]
}

Message Status Updates

The gateway sends asynchronous webhook updates for WhatsApp message events.

Documented Events

Sent
Delivered
Read
Incoming customer messages

Each webhook payload uses the whatsapp_business_account object and includes an entry array containing message-related changes.

Select an event from the sidebar to view the information contained in its documented payload.

Sent Webhook Event

The sent event is generated when a WhatsApp message reaches the sent status.

Status value sent

Payload Information

  • Object type: whatsapp_business_account
  • WhatsApp Business Account entry ID
  • Messaging product
  • Display phone number
  • Phone number ID
  • Message ID
  • Status
  • Timestamp
  • Recipient phone number
  • Billable value
  • Pricing model
  • Message category
  • Pricing type
  • Webhook field: messages

Documented Pricing Values

Pricing modelPMP
Categorymarketing
Typeregular

Example Webhook Payload

Sent webhook payload
{
  "object": "whatsapp_business_account",
  "entry": [
    {
      "id": "1435343061523969",
      "changes": [
        {
          "value": {
            "messaging_product": "whatsapp",
            "metadata": {
              "display_phone_number": "<DISPLAY_PHONE_NUMBER>",
              "phone_number_id": "<PHONE_NUMBER_ID>"
            },
            "statuses": [
              {
                "id": "<MESSAGE_ID>",
                "status": "sent",
                "timestamp": "1770893055",
                "recipient_id": "<RECIPIENT_PHONE_NUMBER>",
                "pricing": {
                  "billable": true,
                  "pricing_model": "PMP",
                  "category": "marketing",
                  "type": "regular"
                }
              }
            ]
          },
          "field": "messages"
        }
      ]
    }
  ]
}

Delivered Webhook Event

The delivered event is generated when a WhatsApp message reaches the delivered status.

Status value delivered

Payload Information

  • Object type: whatsapp_business_account
  • WhatsApp Business Account entry ID
  • Messaging product
  • Display phone number
  • Phone number ID
  • Message ID
  • Status
  • Timestamp
  • Recipient phone number
  • Billable value
  • Pricing model
  • Message category
  • Pricing type
  • Webhook field: messages

Documented Pricing Values

Pricing modelPMP
Categorymarketing
Typeregular

Example Webhook Payload

Delivered webhook payload
{
  "object": "whatsapp_business_account",
  "entry": [
    {
      "id": "1435343061523969",
      "changes": [
        {
          "value": {
            "messaging_product": "whatsapp",
            "metadata": {
              "display_phone_number": "<DISPLAY_PHONE_NUMBER>",
              "phone_number_id": "<PHONE_NUMBER_ID>"
            },
            "statuses": [
              {
                "id": "<MESSAGE_ID>",
                "status": "delivered",
                "timestamp": "1770893055",
                "recipient_id": "<RECIPIENT_PHONE_NUMBER>",
                "pricing": {
                  "billable": true,
                  "pricing_model": "PMP",
                  "category": "marketing",
                  "type": "regular"
                }
              }
            ]
          },
          "field": "messages"
        }
      ]
    }
  ]
}

Read Webhook Event

The read event is generated when a WhatsApp message reaches the read status.

Status value read

Payload Information

  • Object type: whatsapp_business_account
  • WhatsApp Business Account entry ID
  • Messaging product
  • Display phone number
  • Phone number ID
  • Message ID
  • Status
  • Timestamp
  • Recipient phone number
  • Billable value
  • Pricing model
  • Message category
  • Pricing type
  • Webhook field: messages

Documented Pricing Values

Pricing modelPMP
Categorymarketing
Typeregular

Example Webhook Payload

Read webhook payload
{
  "object": "whatsapp_business_account",
  "entry": [
    {
      "id": "1435343061523969",
      "changes": [
        {
          "value": {
            "messaging_product": "whatsapp",
            "metadata": {
              "display_phone_number": "<DISPLAY_PHONE_NUMBER>",
              "phone_number_id": "<PHONE_NUMBER_ID>"
            },
            "statuses": [
              {
                "id": "<MESSAGE_ID>",
                "status": "read",
                "timestamp": "1770892507",
                "recipient_id": "<RECIPIENT_PHONE_NUMBER>",
                "pricing": {
                  "billable": true,
                  "pricing_model": "PMP",
                  "category": "marketing",
                  "type": "regular"
                }
              }
            ]
          },
          "field": "messages"
        }
      ]
    }
  ]
}

Incoming Customer Messages

This webhook event is delivered when a customer replies to one of your WhatsApp messages.

Payload Information

  • Object type: whatsapp_business_account
  • WhatsApp Business Account entry ID
  • Messaging product
  • Display phone number
  • Phone number ID
  • Contact profile name
  • Contact WhatsApp ID
  • Message context
  • Context sender
  • Context message ID
  • Sender phone number
  • Incoming message ID
  • Timestamp
  • Text body
  • Message type
  • Webhook field: messages

Documented Example Values

Message typetext
Text bodyHi

Example Webhook Payload

Incoming customer message payload
{
  "object": "whatsapp_business_account",
  "entry": [
    {
      "id": "1435343061523969",
      "changes": [
        {
          "value": {
            "messaging_product": "whatsapp",
            "metadata": {
              "display_phone_number": "<DISPLAY_PHONE_NUMBER>",
              "phone_number_id": "<PHONE_NUMBER_ID>"
            },
            "contacts": [
              {
                "profile": {
                  "name": "<REPLIED_CONTACT_NAME>"
                },
                "wa_id": "<RECIPIENT_PHONE_NUMBER>"
              }
            ],
            "messages": [
              {
                "context": {
                  "from": "<DISPLAY_PHONE_NUMBER>",
                  "id": "<CONTEXT_MESSAGE_ID>"
                },
                "from": "<RECIPIENT_PHONE_NUMBER>",
                "id": "<INCOMING_MESSAGE_ID>",
                "timestamp": "1770892557",
                "text": {
                  "body": "Hi"
                },
                "type": "text"
              }
            ]
          },
          "field": "messages"
        }
      ]
    }
  ]
}

Sandbox Account Access

Request access to the Sprout sandbox environment to view and manage WhatsApp message templates.

Before Requesting Access

A WhatsApp number must be integrated before you can access the portal and manage message templates.

Request Sandbox Access

Portal Login

Access the Sprout template portal to view and manage WhatsApp message templates.

Login URL

https://app.hellosprout.ai/promotion/templates
Your WhatsApp number must be integrated before you can access the portal.
Open Template Portal

Sprout Business API v1

Retrieve your enterprise's contacts and their conversation history through a read-only REST API.

The Business API gives external systems such as a CRM, a data warehouse or a reporting tool direct access to the leads captured by your Sprout agents and to the messages exchanged with them. Every response is automatically limited to your own enterprise's data.

Main Capabilities

List Contacts

Retrieve contacts and leads captured by your agents, newest first, including any custom fields collected during the conversation.

Conversation History

Retrieve the full message history for a contact, grouped by session, in the same order as the admin Conversations screen.

Rich Content Support

Text, rich media, template messages, emoji reactions and voice-call events are all represented in the response.

Self-Service API Keys

Create and revoke API keys yourself from the Sprout admin UI, with up to five active keys per enterprise.

Important Characteristics

Versionv1
MethodsGET only. Version 1 is read-only.
AuthenticationX-API-Key
Rate limit60 requests per minute per key, by default.
Message retentionThe last 3 months of messages.

Getting Started

  1. Create an API Key Generate a key from Integrations, then Sprout API, in the admin UI.
  2. Add the Authentication Header Send the key in the X-API-Key header on every request.
  3. List Your Contacts Call the contacts endpoint and store the contact IDs you receive.
  4. Retrieve Conversations Use a contact ID to pull that contact's full message history.
  5. Poll Incrementally Use the timestamp filter so you only fetch what has changed.

Create an API Key

API keys are created and revoked by you, from within the Sprout admin UI.

Steps

  1. Open the Integrations Page In the Sprout admin UI, go to Integrations, then Sprout API, and select sprout-api.
  2. Create the Key Each enterprise can hold a maximum of five keys at a time.
  3. Copy It Immediately The full key is shown only once, at creation. It cannot be retrieved afterwards. Only a name and an identifier are stored.
  4. Revoke When No Longer Needed Revoke a key at any time from the same page. Revoked keys stop working immediately.

Key Format

A key has two parts separated by a dot: a key ID and a secret. Send the whole value, including the dot, in the authentication header.

<keyId>.<secret>

Scope

Each key is scoped to your enterprise. All API responses are automatically limited to your enterprise's data, so you never pass an enterprise ID yourself.

Treat your key like a password

Anyone holding the key can read your contacts and conversation history. Never publish it, never commit it to a repository, and revoke it immediately if it is exposed.

Do Not Have Access Yet?

If the Sprout API integration is not enabled on your account, or you cannot see the Integrations page, contact us and our team will get in touch.

Request Business API Access

Base URL and Conventions

All Business API requests are sent to a versioned base path over HTTPS.

Base URL

https://<gateway-host>/business-api/v1
Your gateway host is confirmed together with your API access. Replace <gateway-host> with the value supplied for your account.

Conventions

ItemValue
TransportHTTPS only
MethodsGET only. Version 1 is read-only.
Authentication headerX-API-Key: <keyId>.<secret>, required on every request
Content typeapplication/json in responses
TimestampsISO-8601 in UTC, for example 2026-07-20T10:15:00Z
IDsOpaque strings. Do not attempt to parse them.
CorrelationEvery response carries X-Correlation-ID. Include it when reporting an issue.

Pagination

Both endpoints use offset pagination through the page and limit query parameters, and return a pagination object in the response.

FieldDescription
pageThe page that was returned
limitThe page size that was applied
totalTotal number of records available
totalPagesTotal number of pages available
hasMoreWhether a further page exists

Authentication

Every Business API request must include your enterprise API key in the X-API-Key header.

Required Header

X-API-Key: <keyId>.<secret>

How the Key Is Validated

The gateway validates the key, enforces the key's rate limit and endpoint allowlist, and resolves your enterprise before the request reaches the service.

A missing, malformed, revoked or out-of-scope key is rejected at the edge with a 401 INVALID_API_KEY response.

Example Request

cURL
curl -s 'https://<gateway-host>/business-api/v1/contacts?limit=50&page=1' \
  -H 'X-API-Key: <keyId>.<secret>'
Request Business API Access

List Contacts

Returns your enterprise's contacts and leads, newest first by creation time.

GET /business-api/v1/contacts

Query Parameters

ParameterTypeDefaultConstraints and notes
limitinteger50Clamped to a value between 1 and 100
pageinteger1Must be 1 or greater. Offset pagination using page and limit.
updatedSinceISO-8601—Optional. Returns contacts created at or after this instant, for incremental polling.

Example Request

cURL
curl -s 'https://<gateway-host>/business-api/v1/contacts?limit=50&page=1' \
  -H 'X-API-Key: <keyId>.<secret>'

Example Response

200 OK
{
  "data": [
    {
      "id": "665f2b8c9a1e4f0012ab34cd",
      "name": "Jane Doe",
      "email": "jane@example.com",
      "phone": "+94771234567",
      "source": "WEB",
      "customFields": {
        "company": "Acme",
        "budget": "5000"
      },
      "createdOn": "2026-07-20T10:15:00Z",
      "lastUpdatedOn": "2026-07-21T08:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 50,
    "total": 1234,
    "totalPages": 25,
    "hasMore": true
  }
}

Contact Object

FieldTypeNullableDescription
idstringNoStable contact ID. Use this as the contactId for the messages endpoint.
namestringYesContact name, if collected.
emailstringYesEmail address, if collected.
phonestringYesPhone number in E.164 form, if collected.
sourcestringNo Acquisition channel: WEB, WHATSAPP, FB or IG. Version 1 returns the channel only, not the specific web page URL.
customFieldsobjectNo Key and value map of extra fields the agent collected during the conversation. May be an empty object. Values are strings.
createdOnstringNoWhen the contact was first recorded, in ISO-8601 UTC. This is the sort key.
lastUpdatedOnstringYesThe last time the contact record changed.

Notes

  • Results are sorted by createdOn in descending order.
  • customFields is derived from the contact's collected data. Malformed data yields an empty object rather than failing the whole row.
  • To poll incrementally, store the highest createdOn you have seen and pass it as updatedSince on the next call.
Incremental polling is the recommended pattern. It keeps you well inside the rate limit and avoids re-fetching unchanged data.

Get Conversation History

Returns the conversation history for one contact, grouped by session.

Sessions are returned in the same order as the admin Conversations screen: the newest session first, with messages inside each session running oldest to newest.

GET /business-api/v1/messages

Query Parameters

ParameterTypeDefaultConstraints and notes
contactIdstring—Required. An ID returned by the contacts endpoint.
limitinteger50 Clamped to a value between 1 and 100. Paginates over session groups, not individual messages.
pageinteger1Must be 1 or greater.
Pagination works on sessions

A limit of 50 returns up to 50 conversation sessions, each of which may contain many messages. It does not return 50 messages.

Example Request

cURL
curl -s 'https://<gateway-host>/business-api/v1/messages?contactId=665f2b8c9a1e4f0012ab34cd&limit=50' \
  -H 'X-API-Key: <keyId>.<secret>'

Example Response

200 OK
{
  "contactId": "665f2b8c9a1e4f0012ab34cd",
  "data": [
    {
      "sessionId": "sess_abc",
      "personaName": "Sales Bot",
      "messages": [
        {
          "messageId": "6690aa11bb22cc33dd44ee55",
          "sender": "visitor",
          "content": "Hi",
          "contentType": "TEXT",
          "createdOn": "2026-07-20T10:15:00Z"
        },
        {
          "messageId": "6690aa11bb22cc33dd44ee56",
          "sender": "bot",
          "content": "Hello! How can I help?",
          "contentType": "TEXT",
          "createdOn": "2026-07-20T10:15:03Z"
        },
        {
          "messageId": "6690aa11bb22cc33dd44ee57",
          "sender": "agent",
          "content": "This is Sam, taking over.",
          "contentType": "TEXT",
          "createdOn": "2026-07-20T10:16:00Z"
        }
      ]
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 50,
    "total": 3,
    "totalPages": 1,
    "hasMore": false
  }
}
The structure of each object in the response is described on the Response Objects page.

Response Objects

The messages endpoint returns session blocks, each containing messages, which may in turn carry reactions or call details.

Session Block Object

FieldTypeNullableDescription
sessionIdstringNoConversation or session identifier.
personaNamestringYesName of the agent persona for the session, if known.
messagesarrayNoMessages in the session, ascending by createdOn.

Message Object

FieldTypeNullableDescription
messageIdstringNoMessage identifier.
senderstringNovisitor, bot, agent or system.
contentstringNoMessage text. For non-text content types the payload is carried as-is.
contentTypestringNoTEXT, JSON, REACT, TEMPLATE_MESSAGE or CALL.
createdOnstringNoMessage timestamp in ISO-8601 UTC.
reactionsarrayYesEmoji reactions applied to this message. Omitted or null when there are none.
callDetailsobjectYesPresent only when contentType is CALL. Otherwise omitted or null.

Reaction Object

Each entry in a message's reactions array:

FieldTypeNullableDescription
emojistringNoThe reaction emoji character.
senderstringNo Who reacted: visitor for the end user or agent for a human agent.
createdOnstringNoWhen the reaction was added, in ISO-8601 UTC.
A standalone message with content type REACT is an event marker with empty content. The emoji itself is carried in the reactions array of the message it reacts to.

Call Details Object

Present on CALL messages:

FieldTypeNullableDescription
callIdstringNoCall identifier.
directionstringNoUSER_INITIATED or AGENT_INITIATED.
statusstringNo One of RINGING, INITIATING, CONNECTING, CONNECTED, ACCEPTED, TERMINATED, REJECTED, MISSED, FAILED, AI_CONNECTED or UNKNOWN.
consumerPhonestringNoEnd user's phone number in E.164 form.
businessPhonestringNoBusiness phone number in E.164 form.
startedAtstringYesCall start time in ISO-8601 UTC, if known.
endedAtstringYesCall end time in ISO-8601 UTC, if known.
durationstringYesCall duration in seconds, if known.

Content Types

The content field is always a string. Its meaning depends on the contentType.

Content typeWhat content holds
TEXTPlain UTF-8 text. This is the default and covers the vast majority of messages.
JSON A stringified JSON payload, typically rich media such as an image, video, document, audio clip or sticker, or an interactive menu.
TEMPLATE_MESSAGE A stringified JSON WhatsApp template or promotion message, with a header, body, footer, buttons and optional carousel cards.
REACT An empty string. The message records an emoji reaction to an earlier message. There is no inline text payload.
CALL An empty string. The message marks a voice-call event, for example a WhatsApp call. There is no inline text payload.

Sample: TEXT

Plain text, the default
{
  "messageId": "6690aa11bb22cc33dd44ee55",
  "sender": "visitor",
  "content": "Hi there, I need help with my order",
  "contentType": "TEXT",
  "createdOn": "2026-07-20T10:15:00Z"
}

Sample: JSON

Rich media, carried as a stringified JSON payload
{
  "messageId": "6690aa11bb22cc33dd44ee58",
  "sender": "bot",
  "content": "{\"type\":\"RICH_CONTENT\",\"image\":\"https://cdn.example.com/p.jpg\",\"caption\":\"Our new arrival\"}",
  "contentType": "JSON",
  "createdOn": "2026-07-20T10:16:10Z"
}

Sample: TEMPLATE_MESSAGE

A WhatsApp template or promotion message
{
  "messageId": "6690aa11bb22cc33dd44ee59",
  "sender": "bot",
  "content": "{\"header\":{\"type\":\"IMAGE\",\"mediaUrl\":\"https://cdn.example.com/promo.jpg\"},\"body\":\"Flash sale today!\",\"footer\":\"Reply STOP to opt out\",\"buttons\":[{\"type\":\"URL\",\"text\":\"Shop now\",\"url\":\"https://shop.example.com\"}]}",
  "contentType": "TEMPLATE_MESSAGE",
  "createdOn": "2026-07-20T10:17:00Z"
}

Sample: REACT

The reaction event itself carries empty content:

The reaction event marker
{
  "messageId": "6690aa11bb22cc33dd44ee5a",
  "sender": "agent",
  "content": "",
  "contentType": "REACT",
  "createdOn": "2026-07-20T10:18:00Z"
}

The earlier message it applies to then carries the emoji in its reactions array:

The message that was reacted to
{
  "messageId": "6690aa11bb22cc33dd44ee55",
  "sender": "visitor",
  "content": "Hi there, I need help with my order",
  "contentType": "TEXT",
  "createdOn": "2026-07-20T10:15:00Z",
  "reactions": [
    {
      "emoji": "<EMOJI_CHARACTER>",
      "sender": "agent",
      "createdOn": "2026-07-20T10:18:00Z"
    }
  ]
}

Sample: CALL

A voice-call event marker
{
  "messageId": "6690aa11bb22cc33dd44ee5b",
  "sender": "system",
  "content": "",
  "contentType": "CALL",
  "createdOn": "2026-07-20T10:19:00Z",
  "callDetails": {
    "callId": "wacid.HBgL...",
    "direction": "USER_INITIATED",
    "status": "TERMINATED",
    "consumerPhone": "+94771234567",
    "businessPhone": "+94112000000",
    "startedAt": "2026-07-20T10:19:05Z",
    "endedAt": "2026-07-20T10:21:35Z",
    "duration": "150"
  }
}

Senders, Ordering and Retention

Three behaviours determine how a conversation transcript should be read and displayed.

Sender Mapping

Internal roleAPI senderMeaning
uservisitorMessage from the end user or contact.
assistantbotAutomated persona reply.
agentagentHuman agent reply.
readersystemRare system or internal marker.

Ordering

  • Within a session, messages are ascending by createdOn, oldest first.
  • Across sessions, ordering is descending by the session's latest message, so the most recent conversation comes first.
  • Pagination through page and limit is applied over session groups, not over individual messages.

Retention

Retention window Last 3 months

Only messages from the last three months are returned. This matches the admin Conversations screen.

Plan for the retention window

If you need a permanent archive of conversations, export and store them in your own system on a regular schedule. Messages older than three months are not available through this API.

Errors

All errors return a JSON body with a machine-readable code and a human-readable message.

Error Response Shape

JSON
{
  "error": {
    "code": "INVALID_API_KEY",
    "message": "The provided API key is missing or invalid."
  }
}

Status Codes

HTTP codeCodeWhen it happens
400BAD_REQUEST An invalid or missing query parameter, for example a missing contactId or a non-integer page.
401INVALID_API_KEYA missing, malformed, revoked or unscoped API key.
403FORBIDDENThe key is not permitted for this endpoint, method or enterprise.
404CONTACT_NOT_FOUNDThe contactId does not exist within your enterprise.
429RATE_LIMITEDThe per-key rate limit has been exceeded.
500INTERNAL_ERRORAn unexpected server error.
Cross-tenant access is treated as not found, returning 404 rather than 403, so keys cannot be used to probe for other enterprises' contact IDs.
When reporting an issue, include the X-Correlation-ID header returned with the failing response.

Rate Limiting

Each API key has a requests-per-minute limit, enforced at the gateway.

Default limit 60 requests per minute

When the Limit Is Exceeded

The API returns 429 RATE_LIMITED. Design your polling to stay within the limit.

Recommended Approach

  • Use updatedSince on the contacts endpoint so you avoid re-fetching unchanged data.
  • Store the highest createdOn you have seen and send it on the next call.
  • Request larger pages rather than more frequent calls. The maximum page size is 100.
  • Back off and retry after a short delay when you receive a 429 response.

Versioning

The API version appears in the request path.

/business-api/v1

What May Change Within v1

Additive, backward-compatible changes such as new fields or new optional parameters may ship within version 1.

Breaking Changes

Breaking changes are introduced under a new version prefix, so your existing integration continues to work against version 1.

What else should I read before I integrate?

Before you write code, see the ready-made integrations, compare what each pricing plan includes (custom API integration is part of the Enterprise plan). To ask about API access, contact our team.