Menu

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Origination URLs

Represents the Origination SIP URL(s) of your Trunk. These identify the network element entry point(s) into your communications infrastructure (e.g. IP-PBX, SBC). See Origination Settings for more information.

Actions

Resource Properties

An Origination URL instance resource has the following properties:

Names in PHP format
accountSid
sid<AC> Not PII

The SID of the Account that created the OriginationUrl resource.

sid
sid<OU> Not PII

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

trunkSid
sid<TR> Not PII

The SID of the Trunk that owns the Origination URL.

weight
integer Not PII

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.

enabled
boolean Not PII

Whether the URL is enabled. The default is true.

sipUrl

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

friendlyName
string Not PII

The string that you assigned to describe the resource.

priority
integer Not PII

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.

dateCreated
date_time<iso8601> Not PII

The date and time in GMT when the resource was created specified in RFC 2822 format.

dateUpdated
date_time<iso8601> Not PII

The date and time in GMT when the resource was last updated specified in RFC 2822 format.

url
url Not PII

The absolute URL of the resource.


List All Origination URLs

Back To Top

GET /Trunks/{Trunk SID}/OriginationUrls

Get a paged listing of all Origination URLs for this Trunk.

curl -G https://trunking.twilio.com/v1/Trunks/{Trunk SID}/OriginationUrls \
    -u '{twilio account sid}:{twilio auth token}'

Example Response

{
  "meta": {
    "page": 0,
    "page_size": 50,
    "first_page_url": "https://trunking.twilio.com/v1/Trunks/TKfa1e5a85f63bfc475c2c753c0f289932/OriginationUrls?PageSize=50&Page=0",
    "previous_page_url": null,
    "url": "https://trunking.twilio.com/v1/Trunks/TKfa1e5a85f63bfc475c2c753c0f289932/OriginationUrls?PageSize=50&Page=0",
    "next_page_url": null,
    "key": "origination_urls"
  },
  "origination_urls": [
    {
      "sid": "OU7d8d1292a8a8b2722cbaff50b371fc33",
      "account_sid": "ACxxx",
      "trunk_sid": "TKfa1e5a85f63bfc475c2c753c0f289932",
      "weight": 60,
      "enabled": true,
      "sip_url": "sip:169.10.1.15",
      "friendly_name": "",
      "priority": 10,
      "date_created": "2015-03-10T19:25:50Z",
      "date_updated": "2015-08-16T05:17:49Z",
      "url": "https://trunking.twilio.com/v1/Trunks/TKfa1e5a85f63bfc475c2c753c0f289932/OriginationUrls/OU7d8d1292a8a8b2722cbaff50b371fc33"
    }
  ]
}


Create an Origination URL

Back To Top

POST /Trunks/{Trunk SID}/OriginationUrls

Create a new Origination URL for a Trunk.

Note: The maximum amount of Origination URLs allowed for any given Trunk is 10.

curl -XPOST https://trunking.twilio.com/v1/Trunks/{Trunk SID}/OriginationUrls \
    -d "FriendlyName=MyOriginationUrl" \
    -d "SipUrl=sip:xxx" \
    -d "Priority=0" \
    -d "Weight=1" \
    -d "Enabled=true" \
    -u '{twilio account sid}:{twilio auth token}'

Required Parameters

Names in PHP format
trunkSid
Required
post sid<TR> Not PII

The SID of the Trunk to associate the resource with.

weight
Required
post integer Not PII

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.

priority
Required
post integer Not PII

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.

enabled
Required
post boolean Not PII

Whether the URL is enabled. The default is true.

friendlyName
Required
post string Not PII

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

sipUrl
Required
post url PII MTL: 30 DAYS

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

Example Response

{
  "sid": "OUa83fd602a8bcb24b0a8a10bab87b1085",
  "account_sid": "ACxxx",
  "trunk_sid": "TKfa1e5a85f63bfc475c2c753c0f289932",
  "weight": 10,
  "enabled": true,
  "sip_url": "sip:169.10.1.35",
  "friendly_name": "sip:169.10.1.35",
  "priority": 20,
  "date_created": "2015-09-02T23:15:56Z",
  "date_updated": "2015-09-02T23:15:56Z",
  "url": "https://trunking.twilio.com/v1/Trunks/TKfa1e5a85f63bfc475c2c753c0f289932/OriginationUrls/OUa83fd602a8bcb24b0a8a10bab87b1085"
}


Retrieve an Origination URL

Back To Top

GET /Trunks/{Trunk SID}/OriginationUrls/{URL SID}

Get instance data for a particular origination URL for a Trunk.

curl -G https://trunking.twilio.com/v1/Trunks/{Trunk SID}/OriginationUrls/{URL SID} \
    -u '{twilio account sid}:{twilio auth token}'

Example Response

{
  "sid": "OUa83fd602a8bcb24b0a8a10bab87b1085",
  "account_sid": "ACxxx",
  "trunk_sid": "TKfa1e5a85f63bfc475c2c753c0f289932",
  "weight": 10,
  "enabled": true,
  "sip_url": "sip:169.10.1.35",
  "friendly_name": "sip:169.10.1.35",
  "priority": 20,
  "date_created": "2015-09-02T23:15:56Z",
  "date_updated": "2015-09-02T23:15:56Z",
  "url": "https://trunking.twilio.com/v1/Trunks/TKfa1e5a85f63bfc475c2c753c0f289932/OriginationUrls/OUa83fd602a8bcb24b0a8a10bab87b1085"
}


Update an Origination URL

Back To Top

POST /Trunks/{Trunk SID}/OriginationUrls/{URL SID}

Update the properties of an Origination URL for a Trunk.

Note: The maximum amount of Origination URLs allowed for any given Trunk is 10.

curl -XPOST https://trunking.twilio.com/v1/Trunks/{Trunk SID}/OriginationUrls/{URL SID} \
    -d "Priority=30"  \
    -u '{twilio account sid}:{twilio auth token}'

Optional Parameters

Names in PHP format
trunkSid
Required
post sid<TR> Not PII

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

sid
Required
post sid<OU> Not PII

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

weight
Optional
post integer Not PII

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.

priority
Optional
post integer Not PII

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.

enabled
Optional
post boolean Not PII

Whether the URL is enabled. The default is true.

friendlyName
Optional
post string Not PII

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

sipUrl
Optional
post url PII MTL: 30 DAYS

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

Example Response

{
  "sid": "OUa83fd602a8bcb24b0a8a10bab87b1085",
  "account_sid": "ACxxx",
  "trunk_sid": "TKfa1e5a85f63bfc475c2c753c0f289932",
  "weight": 10,
  "enabled": true,
  "sip_url": "sip:169.10.1.35",
  "friendly_name": "sip:169.10.1.35",
  "priority": 30,
  "date_created": null,
  "date_updated": null,
  "url": "https://trunking.twilio.com/v1/Trunks/TKfa1e5a85f63bfc475c2c753c0f289932/OriginationUrls/OUa83fd602a8bcb24b0a8a10bab87b1085"
}


Delete an Origination URL

Back To Top

DELETE /Trunks/{Trunk SID}/OriginationUrls/{URL SID}

Remove an Origination URL from this Trunk.

curl -XDELETE https://trunking.twilio.com/v1/Trunks/{Trunk SID}/OriginationUrls/{URL SID} \
    -u '{twilio account sid}:{twilio auth token}'

Example Response

A successful request returns an HTTP status code 204 and an empty body.

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.