curl --request POST \
--url https://api.buildwithchirp.com/v1/organization/whatsapp/phone-numbers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"displayPhoneNumber": "+15551234567",
"metaPhoneNumberId": "123456789012345",
"metaBusinessAccountId": "987654321098765",
"appIds": [
"app_2DbBs7GWhGvVNJGrDXr5RG0mBWI"
]
}
'import requests
url = "https://api.buildwithchirp.com/v1/organization/whatsapp/phone-numbers"
payload = {
"displayPhoneNumber": "+15551234567",
"metaPhoneNumberId": "123456789012345",
"metaBusinessAccountId": "987654321098765",
"appIds": ["app_2DbBs7GWhGvVNJGrDXr5RG0mBWI"]
}
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({
displayPhoneNumber: '+15551234567',
metaPhoneNumberId: '123456789012345',
metaBusinessAccountId: '987654321098765',
appIds: ['app_2DbBs7GWhGvVNJGrDXr5RG0mBWI']
})
};
fetch('https://api.buildwithchirp.com/v1/organization/whatsapp/phone-numbers', 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/organization/whatsapp/phone-numbers",
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([
'displayPhoneNumber' => '+15551234567',
'metaPhoneNumberId' => '123456789012345',
'metaBusinessAccountId' => '987654321098765',
'appIds' => [
'app_2DbBs7GWhGvVNJGrDXr5RG0mBWI'
]
]),
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/organization/whatsapp/phone-numbers"
payload := strings.NewReader("{\n \"displayPhoneNumber\": \"+15551234567\",\n \"metaPhoneNumberId\": \"123456789012345\",\n \"metaBusinessAccountId\": \"987654321098765\",\n \"appIds\": [\n \"app_2DbBs7GWhGvVNJGrDXr5RG0mBWI\"\n ]\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/organization/whatsapp/phone-numbers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"displayPhoneNumber\": \"+15551234567\",\n \"metaPhoneNumberId\": \"123456789012345\",\n \"metaBusinessAccountId\": \"987654321098765\",\n \"appIds\": [\n \"app_2DbBs7GWhGvVNJGrDXr5RG0mBWI\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buildwithchirp.com/v1/organization/whatsapp/phone-numbers")
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 \"displayPhoneNumber\": \"+15551234567\",\n \"metaPhoneNumberId\": \"123456789012345\",\n \"metaBusinessAccountId\": \"987654321098765\",\n \"appIds\": [\n \"app_2DbBs7GWhGvVNJGrDXr5RG0mBWI\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "wapn_2DbBs7GWhGvVNJGrDXr5RG0mBWI",
"displayPhoneNumber": "<string>",
"metaPhoneNumberId": "<string>",
"metaBusinessAccountId": "<string>",
"verified": true,
"qualityRating": "<string>",
"throughputTier": "<string>",
"qualityEvent": "<string>",
"qualityEventAt": "2023-11-07T05:31:56Z",
"nameStatus": "<string>",
"requestedVerifiedName": "<string>",
"nameRejectionReason": "<string>",
"nameDecisionAt": "2023-11-07T05:31:56Z",
"isTestNumber": true,
"cloudApiRegistered": true,
"businessProfile": {
"id": "<string>",
"metaWabaId": "<string>",
"businessName": "<string>"
},
"apps": [
{
"appId": "<string>",
"appName": "<string>",
"appSlug": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"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>"
]
}
}Register WhatsApp phone number
Register a WhatsApp phone number with Meta’s phone_number_id and optionally assign it to apps
curl --request POST \
--url https://api.buildwithchirp.com/v1/organization/whatsapp/phone-numbers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"displayPhoneNumber": "+15551234567",
"metaPhoneNumberId": "123456789012345",
"metaBusinessAccountId": "987654321098765",
"appIds": [
"app_2DbBs7GWhGvVNJGrDXr5RG0mBWI"
]
}
'import requests
url = "https://api.buildwithchirp.com/v1/organization/whatsapp/phone-numbers"
payload = {
"displayPhoneNumber": "+15551234567",
"metaPhoneNumberId": "123456789012345",
"metaBusinessAccountId": "987654321098765",
"appIds": ["app_2DbBs7GWhGvVNJGrDXr5RG0mBWI"]
}
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({
displayPhoneNumber: '+15551234567',
metaPhoneNumberId: '123456789012345',
metaBusinessAccountId: '987654321098765',
appIds: ['app_2DbBs7GWhGvVNJGrDXr5RG0mBWI']
})
};
fetch('https://api.buildwithchirp.com/v1/organization/whatsapp/phone-numbers', 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/organization/whatsapp/phone-numbers",
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([
'displayPhoneNumber' => '+15551234567',
'metaPhoneNumberId' => '123456789012345',
'metaBusinessAccountId' => '987654321098765',
'appIds' => [
'app_2DbBs7GWhGvVNJGrDXr5RG0mBWI'
]
]),
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/organization/whatsapp/phone-numbers"
payload := strings.NewReader("{\n \"displayPhoneNumber\": \"+15551234567\",\n \"metaPhoneNumberId\": \"123456789012345\",\n \"metaBusinessAccountId\": \"987654321098765\",\n \"appIds\": [\n \"app_2DbBs7GWhGvVNJGrDXr5RG0mBWI\"\n ]\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/organization/whatsapp/phone-numbers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"displayPhoneNumber\": \"+15551234567\",\n \"metaPhoneNumberId\": \"123456789012345\",\n \"metaBusinessAccountId\": \"987654321098765\",\n \"appIds\": [\n \"app_2DbBs7GWhGvVNJGrDXr5RG0mBWI\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buildwithchirp.com/v1/organization/whatsapp/phone-numbers")
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 \"displayPhoneNumber\": \"+15551234567\",\n \"metaPhoneNumberId\": \"123456789012345\",\n \"metaBusinessAccountId\": \"987654321098765\",\n \"appIds\": [\n \"app_2DbBs7GWhGvVNJGrDXr5RG0mBWI\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "wapn_2DbBs7GWhGvVNJGrDXr5RG0mBWI",
"displayPhoneNumber": "<string>",
"metaPhoneNumberId": "<string>",
"metaBusinessAccountId": "<string>",
"verified": true,
"qualityRating": "<string>",
"throughputTier": "<string>",
"qualityEvent": "<string>",
"qualityEventAt": "2023-11-07T05:31:56Z",
"nameStatus": "<string>",
"requestedVerifiedName": "<string>",
"nameRejectionReason": "<string>",
"nameDecisionAt": "2023-11-07T05:31:56Z",
"isTestNumber": true,
"cloudApiRegistered": true,
"businessProfile": {
"id": "<string>",
"metaWabaId": "<string>",
"businessName": "<string>"
},
"apps": [
{
"appId": "<string>",
"appName": "<string>",
"appSlug": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"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
Admin API key (format: sk_admin_*) for organization-level operations
Body
The display phone number in E.164 format
"+15551234567"
The phone_number_id from Meta's WhatsApp Business API
"123456789012345"
The WhatsApp Business Account ID from Meta
"987654321098765"
Optional array of app IDs to assign the phone number to
["app_2DbBs7GWhGvVNJGrDXr5RG0mBWI"]
Response
WhatsApp phone number registered successfully
Unique identifier for a WhatsApp Phone Number. Format: wapn_[test_]{ksuid}
^wapn_(?:test_)?[a-zA-Z0-9]{27}$"wapn_2DbBs7GWhGvVNJGrDXr5RG0mBWI"
Messaging throughput tier from phone_number_quality_update (e.g. STANDARD, HIGH)
Most recent quality event (e.g. FLAGGED, ONBOARDED, UPGRADE)
Display name verification status (APPROVED, REJECTED, PENDING, DEFERRED)
Whether the phone number has been registered with Meta Cloud API (two-step verification)
The WhatsApp Business Account (WABA) this phone number belongs to
Show child attributes
Show child attributes
Show child attributes
Show child attributes