Chatilo
USDPrices shown in US dollars Sign in Start free trial
API reference

Messages

Send text, approved templates and files, and check what happened to them. WhatsApp only allows free text and files within 24 hours of the customer’s last message; outside that window, send an approved template.

Send a message #

POST/api/v1/messages

Needs a read-and-write key Accepts Idempotency-Key

Sends a WhatsApp message to a phone number, or a message on any channel into a conversation you name. A phone number you haven’t messaged before becomes a new contact. Templates work at any time; text and files only within 24 hours of the customer’s last message.

Body JSON

tostring
The phone number, with the country code. Required unless conversation_id is sent.
conversation_idinteger
Send into this conversation instead, on whatever channel it is.
number_idinteger
Which of your WhatsApp numbers to send from. The first one when left out.
namestring
A name for the contact, used only when the number is new.
typestring
text (the default), template, image, video, audio or document.
textstring
For type text: the message, up to 4,096 characters (1,600 for SMS).
templateobject
For type template: {"name", "language", "header", "body"}. body is a list that fills {{1}}, {{2}}… in order; header fills a header variable, or is the https link for an image, video or document header. language can be left out when the name exists in only one. Values may use {{name}}, {{first_name}}, {{phone}}, {{email}} and the contact’s attributes.
mediaobject
For image, video, audio and document: {"url", "caption", "filename"}. url must be a public https link; the file is downloaded (up to 16 MB), checked, and sent. caption is up to 1,024 characters.

Returns HTTP 201

okboolean
Always true on success.
messageobject
{"id", "status", "conversation_id", "contact_id"}. status is sent; ask for the message later to see delivered or read.

Errors

401unauthorized
The Authorization header is missing, or the key is wrong or deleted.
403contact_limit
The plan’s contact limit is reached, so a new contact can’t be added.
403read_only_key
A read-only key was used for a request that changes something.
404conversation_not_found
conversation_id is not a conversation in this workspace.
409idempotency_conflict
A request with the same Idempotency-Key is still running.
422invalid_idempotency_key
The Idempotency-Key is longer than 200 characters.
422invalid_media
media.url is missing, private, unreachable, too large, not an allowed file type, or not the type you said.
422invalid_phone
The phone number is missing or isn’t 8 to 15 digits with the country code.
422invalid_text
text is missing or too long.
422invalid_type
type isn’t one of the six, or that type can’t be sent on the conversation’s channel.
422no_number
No WhatsApp number is connected, or number_id isn’t one of yours.
422opted_out
The contact has opted out. They can opt back in by replying START.
422policy_violation
The text breaks Meta’s rules for WhatsApp, for example it asks for a full card number or promotes something Meta prohibits. The message says which rule. Nothing was sent.
422template_not_found
No approved template with that name and language on the sending number.
422window_closed
Free text or a file was sent more than 24 hours after the customer’s last message. Send a template instead.
429rate_limited
More than 120 requests in a minute with this key. Wait for the seconds in Retry-After.
502send_failed
The channel refused the message. The message text says why. Nothing was delivered.

Plus the errors any request can get.

Request
curl -X POST "https://chatilo.me/api/v1/messages" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+919876543210",
    "type": "template",
    "template": {
        "name": "order_update",
        "language": "en",
        "body": [
            "{{first_name}}",
            "#1042"
        ]
    }
}'
<?php
$apiKey = 'YOUR_API_KEY';

$ch = curl_init('https://chatilo.me/api/v1/messages');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => json_encode([
        'to' => '+919876543210',
        'type' => 'template',
        'template' => [
            'name' => 'order_update',
            'language' => 'en',
            'body' => [
                '{{first_name}}',
                '#1042',
            ],
        ],
    ]),
]);
$result = json_decode((string) curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);

if ($status >= 400) {
    throw new RuntimeException($result['error']['code'] . ': ' . $result['error']['message']);
}
print_r($result);
const apiKey = 'YOUR_API_KEY';

