Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

OriginationUrl Resource


The OriginationUrl Resource represents the Origination SIP URL(s) of your Trunk. OriginationUrls identify the network element entry point(s) into your communications infrastructure (e.g. IP-PBX, SBC). See Origination Settings in the SIP Trunking configuration page
for more information.


OriginationUrl Properties

originationurl-properties page anchor
Resource properties
account_sidtype: SID<AC>
Not PII

The SID of the Account(link takes you to an external page) that created the OriginationUrl resource.

Pattern:
^AC[0-9a-fA-F]{32}$
Min length:
34
Max length:
34

sidtype: SID<OU>

The unique string that we created to identify the OriginationUrl resource.

Pattern:
^OU[0-9a-fA-F]{32}$
Min length:
34
Max length:
34

trunk_sidtype: SID<TK>

The SID of the Trunk that owns the Origination URL.

Pattern:
^TK[0-9a-fA-F]{32}$
Min length:
34
Max length:
34

weighttype: integer

The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority.


enabledtype: boolean

Whether the URL is enabled. The default is true.


sip_urltype: string<uri>

The SIP address you want Twilio to route your Origination calls to. This must be a sip: schema.


friendly_nametype: string

The string that you assigned to describe the resource.


prioritytype: integer

The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI.


date_createdtype: string<date-time>

The date and time in GMT when the resource was created specified in RFC 2822(link takes you to an external page) format.


date_updatedtype: string<date-time>

The date and time in GMT when the resource was last updated specified in RFC 2822(link takes you to an external page) format.


urltype: string<uri>

The absolute URL of the resource.


Create an OriginationUrl resource

create-an-originationurl-resource page anchor
POST https://trunking.twilio.com/v1/Trunks/{TrunkSid}/OriginationUrls

Parameters

create-parameters page anchor
URI parameters
TrunkSidtype: SID<TK>
Path ParameterNot PII

The SID of the Trunk to associate the resource with.

Pattern:
^TK[0-9a-fA-F]{32}$
Min length:
34
Max length:
34

Request body parameters
Weighttype: integerRequired

The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority.


Prioritytype: integerRequired

The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI.


Enabledtype: booleanRequired

Whether the URL is enabled. The default is true.


FriendlyNametype: stringRequired

A descriptive string that you create to describe the resource. It can be up to 64 characters long.


SipUrltype: string<uri>Required

