> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# Elenca numeri di telefono

GET https://api.elevenlabs.io/v1/convai/phone-numbers

Recupera tutti i numeri di telefono

Reference: https://elevenlabs.io/docs/api-reference/phone-numbers/list

## Servers

- `https://api.elevenlabs.io` (Production, default)
- `https://api.us.elevenlabs.io` (Production US)
- `https://api.eu.residency.elevenlabs.io` (Production EU)
- `https://api.in.residency.elevenlabs.io` (Production India)
- `https://api.sg.residency.elevenlabs.io` (Production Singapore)

## Request

### Query parameters

- `provider` (enum, optional, nullable) — Filtra in base al provider di telefonia
  - Allowed values: `twilio`, `sip_trunk`, `exotel`
- `agent_id` (string, optional, nullable) — Filtra in base all'ID dell'agente assegnato
- `branch_id` (string, optional, nullable) — Filtra in base all'ID del branch assegnato

## Response

### 200

Risposta riuscita

- `list of V1ConvaiPhoneNumbersGetResponsesContentApplicationJsonSchemaItems`

## Errors

### 422 Unprocessable Entity Error

Errore di convalida

- `detail` (list of ValidationError, optional)

## Types

### V1ConvaiPhoneNumbersGetResponsesContentApplicationJsonSchemaItems

- `provider`: `twilio` (GetPhoneNumberTwilioResponseModel)
  - `label` (string, required) — Etichetta del numero di telefono
  - `phone_number` (string, required) — Numero di telefono
  - `phone_number_id` (string, required) — L'ID del numero di telefono
  - `assigned_agent` (PhoneNumberAgentInfo, optional, nullable) — L'agente assegnato al numero di telefono
  - `supports_inbound` (boolean, optional, default: true, deprecated) — Questo campo è deprecato e verrà rimosso in futuro. Indica se questo numero di telefono supporta le chiamate in entrata.
  - `supports_outbound` (boolean, optional, default: true, deprecated) — Questo campo è deprecato e verrà rimosso in futuro. Indica se questo numero di telefono supporta le chiamate in uscita.
- `provider`: `exotel` (GetPhoneNumberExotelResponseModel)
  - `label` (string, required) — Etichetta del numero di telefono
  - `phone_number` (string, required) — Numero di telefono
  - `phone_number_id` (string, required) — L'ID del numero di telefono
  - `assigned_agent` (PhoneNumberAgentInfo, optional, nullable) — L'agente assegnato al numero di telefono
  - `supports_inbound` (boolean, optional, default: true, deprecated) — Questo campo è deprecato e verrà rimosso in futuro. Indica se questo numero di telefono supporta le chiamate in entrata.
  - `supports_outbound` (boolean, optional, default: true, deprecated) — Questo campo è deprecato e verrà rimosso in futuro. Indica se questo numero di telefono supporta le chiamate in uscita.
- `provider`: `sip_trunk` (GetPhoneNumberSIPTrunkResponseModel)
  - `label` (string, required) — Etichetta del numero di telefono
  - `livekit_stack` (enum, required, default: standard) — Tipo di stack Livekit usato per questo numero.
    - Allowed values: `standard`, `static`
  - `phone_number` (string, required) — Numero di telefono
  - `phone_number_id` (string, required) — L'ID del numero di telefono
  - `assigned_agent` (PhoneNumberAgentInfo, optional, nullable) — L'agente assegnato al numero di telefono
  - `inbound_trunk` (GetPhoneNumberInboundSIPTrunkConfigResponseModel, optional, nullable) — Configurazione del trunk SIP in entrata, se configurato.
  - `outbound_trunk` (GetPhoneNumberOutboundSIPTrunkConfigResponseModel, optional, nullable) — Configurazione del trunk SIP in uscita, se configurato.
  - `store_sip_messages` (boolean, optional, default: true) — Indica se archiviare i messaggi SIP per questo numero di telefono.
  - `provider_config` (GetPhoneNumberOutboundSIPTrunkConfigResponseModel, optional, nullable, deprecated) — Dettagli della configurazione del trunk SIP per un numero di telefono
  - `supports_inbound` (boolean, optional, default: true, deprecated) — Questo campo è deprecato e verrà rimosso in futuro. Indica se questo numero di telefono supporta le chiamate in entrata.
  - `supports_outbound` (boolean, optional, default: true, deprecated) — Questo campo è deprecato e verrà rimosso in futuro. Indica se questo numero di telefono supporta le chiamate in uscita.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### PhoneNumberAgentInfo

