API CodexAPI Codex
WebsiteDashboardGet API Key
  • Documentation
  • All APIs
  • Changelog
Resources
  • Docs Home
  • API Catalog
  • API Codex Website
Platform
  • Get a free API key
  • Dashboard
  • APIs & Pricing

© 2026 API Codex. All rights reserved.

Information
Other endpoints
    Validate & Format (query params)getValidate & Format (JSON body)post
Schemas
powered by Zudoku
Phone Number Validation & Formatting API
Phone Number Validation & Formatting API

Other endpoints


Validate & Format (query params)

GET
https://api.apicodex.io/phone
/v1/validate

Validate and format a phone number supplied via query parameters.

Provide number alone if it is already in international +E.164 form (e.g. +14155552671), or add a country hint (ISO 3166-1 alpha-2, e.g. US, GB, TR) to parse a local-format number such as (415) 555-2671.

The response is always well-formed: genuinely unparseable input returns { "valid": false, "possible": false } with HTTP 200. A 400 is returned only when the required number parameter is missing.

Validate & Format (query params) › query Parameters

number
​string · required

The phone number. May be E.164 (e.g. +14155552671) or a local format (e.g. (415) 555-2671) when a country is supplied.

Example: (415) 555-2671
country
​string

Optional ISO 3166-1 alpha-2 region used as the default country when the number is not in +E.164 form (e.g. US, GB, TR).

Example: US

Validate & Format (query params) › Responses

Validation result (well-formed even for invalid numbers)

oneOf
Exactly one variant must match.

Decision Table

VariantMatching Criteria
type = object · requires: input, valid, possible
type = object · requires: input, valid, possible
Properties for Variant 1:
Parsed result for a number that could be interpreted.
ValidResult
input
​string · required

The original number string as received.

Example: (415) 555-2671
valid
​boolean · required

Whether the number is fully valid for its detected region.

Example: true
possible
​boolean · required

Whether the number has a plausible length and shape for its region.

Example: true
e164
​string

Canonical international E.164 form.

Example: +14155552671
national
​string

Number formatted the way locals write it.

Example: (415) 555-2671
international
​string

Internationally formatted display form.

Example: +1 415 555 2671
rfc3966
​string

RFC3966 tel: URI.

Example: tel:+14155552671
uri
​string

tel: URI for click-to-call links.

Example: tel:+14155552671
country
​string | null

Detected ISO 3166-1 alpha-2 country code, or null.

Example: US
country_calling_code
​string

International dialing prefix without the plus sign.

Example: 1
type
​string | null

Line type (MOBILE, FIXED_LINE, FIXED_LINE_OR_MOBILE, etc.) or null.

Example: FIXED_LINE_OR_MOBILE
is_mobile
​boolean

Convenience flag derived from the line type.

Example: false
is_fixed_line
​boolean

Convenience flag derived from the line type.

Example: false
GET/v1/validate
curl 'https://api.apicodex.io/phone/v1/validate?number=<string>&apikey=<api-key>'
Example Responses
{ "input": "(415) 555-2671", "valid": true, "possible": true, "e164": "+14155552671", "national": "(415) 555-2671", "international": "+1 415 555 2671", "rfc3966": "tel:+14155552671", "uri": "tel:+14155552671", "country": "US", "country_calling_code": "1", "type": "FIXED_LINE_OR_MOBILE", "is_mobile": false, "is_fixed_line": false }
json
application/json

Validate & Format (JSON body)

POST
https://api.apicodex.io/phone
/v1/validate

Validate and format a phone number supplied via a JSON request body.

Provide number alone if it is already in international +E.164 form, or include a country hint (ISO 3166-1 alpha-2) to parse a local-format number.

Validate & Format (JSON body) › Request Body

number
​string · required

The phone number to validate and format.

Example: +442071838750
country
​string

Optional ISO 3166-1 alpha-2 region hint.

Example: GB

Validate & Format (JSON body) › Responses

Validation result

oneOf
Exactly one variant must match.

Decision Table

VariantMatching Criteria
type = object · requires: input, valid, possible
type = object · requires: input, valid, possible
Properties for Variant 1:
Parsed result for a number that could be interpreted.
ValidResult
input
​string · required

The original number string as received.

Example: (415) 555-2671
valid
​boolean · required

Whether the number is fully valid for its detected region.

Example: true
possible
​boolean · required

Whether the number has a plausible length and shape for its region.

Example: true
e164
​string

Canonical international E.164 form.

Example: +14155552671
national
​string

Number formatted the way locals write it.

Example: (415) 555-2671
international
​string

Internationally formatted display form.

Example: +1 415 555 2671
rfc3966
​string

RFC3966 tel: URI.

Example: tel:+14155552671
uri
​string

tel: URI for click-to-call links.

Example: tel:+14155552671
country
​string | null

Detected ISO 3166-1 alpha-2 country code, or null.

Example: US
country_calling_code
​string

International dialing prefix without the plus sign.

Example: 1
type
​string | null

Line type (MOBILE, FIXED_LINE, FIXED_LINE_OR_MOBILE, etc.) or null.

Example: FIXED_LINE_OR_MOBILE
is_mobile
​boolean

Convenience flag derived from the line type.

Example: false
is_fixed_line
​boolean

Convenience flag derived from the line type.

Example: false
POST/v1/validate
curl 'https://api.apicodex.io/phone/v1/validate?apikey=<api-key>' \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "number": "+442071838750" }'
Example Request Body
{ "number": "+442071838750" }
json
application/json
Example Responses
{ "input": "+442071838750", "valid": true, "possible": true, "e164": "+442071838750", "national": "020 7183 8750", "international": "+44 20 7183 8750", "rfc3966": "tel:+442071838750", "uri": "tel:+442071838750", "country": "GB", "country_calling_code": "44", "type": "FIXED_LINE", "is_mobile": false, "is_fixed_line": true }
json
application/json