cURL
curl --request POST \
--url https://api.buildwithchirp.com/v1/sms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "+15551234567",
"to": [
"+15559876543"
],
"text": "Hello from Chirp!",
"subject": "Important Message",
"mediaUrls": [
"https://example.com/image.jpg"
],
"transport": "automatic"
}
'import requests
url = "https://api.buildwithchirp.com/v1/sms"
payload = {
"from": "+15551234567",
"to": ["+15559876543"],
"text": "Hello from Chirp!",
"subject": "Important Message",
"mediaUrls": ["https://example.com/image.jpg"],
"transport": "automatic"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '+15551234567',
to: ['+15559876543'],
text: 'Hello from Chirp!',
subject: 'Important Message',
mediaUrls: ['https://example.com/image.jpg'],
transport: 'automatic'
})
};
fetch('https://api.buildwithchirp.com/v1/sms', 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.buildwithchirp.com/v1/sms",
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' => '+15551234567',
'to' => [
'+15559876543'
],
'text' => 'Hello from Chirp!',
'subject' => 'Important Message',
'mediaUrls' => [
'https://example.com/image.jpg'
],
'transport' => 'automatic'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.buildwithchirp.com/v1/sms"
payload := strings.NewReader("{\n \"from\": \"+15551234567\",\n \"to\": [\n \"+15559876543\"\n ],\n \"text\": \"Hello from Chirp!\",\n \"subject\": \"Important Message\",\n \"mediaUrls\": [\n \"https://example.com/image.jpg\"\n ],\n \"transport\": \"automatic\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.buildwithchirp.com/v1/sms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"+15551234567\",\n \"to\": [\n \"+15559876543\"\n ],\n \"text\": \"Hello from Chirp!\",\n \"subject\": \"Important Message\",\n \"mediaUrls\": [\n \"https://example.com/image.jpg\"\n ],\n \"transport\": \"automatic\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buildwithchirp.com/v1/sms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"+15551234567\",\n \"to\": [\n \"+15559876543\"\n ],\n \"text\": \"Hello from Chirp!\",\n \"subject\": \"Important Message\",\n \"mediaUrls\": [\n \"https://example.com/image.jpg\"\n ],\n \"transport\": \"automatic\"\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_sms_2DbBs7GWhGvVNJGrDXr5RG0mBWI",
"from": "<string>",
"to": [
"<string>"
],
"text": "<string>",
"subject": "<string>",
"direction": "OUTBOUND",
"createdAt": "<string>",
"mediaUrls": [
"<string>"
]
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}SMS
Send SMS
Send an SMS or MMS message
POST
/
v1
/
sms
cURL
curl --request POST \
--url https://api.buildwithchirp.com/v1/sms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "+15551234567",
"to": [
"+15559876543"
],
"text": "Hello from Chirp!",
"subject": "Important Message",
"mediaUrls": [
"https://example.com/image.jpg"
],
"transport": "automatic"
}
'import requests
url = "https://api.buildwithchirp.com/v1/sms"
payload = {
"from": "+15551234567",
"to": ["+15559876543"],
"text": "Hello from Chirp!",
"subject": "Important Message",
"mediaUrls": ["https://example.com/image.jpg"],
"transport": "automatic"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '+15551234567',
to: ['+15559876543'],
text: 'Hello from Chirp!',
subject: 'Important Message',
mediaUrls: ['https://example.com/image.jpg'],
transport: 'automatic'
})
};
fetch('https://api.buildwithchirp.com/v1/sms', 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.buildwithchirp.com/v1/sms",
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' => '+15551234567',
'to' => [
'+15559876543'
],
'text' => 'Hello from Chirp!',
'subject' => 'Important Message',
'mediaUrls' => [
'https://example.com/image.jpg'
],
'transport' => 'automatic'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.buildwithchirp.com/v1/sms"
payload := strings.NewReader("{\n \"from\": \"+15551234567\",\n \"to\": [\n \"+15559876543\"\n ],\n \"text\": \"Hello from Chirp!\",\n \"subject\": \"Important Message\",\n \"mediaUrls\": [\n \"https://example.com/image.jpg\"\n ],\n \"transport\": \"automatic\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.buildwithchirp.com/v1/sms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"+15551234567\",\n \"to\": [\n \"+15559876543\"\n ],\n \"text\": \"Hello from Chirp!\",\n \"subject\": \"Important Message\",\n \"mediaUrls\": [\n \"https://example.com/image.jpg\"\n ],\n \"transport\": \"automatic\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buildwithchirp.com/v1/sms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"+15551234567\",\n \"to\": [\n \"+15559876543\"\n ],\n \"text\": \"Hello from Chirp!\",\n \"subject\": \"Important Message\",\n \"mediaUrls\": [\n \"https://example.com/image.jpg\"\n ],\n \"transport\": \"automatic\"\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_sms_2DbBs7GWhGvVNJGrDXr5RG0mBWI",
"from": "<string>",
"to": [
"<string>"
],
"text": "<string>",
"subject": "<string>",
"direction": "OUTBOUND",
"createdAt": "<string>",
"mediaUrls": [
"<string>"
]
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}Authorizations
App API key (format: sk_live_app_* or sk_test_app_*) for app-level operations
Body
application/json
Phone number to send from (must be assigned to your app). E.164 format required.
Example:
"+15551234567"
Array of phone numbers to send to. E.164 format required.
Example:
["+15559876543"]
Message text content
Example:
"Hello from Chirp!"
Subject for MMS messages
Example:
"Important Message"
Array of media URLs for MMS messages
Example:
["https://example.com/image.jpg"]
Transport method: 'automatic' (decide based on content), 'sms' (force SMS), or 'mms' (force MMS)
Available options:
automatic, sms, mms Example:
"automatic"
Response
Message queued successfully
Unique identifier for a Message. Format: msg_sms_[test_]{ksuid}
Pattern:
^msg_sms_(?:test_)?[a-zA-Z0-9]{27}$Example:
"msg_sms_2DbBs7GWhGvVNJGrDXr5RG0mBWI"
Available options:
SMS, MMS Available options:
sms, mms Available options:
OUTBOUND Available options:
QUEUED, SENDING, SENT, DELIVERED, FAILED ⌘I