Creates an address
POST/addresses
Creates an address.
Request
- application/json
Body
required
Parameters that can be defined during address creation
A customer reference string for customer look ups.
The first name associated with the address. An address must have either a first last name or a business name.
The last name associated with the address. An address must have either a first last name or a business name.
The business name associated with the address. An address must have either a first last name or a business name.
The phone number associated with the address.
The primary street address information about the address.
Additional street address information about the address such as, but not limited to, unit number or apartment number.
The locality of the address. For US addresses, this corresponds to the city of the address.
The locality of the address. For US addresses, this corresponds to the state of the address.
The neighborhood of the address. This field is not used for addresses in the US but is used for some international addresses.
The borough of the address. This field is not used for addresses in the US but is used for some international addresses.
The postal code of the address.
The two-character (ISO 3166-1 alpha-2) country code of the address.
Default value: true
Indicates whether or not the address should be considered part of your list of addresses that appear for regular use.
Default value: true
Indicates whether or not the address should be validated for emergency use upon creation or not. This should be left with the default value of true
unless you have used the /addresses/actions/validate
endpoint to validate the address separately prior to creation. If an address is not validated for emergency use upon creation and it is not valid, it will not be able to be used for emergency services.
Responses
200: Successful response
- application/json
422: Bad request
Request samples
curl -L 'https://api.telnyx.com/v2/addresses' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"customer_reference": "MY REF 001",
"first_name": "Alfred",
"last_name": "Foster",
"business_name": "Toy-O'\''Kon",
"phone_number": "+12125559000",
"street_address": "311 W Superior Street",
"extended_address": "#504",
"locality": "Chicago",
"administrative_area": "IL",
"neighborhood": "Ciudad de los deportes",
"borough": "Guadalajara",
"postal_code": "60654",
"country_code": "US",
"address_book": false,
"validate_address": true
}'
Response samples
{
"data": {
"id": "1293384261075731499",
"record_type": "address",
"customer_reference": "MY REF 001",
"first_name": "Alfred",
"last_name": "Foster",
"business_name": "Toy-O'Kon",
"phone_number": "+12125559000",
"street_address": "311 W Superior Street",
"extended_address": "#504",
"locality": "Chicago",
"administrative_area": "IL",
"neighborhood": "Ciudad de los deportes",
"borough": "Guadalajara",
"postal_code": "60654",
"country_code": "US",
"address_book": false,
"validate_address": true,
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z"
}
}