List scheduled messages
List the scheduled messages on your account that are still waiting to be sent: those with status pending that weren't cancelled. The list covers every number on the account, and includes messages scheduled from the 2Chat app.
Messages that were already sent, failed or were cancelled aren't listed.
Endpointโ
GET https://api.p.2chat.io/open/whatsapp/scheduled-messages
Authenticationโ
Include your API key in the X-User-API-Key header. Learn more about authentication.
API costโ
1API credit
Each call to this endpoint deducts 1 API credit from your plan's API credit pool.
Parametersโ
This endpoint takes no parameters. It returns every pending scheduled message in a single response, in no particular order.
Invocationโ
- cURL
- Python
- JavaScript
- PHP
curl --location --request GET 'https://api.p.2chat.io/open/whatsapp/scheduled-messages' \
--header 'X-User-API-Key: your_api_key_here'
import requests
url = "https://api.p.2chat.io/open/whatsapp/scheduled-messages"
headers = {
"X-User-API-Key": "your_api_key_here"
}
response = requests.get(url, headers=headers)
print(response.json())
const axios = require('axios');
const response = await axios.get('https://api.p.2chat.io/open/whatsapp/scheduled-messages', {
headers: {
'X-User-API-Key': 'your_api_key_here'
}
});
console.log(response.data);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.p.2chat.io/open/whatsapp/scheduled-messages',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'X-User-API-Key: your_api_key_here'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Responseโ
Success (HTTP 200)โ
The pending scheduled messages, each with the fields described in The scheduled message object. An account with none returns an empty data list.
{
"data": [
{
"uuid": "EST6cc93513-1706-4ffc-a69e-174572d860dd",
"status": "pending",
"cancelled": false,
"next_send_at_utc": "2026-12-01 14:30:00",
"timezone": "America/New_York",
"channel_uuid": "WPNb932ad7f-250a-4ada-86a6-c1691e00a2cb",
"to_number": "+447700900461",
"text": "Hi! Just a reminder that your appointment is tomorrow at 10:00.",
"url": null,
"template": null,
"recurring": false,
"repeat": null,
"ends": null,
"sent_count": "0",
"created_at": "2026-11-20 15:04:12"
},
{
"uuid": "ESTb61e97ab-fbfe-46c4-b1da-e3ae3c88e2e6",
"status": "pending",
"cancelled": false,
"next_send_at_utc": "2026-12-02 23:00:00",
"timezone": "America/New_York",
"channel_uuid": "WPNb932ad7f-250a-4ada-86a6-c1691e00a2cb",
"to_number": "+447700900461",
"text": "Don't forget to log today's sales.",
"url": null,
"template": null,
"recurring": true,
"repeat": {
"unit": "daily",
"every": "1"
},
"ends": {
"type": "date",
"occurrences": "1",
"date": "2026-12-24 23:59:00"
},
"sent_count": "1",
"created_at": "2026-11-20 15:06:40"
}
],
"success": true
}
| Field | Description |
|---|---|
success | true when the request succeeded |
data | The pending scheduled messages |
Errorโ
{
"error": true,
"error_message": "Description of what went wrong"
}
| Field | Description |
|---|---|
error | true when the request failed |
error_message | A description of what went wrong |