Skip to main content
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.

Headers

HeaderValue
AuthorizationBearer apitk_...
Content-Typeapplication/json
Acceptapplication/json

Path parameters

subdomain
string
required
Your workspace subdomain.

Body parameters

phone_number
string
required
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

200 OK
{
  "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

200 OK
{
  "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

StatusWhenExample body
401Missing / invalid token{"status":"error","message":"Invalid API token"}
403Missing ability{"status":"error","message":"Token does not have the required ability: messages.send"}
422Validation{"status":"error","message":"Validation failed","errors":{"phone_number":["The phone number field is required."]}}
429Rate limit{"message":"Too many requests","retry_after":45}
500Server error{"status":"error","message":"Failed to validate phone number"}