# SIP Domain Resource

A SIP **Domain** resource describes a custom DNS hostname that can accept [SIP](/docs/glossary/what-is-session-initiation-protocol-sip) traffic for your account. A SIP request to that domain, such as to `sip:alice@example.sip.twilio.com`, routes to Twilio. Twilio authenticates the request and requests TwiML from the `voice_url` of the SIP Domain.

## SIP Domain Authentication

Your SIP Domain must map at least one of these two authentication methods or requests to it will be blocked.

* [IpAccessControlLists](/docs/voice/sip/api/sip-ipaccesscontrollist-resource), mapped by [IpAccessControlListMapping resources](/docs/voice/sip/api/sip-ipaccesscontrollistmapping-resource)
* [CredentialLists](/docs/voice/sip/api/sip-credentiallist-resource), mapped by [CredentialListMapping resources](/docs/voice/sip/api/sip-credentiallistmapping-resource)

## Domain Properties

```json
{"type":"object","refName":"api.v2010.account.sip.sip_domain","modelName":"api_v2010_account_sip_sip_domain","properties":{"account_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$","nullable":true,"description":"The SID of the [Account](/docs/iam/api/account) that created the SipDomain resource."},"api_version":{"type":"string","nullable":true,"description":"The API version used to process the call."},"auth_type":{"type":"string","nullable":true,"description":"The types of authentication you have mapped to your domain. Can be: `IP_ACL` and `CREDENTIAL_LIST`. If you have both defined for your domain, both will be returned in a comma delimited string. If `auth_type` is not defined, the domain will not be able to receive any traffic."},"date_created":{"type":"string","format":"date-time-rfc-2822","nullable":true,"description":"The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."},"date_updated":{"type":"string","format":"date-time-rfc-2822","nullable":true,"description":"The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format."},"domain_name":{"type":"string","nullable":true,"description":"The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \"-\" and must end with `sip.twilio.com`."},"friendly_name":{"type":"string","nullable":true,"description":"The string that you assigned to describe the resource."},"sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^SD[0-9a-fA-F]{32}$","nullable":true,"description":"The unique string that that we created to identify the SipDomain resource."},"uri":{"type":"string","nullable":true,"description":"The URI of the resource, relative to `https://api.twilio.com`."},"voice_fallback_method":{"type":"string","format":"http-method","enum":["GET","POST"],"nullable":true,"description":"The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`."},"voice_fallback_url":{"type":"string","format":"uri","nullable":true,"description":"The URL that we call when an error occurs while retrieving or executing the TwiML requested from `voice_url`.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},"voice_method":{"type":"string","format":"http-method","enum":["GET","POST"],"nullable":true,"description":"The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`."},"voice_status_callback_method":{"type":"string","format":"http-method","enum":["GET","POST"],"nullable":true,"description":"The HTTP method we use to call `voice_status_callback_url`. Either `GET` or `POST`."},"voice_status_callback_url":{"type":"string","format":"uri","nullable":true,"description":"The URL that we call to pass status parameters (such as call ended) to your application.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},"voice_url":{"type":"string","format":"uri","nullable":true,"description":"The URL we call using the `voice_method` when the domain receives a call.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},"subresource_uris":{"type":"object","format":"uri-map","nullable":true,"description":"A list of mapping resources associated with the SIP Domain resource identified by their relative URIs."},"sip_registration":{"type":"boolean","nullable":true,"description":"Whether to allow SIP Endpoints to register with the domain to receive calls."},"emergency_calling_enabled":{"type":"boolean","nullable":true,"description":"Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses."},"secure":{"type":"boolean","nullable":true,"description":"Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain."},"byoc_trunk_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^BY[0-9a-fA-F]{32}$","nullable":true,"description":"The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with."},"emergency_caller_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^PN[0-9a-fA-F]{32}$","nullable":true,"description":"Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call."}}}
```

## Create a SipDomain resource

`POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains.json`

### Path parameters

```json
[{"name":"AccountSid","in":"path","description":"The SID of the [Account](/docs/iam/api/account) that will create the resource.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$"},"required":true}]
```

### Request body parameters

```json
{"schema":{"type":"object","title":"CreateSipDomainRequest","required":["DomainName"],"properties":{"DomainName":{"type":"string","description":"The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \"-\" and must end with `sip.twilio.com`."},"FriendlyName":{"type":"string","description":"A descriptive string that you created to describe the resource. It can be up to 64 characters long."},"VoiceUrl":{"type":"string","format":"uri","description":"The URL we should when the domain receives a call.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},"VoiceMethod":{"type":"string","format":"http-method","enum":["GET","POST"],"description":"The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`."},"VoiceFallbackUrl":{"type":"string","format":"uri","description":"The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},"VoiceFallbackMethod":{"type":"string","format":"http-method","enum":["GET","POST"],"description":"The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`."},"VoiceStatusCallbackUrl":{"type":"string","format":"uri","description":"The URL that we should call to pass status parameters (such as call ended) to your application.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},"VoiceStatusCallbackMethod":{"type":"string","format":"http-method","enum":["GET","POST"],"description":"The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`."},"SipRegistration":{"type":"boolean","description":"Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not."},"EmergencyCallingEnabled":{"type":"boolean","description":"Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses."},"Secure":{"type":"boolean","description":"Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain."},"ByocTrunkSid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^BY[0-9a-fA-F]{32}$","description":"The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with."},"EmergencyCallerSid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^PN[0-9a-fA-F]{32}$","description":"Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call."}}},"examples":{"create":{"value":{"lang":"json","value":"{\n  \"DomainName\": \"dunder-mifflin-scranton.sip.twilio.com\",\n  \"FriendlyName\": \"Scranton Office\",\n  \"VoiceFallbackMethod\": \"POST\",\n  \"VoiceFallbackUrl\": \"\",\n  \"VoiceMethod\": \"POST\",\n  \"VoiceStatusCallbackMethod\": \"POST\",\n  \"VoiceStatusCallbackUrl\": \"\",\n  \"VoiceUrl\": \"https://dundermifflin.example.com/twilio/app.php\",\n  \"SipRegistration\": true,\n  \"EmergencyCallingEnabled\": true,\n  \"Secure\": true,\n  \"ByocTrunkSid\": \"BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n  \"EmergencyCallerSid\": \"PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n}","meta":"","code":"{\n  \"DomainName\": \"dunder-mifflin-scranton.sip.twilio.com\",\n  \"FriendlyName\": \"Scranton Office\",\n  \"VoiceFallbackMethod\": \"POST\",\n  \"VoiceFallbackUrl\": \"\",\n  \"VoiceMethod\": \"POST\",\n  \"VoiceStatusCallbackMethod\": \"POST\",\n  \"VoiceStatusCallbackUrl\": \"\",\n  \"VoiceUrl\": \"https://dundermifflin.example.com/twilio/app.php\",\n  \"SipRegistration\": true,\n  \"EmergencyCallingEnabled\": true,\n  \"Secure\": true,\n  \"ByocTrunkSid\": \"BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n  \"EmergencyCallerSid\": \"PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"DomainName\"","#7EE787"],[":","#C9D1D9"]," ",["\"dunder-mifflin-scranton.sip.twilio.com\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"FriendlyName\"","#7EE787"],[":","#C9D1D9"]," ",["\"Scranton Office\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"VoiceFallbackMethod\"","#7EE787"],[":","#C9D1D9"]," ",["\"POST\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"VoiceFallbackUrl\"","#7EE787"],[":","#C9D1D9"]," ",["\"\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"VoiceMethod\"","#7EE787"],[":","#C9D1D9"]," ",["\"POST\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"VoiceStatusCallbackMethod\"","#7EE787"],[":","#C9D1D9"]," ",["\"POST\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"VoiceStatusCallbackUrl\"","#7EE787"],[":","#C9D1D9"]," ",["\"\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"VoiceUrl\"","#7EE787"],[":","#C9D1D9"]," ",["\"https://dundermifflin.example.com/twilio/app.php\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"SipRegistration\"","#7EE787"],[":","#C9D1D9"]," ",["true","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"EmergencyCallingEnabled\"","#7EE787"],[":","#C9D1D9"]," ",["true","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"Secure\"","#7EE787"],[":","#C9D1D9"]," ",["true","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"ByocTrunkSid\"","#7EE787"],[":","#C9D1D9"]," ",["\"BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"EmergencyCallerSid\"","#7EE787"],[":","#C9D1D9"]," ",["\"PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Create a SipDomain resource

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function createSipDomain() {
  const domain = await client.sip.domains.create({ domainName: "domain_name" });

  console.log(domain.accountSid);
}

createSipDomain();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

domain = client.sip.domains.create(domain_name="domain_name")

print(domain.account_sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Sip;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var domain = await DomainResource.CreateAsync(domainName: "domain_name");

        Console.WriteLine(domain.AccountSid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.sip.Domain;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Domain domain = Domain.creator("domain_name").create();

        System.out.println(domain.getAccountSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	api "github.com/twilio/twilio-go/rest/api/v2010"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &api.CreateSipDomainParams{}
	params.SetDomainName("domain_name")

	resp, err := client.Api.CreateSipDomain(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.AccountSid != nil {
			fmt.Println(*resp.AccountSid)
		} else {
			fmt.Println(resp.AccountSid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$domain = $twilio->sip->domains->create(
    "domain_name" // DomainName
);

print $domain->accountSid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

domain = @client
         .api
         .v2010
         .sip
         .domains
         .create(domain_name: 'domain_name')

puts domain.account_sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:core:sip:domains:create \
   --domain-name domain_name
```

```bash
curl -X POST "https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/SIP/Domains.json" \
--data-urlencode "DomainName=domain_name" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "api_version": "2010-04-01",
  "auth_type": "IP_ACL",
  "date_created": "Mon, 20 Jul 2015 17:27:10 +0000",
  "date_updated": "Mon, 20 Jul 2015 17:27:10 +0000",
  "domain_name": "domain_name",
  "friendly_name": "Scranton Office",
  "sip_registration": true,
  "sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "subresource_uris": {
    "credential_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json",
    "ip_access_control_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json"
  },
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
  "voice_fallback_method": "POST",
  "voice_fallback_url": null,
  "voice_method": "POST",
  "voice_status_callback_method": "POST",
  "voice_status_callback_url": null,
  "voice_url": "https://dundermifflin.example.com/twilio/app.php",
  "emergency_calling_enabled": true,
  "secure": true,
  "byoc_trunk_sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "emergency_caller_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

## Fetch a SipDomain resource

`GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json`

### Path parameters

```json
[{"name":"AccountSid","in":"path","description":"The SID of the [Account](/docs/iam/api/account) that created the SipDomain resource to fetch.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$"},"required":true},{"name":"Sid","in":"path","description":"The Twilio-provided string that uniquely identifies the SipDomain resource to fetch.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^SD[0-9a-fA-F]{32}$"},"required":true}]
```

Fetch a SipDomain resource

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchSipDomain() {
  const domain = await client.sip
    .domains("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .fetch();

  console.log(domain.accountSid);
}

fetchSipDomain();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

domain = client.sip.domains("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch()

print(domain.account_sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Sip;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var domain = await DomainResource.FetchAsync(pathSid: "SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

        Console.WriteLine(domain.AccountSid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.sip.Domain;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Domain domain = Domain.fetcher("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch();

        System.out.println(domain.getAccountSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	api "github.com/twilio/twilio-go/rest/api/v2010"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &api.FetchSipDomainParams{}

	resp, err := client.Api.FetchSipDomain("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.AccountSid != nil {
			fmt.Println(*resp.AccountSid)
		} else {
			fmt.Println(resp.AccountSid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$domain = $twilio->sip->domains("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")->fetch();

print $domain->accountSid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

domain = @client
         .api
         .v2010
         .sip
         .domains('SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
         .fetch

puts domain.account_sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:core:sip:domains:fetch \
   --sid SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
```

```bash
curl -X GET "https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/SIP/Domains/SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "api_version": "2010-04-01",
  "auth_type": "IP_ACL",
  "date_created": "Mon, 20 Jul 2015 17:27:10 +0000",
  "date_updated": "Mon, 20 Jul 2015 17:27:10 +0000",
  "domain_name": "dunder-mifflin-scranton.sip.twilio.com",
  "friendly_name": "Scranton Office",
  "sip_registration": true,
  "sid": "SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "subresource_uris": {
    "credential_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json",
    "ip_access_control_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json"
  },
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
  "voice_fallback_method": "POST",
  "voice_fallback_url": null,
  "voice_method": "POST",
  "voice_status_callback_method": "POST",
  "voice_status_callback_url": null,
  "voice_url": "https://dundermifflin.example.com/twilio/app.php",
  "emergency_calling_enabled": true,
  "secure": true,
  "byoc_trunk_sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "emergency_caller_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

## Read multiple SipDomain resources

`GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains.json`

### Path parameters

```json
[{"name":"AccountSid","in":"path","description":"The SID of the [Account](/docs/iam/api/account) that created the SipDomain resources to read.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$"},"required":true}]
```

### Query parameters

```json
[{"name":"PageSize","in":"query","description":"How many resources to return in each list page. The default is 50, and the maximum is 1000.","schema":{"type":"integer","format":"int64","minimum":1,"maximum":1000}},{"name":"Page","in":"query","description":"The page index. This value is simply for client state.","schema":{"type":"integer","minimum":0}},{"name":"PageToken","in":"query","description":"The page token. This is provided by the API.","schema":{"type":"string"}}]
```

Read multiple SipDomain resources

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function listSipDomain() {
  const domains = await client.sip.domains.list({ limit: 20 });

  domains.forEach((d) => console.log(d.accountSid));
}

listSipDomain();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

domains = client.sip.domains.list(limit=20)

for record in domains:
    print(record.account_sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Sip;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var domains = await DomainResource.ReadAsync(limit: 20);

        foreach (var record in domains) {
            Console.WriteLine(record.AccountSid);
        }
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.sip.Domain;
import com.twilio.base.ResourceSet;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        ResourceSet<Domain> domains = Domain.reader().limit(20).read();

        for (Domain record : domains) {
            System.out.println(record.getAccountSid());
        }
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	api "github.com/twilio/twilio-go/rest/api/v2010"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &api.ListSipDomainParams{}
	params.SetLimit(20)

	resp, err := client.Api.ListSipDomain(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		for record := range resp {
			if resp[record].AccountSid != nil {
				fmt.Println(*resp[record].AccountSid)
			} else {
				fmt.Println(resp[record].AccountSid)
			}
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$domains = $twilio->sip->domains->read(20);

foreach ($domains as $record) {
    print $record->accountSid;
}
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

domains = @client
          .api
          .v2010
          .sip
          .domains
          .list(limit: 20)

domains.each do |record|
   puts record.account_sid
end
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:core:sip:domains:list
```

```bash
curl -X GET "https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/SIP/Domains.json?PageSize=20" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "domains": [
    {
      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "api_version": "2010-04-01",
      "auth_type": "IP_ACL",
      "date_created": "Mon, 20 Jul 2015 17:27:10 +0000",
      "date_updated": "Mon, 20 Jul 2015 17:27:10 +0000",
      "domain_name": "dunder-mifflin-scranton.sip.twilio.com",
      "friendly_name": "Scranton Office",
      "sip_registration": true,
      "sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "subresource_uris": {
        "credential_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json",
        "ip_access_control_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json"
      },
      "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
      "voice_fallback_method": "POST",
      "voice_fallback_url": null,
      "voice_method": "POST",
      "voice_status_callback_method": "POST",
      "voice_status_callback_url": null,
      "voice_url": "https://dundermifflin.example.com/twilio/app.php",
      "emergency_calling_enabled": true,
      "secure": true,
      "byoc_trunk_sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "emergency_caller_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    }
  ],
  "start": 0,
  "end": 0,
  "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains.json?PageSize=50&Page=0",
  "next_page_uri": null,
  "page": 0,
  "page_size": 50,
  "previous_page_uri": null,
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains.json?PageSize=50&Page=0"
}
```

## Update a SipDomain resource

`POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json`

### Path parameters

```json
[{"name":"AccountSid","in":"path","description":"The SID of the [Account](/docs/iam/api/account) that created the SipDomain resource to update.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$"},"required":true},{"name":"Sid","in":"path","description":"The Twilio-provided string that uniquely identifies the SipDomain resource to update.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^SD[0-9a-fA-F]{32}$"},"required":true}]
```

### Request body parameters

```json
{"schema":{"type":"object","title":"UpdateSipDomainRequest","properties":{"FriendlyName":{"type":"string","description":"A descriptive string that you created to describe the resource. It can be up to 64 characters long."},"VoiceFallbackMethod":{"type":"string","format":"http-method","enum":["GET","POST"],"description":"The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`."},"VoiceFallbackUrl":{"type":"string","format":"uri","description":"The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},"VoiceMethod":{"type":"string","format":"http-method","enum":["GET","POST"],"description":"The HTTP method we should use to call `voice_url`"},"VoiceStatusCallbackMethod":{"type":"string","format":"http-method","enum":["GET","POST"],"description":"The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`."},"VoiceStatusCallbackUrl":{"type":"string","format":"uri","description":"The URL that we should call to pass status parameters (such as call ended) to your application.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},"VoiceUrl":{"type":"string","format":"uri","description":"The URL we should call when the domain receives a call.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}},"SipRegistration":{"type":"boolean","description":"Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not."},"DomainName":{"type":"string","description":"The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \"-\" and must end with `sip.twilio.com`."},"EmergencyCallingEnabled":{"type":"boolean","description":"Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses."},"Secure":{"type":"boolean","description":"Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain."},"ByocTrunkSid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^BY[0-9a-fA-F]{32}$","description":"The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with."},"EmergencyCallerSid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^PN[0-9a-fA-F]{32}$","description":"Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call."}}},"examples":{"update":{"value":{"lang":"json","value":"{\n  \"DomainName\": \"dunder-mifflin-scranton.sip.twilio.com\",\n  \"FriendlyName\": \"Scranton Office\",\n  \"VoiceFallbackMethod\": \"POST\",\n  \"VoiceFallbackUrl\": \"\",\n  \"VoiceMethod\": \"POST\",\n  \"VoiceStatusCallbackMethod\": \"POST\",\n  \"VoiceStatusCallbackUrl\": \"\",\n  \"VoiceUrl\": \"https://dundermifflin.example.com/twilio/app.php\",\n  \"SipRegistration\": true,\n  \"EmergencyCallingEnabled\": true,\n  \"Secure\": true,\n  \"ByocTrunkSid\": \"BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n  \"EmergencyCallerSid\": \"PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n}","meta":"","code":"{\n  \"DomainName\": \"dunder-mifflin-scranton.sip.twilio.com\",\n  \"FriendlyName\": \"Scranton Office\",\n  \"VoiceFallbackMethod\": \"POST\",\n  \"VoiceFallbackUrl\": \"\",\n  \"VoiceMethod\": \"POST\",\n  \"VoiceStatusCallbackMethod\": \"POST\",\n  \"VoiceStatusCallbackUrl\": \"\",\n  \"VoiceUrl\": \"https://dundermifflin.example.com/twilio/app.php\",\n  \"SipRegistration\": true,\n  \"EmergencyCallingEnabled\": true,\n  \"Secure\": true,\n  \"ByocTrunkSid\": \"BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n  \"EmergencyCallerSid\": \"PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"DomainName\"","#7EE787"],[":","#C9D1D9"]," ",["\"dunder-mifflin-scranton.sip.twilio.com\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"FriendlyName\"","#7EE787"],[":","#C9D1D9"]," ",["\"Scranton Office\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"VoiceFallbackMethod\"","#7EE787"],[":","#C9D1D9"]," ",["\"POST\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"VoiceFallbackUrl\"","#7EE787"],[":","#C9D1D9"]," ",["\"\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"VoiceMethod\"","#7EE787"],[":","#C9D1D9"]," ",["\"POST\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"VoiceStatusCallbackMethod\"","#7EE787"],[":","#C9D1D9"]," ",["\"POST\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"VoiceStatusCallbackUrl\"","#7EE787"],[":","#C9D1D9"]," ",["\"\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"VoiceUrl\"","#7EE787"],[":","#C9D1D9"]," ",["\"https://dundermifflin.example.com/twilio/app.php\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"SipRegistration\"","#7EE787"],[":","#C9D1D9"]," ",["true","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"EmergencyCallingEnabled\"","#7EE787"],[":","#C9D1D9"]," ",["true","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"Secure\"","#7EE787"],[":","#C9D1D9"]," ",["true","#79C0FF"],[",","#C9D1D9"],"\n  ",["\"ByocTrunkSid\"","#7EE787"],[":","#C9D1D9"]," ",["\"BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"EmergencyCallerSid\"","#7EE787"],[":","#C9D1D9"]," ",["\"PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

Update a SipDomain resource

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function updateSipDomain() {
  const domain = await client.sip
    .domains("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .update({ friendlyName: "friendly_name" });

  console.log(domain.accountSid);
}

updateSipDomain();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

sip_domain = client.sip.domains("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(
    friendly_name="friendly_name"
)

print(sip_domain.account_sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Sip;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var domain = await DomainResource.UpdateAsync(
            friendlyName: "friendly_name", pathSid: "SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

        Console.WriteLine(domain.AccountSid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.sip.Domain;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Domain domain = Domain.updater("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").setFriendlyName("friendly_name").update();

        System.out.println(domain.getAccountSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	api "github.com/twilio/twilio-go/rest/api/v2010"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &api.UpdateSipDomainParams{}
	params.SetFriendlyName("friendly_name")

	resp, err := client.Api.UpdateSipDomain("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.AccountSid != nil {
			fmt.Println(*resp.AccountSid)
		} else {
			fmt.Println(resp.AccountSid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$sip_domain = $twilio->sip
    ->domains("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    ->update(["friendlyName" => "friendly_name"]);

print $sip_domain->accountSid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

domain = @client
         .api
         .v2010
         .sip
         .domains('SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
         .update(friendly_name: 'friendly_name')

puts domain.account_sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:core:sip:domains:update \
   --sid SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
   --friendly-name friendly_name
```

```bash
curl -X POST "https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/SIP/Domains/SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json" \
--data-urlencode "FriendlyName=friendly_name" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "api_version": "2010-04-01",
  "auth_type": "IP_ACL",
  "date_created": "Mon, 20 Jul 2015 17:27:10 +0000",
  "date_updated": "Mon, 20 Jul 2015 17:27:10 +0000",
  "domain_name": "dunder-mifflin-scranton.sip.twilio.com",
  "friendly_name": "friendly_name",
  "sip_registration": true,
  "sid": "SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "subresource_uris": {
    "credential_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json",
    "ip_access_control_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json"
  },
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
  "voice_fallback_method": "POST",
  "voice_fallback_url": null,
  "voice_method": "POST",
  "voice_status_callback_method": "POST",
  "voice_status_callback_url": null,
  "voice_url": "https://dundermifflin.example.com/twilio/app.php",
  "emergency_calling_enabled": true,
  "secure": true,
  "byoc_trunk_sid": "BYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "emergency_caller_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
```

## Delete a SipDomain resource

`DELETE https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SIP/Domains/{Sid}.json`

### Path parameters

```json
[{"name":"AccountSid","in":"path","description":"The SID of the [Account](/docs/iam/api/account) that created the SipDomain resources to delete.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$"},"required":true},{"name":"Sid","in":"path","description":"The Twilio-provided string that uniquely identifies the SipDomain resource to delete.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^SD[0-9a-fA-F]{32}$"},"required":true}]
```

Delete a SipDomain resource

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function deleteSipDomain() {
  await client.sip.domains("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").remove();
}

deleteSipDomain();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

client.sip.domains("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete()
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Sip;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        await DomainResource.DeleteAsync(pathSid: "SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.sip.Domain;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Domain.deleter("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete();
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	api "github.com/twilio/twilio-go/rest/api/v2010"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &api.DeleteSipDomainParams{}

	err := client.Api.DeleteSipDomain("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$twilio->sip->domains("SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")->delete();
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

@client
  .api
  .v2010
  .sip
  .domains('SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
  .delete
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:core:sip:domains:remove \
   --sid SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
```

```bash
curl -X DELETE "https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/SIP/Domains/SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```
