Addresses

Creates an address

Changed on

Creates a new address on your account from the provided details, for use with services that require a physical address such as emergency calling and regulatory compliance.

By default, the new record is validated for emergency use at creation time. If the address fails validation, no record is created and the request is rejected with a 422 response; the errors array includes a suggested value for each offending field when one is available.

Set validate_address to false to skip validation at creation, for example when the address was already validated with the Validate an address action. The record is then created without emergency validation: if it is not valid it will not be able to be used for emergency services (such as a phone number's emergency address), and because address records cannot be updated, a new record has to be created to correct it.

post/addresses

Request

  • Base URL: https://api.telnyx.com/v2
  • URL: https://api.telnyx.com/v2/addresses
  • Auth: HTTP bearer

Request body

customer_referencestring

A customer reference string for customer look ups.

first_namestring required

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

last_namestring required

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

business_namestring required

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

phone_numberstring

The phone number associated with the address.

street_addressstring required

The primary street address information about the address.

extended_addressstring

Additional street address information about the address such as, but not limited to, unit number or apartment number.

localitystring required

The locality of the address. For US addresses, this corresponds to the city of the address.

administrative_areastring

The locality of the address. For US addresses, this corresponds to the state of the address.

neighborhoodstring

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

boroughstring

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

postal_codestring

The postal code of the address.

country_codestring required

The two-character (ISO 3166-1 alpha-2) country code of the address.

address_bookboolean

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

validate_addressboolean

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. In an address record, this flag indicates whether emergency validation was performed at creation: true means the record passed emergency validation before it was created; false means validation was skipped during this creation request, and the address may have been validated separately. This flag is not a current validity status; emergency use still requires a valid address.

Example request

{
  "customer_reference": "MY REF 001",
  "first_name": "Alfred",
  "last_name": "Foster",
  "business_name": "Toy-O'Kon",
  "phone_number": "+12125559000",
  "street_address": "600 Congress Avenue",
  "extended_address": "14th Floor",
  "locality": "Austin",
  "administrative_area": "TX",
  "neighborhood": "Ciudad de los deportes",
  "borough": "Guadalajara",
  "postal_code": "78701",
  "country_code": "US",
  "validate_address": true
}

Response

Successful response. validate_address on the returned record indicates whether it was validated for emergency use at creation: created with the default true, the record passed emergency validation; created with false, validation was skipped during this creation request, and the address may have been validated separately. This flag is not a current validity status; emergency use still requires a valid address.

Example response

{
  "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": "600 Congress Avenue",
    "extended_address": "14th Floor",
    "locality": "Austin",
    "administrative_area": "TX",
    "neighborhood": "Ciudad de los deportes",
    "borough": "Guadalajara",
    "postal_code": "78701",
    "country_code": "US",
    "validate_address": true,
    "created_at": "2018-02-02T22:25:27.521Z",
    "updated_at": "2018-02-02T22:25:27.521Z"
  }
}

Changes