> This page is for Compatibility API.

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

# Retrieve an incoming phone number

GET https://YOUR_SPACE.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}

Retrieves one account-owned phone number by Incoming Phone Number SID so you can inspect how it is used in the project. Use [List all Incoming Phone Numbers](/docs/compatibility-api/rest/incoming-phone-numbers/list-incoming-phone-numbers) to discover SIDs, or native [Get phone number](/docs/apis/rest/phone-numbers/retrieve-phone-number) when working with SignalWire resource IDs.

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

## 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.
- `call_handler` (string, required) — How incoming calls to this number are handled. `laml_webhooks` sends calls to `voice_url`, and `laml_application` sends them to the application in `voice_application_sid`. Any other value means the number's call handler was set outside the Compatibility API. This field is read-only in the Compatibility API. Setting `VoiceUrl` or `VoiceApplicationSid` switches the number to `laml_webhooks` or `laml_application`; to choose any other handler, use [Update phone number](/docs/apis/rest/phone-numbers/update-phone-number).
- `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`
- `pending_port_in` (boolean, required) — Whether the number is part of a port-in that hasn't completed. A number pending port-in can't be assigned to a 10DLC campaign.
- `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.

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

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

**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,
  "call_handler": "laml_webhooks",
  "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",
  "pending_port_in": false,
  "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"

response = requests.get(url, auth=("<project_id>", "<api_token>"))

print(response.json())
```

```javascript
const url = 'https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/IncomingPhoneNumbers/Sid';
const credentials = btoa("<project_id>:<api_token>");

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

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("GET", url, nil)

	req.SetBasicAuth("<project_id>", "<api_token>")

	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::Get.new(url)
request.basic_auth("<project_id>", "<api_token>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/IncomingPhoneNumbers/Sid")
  .basicAuth("<project_id>", "<api_token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://your_space.signalwire.com/api/laml/2010-04-01/Accounts/AccountSid/IncomingPhoneNumbers/Sid', [
  'headers' => [
  ],
    'auth' => ['<project_id>', '<api_token>'],
]);

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("<project_id>", "<api_token>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<project_id>:<api_token>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

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 = "GET"
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()
```