curl --request POST \
--url https://truecaller.udchowdhury.me/v1/messages \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"to": "919999999999",
"template_id": "7f3c2a9e-1b2d-4c5e-8f90-123456789abc",
"variables": {
"name": "Asha",
"order_id": "OX1002"
}
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to": "+919999999999",
"sender_id": "<string>",
"category": "promotional",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"body": "<string>",
"extras": {},
"status": "queued",
"error": null,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"events": [
{
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": "invalid body",
"details": [
{
"path": [
"to"
],
"message": "Required"
}
]
}{
"error": "invalid x-api-key"
}Send a message
Send one Truecaller message now: free text, an approved template, or either with an image, file and buttons.
curl --request POST \
--url https://truecaller.udchowdhury.me/v1/messages \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"to": "919999999999",
"template_id": "7f3c2a9e-1b2d-4c5e-8f90-123456789abc",
"variables": {
"name": "Asha",
"order_id": "OX1002"
}
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to": "+919999999999",
"sender_id": "<string>",
"category": "promotional",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"body": "<string>",
"extras": {},
"status": "queued",
"error": null,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"events": [
{
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": "invalid body",
"details": [
{
"path": [
"to"
],
"message": "Required"
}
]
}{
"error": "invalid x-api-key"
}body or template_id:
template_idsends an approved template. Its media and buttons come with it. Fill its{{variables}}withvariables; any you leave empty use the template’s defaults.bodysends free text. Addmediaand up to 3buttonsif you need them.
202 means Truecaller accepted the message (status: "sent"). Delivery and read come later:
subscribe to webhooks or get the message.
Truecaller NOT_FOUND. That is the most
common failure and is not worth retrying.Authorizations
Workspace API key from Developers → API keys. It starts with tc_live_.
Body
Recipient number with country code (+919999999999 or 919999999999). Bare 10-digit numbers are treated as Indian.
"919999999999"
One of the workspace's active senders. Defaults to the first active sender.
Free text. Supports bold, italic, strikethrough, monospace and label [blocked] links. Give this or template_id.
1000For free-text sends. A template uses its own category.
promotional, transactional, service An approved template. Give this or body.
Values for the template's variables. Empty ones fall back to the template's defaults.
Show child attributes
Show child attributes
One attachment. Upload with Upload media, or give any public https URL.
Show child attributes
Show child attributes
3Up to 3 per message. Labels and URLs can use {{variables}}.
- Link button
- Quick reply
Show child attributes
Show child attributes
Response
Accepted by Truecaller.
"+919999999999"
promotional, transactional, service Media and buttons sent with the message.
sent means Truecaller accepted it, blocked means a limit or opt-out skipped it.
queued, sent, delivered, read, failed, blocked null
Show child attributes
Show child attributes
Was this page helpful?

