Skip to main content

Creates an address

POST 
/addresses

Creates an address.

Request

Body

required

Parameters that can be defined during address creation

    customer_reference customer_reference (string)

    A customer reference string for customer look ups.

    first_name first_name (string)required

    The first name associated with the address. An address must have either a first last name or a business name.

    last_name last_name (string)required

    The last name associated with the address. An address must have either a first last name or a business name.

    business_name business_name (string)required

    The business name associated with the address. An address must have either a first last name or a business name.

    phone_number phone_number (string)

    The phone number associated with the address.

    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)required

    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.

    neighborhood neighborhood (string)

    The neighborhood of the address. This field is not used for addresses in the US but is used for some international addresses.

    borough borough (string)

    The borough of the address. This field is not used for addresses in the US but is used for some international addresses.

    postal_code postal_code (string)

    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.

    address_book address_book (boolean)

    Default value: true

    Indicates whether or not the address should be considered part of your list of addresses that appear for regular use.

    validate_address validate_address (boolean)

    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

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"
}
}