The SIP address you want Twilio to route your Origination calls to. This must be a sip: schema.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_17
// Download the helper library from https://www.twilio.com/docs/node/install
_17
// Find your Account SID and Auth Token at twilio.com/console
_17
// and set the environment variables. See http://twil.io/secure
_17
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_17
const authToken = process.env.TWILIO_AUTH_TOKEN;
_17
const client = require('twilio')(accountSid, authToken);
_17
_17
client.trunking.v1.trunks('TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_17
.originationUrls
_17
.create({
_17
weight: 1,
_17
priority: 1,
_17
enabled: true,
_17
friendlyName: 'friendly_name',
_17
sipUrl: 'https://example.com'
_17
})
_17
.then(origination_url => console.log(origination_url.sid));

Output

_13
{
_13
"weight": 1,
_13
"date_updated": "2018-05-07T20:50:58Z",
_13
"enabled": true,
_13
"friendly_name": "friendly_name",
_13
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"priority": 1,
_13
"sip_url": "sip://sip-box.com:1234",
_13
"sid": "OUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"date_created": "2018-05-07T20:50:58Z",
_13
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"url": "https://trunking.twilio.com/v1/Trunks/TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OriginationUrls/OUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_13
}


Fetch an OriginationUrl resource

fetch-an-originationurl-resource page anchor
GET https://trunking.twilio.com/v1/Trunks/{TrunkSid}/OriginationUrls/{Sid}

URI parameters
TrunkSidtype: SID<TK>
Path ParameterNot PII

The SID of the Trunk from which to fetch the OriginationUrl.

Pattern:
^TK[0-9a-fA-F]{32}$
Min length:
34
Max length:
34

Sidtype: SID<OU>
Path ParameterNot PII

The unique string that we created to identify the OriginationUrl resource to fetch.

Pattern:
^OU[0-9a-fA-F]{32}$
Min length:
34
Max length:
34
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.trunking.v1.trunks('TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.originationUrls('OUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.fetch()
_11
.then(origination_url => console.log(origination_url.friendlyName));

Output

_13
{
_13
"weight": 1,
_13
"date_updated": "2018-05-07T20:20:46Z",
_13
"enabled": false,
_13
"friendly_name": "friendly_name",
_13
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"priority": 1,
_13
"sip_url": "sip://sip-box.com:1234",
_13
"sid": "OUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"date_created": "2018-05-07T20:20:46Z",
_13
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"url": "https://trunking.twilio.com/v1/Trunks/TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OriginationUrls/OUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_13
}


Read multiple OriginationUrl resources

read-multiple-originationurl-resources page anchor
GET https://trunking.twilio.com/v1/Trunks/{TrunkSid}/OriginationUrls

URI parameters
TrunkSidtype: SID<TK>
Path ParameterNot PII

The SID of the Trunk from which to read the OriginationUrl.

Pattern:
^TK[0-9a-fA-F]{32}$
Min length:
34
Max length:
34

PageSizetype: integer
Query ParameterNot PII

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum:
1

Pagetype: integer
Query ParameterNot PII

The page index. This value is simply for client state.

Minimum:
0

PageTokentype: string
Query ParameterNot PII

The page token. This is provided by the API.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.trunking.v1.trunks('TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.originationUrls
_11
.list({limit: 20})
_11
.then(originationUrls => originationUrls.forEach(o => console.log(o.sid)));

Output

_26
{
_26
"meta": {
_26
"first_page_url": "https://trunking.twilio.com/v1/Trunks/TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OriginationUrls?PageSize=50&Page=0",
_26
"key": "origination_urls",
_26
"next_page_url": "https://trunking.twilio.com/v1/Trunks/TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OriginationUrls?PageSize=50&Page=1",
_26
"page": 0,
_26
"page_size": 50,
_26
"previous_page_url": "https://trunking.twilio.com/v1/Trunks/TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OriginationUrls?PageSize=50&Page=0",
_26
"url": "https://trunking.twilio.com/v1/Trunks/TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OriginationUrls?PageSize=50&Page=0"
_26
},
_26
"origination_urls": [
_26
{
_26
"weight": 1,
_26
"date_updated": "2018-05-09T20:47:35Z",
_26
"enabled": true,
_26
"friendly_name": "friendly_name",
_26
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_26
"priority": 1,
_26
"sip_url": "sip://sip-box.com:1234",
_26
"sid": "OUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_26
"date_created": "2018-05-09T20:47:35Z",
_26
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_26
"url": "https://trunking.twilio.com/v1/Trunks/TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OriginationUrls/OUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_26
}
_26
]
_26
}


Update an OriginationUrl resource

update-an-originationurl-resource page anchor
POST https://trunking.twilio.com/v1/Trunks/{TrunkSid}/OriginationUrls/{Sid}

URI parameters
TrunkSidtype: SID<TK>
Path ParameterNot PII

The SID of the Trunk from which to update the OriginationUrl.

Pattern:
^TK[0-9a-fA-F]{32}$
Min length:
34
Max length:
34

Sidtype: SID<OU>
Path ParameterNot PII

The unique string that we created to identify the OriginationUrl resource to update.

Pattern:
^OU[0-9a-fA-F]{32}$
Min length:
34
Max length:
34

Request body parameters
Weighttype: integer

The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority.


Prioritytype: integer

The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI.


Enabledtype: boolean

Whether the URL is enabled. The default is true.


FriendlyNametype: string

A descriptive string that you create to describe the resource. It can be up to 64 characters long.


SipUrltype: string<uri>

The SIP address you want Twilio to route your Origination calls to. This must be a sip: schema. sips is NOT supported.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.trunking.v1.trunks('TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.originationUrls('OUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.update({weight: 1})
_11
.then(origination_url => console.log(origination_url.friendlyName));

Output

_13
{
_13
"weight": 2,
_13
"date_updated": "2018-05-07T20:50:58Z",
_13
"enabled": false,
_13
"friendly_name": "updated_name",
_13
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"priority": 2,
_13
"sip_url": "sip://sip-updated.com:4321",
_13
"sid": "OUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"date_created": "2018-05-07T20:50:58Z",
_13
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"url": "https://trunking.twilio.com/v1/Trunks/TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OriginationUrls/OUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_13
}


Delete an OriginationUrl resource

delete-an-originationurl-resource page anchor
DELETE https://trunking.twilio.com/v1/Trunks/{TrunkSid}/OriginationUrls/{Sid}

URI parameters
TrunkSidtype: SID<TK>
Path ParameterNot PII

The SID of the Trunk from which to delete the OriginationUrl.

Pattern:
^TK[0-9a-fA-F]{32}$
Min length:
34
Max length:
34

Sidtype: SID<OU>
Path ParameterNot PII

The unique string that we created to identify the OriginationUrl resource to delete.

Pattern:
^OU[0-9a-fA-F]{32}$
Min length:
34
Max length:
34
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.trunking.v1.trunks('TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.originationUrls('OUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.remove();


Rate this page: