NAME

Twilio::Rest::Trunking::V1::Trunk::OriginationUrl - The OriginationUrl resource

SYNOPSIS

my $client = Twilio::Rest::Client->new($account_sid, $auth_token);

my $origination_url = $client->trunking->v1->trunks($trunk_sid)->origination_urls->create($weight, $priority, $enabled, $friendly_name, $sip_url);
for my $origination_url ($client->trunking->v1->trunks($trunk_sid)->origination_urls->read({}, 20)) {
  ...
}
my $origination_url = $client->trunking->v1->trunks($trunk_sid)->origination_urls($sid)->fetch;
$client->trunking->v1->trunks($trunk_sid)->origination_urls($sid)->update(\%options);
$client->trunking->v1->trunks($trunk_sid)->origination_urls($sid)->delete;

DESCRIPTION

Network element entry points into your communications infrastructure

This file holds OriginationUrlList, OriginationUrlPage, OriginationUrlContext and OriginationUrlInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

OriginationUrlList

Returned by $client->trunking->v1->trunks($trunk_sid)->origination_urls. See also Twilio::ListResource.

create

my $origination_url = $client->trunking->v1->trunks($trunk_sid)->origination_urls->create($weight, $priority, $enabled, $friendly_name, $sip_url);

Returns a OriginationUrlInstance.

The required values are:

$weight

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

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

Whether the URL is enabled. The default is true.

$friendly_name

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

$sip_url

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

read

my @records = $client->trunking->v1->trunks($trunk_sid)->origination_urls->read(\%options, $limit, $page_size);

Returns the records as a list, fetching as many pages as it needs.

stream

my $stream = $client->trunking->v1->trunks($trunk_sid)->origination_urls->stream(\%options, $limit, $page_size);

Takes the same arguments as "read", and returns a Twilio::Stream.

page

my $page = $client->trunking->v1->trunks($trunk_sid)->origination_urls->page(\%options, $page_size, $page_token, $page_number);

Fetches one page, and returns a Twilio::Page.

get_page

my $page = $client->trunking->v1->trunks($trunk_sid)->origination_urls->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->trunking->v1->trunks($trunk_sid)->origination_urls->get_context($sid);

Returns a OriginationUrlContext, and makes no request.

OriginationUrlPage

A Twilio::Page of OriginationUrlInstance objects.

records_key

build_instance

Used by Twilio::Page.

OriginationUrlContext

Returned by $client->trunking->v1->trunks($trunk_sid)->origination_urls($sid). It makes no request until one of these methods is called.

fetch

my $origination_url = $client->trunking->v1->trunks($trunk_sid)->origination_urls($sid)->fetch;

Returns a OriginationUrlInstance.

update

my $origination_url = $client->trunking->v1->trunks($trunk_sid)->origination_urls($sid)->update(\%options);

Returns a OriginationUrlInstance.

The options are:

enabled

Whether the URL is enabled. The default is true.

friendly_name

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

priority

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.

sip_url

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

weight

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.

delete

$client->trunking->v1->trunks($trunk_sid)->origination_urls($sid)->delete;

Returns true.

OriginationUrlInstance

See also Twilio::InstanceResource.

It has fetch, update and delete, which work as they do on the context.

Its fields are:

account_sid

The SID of the Account that created the OriginationUrl resource.

date_created

The date and time in GMT when the resource was created specified in RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

date_updated

The date and time in GMT when the resource was last updated specified in RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

enabled

Whether the URL is enabled. The default is true.

friendly_name

The string that you assigned to describe the resource.

priority

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.

sid

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

sip_url

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

trunk_sid

The SID of the Trunk that owns the Origination URL.

url

The absolute URL of the resource.

weight

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.

CONSTRUCTORS

new

Objects here come from the methods above, so there is no need to call new directly.

LICENSE

Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.