Request a phone number verification code
curl --request POST \
--url https://api.social-api.ai/v1/platforms/whatsapp/phone-numbers/{id}/request-code \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"language": "en_US",
"method": "SMS"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({language: 'en_US', method: 'SMS'})
};
fetch('https://api.social-api.ai/v1/platforms/whatsapp/phone-numbers/{id}/request-code', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.social-api.ai/v1/platforms/whatsapp/phone-numbers/{id}/request-code"
payload = {
"language": "en_US",
"method": "SMS"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}WhatsApp
Request a phone number verification code
Asks WhatsApp to send a one-time verification code to the phone number via SMS or voice call. The code is delivered to the underlying phone line, not to the API caller; follow up with verify-code once the user receives it. Step 1 of the phone-number registration flow (request-code, verify-code, register).
POST
/
platforms
/
whatsapp
/
phone-numbers
/
{id}
/
request-code
Request a phone number verification code
curl --request POST \
--url https://api.social-api.ai/v1/platforms/whatsapp/phone-numbers/{id}/request-code \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"language": "en_US",
"method": "SMS"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({language: 'en_US', method: 'SMS'})
};
fetch('https://api.social-api.ai/v1/platforms/whatsapp/phone-numbers/{id}/request-code', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.social-api.ai/v1/platforms/whatsapp/phone-numbers/{id}/request-code"
payload = {
"language": "en_US",
"method": "SMS"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}Authorizations
Prefix your API key with "Bearer ". Example: Authorization: Bearer sapi_key_...
Path Parameters
Connected account ID (sapi_acc_...)
Body
application/json
Verification channel and locale
Response
Code dispatched