WATI API and MCP Quickstart
Copy a minimal request to read a conversation, send a text reply or send a WhatsApp template. Find TikTok, Messenger and MCP workflows.
This guide and its links use documentation version 2.7. REST operations labeled V3 use /api/ext/v3/.
Choose a task
- Connect an AI client to WATI. Product MCP setup. Pick the workspace region, sign in with OAuth, confirm the workspace and run
tools/listto discover available tools and their inputs. - Find a REST API or read its schema. v2.7 Markdown index. Endpoint links open Markdown pages with the operation and its OpenAPI definition.
- Read a conversation before replying. List conversations → Get messages.
- Reply to a WhatsApp, Instagram, Messenger or TikTok conversation. Send text or send supported media by URL. For MCP, use the Messenger and TikTok examples.
- Send an approved WhatsApp template. List templates → send an approved template. Use this path for WhatsApp when the 24-hour customer-service window is closed.
- Reply to a TikTok comment. List posts → list comments → reply publicly or reply privately. These routes are shared across platforms. Use the TikTok fields and
contract=unified_post_comment. - Export Facebook Page and Messenger activity. Get channel activity. Follow
continuous_tokenuntil the last page and useactivity_idto deduplicate. - Subscribe to message events. Webhook setup and migration. Use V2 to create a subscription and V3 to manage existing subscriptions.
- Diagnose permission or rate-limit errors. Endpoint availability and Errors & Rate Limits.
Make your first REST call
Get a scoped API token for the intended workspace and provide it to your client as WATI_API_TOKEN. Set WATI_API_HOST to that workspace's REST origin, with no trailing slash, tenant ID or /api suffix. Use HTTPS. If you do not know the origin or region, confirm it in WATI before sending the token.
| Workspace region | REST origin |
|---|---|
| Global | https://live-mt-server.wati.io |
| EU | https://eu-api.wati.io |
| KSA | https://ksa-api.wati.io |
For a dedicated workspace, use the REST origin assigned to that workspace. Check that both environment variables are set, then start with a read-only request:
: "${WATI_API_HOST:?Set your workspace REST origin}" "${WATI_API_TOKEN:?Set your API token}"
curl --fail-with-body --silent --show-error \
--header "Authorization: Bearer ${WATI_API_TOKEN}" \
"${WATI_API_HOST}/api/ext/v3/channels?page_number=1&page_size=20"Pick the intended channel from the result. Use a conversation id from List conversations as the message target. For Instagram, Messenger or TikTok, you can also build Channel:Id using the WATI channel id from Get channels and the recipient's ID on that platform. Keep both IDs as strings. Check the workspace and channel scope if the list is empty. See Target formats for other supported targets.
Copy a minimal request
For these REST requests, use the workspace's REST origin and send Authorization: Bearer <token>. Use Content-Type: application/json for requests with a JSON body.
Read an Instagram conversation. Pick conversation_list[].id from the first response. Substitute that ID in the second request. Both route examples include pagination.
GET /api/ext/v3/conversations?page_number=1&page_size=20&channel_type=instagram
GET /api/ext/v3/conversations/{conversation_id}/messages?page_number=1&page_size=20Send an approved WhatsApp template. Pick the approved template name for the sending channel from the list response. The example uses a template with no variables and one placeholder recipient. Fill in the fields required by the actual approved template before sending.
GET /api/ext/v3/messageTemplates?page_number=1&page_size=20
POST /api/ext/v3/messageTemplates/send
Content-Type: application/json
{"template_name":"order_update","broadcast_name":"order-update-demo","recipients":[{"target":"14155550123","local_message_id":"demo-001"}]}Check the business result and each recipient even when the HTTP status is 200. Use the template payload guide for variable or media parameters.
Send one permitted reply
Check the channel's reply window and the endpoint's scopes, plan, role and channel permissions. Confirm the recipient and text, then replace <conversation-id> with the selected ID:
curl --fail-with-body --silent --show-error \
--request POST "${WATI_API_HOST}/api/ext/v3/conversations/messages/text" \
--header "Authorization: Bearer ${WATI_API_TOKEN}" \
--header 'Content-Type: application/json' \
--data '{"target":"<conversation-id>","text":"Hello from WATI"}'WhatsApp and Messenger use a 24-hour reply window. TikTok applies a 48-hour window and message quotas. Instagram uses a 24-hour window for automated replies. Use is_bot=false only for a genuine Instagram human-agent reply within its permitted deadline. The Send text reference explains channel-specific limits and eligibility.
HTTP 200 confirms acceptance. Keep the returned message identifiers and verify the outcome through message history or the applicable delivery webhook. If a send times out or its result is unknown, check the original attempt before resending. For MCP, reuse an idempotency key only for the same logical send with identical inputs.
V3 text examples in five languages · Template payload examples · Legacy API exceptions
Updated about 5 hours ago

