> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# create

> Create a new regulatory address.

Create a new regulatory address.

### Schema

```yaml
openapi: 3.1.0
info:
  title: API
  version: 1.0.0
paths:
  /api/relay/rest/addresses:
    post:
      operationId: create_address
      summary: Create E911 address
      description: >-
        To create a new Address, make a POST request to the Address resource.


        When `emergency_enabled=true` and the address is in the US (`country` =
        `US`), the address is validated against the carrier. A valid or
        auto-corrected address is stored (`validated: true`). An address the
        carrier cannot validate — or a correctable address when
        `auto_correct_address=false` — is rejected with a `422` whose body
        includes an `errors` array and a `candidates` array of suggested
        addresses (each with `street_number`, `street_name`, `city`, `state`,
        `postal_code`). Carrier validation applies to US addresses only: a
        non-US address is stored normally, with `emergency_enabled` returned as
        `false`. Requests without `emergency_enabled` are stored without carrier
        validation.


        #### Permissions


        The API token used to authenticate must have the following scope(s)
        enabled to make a successful request: _Numbers_.


        [Learn more about API scopes](/docs/platform/your-signalwire-api-space).
      tags:
        - subpackage_e911Addresses
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddressResponse'
        '401':
          description: Access is unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
        '422':
          description: >-
            The request failed validation. See `errors` for details. When
            carrier validation rejected the address

            and the carrier returned alternatives, a `candidates` array is
            included alongside `errors`; the key is

            omitted when the carrier returned none.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddressValidationError'
        '500':
          description: An internal server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode500'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAddressRequest'
servers:
  - url: https://%7BYour_Space_Name%7D.signalwire.com
    description: SignalWire API
components:
  schemas:
    AddressType:
      type: string
      enum:
        - Apartment
        - Basement
        - Building
        - Department
        - Floor
        - Office
        - Penthouse
        - Suite
        - Trailer
        - Unit
      description: Address type for sub-addresses.
      title: AddressType
    CreateAddressRequest:
      type: object
      properties:
        label:
          type: string
          description: >-
            A friendly name given to the address to help distinguish and search
            for different addresses within your project. When the address is
            assigned to a phone number for E911, this label is also sent to the
            carrier as the caller name. The emergency network limits that field
            to 32 characters, so longer labels are truncated to the first 32
            characters before being sent. Truncation affects only the name shown
            to the dispatcher, never the address used to route the call.
        country:
          type: string
          description: The ISO 3166 Alpha 2 country code.
        first_name:
          type: string
          description: First name of the occupant associated with this address.
        last_name:
          type: string
          description: Last name of the occupant associated with this address.
        street_number:
          type: string
          description: The number portion of the street address.
        street_name:
          type: string
          description: The name portion of the street address.
        address_type:
          $ref: '#/components/schemas/AddressType'
          description: >-
            If the address is divided into multiple sub-addresses, this
            identifies how the address is divided. Possible values are:
            Apartment, Basement, Building, Department, Floor, Office, Penthouse,
            Suite, Trailer, Unit.
        address_number:
          type: string
          description: >-
            If the address is divided into multiple sub-addresses, this
            identifies the particular sub-address.
        city:
          type: string
          description: The city portion of the street address.
        state:
          type: string
          description: >-
            The state/province/region of the street address. In the USA and
            Canada, use the two-letter abbreviated form.
        postal_code:
          type: string
          description: The postal code of the street address.
        emergency_enabled:
          type: boolean
          default: false
          description: >-
            Applies to US addresses only. When `true` and `country` is `US`, the
            address is validated against

            the carrier before it is stored. For any other `country` the flag is
            ignored and the response

            returns `emergency_enabled: false`. Defaults to `false`, which
            stores the address without carrier

            validation.
        auto_correct_address:
          type: boolean
          default: true
          description: >-
            When the carrier suggests a corrected version of the address, `true`
            (the default) stores the corrected address; `false` rejects the
            request with the suggestion returned as candidates.
      required:
        - label
        - country
        - first_name
        - last_name
        - street_number
        - street_name
        - city
        - state
        - postal_code
      description: Request body for creating an address.
      title: CreateAddressRequest
    uuid:
      type: string
      format: uuid
      description: Universal Unique Identifier.
      title: uuid
    AddressResponse:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/uuid'
          description: The unique identifier of the Address on SignalWire.
        label:
          type: string
          description: >-
            A friendly name given to the address to help distinguish and search
            for different addresses within your project.
        country:
          type: string
          description: The ISO 3166 Alpha 2 country code.
        first_name:
          type: string
          description: First name of the occupant associated with this address.
        last_name:
          type: string
          description: Last name of the occupant associated with this address.
        street_number:
          type: string
          description: The number portion of the street address.
        street_name:
          type: string
          description: The name portion of the street address.
        address_type:
          oneOf:
            - $ref: '#/components/schemas/AddressType'
            - type: 'null'
          description: >-
            If the address is divided into multiple sub-addresses, this
            identifies how the address is divided.
        address_number:
          type:
            - string
            - 'null'
          description: >-
            If the address is divided into multiple sub-addresses, this
            identifies the particular sub-address.
        city:
          type: string
          description: The city portion of the street address.
        state:
          type: string
          description: >-
            The state/province/region of the street address. In the USA and
            Canada, use the two-letter abbreviated form.
        postal_code:
          type: string
          description: The postal code of the street address.
        zip_code:
          type: string
          description: >-
            The postal code of the street address. Alias for postal_code for
            backwards compatibility.
        emergency_enabled:
          type: boolean
          description: >-
            Whether E911 emergency calling is enabled for this address
            (carrier-validated when created/updated with
            `emergency_enabled=true` for a US address).
        validated:
          type: boolean
          description: >-
            Whether the address was validated by the carrier (true when the
            carrier returned a valid or auto-corrected match).
        validated_at:
          type:
            - string
            - 'null'
          description: >-
            The RFC 3339 / ISO 8601 timestamp of the last successful carrier
            validation, or null if never validated.
      required:
        - id
        - label
        - country
        - first_name
        - last_name
        - street_number
        - street_name
        - address_type
        - address_number
        - city
        - state
        - postal_code
        - zip_code
        - emergency_enabled
        - validated
        - validated_at
      description: Response containing a single address.
      title: AddressResponse
    TypesStatusCodesStatusCode401Error:
      type: string
      enum:
        - Unauthorized
      title: TypesStatusCodesStatusCode401Error
    Types.StatusCodes.StatusCode401:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode401Error'
      required:
        - error
      description: Access is unauthorized.
      title: Types.StatusCodes.StatusCode401
    Types.StatusCodes.SpaceApiErrorItem:
      type: object
      properties:
        detail:
          type: string
          description: A description of what caused the error.
        status:
          type: string
          description: The HTTP status code.
        title:
          type: string
          description: A short summary of the error type.
        code:
          type: string
          description: The error code.
      required:
        - detail
        - status
        - title
        - code
      description: Details about a specific validation error.
      title: Types.StatusCodes.SpaceApiErrorItem
    AddressCandidate:
      type: object
      properties:
        street_number:
          type:
            - string
            - 'null'
          description: The number portion of the suggested street address.
        street_name:
          type:
            - string
            - 'null'
          description: The name portion of the suggested street address.
        city:
          type:
            - string
            - 'null'
          description: The city portion of the suggested street address.
        state:
          type:
            - string
            - 'null'
          description: The state of the suggested street address.
        postal_code:
          type:
            - string
            - 'null'
          description: The postal code of the suggested street address.
      required:
        - street_number
        - street_name
        - city
        - state
        - postal_code
      description: A carrier-suggested alternative to the submitted address.
      title: AddressCandidate
    AddressValidationError:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Types.StatusCodes.SpaceApiErrorItem'
          description: List of validation errors.
        candidates:
          type: array
          items:
            $ref: '#/components/schemas/AddressCandidate'
          description: >-
            Alternative addresses suggested by the carrier. Omitted when the
            carrier returned no alternatives.
      required:
        - errors
      description: >-
        The request failed validation. See `errors` for details. When carrier
        validation rejected the address

        and the carrier returned alternatives, a `candidates` array is included
        alongside `errors`; the key is

        omitted when the carrier returned none.
      title: AddressValidationError
    TypesStatusCodesStatusCode500Error:
      type: string
      enum:
        - Internal Server Error
      title: TypesStatusCodesStatusCode500Error
    Types.StatusCodes.StatusCode500:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode500Error'
      required:
        - error
      description: An internal server error occurred.
      title: Types.StatusCodes.StatusCode500

```

## **Response Example**

### Response (200)

```json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "label": "My Address",
  "country": "US",
  "first_name": "Emmett",
  "last_name": "Brown",
  "street_number": "1640",
  "street_name": "Riverside Drive",
  "address_type": "Apartment",
  "address_number": "42",
  "city": "Alexandria",
  "state": "CA",
  "postal_code": "91905",
  "zip_code": "91905",
  "emergency_enabled": false,
  "validated": false,
  "validated_at": null
}
```

## **Example**

```typescript {9}
import { RestClient } from "@signalwire/sdk";

const client = new RestClient({
  project: "your-project-id",
  token: "your-api-token",
  host: "your-space.signalwire.com"
});

const addr = await client.addresses.create({
    label: "HQ Address",
    first_name: "Jane",
    last_name: "Doe",
    street_number: "123",
    street_name: "Main St",
    city: "Austin",
    state: "TX",
    postal_code: "78701",
    country: "US",
});
console.log("Created address:", addr.id);
```