> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # Update E911 address PUT https://%7BYour_Space_Name%7D.signalwire.com/api/relay/rest/addresses/{id} Content-Type: application/json Changes a physical E911 service location and performs carrier validation when requested. Assigning the updated location to a phone number remains a separate [phone-number operation](/docs/apis/rest/e-911-addresses/assign-e-911-address). 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). Reference: https://signalwire.com/docs/apis/rest/e-911-addresses/update-address ## Authentication - `Authorization` header (basic auth, required) — SignalWire Basic Authentication using Project ID and API Token. The client sends HTTP requests with the Authorization header containing the word Basic followed by a space and a base64-encoded string of project_id:token. The project ID will be used as the username and the API token as the password. Example: ``` Authorization: Basic base64(project_id:token) ``` ## Request ### Path parameters - `id` (string, required) — Unique ID of the address. ### Body (application/json) This endpoint expects an UpdateAddressRequest. - `label` (string, required) — 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` (string, required) — The ISO 3166 Alpha 2 country code. - `first_name` (string, required) — First name of the occupant associated with this address. - `last_name` (string, required) — Last name of the occupant associated with this address. - `street_number` (string, required) — The number portion of the street address. - `street_name` (string, required) — The name portion of the street address. - `city` (string, required) — The city portion of the street address. - `state` (string, required) — The state/province/region of the street address. In the USA and Canada, use the two-letter abbreviated form. - `postal_code` (string, required) — The postal code of the street address. - `address_type` (enum, optional) — 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. - Allowed values: `Apartment`, `Basement`, `Building`, `Department`, `Floor`, `Office`, `Penthouse`, `Suite`, `Trailer`, `Unit` - `address_number` (string, optional) — If the address is divided into multiple sub-addresses, this identifies the particular sub-address. - `emergency_enabled` (boolean, optional, default: false) — 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` (boolean, optional, default: true) — 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. ## Response ### 200 The request has succeeded. - `id` (string, required) — The unique identifier of the Address on SignalWire. - `label` (string, required) — A friendly name given to the address to help distinguish and search for different addresses within your project. - `country` (string, required) — The ISO 3166 Alpha 2 country code. - `first_name` (string, required) — First name of the occupant associated with this address. - `last_name` (string, required) — Last name of the occupant associated with this address. - `street_number` (string, required) — The number portion of the street address. - `street_name` (string, required) — The name portion of the street address. - `address_type` (enum, required, nullable) — If the address is divided into multiple sub-addresses, this identifies how the address is divided. - Allowed values: `Apartment`, `Basement`, `Building`, `Department`, `Floor`, `Office`, `Penthouse`, `Suite`, `Trailer`, `Unit` - `address_number` (string, required, nullable) — If the address is divided into multiple sub-addresses, this identifies the particular sub-address. - `city` (string, required) — The city portion of the street address. - `state` (string, required) — The state/province/region of the street address. In the USA and Canada, use the two-letter abbreviated form. - `postal_code` (string, required) — The postal code of the street address. - `zip_code` (string, required) — The postal code of the street address. Alias for postal_code for backwards compatibility. - `emergency_enabled` (boolean, required) — Whether E911 emergency calling is enabled for this address (carrier-validated when created/updated with `emergency_enabled=true` for a US address). - `validated` (boolean, required) — Whether the address was validated by the carrier (true when the carrier returned a valid or auto-corrected match). - `validated_at` (string, required, nullable) — The RFC 3339 / ISO 8601 timestamp of the last successful carrier validation, or null if never validated. ## Errors ### 401 Unauthorized Error Access is unauthorized. - `error` (enum, required) - Allowed values: `Unauthorized` ### 404 Not Found Error The server cannot find the requested resource. - `error` (enum, required) - Allowed values: `Not Found` ### 422 Unprocessable Entity Error 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. - `errors` (list of Types.StatusCodes.SpaceApiErrorItem, required) — List of validation errors. - `candidates` (list of AddressCandidate, optional) — Alternative addresses suggested by the carrier. Omitted when the carrier returned no alternatives. ### 500 Internal Server Error An internal server error occurred. - `error` (enum, required) - Allowed values: `Internal Server Error` ## Types ### Types.StatusCodes.SpaceApiErrorItem Details about a specific validation error. - `detail` (string, required) — A description of what caused the error. - `status` (string, required) — The HTTP status code. - `title` (string, required) — A short summary of the error type. - `code` (string, required) — The error code. ### AddressCandidate A carrier-suggested alternative to the submitted address. - `street_number` (string, required, nullable) — The number portion of the suggested street address. - `street_name` (string, required, nullable) — The name portion of the suggested street address. - `city` (string, required, nullable) — The city portion of the suggested street address. - `state` (string, required, nullable) — The state of the suggested street address. - `postal_code` (string, required, nullable) — The postal code of the suggested street address. ## Examples **Request** ```json { "label": "My Address", "country": "US", "first_name": "Emmett", "last_name": "Brown", "street_number": "1640", "street_name": "Riverside Drive", "city": "Alexandria", "state": "CA", "postal_code": "91905" } ``` **Response** ```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 } ``` **SDK Code** ```python import requests url = "https://{your_space_name}.signalwire.com/api/relay/rest/addresses/id" payload = { "label": "My Address", "country": "US", "first_name": "Emmett", "last_name": "Brown", "street_number": "1640", "street_name": "Riverside Drive", "city": "Alexandria", "state": "CA", "postal_code": "91905" } headers = { "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers, auth=("", "")) print(response.json()) ``` ```javascript const url = 'https://{your_space_name}.signalwire.com/api/relay/rest/addresses/id'; const credentials = btoa(":"); const options = { method: 'PUT', headers: { Authorization: `Basic ${credentials}`, 'Content-Type': 'application/json' }, body: '{"label":"My Address","country":"US","first_name":"Emmett","last_name":"Brown","street_number":"1640","street_name":"Riverside Drive","city":"Alexandria","state":"CA","postal_code":"91905"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://{your_space_name}.signalwire.com/api/relay/rest/addresses/id" payload := strings.NewReader("{\n \"label\": \"My Address\",\n \"country\": \"US\",\n \"first_name\": \"Emmett\",\n \"last_name\": \"Brown\",\n \"street_number\": \"1640\",\n \"street_name\": \"Riverside Drive\",\n \"city\": \"Alexandria\",\n \"state\": \"CA\",\n \"postal_code\": \"91905\"\n}") req, _ := http.NewRequest("PUT", url, payload) req.SetBasicAuth("", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://{your_space_name}.signalwire.com/api/relay/rest/addresses/id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request.basic_auth("", "") request["Content-Type"] = 'application/json' request.body = "{\n \"label\": \"My Address\",\n \"country\": \"US\",\n \"first_name\": \"Emmett\",\n \"last_name\": \"Brown\",\n \"street_number\": \"1640\",\n \"street_name\": \"Riverside Drive\",\n \"city\": \"Alexandria\",\n \"state\": \"CA\",\n \"postal_code\": \"91905\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("https://{your_space_name}.signalwire.com/api/relay/rest/addresses/id") .basicAuth("", "") .header("Content-Type", "application/json") .body("{\n \"label\": \"My Address\",\n \"country\": \"US\",\n \"first_name\": \"Emmett\",\n \"last_name\": \"Brown\",\n \"street_number\": \"1640\",\n \"street_name\": \"Riverside Drive\",\n \"city\": \"Alexandria\",\n \"state\": \"CA\",\n \"postal_code\": \"91905\"\n}") .asString(); ``` ```php request('PUT', 'https://{your_space_name}.signalwire.com/api/relay/rest/addresses/id', [ 'body' => '{ "label": "My Address", "country": "US", "first_name": "Emmett", "last_name": "Brown", "street_number": "1640", "street_name": "Riverside Drive", "city": "Alexandria", "state": "CA", "postal_code": "91905" }', 'headers' => [ 'Content-Type' => 'application/json', ], 'auth' => ['', ''], ]); echo $response->getBody(); ``` ```csharp using RestSharp; using RestSharp.Authenticators; var client = new RestClient("https://{your_space_name}.signalwire.com/api/relay/rest/addresses/id"); client.Authenticator = new HttpBasicAuthenticator("", ""); var request = new RestRequest(Method.PUT); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"label\": \"My Address\",\n \"country\": \"US\",\n \"first_name\": \"Emmett\",\n \"last_name\": \"Brown\",\n \"street_number\": \"1640\",\n \"street_name\": \"Riverside Drive\",\n \"city\": \"Alexandria\",\n \"state\": \"CA\",\n \"postal_code\": \"91905\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let credentials = Data(":".utf8).base64EncodedString() let headers = [ "Authorization": "Basic \(credentials)", "Content-Type": "application/json" ] let parameters = [ "label": "My Address", "country": "US", "first_name": "Emmett", "last_name": "Brown", "street_number": "1640", "street_name": "Riverside Drive", "city": "Alexandria", "state": "CA", "postal_code": "91905" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://{your_space_name}.signalwire.com/api/relay/rest/addresses/id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```