Skip to main content
POST
/
addresses
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: 'My API Key',
});

const address = await client.addresses.create({
  business_name: "Toy-O'Kon",
  country_code: 'US',
  first_name: 'Alfred',
  last_name: 'Foster',
  locality: 'Austin',
  street_address: '600 Congress Avenue',
});

console.log(address.data);
{
  "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",
    "address_book": false,
    "validate_address": true,
    "created_at": "2018-02-02T22:25:27.521Z",
    "updated_at": "2018-02-02T22:25:27.521Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Parameters that can be defined during address creation

first_name
string
required

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

Example:

"Alfred"

last_name
string
required

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

Example:

"Foster"

business_name
string
required

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

Example:

"Toy-O'Kon"

street_address
string
required

The primary street address information about the address.

Example:

"600 Congress Avenue"

locality
string
required

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

Example:

"Austin"

country_code
string
required

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

Example:

"US"

customer_reference
string

A customer reference string for customer look ups.

Example:

"MY REF 001"

phone_number
string

The phone number associated with the address.

Example:

"+12125559000"

extended_address
string

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

Example:

"14th Floor"

administrative_area
string

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

Example:

"TX"

neighborhood
string

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

Example:

"Ciudad de los deportes"

borough
string

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

Example:

"Guadalajara"

postal_code
string

The postal code of the address.

Example:

"78701"

address_book
boolean
default:true

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

Example:

false

validate_address
boolean
default: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.

Example:

true

Response

Successful response

data
object