const response = await fetch("https://chatilo.me/api/v1/messages", {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${apiKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "to": "+919876543210",
      "type": "template",
      "template": {
          "name": "order_update",
          "language": "en",
          "body": [
              "{{first_name}}",
              "#1042"
          ]
      }
  }),
});
const result = await response.json();

if (!response.ok) {
  throw new Error(`${result.error.code}: ${result.error.message}`);
}
console.log(result);
import requests

api_key = "YOUR_API_KEY"

response = requests.post(
    "https://chatilo.me/api/v1/messages",
    headers={"Authorization": f"Bearer {api_key}"},
    json={
        "to": "+919876543210",
        "type": "template",
        "template": {
            "name": "order_update",
            "language": "en",
            "body": [
                "{{first_name}}",
                "#1042",
            ],
        },
    },
    timeout=30,
)
result = response.json()

if not response.ok:
    raise RuntimeError(f"{result['error']['code']}: {result['error']['message']}")
print(result)
Response · HTTP 201
{
    "ok": true,
    "message": {
        "id": 3001,
        "status": "sent",
        "conversation_id": 2001,
        "contact_id": 1001
    }
}

Reply in a conversation #

POST/api/v1/conversations/{id}/messages

Needs a read-and-write key Accepts Idempotency-Key

The same as “Send a message” with conversation_id: answers in an existing conversation on its own channel.

Path

idintegerrequired
The conversation’s id.

Body JSON

typestring
text (the default), template, image, video, audio or document.
textstring
For type text: the message, up to 4,096 characters (1,600 for SMS).
templateobject
For type template: {"name", "language", "header", "body"}. body is a list that fills {{1}}, {{2}}… in order; header fills a header variable, or is the https link for an image, video or document header. language can be left out when the name exists in only one. Values may use {{name}}, {{first_name}}, {{phone}}, {{email}} and the contact’s attributes.
mediaobject
For image, video, audio and document: {"url", "caption", "filename"}. url must be a public https link; the file is downloaded (up to 16 MB), checked, and sent. caption is up to 1,024 characters.

Returns HTTP 201

okboolean
Always true on success.
messageobject
{"id", "status", "conversation_id", "contact_id"}. status is sent; ask for the message later to see delivered or read.

Errors

401unauthorized
The Authorization header is missing, or the key is wrong or deleted.
403read_only_key
A read-only key was used for a request that changes something.
404conversation_not_found
conversation_id is not a conversation in this workspace.
409idempotency_conflict
A request with the same Idempotency-Key is still running.
422invalid_idempotency_key
The Idempotency-Key is longer than 200 characters.
422invalid_media
media.url is missing, private, unreachable, too large, not an allowed file type, or not the type you said.
422invalid_text
text is missing or too long.
422invalid_type
type isn’t one of the six, or that type can’t be sent on the conversation’s channel.
422no_number
No WhatsApp number is connected, or number_id isn’t one of yours.
422opted_out
The contact has opted out. They can opt back in by replying START.
422policy_violation
The text breaks Meta’s rules for WhatsApp, for example it asks for a full card number or promotes something Meta prohibits. The message says which rule. Nothing was sent.
422template_not_found
No approved template with that name and language on the sending number.
422window_closed
Free text or a file was sent more than 24 hours after the customer’s last message. Send a template instead.
429rate_limited
More than 120 requests in a minute with this key. Wait for the seconds in Retry-After.
502send_failed
The channel refused the message. The message text says why. Nothing was delivered.

Plus the errors any request can get.

Request
curl -X POST "https://chatilo.me/api/v1/conversations/2001/messages" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "image",
    "media": {
        "url": "https://example.com/files/size-chart.png",
        "caption": "Our size chart"
    }
}'
<?php
$apiKey = 'YOUR_API_KEY';

$ch = curl_init('https://chatilo.me/api/v1/conversations/2001/messages');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => json_encode([
        'type' => 'image',
        'media' => [
            'url' => 'https://example.com/files/size-chart.png',
            'caption' => 'Our size chart',
        ],
    ]),
]);
$result = json_decode((string) curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);

