> ## 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.

# Update a location's static emergency address



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/real-time-communications/external-connects.yml patch /external_connections/{id}/locations/{location_id}
openapi: 3.1.0
info:
  title: Telnyx External Connects API
  version: 2.0.0
  description: API for External connects.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /external_connections/{id}/locations/{location_id}:
    patch:
      tags:
        - External Connections
      summary: Update a location's static emergency address
      operationId: updateLocation
      parameters:
        - name: id
          in: path
          required: true
          description: The ID of the external connection
          schema:
            type: string
            format: uuid
        - name: location_id
          in: path
          required: true
          description: The ID of the location to update
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                static_emergency_address_id:
                  type: string
                  format: uuid
                  description: >-
                    A new static emergency address ID to update the location
                    with
              required:
                - static_emergency_address_id
      responses:
        '200':
          description: Location successfully updated with no associated orders to process
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationResponse'
        '202':
          description: Location update accepted; associated orders being processed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationResponse'
        '404':
          description: Location or external connection not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            Unprocessable Entity - Location already has an accepted emergency
            address
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      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.externalConnections.updateLocation(
              '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
              {
                id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
                static_emergency_address_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
              },
            );

            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.external_connections.update_location(
                location_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                static_emergency_address_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            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.ExternalConnections.UpdateLocation(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\ttelnyx.ExternalConnectionUpdateLocationParams{\n\t\t\tID:                       \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\t\tStaticEmergencyAddressID: \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\t},\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.externalconnections.ExternalConnectionUpdateLocationParams;

            import
            com.telnyx.sdk.models.externalconnections.ExternalConnectionUpdateLocationResponse;


            public final class Main {
                private Main() {}

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

                    ExternalConnectionUpdateLocationParams params = ExternalConnectionUpdateLocationParams.builder()
                        .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                        .locationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                        .staticEmergencyAddressId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                        .build();
                    ExternalConnectionUpdateLocationResponse response = client.externalConnections().updateLocation(params);
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            response = telnyx.external_connections.update_location(
              "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              static_emergency_address_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
            )

            puts(response)
        - lang: CLI
          source: |-
            telnyx external-connections update-location \
              --api-key 'My API Key' \
              --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --location-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --static-emergency-address-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
components:
  schemas:
    LocationResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            location_id:
              type: string
              format: uuid
            static_emergency_address_id:
              type: string
              format: uuid
            accepted_address_suggestions:
              type: boolean
    ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              detail:
                type: string
              meta:
                type: object
                properties:
                  url:
                    type: string
                    format: uri
              title:
                type: string
              source:
                type: object
                properties:
                  pointer:
                    type: string
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````