List SMS Channels
Agent Skill
Automate this endpoint with an AI agent using the 2chat-sms skill:
npx skills add 2ChatCo/agent-skills -s 2chat-sms
List the SMS channels (numbers) connected to your 2Chat account, with pagination.
Endpoint
GET https://api.p.2chat.io/open/sms/channels
Authentication
Include your API key in the X-User-API-Key header. Learn more about authentication.
Query parameters
| Parameter | Description | Example |
|---|---|---|
page_number | Zero-based page index to return. Default is 0 | 0 |
results_per_page | Number of results per page, between 1 and 200. Default is 200 | 50 |
Invocation
- cURL
- Python
- JavaScript
- PHP
curl -L -G 'https://api.p.2chat.io/open/sms/channels?page_number=0&results_per_page=50' \
--header 'X-User-API-Key: your_api_key_here'
import requests
url = "https://api.p.2chat.io/open/sms/channels?page_number=0&results_per_page=50"
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/sms/channels', {
params: { page_number: 0, results_per_page: 50 },
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/sms/channels?page_number=0&results_per_page=50',
CURLOPT_RETURNTRANSFER => true,
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 OK)
{
"success": true,
"count": 1,
"page": 0,
"channels": [
{
"uuid": "SMS9a3f1c20-4e7b-4d8a-9c61-2f5b8d0a4e13",
"account_uuid": "ACC7b2e9d41-3c8a-4f02-9b1d-6e5a4c3f2a10",
"voip_number_setup_uuid": "DID3e1b7a90-2f64-4c8d-bb15-9a0e2d7f4c83",
"phone_number": "+13057654321",
"friendly_name": "Support line",
"iso_country_code": "US",
"supports_sms_in": true,
"supports_sms_out": true,
"enabled": true,
"created_at": "2026-05-12T14:03:21Z",
"updated_at": "2026-06-01T09:18:44Z"
}
]
}
| Field | Description |
|---|---|
success | true when the request was successful |
count | Total number of SMS channels on your account (across all pages) |
page | The zero-based page index returned |
channels | Array of SMS channel objects (see below) |
Each channel object contains:
| Field | Description | Example |
|---|---|---|
uuid | Unique identifier of the SMS channel (prefixed SMS) | SMS9a3f1c20-4e7b-4d8a-9c61-2f5b8d0a4e13 |
account_uuid | UUID of the account the channel belongs to | ACC7b2e9d41-3c8a-4f02-9b1d-6e5a4c3f2a10 |
voip_number_setup_uuid | UUID of the underlying virtual number setup (prefixed DID) | DID3e1b7a90-2f64-4c8d-bb15-9a0e2d7f4c83 |
phone_number | The channel's phone number in E.164 format | +13057654321 |
friendly_name | The friendly name you chose for the number | Support line |
iso_country_code | Two-letter country code of the number | US |
supports_sms_in | Whether the channel can receive inbound SMS | true |
supports_sms_out | Whether the channel can send outbound SMS | true |
enabled | Whether the channel is enabled on 2Chat | true |
created_at | When the channel was created (UTC) | 2026-05-12T14:03:21Z |
updated_at | When the channel was last updated (UTC) | 2026-06-01T09:18:44Z |
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 |