if ($status >= 400) {
    throw new RuntimeException($result['error']['code'] . ': ' . $result['error']['message']);
}
print_r($result);
const apiKey = 'YOUR_API_KEY';

const response = await fetch("https://chatilo.me/api/v1/conversations/2001/messages", {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${apiKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "type": "image",
      "media": {
          "url": "https://example.com/files/size-chart.png",
          "caption": "Our size chart"
      }
  }),
});
const result = await response.json();

if (!response.ok) {
  throw new Error(`${result.error.code}: ${result.error.message}`);
}
console.log(result);
import requests

api_key = "YOUR_API_KEY"

response = requests.post(
    "https://chatilo.me/api/v1/conversations/2001/messages",
    headers={"Authorization": f"Bearer {api_key}"},
    json={
        "type": "image",
        "media": {
            "url": "https://example.com/files/size-chart.png",
            "caption": "Our size chart",
        },
    },
    timeout=30,
)
result = response.json()

if not response.ok:
    raise RuntimeError(f"{result['error']['code']}: {result['error']['message']}")
print(result)
Response · HTTP 201
{
    "ok": true,
    "message": {
        "id": 3001,
        "status": "sent",
        "conversation_id": 2001,
        "contact_id": 1001
    }
}

List messages #

GET/api/v1/messages

Works with any key Paged

Messages across every conversation, newest first. Useful for polling what customers wrote: direction=in.

Query parameters

directionstring
in for customers’ messages, out for yours.
conversation_idinteger
Only this conversation.
contact_idinteger
Only this contact.
statusstring
sent, delivered, read, failed or received.
sincedate-time
Only messages at or after this time.
pageinteger
Which page, starting at 1. A page past the end is an empty list.
limitinteger
How many per page: 1 to 100. 50 when left out.

Returns HTTP 200

okboolean
Always true on success.
messageslist of Message
The messages on this page.
pageinteger
The page you asked for.
pagesinteger
How many pages there are at this limit.
totalinteger
How many items match in all.
limitinteger
Items per page.
has_moreboolean
True while there is a next page.

Errors

401unauthorized
The Authorization header is missing, or the key is wrong or deleted.
422invalid_date
A date filter isn’t a date and time like 2026-01-31T09:30:00Z.
429rate_limited
More than 120 requests in a minute with this key. Wait for the seconds in Retry-After.

Plus the errors any request can get.

Request
curl "https://chatilo.me/api/v1/messages?direction=in&since=2026-01-31T00%3A00%3A00Z" \
  -H "Authorization: Bearer YOUR_API_KEY"
<?php
$apiKey = 'YOUR_API_KEY';

$ch = curl_init('https://chatilo.me/api/v1/messages?direction=in&since=2026-01-31T00%3A00%3A00Z');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$result = json_decode((string) curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);

if ($status >= 400) {
    throw new RuntimeException($result['error']['code'] . ': ' . $result['error']['message']);
}
print_r($result);
const apiKey = 'YOUR_API_KEY';

const response = await fetch("https://chatilo.me/api/v1/messages?direction=in&since=2026-01-31T00%3A00%3A00Z", {
  headers: {
    Authorization: `Bearer ${apiKey}`,
  },
});
const result = await response.json();

if (!response.ok) {
  throw new Error(`${result.error.code}: ${result.error.message}`);
}
console.log(result);
import requests

api_key = "YOUR_API_KEY"

response = requests.get(
    "https://chatilo.me/api/v1/messages?direction=in&since=2026-01-31T00%3A00%3A00Z",
    headers={"Authorization": f"Bearer {api_key}"},
    timeout=30,
)
result = response.json()

if not response.ok:
    raise RuntimeError(f"{result['error']['code']}: {result['error']['message']}")
