curl --request POST \
--url https://api.cloudtalk.io/v1/messages/bulk \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "+12025550100",
"body": "Your order ships today.",
"messages": [
{
"to": "+12025550164",
"body": "Hi Chris, your order ships today."
},
{
"to": "+12025550175"
}
]
}
'import requests
url = "https://api.cloudtalk.io/v1/messages/bulk"
payload = {
"from": "+12025550100",
"body": "Your order ships today.",
"messages": [{
"to": "+12025550164",
"body": "Hi Chris, your order ships today."
}, { "to": "+12025550175" }]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '+12025550100',
body: JSON.stringify('Your order ships today.'),
messages: [
{to: '+12025550164', body: JSON.stringify('Hi Chris, your order ships today.')},
{to: '+12025550175'}
]
})
};
fetch('https://api.cloudtalk.io/v1/messages/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cloudtalk.io/v1/messages/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '+12025550100',
'body' => 'Your order ships today.',
'messages' => [
[
'to' => '+12025550164',
'body' => 'Hi Chris, your order ships today.'
],
[
'to' => '+12025550175'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cloudtalk.io/v1/messages/bulk"
payload := strings.NewReader("{\n \"from\": \"+12025550100\",\n \"body\": \"Your order ships today.\",\n \"messages\": [\n {\n \"to\": \"+12025550164\",\n \"body\": \"Hi Chris, your order ships today.\"\n },\n {\n \"to\": \"+12025550175\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cloudtalk.io/v1/messages/bulk")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"+12025550100\",\n \"body\": \"Your order ships today.\",\n \"messages\": [\n {\n \"to\": \"+12025550164\",\n \"body\": \"Hi Chris, your order ships today.\"\n },\n {\n \"to\": \"+12025550175\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudtalk.io/v1/messages/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"+12025550100\",\n \"body\": \"Your order ships today.\",\n \"messages\": [\n {\n \"to\": \"+12025550164\",\n \"body\": \"Hi Chris, your order ships today.\"\n },\n {\n \"to\": \"+12025550175\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"index": 0,
"status": "ok",
"message": {
"id": "918274",
"conversationId": "55121",
"direction": "outbound",
"channel": "sms",
"externalNumber": "+12025550164",
"internalNumber": {
"id": "3104",
"numberE164": "+12025550100",
"internalName": "Support line",
"numberType": "fixed",
"country": "US"
},
"body": "Hi Chris, your order ships today.",
"media": [],
"fragments": 1,
"whatsappTemplate": null,
"status": "queued",
"error": null,
"statusUpdatedAt": "2026-11-12T10:00:00Z",
"sentAt": null,
"deliveredAt": null,
"contact": null,
"contactAmbiguous": false,
"user": null,
"createdAt": "2026-11-12T10:00:00Z"
}
},
{
"index": 1,
"status": "error",
"error": {
"code": "MESSAGES.BLOCKED",
"message": "The recipient opted out of your messages.",
"details": {
"retryable": false
}
}
}
],
"requestId": "5f0c2a7e-91d4-4c1b-8e2a-3b6d9f1e7a20"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {
"retryable": true,
"candidates": [
{
"id": "<string>",
"numberE164": "<string>",
"internalName": "<string>"
}
]
},
"target": "<string>"
},
"requestId": "<string>"
}{
"code": "UNAUTHORIZED",
"message": "You are not authorized to access this resource."
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {
"retryable": true,
"candidates": [
{
"id": "<string>",
"numberE164": "<string>",
"internalName": "<string>"
}
]
},
"target": "<string>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {
"retryable": true,
"candidates": [
{
"id": "<string>",
"numberE164": "<string>",
"internalName": "<string>"
}
]
},
"target": "<string>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {
"retryable": true,
"candidates": [
{
"id": "<string>",
"numberE164": "<string>",
"internalName": "<string>"
}
]
},
"target": "<string>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {
"retryable": true,
"candidates": [
{
"id": "<string>",
"numberE164": "<string>",
"internalName": "<string>"
}
]
},
"target": "<string>"
},
"requestId": "<string>"
}<string>{
"error": {
"code": "<string>",
"message": "<string>",
"details": {
"retryable": true,
"candidates": [
{
"id": "<string>",
"numberE164": "<string>",
"internalName": "<string>"
}
]
},
"target": "<string>"
},
"requestId": "<string>"
}Bulk send messages
Sends one message each to 1 to 50 recipients and answers 200 with one result per row, in request order. Check every row: status: ok carries the message as Send a message answers it, and status: error carries the refusal, with the same codes. Nothing was sent for a row in error.
from, channel, body, whatsappTemplate and userId apply to every row. A row’s body replaces the shared one, and its variables are added to the shared template’s. Without from, each row goes from the number of your latest conversation with its recipient, and a row with none fails with MESSAGES.SENDER_REQUIRED. mediaIds is refused: send messages with media one at a time.
Send one Idempotency-Key per call. Within 7 days, a retried call never sends a row twice: sent rows come back as they were, and refused rows are tried again. After that, the same key sends again.
When CloudTalk cannot tell whether a row’s message went out, the row is ok with the message in status: queued and id: null, as on Send a message. A retry with the same key answers that row the same and does not send it.
Rate limited at 6 calls per minute per company. Each call also counts once toward your company’s Messaging rate limit.
curl --request POST \
--url https://api.cloudtalk.io/v1/messages/bulk \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "+12025550100",
"body": "Your order ships today.",
"messages": [
{
"to": "+12025550164",
"body": "Hi Chris, your order ships today."
},
{
"to": "+12025550175"
}
]
}
'import requests
url = "https://api.cloudtalk.io/v1/messages/bulk"
payload = {
"from": "+12025550100",
"body": "Your order ships today.",
"messages": [{
"to": "+12025550164",
"body": "Hi Chris, your order ships today."
}, { "to": "+12025550175" }]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '+12025550100',
body: JSON.stringify('Your order ships today.'),
messages: [
{to: '+12025550164', body: JSON.stringify('Hi Chris, your order ships today.')},
{to: '+12025550175'}
]
})
};
fetch('https://api.cloudtalk.io/v1/messages/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cloudtalk.io/v1/messages/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '+12025550100',
'body' => 'Your order ships today.',
'messages' => [
[
'to' => '+12025550164',
'body' => 'Hi Chris, your order ships today.'
],
[
'to' => '+12025550175'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cloudtalk.io/v1/messages/bulk"
payload := strings.NewReader("{\n \"from\": \"+12025550100\",\n \"body\": \"Your order ships today.\",\n \"messages\": [\n {\n \"to\": \"+12025550164\",\n \"body\": \"Hi Chris, your order ships today.\"\n },\n {\n \"to\": \"+12025550175\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cloudtalk.io/v1/messages/bulk")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"+12025550100\",\n \"body\": \"Your order ships today.\",\n \"messages\": [\n {\n \"to\": \"+12025550164\",\n \"body\": \"Hi Chris, your order ships today.\"\n },\n {\n \"to\": \"+12025550175\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudtalk.io/v1/messages/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"+12025550100\",\n \"body\": \"Your order ships today.\",\n \"messages\": [\n {\n \"to\": \"+12025550164\",\n \"body\": \"Hi Chris, your order ships today.\"\n },\n {\n \"to\": \"+12025550175\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"index": 0,
"status": "ok",
"message": {
"id": "918274",
"conversationId": "55121",
"direction": "outbound",
"channel": "sms",
"externalNumber": "+12025550164",
"internalNumber": {
"id": "3104",
"numberE164": "+12025550100",
"internalName": "Support line",
"numberType": "fixed",
"country": "US"
},
"body": "Hi Chris, your order ships today.",
"media": [],
"fragments": 1,
"whatsappTemplate": null,
"status": "queued",
"error": null,
"statusUpdatedAt": "2026-11-12T10:00:00Z",
"sentAt": null,
"deliveredAt": null,
"contact": null,
"contactAmbiguous": false,
"user": null,
"createdAt": "2026-11-12T10:00:00Z"
}
},
{
"index": 1,
"status": "error",
"error": {
"code": "MESSAGES.BLOCKED",
"message": "The recipient opted out of your messages.",
"details": {
"retryable": false
}
}
}
],
"requestId": "5f0c2a7e-91d4-4c1b-8e2a-3b6d9f1e7a20"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {
"retryable": true,
"candidates": [
{
"id": "<string>",
"numberE164": "<string>",
"internalName": "<string>"
}
]
},
"target": "<string>"
},
"requestId": "<string>"
}{
"code": "UNAUTHORIZED",
"message": "You are not authorized to access this resource."
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {
"retryable": true,
"candidates": [
{
"id": "<string>",
"numberE164": "<string>",
"internalName": "<string>"
}
]
},
"target": "<string>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {
"retryable": true,
"candidates": [
{
"id": "<string>",
"numberE164": "<string>",
"internalName": "<string>"
}
]
},
"target": "<string>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {
"retryable": true,
"candidates": [
{
"id": "<string>",
"numberE164": "<string>",
"internalName": "<string>"
}
]
},
"target": "<string>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {
"retryable": true,
"candidates": [
{
"id": "<string>",
"numberE164": "<string>",
"internalName": "<string>"
}
]
},
"target": "<string>"
},
"requestId": "<string>"
}<string>{
"error": {
"code": "<string>",
"message": "<string>",
"details": {
"retryable": true,
"candidates": [
{
"id": "<string>",
"numberE164": "<string>",
"internalName": "<string>"
}
]
},
"target": "<string>"
},
"requestId": "<string>"
}Authorizations
HTTP Basic Authentication. Use your API Access Key ID as the username and your API Access Key Secret as the password. Generate keys in the CloudTalk Dashboard under Account -> Settings -> API Keys (https://dashboard.cloudtalk.io/menu/account/settings/API-keys).