Validate a phone number format and return parsed country/national parts. This endpoint checks format only. It does not verify whether the number is registered on WhatsApp.
To verify WhatsApp registration, send a template message and inspect the response — there is no format-level way to check registration.
Endpoint
POST /api/v1/{subdomain}/phone/validate
Required ability: messages.send.
| Header | Value |
|---|
Authorization | Bearer apitk_... |
Content-Type | application/json |
Accept | application/json |
Path parameters
Your workspace subdomain.
Body parameters
Phone number to validate. E.164 format recommended.
Example request
curl -X POST https://dash.xobito.com/api/v1/acme/phone/validate \
-H "Authorization: Bearer apitk_your_token_here" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"phone_number": "+919909919284"}'
Example response — valid
{
"status": "success",
"message": "Phone number format is valid",
"data": {
"phone": "+919909919284",
"phone_digits": "919909919284",
"format_valid": true,
"country_code": "91",
"country": "India",
"national_number": "9909919284",
"e164": "+919909919284",
"reason": null,
"note": "Format validation only. To verify WhatsApp registration, send a template message and check response."
}
}
Example response — invalid
{
"status": "success",
"message": "Phone number format is invalid",
"data": {
"phone": "+00000",
"phone_digits": "00000",
"format_valid": false,
"country_code": null,
"country": null,
"national_number": null,
"e164": null,
"reason": "Number is too short to be valid",
"note": "Format validation only. To verify WhatsApp registration, send a template message and check response."
}
}
See Data Types → Phone validation response.
Error responses
| Status | When | Example body |
|---|
401 | Missing / invalid token | {"status":"error","message":"Invalid API token"} |
403 | Missing ability | {"status":"error","message":"Token does not have the required ability: messages.send"} |
422 | Validation | {"status":"error","message":"Validation failed","errors":{"phone_number":["The phone number field is required."]}} |
429 | Rate limit | {"message":"Too many requests","retry_after":45} |
500 | Server error | {"status":"error","message":"Failed to validate phone number"} |