print(result)
Response · HTTP 200
{
    "ok": true,
    "messages": [
        {
            "id": 3000,
            "conversation_id": 2001,
            "direction": "in",
            "kind": "text",
            "body": "Hi, is the blue kurta available in medium?",
            "status": "received",
            "error": null,
            "sender": null,
            "created_at": "2026-01-31T09:30:00Z",
            "media": null,
            "contact_id": 1001
        }
    ],
    "page": 1,
    "pages": 1,
    "total": 1,
    "limit": 50,
    "has_more": false
}

Get a message #

GET/api/v1/messages/{id}

Works with any key

One message. Ask again after sending to see whether it was delivered, read, or failed and why.

Path

idintegerrequired
The message’s id, from the send response.

Returns HTTP 200

okboolean
Always true on success.
messageMessage
The message.

Errors

401unauthorized
The Authorization header is missing, or the key is wrong or deleted.
404message_not_found
No message with that id in this workspace.
429rate_limited
More than 120 requests in a minute with this key. Wait for the seconds in Retry-After.

Plus the errors any request can get.

Request
curl "https://chatilo.me/api/v1/messages/3001" \
  -H "Authorization: Bearer YOUR_API_KEY"
<?php
$apiKey = 'YOUR_API_KEY';

$ch = curl_init('https://chatilo.me/api/v1/messages/3001');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$result = json_decode((string) curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);

if ($status >= 400) {
    throw new RuntimeException($result['error']['code'] . ': ' . $result['error']['message']);
}
print_r($result);
const apiKey = 'YOUR_API_KEY';

const response = await fetch("https://chatilo.me/api/v1/messages/3001", {
  headers: {
    Authorization: `Bearer ${apiKey}`,
  },
});
const result = await response.json();

if (!response.ok) {
  throw new Error(`${result.error.code}: ${result.error.message}`);
}
console.log(result);
import requests

api_key = "YOUR_API_KEY"

response = requests.get(
    "https://chatilo.me/api/v1/messages/3001",
    headers={"Authorization": f"Bearer {api_key}"},
    timeout=30,
)
result = response.json()

if not response.ok:
    raise RuntimeError(f"{result['error']['code']}: {result['error']['message']}")
print(result)
Response · HTTP 200
{
    "ok": true,
    "message": {
        "id": 3001,
        "conversation_id": 2001,
        "direction": "out",
        "kind": "template",
        "body": "Hi Grace, your order #1042 has shipped.",
        "status": "delivered",
        "error": null,
        "sender": "API",
        "created_at": "2026-01-31T09:30:00Z",
        "media": null,
        "contact_id": 1001
    }
}

Add a note #

POST/api/v1/notes

Needs a read-and-write key Accepts Idempotency-Key

Adds an internal note to a conversation. Notes are seen only by the team, never by the customer. Name the conversation, or give a phone number to use that contact’s latest conversation.

Body JSON

textstringrequired
The note, up to 4,096 characters.
conversation_idinteger
The conversation to add it to.
tostring
Or a phone number: the note goes on that contact’s most recent conversation.

Returns HTTP 201

okboolean
Always true on success.
noteobject
{"id", "conversation_id", "contact_id", "body", "created_at"}.

Errors

401unauthorized
The Authorization header is missing, or the key is wrong or deleted.
403read_only_key
A read-only key was used for a request that changes something.
404conversation_not_found
There is no such conversation, or the contact has none yet. A note can’t start a conversation.
409idempotency_conflict
A request with the same Idempotency-Key is still running.
422invalid_idempotency_key
The Idempotency-Key is longer than 200 characters.
422invalid_phone
The phone number is missing or isn’t 8 to 15 digits with the country code.
422invalid_text
text is missing or longer than 4,096 characters.
429rate_limited
More than 120 requests in a minute with this key. Wait for the seconds in Retry-After.

Plus the errors any request can get.

Request
curl -X POST "https://chatilo.me/api/v1/notes" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+919876543210",
    "text": "Paid by bank transfer."
}'
<?php
$apiKey = 'YOUR_API_KEY';

$ch = curl_init('https://chatilo.me/api/v1/notes');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => json_encode([
        'to' => '+919876543210',
        'text' => 'Paid by bank transfer.',
    ]),
]);
$result = json_decode((string) curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);

