> 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 an incoming phone number POST https://YOUR_SPACE.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid} Content-Type: application/x-www-form-urlencoded Changes how an account-owned phone number is identified or routes inbound calls, messages, and faxes. Use this operation for form-encoded configuration; use SignalWire REST [Update phone number](/docs/apis/rest/phone-numbers/update-phone-number) for JSON configuration. #### 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/compatibility-api/rest/incoming-phone-numbers/update-incoming-phone-number ## 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 - `AccountSid` (string, required) — The unique identifier for the account that is associated with this phone number. - `Sid` (string, required) — The unique identifier of the phone number. ### Body (application/x-www-form-urlencoded) This endpoint expects an UpdateIncomingPhoneNumberRequest. - `AccountSid` (string, optional) — The unique identifier for an account to which the number should be transferred. Must be within the same Space. - `EmergencyAddressSid` (string, optional) — The unique identifier of the address associated with E911 for this phone number. Not supported for toll-free numbers or certain providers. - `FriendlyName` (string, optional) — A friendly name for the phone number. - `SmsApplicationSid` (string, optional) — The unique identifier for the application associated with SMS handling on this phone number. - `SmsFallbackMethod` (enum, optional, default: POST) — Whether the request to `SmsFallbackUrl` is a `GET` or a `POST`. Default is `POST`. - Allowed values: `GET`, `POST` - `SmsFallbackUrl` (string, optional) — The URL to request if errors occur when fetching SmsUrl. - `SmsMethod` (enum, optional, default: POST) — Whether the request to SmsUrl is a `GET` or a `POST`. Default is `POST`. - Allowed values: `GET`, `POST` - `SmsUrl` (string, optional) — The URL to request when an incoming SMS is received. - `StatusCallback` (string, optional) — The URL to request to pass status updates to. - `StatusCallbackMethod` (enum, optional, default: POST) — Whether the request to StatusCallback is a `GET` or a `POST`. Default is `POST`. - Allowed values: `GET`, `POST` - `VoiceApplicationSid` (string, optional) — The unique identifier for the application associated with call handling on this phone number. - `VoiceFallbackMethod` (enum, optional, default: POST) — Whether the request to VoiceFallbackUrl is a `GET` or a `POST`. Default is `POST`. - Allowed values: `GET`, `POST` - `VoiceFallbackUrl` (string, optional) — The URL to request if errors occur when fetching VoiceUrl. - `VoiceMethod` (enum, optional, default: POST) — Whether the request to VoiceUrl is a `GET` or a `POST`. Default is `POST`. - Allowed values: `GET`, `POST` - `VoiceReceiveMode` (enum, optional) — Whether this number can receive voice calls or faxes. - Allowed values: `voice`, `fax` - `VoiceUrl` (string, optional) — The URL to request when an incoming call is received. ## Response ### 200 The request has succeeded. - `account_id` (string, required) — The unique identifier for the account that is associated with this phone number. - `account_sid` (string, required) — The unique identifier for the account that is associated with this phone number. - `address_requirements` (enum, required) — Whether or not a registered address with SignalWire is required. Always 'none'. - Allowed values: `none`, `any`, `local`, `foreign` - `address_sid` (string, required, nullable) — The unique identifier for the address associated with this phone number. Always null. - `api_version` (string, required) — The version of the SignalWire API. - `beta` (boolean, required) — New numbers on SignalWire are marked as beta. Always false. - `capabilities` (IncomingPhoneNumberCapabilities, required) — Whether or not a number can receive calls and messages. - `country_code` (string, required) — The ISO 3166-1 alpha-2 country code for this phone number. - `date_created` (string, required) — The date, in RFC 2822 format, this phone number was created. - `date_updated` (string, required) — The date, in RFC 2822 format, this phone number was updated. - `emergency_address_sid` (string, required, nullable) — The unique identifier of the address associated with E911 for this phone number, or null if not set. - `emergency_status` (string, required) — Whether the phone route has an active E911 address associated. 'Active' or 'Inactive'. - `friendly_name` (string, required) — A formatted version of the number. - `identity_sid` (string, required, nullable) — The unique identifier for the identity associated with this phone number. Always null. - `origin` (enum, required) — The origin of the phone number. - Allowed values: `signalwire`, `hosted` - `phone_number` (string, required) — The incoming number in E.164 format. - `sid` (string, required) — The unique identifier for this phone number. - `sms_application_sid` (string, required, nullable) — The unique identifier for the application associated with SMS handling on this phone number, or null if not set. - `sms_fallback_method` (string, required) — Whether the request to `SmsFallbackUrl` is a `GET` or a `POST`. - `sms_fallback_url` (string, required, nullable) — The URL to request if errors occur when fetching SmsUrl, or null if not set. - `sms_method` (string, required) — Whether the request to SmsUrl is a `GET` or a `POST`. - `sms_url` (string, required, nullable) — The URL to request when an incoming SMS is received, or null if not set. - `status_callback` (string, required, nullable) — The URL to request to pass status updates to, or null if not set. - `status_callback_method` (string, required) — Whether the request to StatusCallback is a `GET` or a `POST`. - `trunk_sid` (string, required, nullable) — The unique identifier for the Trunk associated with this phone number. Always null. - `uri` (string, required) — The URI for this number. - `voice_application_sid` (string, required, nullable) — The unique identifier for the application associated with call handling on this phone number, or null if not set. - `voice_caller_id_lookup` (boolean, required, nullable) — Whether or not to look up a caller's name in the database. Always null. - `voice_fallback_method` (string, required) — Whether the request to VoiceFallbackUrl is a `GET` or a `POST`. - `voice_fallback_url` (string, required, nullable) — The URL to request if errors occur when fetching `Url`, or null if not set. - `voice_method` (string, required) — Whether the request to Url is a `GET` or a `POST`. - `voice_url` (string, required, nullable) — The URL to request when an incoming call is received, or null if not set. - `verification_status` (string, optional) — The verification status for toll-free numbers. Only present for toll-free numbers. ## Errors ### 400 Bad Request Error The request was invalid or cannot be processed. Check the error details for more information. - `code` (integer, required) — Error code. - `message` (string, required) — Error message. - `more_info` (string, required) — URL for more information about the error. - `status` (integer, required) — HTTP status code. ### 401 Unauthorized Error Authentication failed. Please verify your credentials and try again. - `code` (integer, required) — Error code. - `message` (string, required) — Error message. - `more_info` (string, required) — URL for more information about the error. - `status` (integer, required) — HTTP status code. ### 404 Not Found Error The requested resource was not found. Please verify the resource identifier. - `code` (integer, required) — Error code. - `message` (string, required) — Error message. - `more_info` (string, required) — URL for more information about the error. - `status` (integer, required) — HTTP status code. ### 422 Unprocessable Entity Error The request could not be processed due to validation errors. Check the error details for more information. - `code` (integer, required) — Error code. - `message` (string, required) — Error message. - `more_info` (string, required) — URL for more information about the error. - `status` (integer, required) — HTTP status code. ## Types ### IncomingPhoneNumberCapabilities Phone number capabilities. - `voice` (boolean, required) — Whether or not voice is enabled. - `sms` (boolean, required) — Whether or not SMS is enabled. - `mms` (boolean, required) — Whether or not MMS is enabled. - `fax` (boolean, required) — Whether or not fax is enabled. ## Examples **Request** ```json {} ``` **Response** ```json { "account_id": "b3877c40-da60-4998-90ad-b792e98472ac", "account_sid": "b3877c40-da60-4998-90ad-b792e98472ac", "address_requirements": "none", "address_sid": null, "api_version": "2010-04-01", "beta": false, "capabilities": { "voice": true, "sms": true, "mms": true, "fax": true }, "country_code": "US", "date_created": "Tue, 25 Sept 2018 23:00:00 +0000", "date_updated": "Wed, 26 Sept 2018 22:00:00 +0000", "emergency_address_sid": null, "emergency_status": "Inactive", "friendly_name": "(310) 338-6745", "identity_sid": null, "origin": "signalwire", "phone_number": "+13103386745", "sid": "b3877c40-da60-4998-90ad-b792e98472pn", "sms_application_sid": null, "sms_fallback_method": "POST", "sms_fallback_url": null, "sms_method": "POST", "sms_url": null, "status_callback": null, "status_callback_method": "POST", "trunk_sid": null, "uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472ac/IncomingPhoneNumbers/b3877c40-da60-4998-90ad-b792e98472pn.json", "voice_application_sid": null, "voice_caller_id_lookup": null, "voice_fallback_method": "POST", "voice_fallback_url": null, "voice_method": "POST", "voice_url": null, "verification_status": "Unverified" } ``` **SDK Code** ```python import requests url = "https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/IncomingPhoneNumbers/Sid" payload = "" headers = { "Content-Type": "application/x-www-form-urlencoded" } response = requests.post(url, data=payload, headers=headers, auth=("", "")) print(response.json()) ``` ```javascript const url = 'https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/IncomingPhoneNumbers/Sid'; const credentials = btoa(":"); const options = { method: 'POST', headers: { Authorization: `Basic ${credentials}`, 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams('') }; 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" "net/http" "io" ) func main() { url := "https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/IncomingPhoneNumbers/Sid" req, _ := http.NewRequest("POST", url, nil) req.SetBasicAuth("", "") req.Header.Add("Content-Type", "application/x-www-form-urlencoded") 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.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/IncomingPhoneNumbers/Sid") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request.basic_auth("", "") request["Content-Type"] = 'application/x-www-form-urlencoded' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/IncomingPhoneNumbers/Sid") .basicAuth("", "") .header("Content-Type", "application/x-www-form-urlencoded") .asString(); ``` ```php request('POST', 'https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/IncomingPhoneNumbers/Sid', [ 'form_params' => null, 'headers' => [ 'Content-Type' => 'application/x-www-form-urlencoded', ], 'auth' => ['', ''], ]); echo $response->getBody(); ``` ```csharp using RestSharp; using RestSharp.Authenticators; var client = new RestClient("https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/IncomingPhoneNumbers/Sid"); client.Authenticator = new HttpBasicAuthenticator("", ""); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/x-www-form-urlencoded"); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let credentials = Data(":".utf8).base64EncodedString() let headers = [ "Authorization": "Basic \(credentials)", "Content-Type": "application/x-www-form-urlencoded" ] let request = NSMutableURLRequest(url: NSURL(string: "https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/IncomingPhoneNumbers/Sid")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers 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() ```