> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# List SIP credentials

GET https://%7BYour_Space_Name%7D.signalwire.com/api/fabric/resources/sip_endpoints

A list of SIP Credentials

#### Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: _Voice_, _Messaging_, _Fax_, or _Video_.

[Learn more about API scopes](/docs/platform/your-signalwire-api-space).

Reference: https://signalwire.com/docs/apis/rest/sip-credentials/list-sip-credentials

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

## Response

### 200

The request has succeeded.

- `list of object`
  - `links` (object, required) — Pagination links.
    - `self` (string, required) — Link to the current page.
    - `first` (string, required) — Link to the first page.
    - `next` (string, optional) — Link to the next page. Only present when there are more results.
    - `prev` (string, optional) — Link to the previous page. Only present when not on the first page.
  - `data` (list of object, required) — List of SIP endpoints.
    - `type` (string, required) — A string representation of the type of object this record is.
    - `id` (string, required) — The unique identifier of the SIP endpoint.
    - `username` (string, required) — The username for the SIP endpoint.
    - `caller_id` (string, required, nullable) — Friendly Caller ID used as the CNAM when dialing a phone number or the From when dialing another SIP Endpoint.
    - `send_as` (string, required) — When dialing a PSTN phone number, you must send it From a number you have purchased or verified. send_as indicates which number this endpoint has set as its origination. random indicates it will randomly choose a purchased or verified number from within the project.
    - `ciphers` (list of string, required) — A list of encryption ciphers this endpoint will support.
    - `codecs` (list of string, required) — A list of codecs this endpoint will support.
    - `encryption` (enum, required) — Whether connections to this endpoint require encryption or if encryption is optional.
      - Allowed values: `default`, `required`, `optional`
    - `call_handler` (enum, required, nullable) — What type of handler you want to run on inbound calls.
      - Allowed values: `relay_context`, `relay_topic`, `relay_application`, `relay_connector`, `relay_script`, `laml_webhooks`, `laml_application`, `dialogflow`, `video_room`, `call_flow`, `ai_agent`
    - `calling_handler_resource_id` (string, required, nullable) — The unique identifier of the calling handler resource.
    - `call_request_url` (string, required, nullable) — A string representing the LaML URL to access when a call is received. This is only used (and required) when call_handler is set to laml_webhooks.
    - `call_request_method` (enum, required, nullable) — A string representing the HTTP method to use with call_request_url. Valid values are GET and POST.
      - Allowed values: `GET`, `POST`
    - `call_fallback_url` (string, required, nullable) — A string representing the LaML URL to access when the call to call_request_url fails. This is only used (and required) when call_handler is set to laml_webhooks.
    - `call_fallback_method` (enum, required, nullable) — A string representing the HTTP method to use with call_fallback_url. Valid values are GET and POST.
      - Allowed values: `GET`, `POST`
    - `call_status_callback_url` (string, required, nullable) — A string representing a URL to send status change messages to. This is only used (and required) when call_handler is set to laml_webhooks.
    - `call_status_callback_method` (enum, required, nullable) — A string representing the HTTP method to use with call_status_callback_url. Valid values are GET and POST.
      - Allowed values: `GET`, `POST`
    - `call_laml_application_id` (string, required, nullable) — A string representing the ID of the LaML application to forward incoming calls to. This is only used (and required) when call_handler is set to laml_application.
    - `call_dialogflow_agent_id` (string, required, nullable) — A string representing the ID of the Dialogflow agent to forward incoming calls to. This is only used (and required) when call_handler is set to dialogflow.
    - `call_relay_topic` (string, required, nullable) — A string representing the Relay topic to forward incoming calls to. This is only used (and required) when call_handler is set to relay_topic.
    - `call_relay_topic_status_callback_url` (string, required, nullable) — A string representing a URL to send status change messages to. This is only used (and required) when call_handler is set to relay_topic.
    - `call_relay_context` (string, required, nullable) — A string representing the Relay context to forward incoming calls to. This is only used (and required) when call_handler is set to relay_context.
    - `call_relay_context_status_callback_url` (string, required, nullable) — A string representing a URL to send status change messages to. This is only used (and required) when call_handler is set to relay_context.
    - `call_relay_application` (string, required, nullable) — A string representing the Relay application to forward incoming calls to. This is only used (and required) when call_handler is set to relay_application.
    - `call_video_room_id` (string, required, nullable) — A string representing the ID of the Video Room to forward incoming calls to. This is only used (and required) when call_handler is set to video_room.
    - `call_relay_script_url` (string, required, nullable) — A string representing a URL of a SWML script to respond to incoming calls. This is only used (and required) when call_handler is set to relay_script.

## Examples

**Response**

```json
[
  {
    "links": {
      "self": "string",
      "first": "string",
      "next": "string",
      "prev": "string"
    },
    "data": [
      {
        "type": "sip_endpoint",
        "id": "67075301-69b2-4fc3-8a2c-c95a69a5665e",
        "username": "c3p0",
        "caller_id": "C-3P0",
        "send_as": "random",
        "ciphers": [
          "string"
        ],
        "codecs": [
          "string"
        ],
        "encryption": "required",
        "call_handler": "ai_agent",
        "calling_handler_resource_id": "fe4093d9-58c2-4931-b4b9-5679f82652c6",
        "call_request_url": "string",
        "call_request_method": "POST",
        "call_fallback_url": "string",
        "call_fallback_method": "POST",
        "call_status_callback_url": "string",
        "call_status_callback_method": "POST",
        "call_laml_application_id": "string",
        "call_dialogflow_agent_id": "string",
        "call_relay_topic": "office",
        "call_relay_topic_status_callback_url": "https://myapplication/handle_relay_callbacks",
        "call_relay_context": "string",
        "call_relay_context_status_callback_url": "https://myapplication/handle_relay_callbacks",
        "call_relay_application": "string",
        "call_video_room_id": "string",
        "call_relay_script_url": "https://dev.signalwire.com/relay-bins/f9d13f68-f71e-4042-95bb-b07b9e2f2f92"
      }
    ]
  }
]
```

**SDK Code**

```python
import requests

url = "https://{your_space_name}.signalwire.com/api/fabric/resources/sip_endpoints"

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

print(response.json())
```

```javascript
const url = 'https://{your_space_name}.signalwire.com/api/fabric/resources/sip_endpoints';
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_name}.signalwire.com/api/fabric/resources/sip_endpoints"

	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_name}.signalwire.com/api/fabric/resources/sip_endpoints")

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_name}.signalwire.com/api/fabric/resources/sip_endpoints")
  .basicAuth("<project_id>", "<api_token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://{your_space_name}.signalwire.com/api/fabric/resources/sip_endpoints', [
  'headers' => [
  ],
    'auth' => ['<project_id>', '<api_token>'],
]);

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

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://{your_space_name}.signalwire.com/api/fabric/resources/sip_endpoints");
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_name}.signalwire.com/api/fabric/resources/sip_endpoints")! 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()
```