if ($status >= 400) {
    throw new RuntimeException($result['error']['code'] . ': ' . $result['error']['message']);
}
print_r($result);
const apiKey = 'YOUR_API_KEY';

const response = await fetch("https://chatilo.me/api/v1/notes", {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${apiKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "to": "+919876543210",
      "text": "Paid by bank transfer."
  }),
});
const result = await response.json();

if (!response.ok) {
  throw new Error(`${result.error.code}: ${result.error.message}`);
}
console.log(result);
import requests

api_key = "YOUR_API_KEY"

response = requests.post(
    "https://chatilo.me/api/v1/notes",
    headers={"Authorization": f"Bearer {api_key}"},
    json={
        "to": "+919876543210",
        "text": "Paid by bank transfer.",
    },
    timeout=30,
)
result = response.json()

if not response.ok:
    raise RuntimeError(f"{result['error']['code']}: {result['error']['message']}")
print(result)
Response · HTTP 201
{
    "ok": true,
    "note": {
        "id": 3002,
        "conversation_id": 2001,
        "contact_id": 1001,
        "body": "Paid by bank transfer.",
        "created_at": "2026-01-31T09:30:00Z"
    }
}

Add a note to a conversation #

POST/api/v1/conversations/{id}/notes

Needs a read-and-write key Accepts Idempotency-Key

The same as “Add a note”, with the conversation in the path.

Path

idintegerrequired
The conversation’s id.

Body JSON

textstringrequired
The note, up to 4,096 characters.

Returns HTTP 201

okboolean
Always true on success.
noteobject
{"id", "conversation_id", "contact_id", "body", "created_at"}.

Errors

401unauthorized
The Authorization header is missing, or the key is wrong or deleted.
403read_only_key
A read-only key was used for a request that changes something.
404conversation_not_found
No conversation with that id in this workspace.
409idempotency_conflict
A request with the same Idempotency-Key is still running.
422invalid_idempotency_key
The Idempotency-Key is longer than 200 characters.
422invalid_text
text is missing or longer than 4,096 characters.
429rate_limited
More than 120 requests in a minute with this key. Wait for the seconds in Retry-After.

Plus the errors any request can get.

Request
curl -X POST "https://chatilo.me/api/v1/conversations/2001/notes" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Paid by bank transfer."
}'
<?php
$apiKey = 'YOUR_API_KEY';

$ch = curl_init('https://chatilo.me/api/v1/conversations/2001/notes');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey, 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => json_encode([
        'text' => 'Paid by bank transfer.',
    ]),
]);
$result = json_decode((string) curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);

if ($status >= 400) {
    throw new RuntimeException($result['error']['code'] . ': ' . $result['error']['message']);
}
print_r($result);
const apiKey = 'YOUR_API_KEY';

const response = await fetch("https://chatilo.me/api/v1/conversations/2001/notes", {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${apiKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
      "text": "Paid by bank transfer."
  }),
});
const result = await response.json();

if (!response.ok) {
  throw new Error(`${result.error.code}: ${result.error.message}`);
}
console.log(result);
import requests

api_key = "YOUR_API_KEY"

response = requests.post(
    "https://chatilo.me/api/v1/conversations/2001/notes",
    headers={"Authorization": f"Bearer {api_key}"},
    json={
        "text": "Paid by bank transfer.",
    },
    timeout=30,
)
result = response.json()

if not response.ok:
    raise RuntimeError(f"{result['error']['code']}: {result['error']['message']}")
print(result)
Response · HTTP 201
{
    "ok": true,
    "note": {
        "id": 3002,
        "conversation_id": 2001,
        "contact_id": 1001,
        "body": "Paid by bank transfer.",
        "created_at": "2026-01-31T09:30:00Z"
    }
}

Cookies on this site

We use the cookies needed to run the site and keep you signed in. With your OK we also remember choices you make here, such as the currency for prices. We don’t use advertising or tracking cookies. Cookie policy