curl --request POST \
--url https://api.buildwithchirp.com/v1/organization/embedded-signup/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"redirect_uri": "https://example.com/whatsapp/callback",
"state": "abc123-csrf-token",
"metadata": {
"externalUserId": "user_123",
"businessName": "Acme Corp"
},
"prefill": {
"business": {
"name": "Acme Corp",
"email": "contact@acme.com",
"website": "https://acme.com",
"address": {
"streetAddress1": "123 Main St",
"city": "San Francisco",
"state": "CA",
"zipPostal": "94102",
"country": "US"
},
"phone": {
"code": 1,
"number": "4155551234"
},
"timezone": "America/Los_Angeles"
},
"phone": {
"displayName": "Acme Support",
"category": "Automotive",
"description": "Official Acme Corp WhatsApp support channel"
}
}
}
'import requests
url = "https://api.buildwithchirp.com/v1/organization/embedded-signup/sessions"
payload = {
"redirect_uri": "https://example.com/whatsapp/callback",
"state": "abc123-csrf-token",
"metadata": {
"externalUserId": "user_123",
"businessName": "Acme Corp"
},
"prefill": {
"business": {
"name": "Acme Corp",
"email": "contact@acme.com",
"website": "https://acme.com",
"address": {
"streetAddress1": "123 Main St",
"city": "San Francisco",
"state": "CA",
"zipPostal": "94102",
"country": "US"
},
"phone": {
"code": 1,
"number": "4155551234"
},
"timezone": "America/Los_Angeles"
},
"phone": {
"displayName": "Acme Support",
"category": "Automotive",
"description": "Official Acme Corp WhatsApp support channel"
}
}
}
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({
redirect_uri: 'https://example.com/whatsapp/callback',
state: 'abc123-csrf-token',
metadata: {externalUserId: 'user_123', businessName: 'Acme Corp'},
prefill: {
business: {
name: 'Acme Corp',
email: 'contact@acme.com',
website: 'https://acme.com',
address: {
streetAddress1: '123 Main St',
city: 'San Francisco',
state: 'CA',
zipPostal: '94102',
country: 'US'
},
phone: {code: 1, number: '4155551234'},
timezone: 'America/Los_Angeles'
},
phone: {
displayName: 'Acme Support',
category: 'Automotive',
description: 'Official Acme Corp WhatsApp support channel'
}
}
})
};
fetch('https://api.buildwithchirp.com/v1/organization/embedded-signup/sessions', 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/embedded-signup/sessions",
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([
'redirect_uri' => 'https://example.com/whatsapp/callback',
'state' => 'abc123-csrf-token',
'metadata' => [
'externalUserId' => 'user_123',
'businessName' => 'Acme Corp'
],
'prefill' => [
'business' => [
'name' => 'Acme Corp',
'email' => 'contact@acme.com',
'website' => 'https://acme.com',
'address' => [
'streetAddress1' => '123 Main St',
'city' => 'San Francisco',
'state' => 'CA',
'zipPostal' => '94102',
'country' => 'US'
],
'phone' => [
'code' => 1,
'number' => '4155551234'
],
'timezone' => 'America/Los_Angeles'
],
'phone' => [
'displayName' => 'Acme Support',
'category' => 'Automotive',
'description' => 'Official Acme Corp WhatsApp support channel'
]
]
]),
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/embedded-signup/sessions"
payload := strings.NewReader("{\n \"redirect_uri\": \"https://example.com/whatsapp/callback\",\n \"state\": \"abc123-csrf-token\",\n \"metadata\": {\n \"externalUserId\": \"user_123\",\n \"businessName\": \"Acme Corp\"\n },\n \"prefill\": {\n \"business\": {\n \"name\": \"Acme Corp\",\n \"email\": \"contact@acme.com\",\n \"website\": \"https://acme.com\",\n \"address\": {\n \"streetAddress1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zipPostal\": \"94102\",\n \"country\": \"US\"\n },\n \"phone\": {\n \"code\": 1,\n \"number\": \"4155551234\"\n },\n \"timezone\": \"America/Los_Angeles\"\n },\n \"phone\": {\n \"displayName\": \"Acme Support\",\n \"category\": \"Automotive\",\n \"description\": \"Official Acme Corp WhatsApp support channel\"\n }\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/embedded-signup/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"redirect_uri\": \"https://example.com/whatsapp/callback\",\n \"state\": \"abc123-csrf-token\",\n \"metadata\": {\n \"externalUserId\": \"user_123\",\n \"businessName\": \"Acme Corp\"\n },\n \"prefill\": {\n \"business\": {\n \"name\": \"Acme Corp\",\n \"email\": \"contact@acme.com\",\n \"website\": \"https://acme.com\",\n \"address\": {\n \"streetAddress1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zipPostal\": \"94102\",\n \"country\": \"US\"\n },\n \"phone\": {\n \"code\": 1,\n \"number\": \"4155551234\"\n },\n \"timezone\": \"America/Los_Angeles\"\n },\n \"phone\": {\n \"displayName\": \"Acme Support\",\n \"category\": \"Automotive\",\n \"description\": \"Official Acme Corp WhatsApp support channel\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buildwithchirp.com/v1/organization/embedded-signup/sessions")
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 \"redirect_uri\": \"https://example.com/whatsapp/callback\",\n \"state\": \"abc123-csrf-token\",\n \"metadata\": {\n \"externalUserId\": \"user_123\",\n \"businessName\": \"Acme Corp\"\n },\n \"prefill\": {\n \"business\": {\n \"name\": \"Acme Corp\",\n \"email\": \"contact@acme.com\",\n \"website\": \"https://acme.com\",\n \"address\": {\n \"streetAddress1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zipPostal\": \"94102\",\n \"country\": \"US\"\n },\n \"phone\": {\n \"code\": 1,\n \"number\": \"4155551234\"\n },\n \"timezone\": \"America/Los_Angeles\"\n },\n \"phone\": {\n \"displayName\": \"Acme Support\",\n \"category\": \"Automotive\",\n \"description\": \"Official Acme Corp WhatsApp support channel\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "wss_2DbBs7GWhGvVNJGrDXr5RG0mBWI",
"url": "https://dashboard.chirp.com/embed/connect?token=abc123...",
"expires_at": "2024-01-15T12:30:00.000Z"
}{
"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": {
"can_send_message": "AVAILABLE",
"entities": [
{
"entity_type": "PHONE_NUMBER",
"id": "<string>",
"can_send_message": "AVAILABLE",
"can_receive_call_sip": "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": {
"can_send_message": "AVAILABLE",
"entities": [
{
"entity_type": "PHONE_NUMBER",
"id": "<string>",
"can_send_message": "AVAILABLE",
"can_receive_call_sip": "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": {
"can_send_message": "AVAILABLE",
"entities": [
{
"entity_type": "PHONE_NUMBER",
"id": "<string>",
"can_send_message": "AVAILABLE",
"can_receive_call_sip": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}Create embedded signup session
Create a session for the embeddable WhatsApp Business signup flow. Returns a URL that expires in 15 minutes. Redirect your user to this URL to begin the signup process.
curl --request POST \
--url https://api.buildwithchirp.com/v1/organization/embedded-signup/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"redirect_uri": "https://example.com/whatsapp/callback",
"state": "abc123-csrf-token",
"metadata": {
"externalUserId": "user_123",
"businessName": "Acme Corp"
},
"prefill": {
"business": {
"name": "Acme Corp",
"email": "contact@acme.com",
"website": "https://acme.com",
"address": {
"streetAddress1": "123 Main St",
"city": "San Francisco",
"state": "CA",
"zipPostal": "94102",
"country": "US"
},
"phone": {
"code": 1,
"number": "4155551234"
},
"timezone": "America/Los_Angeles"
},
"phone": {
"displayName": "Acme Support",
"category": "Automotive",
"description": "Official Acme Corp WhatsApp support channel"
}
}
}
'import requests
url = "https://api.buildwithchirp.com/v1/organization/embedded-signup/sessions"
payload = {
"redirect_uri": "https://example.com/whatsapp/callback",
"state": "abc123-csrf-token",
"metadata": {
"externalUserId": "user_123",
"businessName": "Acme Corp"
},
"prefill": {
"business": {
"name": "Acme Corp",
"email": "contact@acme.com",
"website": "https://acme.com",
"address": {
"streetAddress1": "123 Main St",
"city": "San Francisco",
"state": "CA",
"zipPostal": "94102",
"country": "US"
},
"phone": {
"code": 1,
"number": "4155551234"
},
"timezone": "America/Los_Angeles"
},
"phone": {
"displayName": "Acme Support",
"category": "Automotive",
"description": "Official Acme Corp WhatsApp support channel"
}
}
}
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({
redirect_uri: 'https://example.com/whatsapp/callback',
state: 'abc123-csrf-token',
metadata: {externalUserId: 'user_123', businessName: 'Acme Corp'},
prefill: {
business: {
name: 'Acme Corp',
email: 'contact@acme.com',
website: 'https://acme.com',
address: {
streetAddress1: '123 Main St',
city: 'San Francisco',
state: 'CA',
zipPostal: '94102',
country: 'US'
},
phone: {code: 1, number: '4155551234'},
timezone: 'America/Los_Angeles'
},
phone: {
displayName: 'Acme Support',
category: 'Automotive',
description: 'Official Acme Corp WhatsApp support channel'
}
}
})
};
fetch('https://api.buildwithchirp.com/v1/organization/embedded-signup/sessions', 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/embedded-signup/sessions",
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([
'redirect_uri' => 'https://example.com/whatsapp/callback',
'state' => 'abc123-csrf-token',
'metadata' => [
'externalUserId' => 'user_123',
'businessName' => 'Acme Corp'
],
'prefill' => [
'business' => [
'name' => 'Acme Corp',
'email' => 'contact@acme.com',
'website' => 'https://acme.com',
'address' => [
'streetAddress1' => '123 Main St',
'city' => 'San Francisco',
'state' => 'CA',
'zipPostal' => '94102',
'country' => 'US'
],
'phone' => [
'code' => 1,
'number' => '4155551234'
],
'timezone' => 'America/Los_Angeles'
],
'phone' => [
'displayName' => 'Acme Support',
'category' => 'Automotive',
'description' => 'Official Acme Corp WhatsApp support channel'
]
]
]),
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/embedded-signup/sessions"
payload := strings.NewReader("{\n \"redirect_uri\": \"https://example.com/whatsapp/callback\",\n \"state\": \"abc123-csrf-token\",\n \"metadata\": {\n \"externalUserId\": \"user_123\",\n \"businessName\": \"Acme Corp\"\n },\n \"prefill\": {\n \"business\": {\n \"name\": \"Acme Corp\",\n \"email\": \"contact@acme.com\",\n \"website\": \"https://acme.com\",\n \"address\": {\n \"streetAddress1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zipPostal\": \"94102\",\n \"country\": \"US\"\n },\n \"phone\": {\n \"code\": 1,\n \"number\": \"4155551234\"\n },\n \"timezone\": \"America/Los_Angeles\"\n },\n \"phone\": {\n \"displayName\": \"Acme Support\",\n \"category\": \"Automotive\",\n \"description\": \"Official Acme Corp WhatsApp support channel\"\n }\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/embedded-signup/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"redirect_uri\": \"https://example.com/whatsapp/callback\",\n \"state\": \"abc123-csrf-token\",\n \"metadata\": {\n \"externalUserId\": \"user_123\",\n \"businessName\": \"Acme Corp\"\n },\n \"prefill\": {\n \"business\": {\n \"name\": \"Acme Corp\",\n \"email\": \"contact@acme.com\",\n \"website\": \"https://acme.com\",\n \"address\": {\n \"streetAddress1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zipPostal\": \"94102\",\n \"country\": \"US\"\n },\n \"phone\": {\n \"code\": 1,\n \"number\": \"4155551234\"\n },\n \"timezone\": \"America/Los_Angeles\"\n },\n \"phone\": {\n \"displayName\": \"Acme Support\",\n \"category\": \"Automotive\",\n \"description\": \"Official Acme Corp WhatsApp support channel\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buildwithchirp.com/v1/organization/embedded-signup/sessions")
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 \"redirect_uri\": \"https://example.com/whatsapp/callback\",\n \"state\": \"abc123-csrf-token\",\n \"metadata\": {\n \"externalUserId\": \"user_123\",\n \"businessName\": \"Acme Corp\"\n },\n \"prefill\": {\n \"business\": {\n \"name\": \"Acme Corp\",\n \"email\": \"contact@acme.com\",\n \"website\": \"https://acme.com\",\n \"address\": {\n \"streetAddress1\": \"123 Main St\",\n \"city\": \"San Francisco\",\n \"state\": \"CA\",\n \"zipPostal\": \"94102\",\n \"country\": \"US\"\n },\n \"phone\": {\n \"code\": 1,\n \"number\": \"4155551234\"\n },\n \"timezone\": \"America/Los_Angeles\"\n },\n \"phone\": {\n \"displayName\": \"Acme Support\",\n \"category\": \"Automotive\",\n \"description\": \"Official Acme Corp WhatsApp support channel\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "wss_2DbBs7GWhGvVNJGrDXr5RG0mBWI",
"url": "https://dashboard.chirp.com/embed/connect?token=abc123...",
"expires_at": "2024-01-15T12:30:00.000Z"
}{
"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": {
"can_send_message": "AVAILABLE",
"entities": [
{
"entity_type": "PHONE_NUMBER",
"id": "<string>",
"can_send_message": "AVAILABLE",
"can_receive_call_sip": "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": {
"can_send_message": "AVAILABLE",
"entities": [
{
"entity_type": "PHONE_NUMBER",
"id": "<string>",
"can_send_message": "AVAILABLE",
"can_receive_call_sip": "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": {
"can_send_message": "AVAILABLE",
"entities": [
{
"entity_type": "PHONE_NUMBER",
"id": "<string>",
"can_send_message": "AVAILABLE",
"can_receive_call_sip": "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 URL to redirect the user to after completing or failing the signup. Required for redirect flow, optional for popup flow.
1"https://example.com/whatsapp/callback"
A CSRF protection token that will be returned unchanged in the redirect. Required for redirect flow.
1 - 512"abc123-csrf-token"
Developer-provided metadata for filtering sessions by internal user IDs. Useful for platforms with multiple end-users. Maximum size: 10KB.
Show child attributes
Show child attributes
{
"externalUserId": "user_123",
"businessName": "Acme Corp"
}
Pre-fill configuration for Facebook Embedded Signup. Auto-populates business information in the signup form. This can improve conversion by reducing manual data entry.
Show child attributes
Show child attributes
{
"business": {
"name": "Acme Corp",
"email": "contact@acme.com",
"website": "https://acme.com",
"address": {
"streetAddress1": "123 Main St",
"city": "San Francisco",
"state": "CA",
"zipPostal": "94102",
"country": "US"
},
"phone": { "code": 1, "number": "4155551234" },
"timezone": "America/Los_Angeles"
},
"phone": {
"displayName": "Acme Support",
"category": "Automotive",
"description": "Official Acme Corp WhatsApp support channel"
}
}
Response
Session created successfully
WhatsApp Signup Session ID
^wss_[a-zA-Z0-9]+$"wss_2DbBs7GWhGvVNJGrDXr5RG0mBWI"
The URL to redirect the user to for completing the WhatsApp Business signup
"https://dashboard.chirp.com/embed/connect?token=abc123..."
When this session URL expires (15 minutes from creation)
"2024-01-15T12:30:00.000Z"