- `agent_id` (string, required) — L'ID dell'agente
- `agent_name` (string, required) — Il nome dell'agente
- `environment` (string, optional, nullable) — Ambiente da usare per risolvere le variabili di ambiente nelle chiamate a questo numero.
- `branch_id` (string, optional, nullable) — Ramo dell'agente da usare per le chiamate a questo numero.

### GetPhoneNumberInboundSIPTrunkConfigResponseModel

- `allowed_addresses` (list of string, required) — Elenco degli indirizzi IP autorizzati a usare il trunk. Ogni elemento dell'elenco può essere un singolo indirizzo IP o una notazione Classless Inter-Domain Routing che rappresenta un blocco CIDR.
- `allowed_numbers` (list of string, required, nullable) — Elenco dei numeri di telefono autorizzati a usare il trunk.
- `media_encryption` (enum, required, default: allowed)
  - Allowed values: `disabled`, `allowed`, `required`
- `has_auth_credentials` (boolean, required) — Se le credenziali di autenticazione sono configurate
- `username` (string, optional, nullable) — Nome utente del trunk SIP, se disponibile
- `remote_domains` (list of string, optional, nullable) — Domini dei server SIP remoti utilizzati per convalidare i certificati TLS.
- `attributes_to_headers` (map from string to string, optional) — Mappa del nome della variabile dinamica al nome dell'header per attributes_to_headers

### GetPhoneNumberOutboundSIPTrunkConfigResponseModel

Dettagli della configurazione del trunk SIP per un numero di telefono

- `address` (string, required) — Hostname o IP a cui viene inviato il SIP INVITE
- `transport` (enum, required, default: auto) — Protocollo da utilizzare per il trasporto SIP
  - Allowed values: `auto`, `udp`, `tcp`, `tls`
- `media_encryption` (enum, required, default: allowed) — Se crittografare i media (livello dati).
  - Allowed values: `disabled`, `allowed`, `required`
- `has_auth_credentials` (boolean, required) — Se le credenziali di autenticazione sono configurate
- `headers` (map from string to string, optional) — Header SIP per la richiesta INVITE
- `attributes_to_headers` (map from string to string, optional) — Mappa del nome della variabile dinamica al nome dell'header per attributes_to_headers
- `username` (string, optional, nullable) — Nome utente del trunk SIP, se disponibile
- `has_outbound_trunk` (boolean, optional, default: false) — Se è configurato un trunk SIP in uscita LiveKit
- `enabled_codecs` (list of enum, optional) — Codec multimediali offerti nell'SDP per le chiamate in uscita. Se vuoto, vengono offerti tutti i codec supportati.
  - Allowed values: `G722/8000`, `PCMU/8000`, `PCMA/8000`

### ValidationErrorLocItems

## Examples

**Response**

```json
[
  {
    "provider": "twilio",
    "label": "Customer Support",
    "phone_number": "+1234567890",
    "phone_number_id": "phone_123"
  }
]
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/convai/phone-numbers"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/convai/phone-numbers';
const options = {method: 'GET'};

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://api.elevenlabs.io/v1/convai/phone-numbers"

	req, _ := http.NewRequest("GET", url, nil)

	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://api.elevenlabs.io/v1/convai/phone-numbers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

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://api.elevenlabs.io/v1/convai/phone-numbers")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.elevenlabs.io/v1/convai/phone-numbers');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/convai/phone-numbers");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/convai/phone-numbers")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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()
```