> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate an address

> Validates an address for emergency services.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/account-billing/addresses.yml post /addresses/actions/validate
openapi: 3.1.0
info:
  title: Telnyx Addresses API
  version: 2.0.0
  description: API for Addresses.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /addresses/actions/validate:
    post:
      tags:
        - Addresses
      summary: Validate an address
      description: Validates an address for emergency services.
      operationId: ValidateAddress
      parameters: []
      requestBody:
        description: Parameters that can be defined during address validation
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateAddressRequest'
      responses:
        '200':
          $ref: '#/components/responses/ValidateAddressResponse'
        '422':
          description: Bad request
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.addresses.actions.validate({
              country_code: 'US',
              postal_code: '78701',
              street_address: '600 Congress Avenue',
            });

            console.log(response.data);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            response = client.addresses.actions.validate(
                country_code="US",
                postal_code="78701",
                street_address="600 Congress Avenue",
            )
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Addresses.Actions.Validate(context.TODO(), telnyx.AddressActionValidateParams{\n\t\tCountryCode:   \"US\",\n\t\tPostalCode:    \"78701\",\n\t\tStreetAddress: \"600 Congress Avenue\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
        - lang: Java
          source: >-
            package com.telnyx.sdk.example;


            import com.telnyx.sdk.client.TelnyxClient;

            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            import com.telnyx.sdk.models.addresses.actions.ActionValidateParams;

            import
            com.telnyx.sdk.models.addresses.actions.ActionValidateResponse;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    ActionValidateParams params = ActionValidateParams.builder()
                        .countryCode("US")
                        .postalCode("78701")
                        .streetAddress("600 Congress Avenue")
                        .build();
                    ActionValidateResponse response = client.addresses().actions().validate(params);
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            response = telnyx.addresses.actions.validate(
              country_code: "US",
              postal_code: "78701",
              street_address: "600 Congress Avenue"
            )

            puts(response)
        - lang: CLI
          source: |-
            telnyx addresses:actions validate \
              --api-key 'My API Key' \
              --country-code US \
              --postal-code 78701 \
              --street-address '600 Congress Avenue'
components:
  schemas:
    ValidateAddressRequest:
      type: object
      required:
        - country_code
        - street_address
        - postal_code
      properties:
        street_address:
          $ref: '#/components/schemas/street_address'
        extended_address:
          $ref: '#/components/schemas/extended_address'
        locality:
          $ref: '#/components/schemas/locality'
        administrative_area:
          $ref: '#/components/schemas/administrative_area'
        postal_code:
          $ref: '#/components/schemas/postal_code'
        country_code:
          $ref: '#/components/schemas/country_code'
    street_address:
      type: string
      description: The primary street address information about the address.
      example: 600 Congress Avenue
    extended_address:
      type: string
      description: >-
        Additional street address information about the address such as, but not
        limited to, unit number or apartment number.
      example: 14th Floor
    locality:
      type: string
      description: >-
        The locality of the address. For US addresses, this corresponds to the
        city of the address.
      example: Austin
    administrative_area:
      type: string
      description: >-
        The locality of the address. For US addresses, this corresponds to the
        state of the address.
      example: TX
    postal_code:
      type: string
      description: The postal code of the address.
      example: '78701'
    country_code:
      type: string
      description: The two-character (ISO 3166-1 alpha-2) country code of the address.
      example: US
    ValidateAddressResult:
      type: object
      title: Validate address action result
      properties:
        result:
          type: string
          description: Indicates whether an address is valid or invalid.
          enum:
            - valid
            - invalid
          example: valid
        suggested:
          $ref: '#/components/schemas/ValidateAddressField'
          type: object
          description: Provides normalized address when available.
          additionalProperties: true
        record_type:
          type: string
          description: Identifies the type of the resource.
          example: address_validation
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
      required:
        - result
        - suggested
    ValidateAddressField:
      type: object
      properties:
        street_address:
          $ref: '#/components/schemas/street_address'
        extended_address:
          $ref: '#/components/schemas/extended_address'
        locality:
          $ref: '#/components/schemas/locality'
        administrative_area:
          $ref: '#/components/schemas/administrative_area'
        postal_code:
          $ref: '#/components/schemas/postal_code'
        country_code:
          $ref: '#/components/schemas/country_code'
    Error:
      required:
        - code
        - title
      properties:
        code:
          type: string
          x-format: int64
        title:
          type: string
        description:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
              format: json-pointer
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
          additionalProperties: true
      example:
        title: Invalid street address
        source:
          pointer: /street_address
        code: '20207'
        description: The street address provided is invalid.
      type: object
  responses:
    ValidateAddressResponse:
      description: Action response
      content:
        application/json:
          schema:
            type: object
            title: Validate address action response
            properties:
              data:
                $ref: '#/components/schemas/ValidateAddressResult'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````