Validate an address
POST/addresses/actions/validate
Validates an address for emergency services.
Request
- application/json
Body
required
Parameters that can be defined during address validation
street_address street_address (string)required
The primary street address information about the address.
extended_address extended_address (string)
Additional street address information about the address such as, but not limited to, unit number or apartment number.
locality locality (string)
The locality of the address. For US addresses, this corresponds to the city of the address.
administrative_area administrative_area (string)
The locality of the address. For US addresses, this corresponds to the state of the address.
postal_code postal_code (string)required
The postal code of the address.
country_code country_code (string)required
The two-character (ISO 3166-1 alpha-2) country code of the address.
Responses
200: Action response
- application/json
422: Bad request
Request samples
curl -L 'https://api.telnyx.com/v2/addresses/actions/validate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"street_address": "311 W Superior Street",
"extended_address": "#504",
"locality": "Chicago",
"administrative_area": "IL",
"postal_code": "60654",
"country_code": "US"
}'
Response samples
{
"data": {
"result": "valid",
"suggested": {
"street_address": "311 W Superior Street",
"extended_address": "#504",
"locality": "Chicago",
"administrative_area": "IL",
"postal_code": "60654",
"country_code": "US"
},
"record_type": "address_validation",
"errors": [
{
"title": "Invalid street address",
"source": {
"pointer": "/street_address"
},
"code": "20207",
"description": "The street address provided is invalid."
}
]
}
}