NAME

Twilio::Rest::Content::V1::Content - The Content resource

SYNOPSIS

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

my $content = $client->content->v1->contents->create(\%body);
for my $content ($client->content->v1->contents->read({}, 20)) {
  ...
}
my $content = $client->content->v1->contents($sid)->fetch;
$client->content->v1->contents($sid)->update(\%body);
$client->content->v1->contents($sid)->delete;

DESCRIPTION

A Content resource represents rich messaging content.

This file holds ContentList, ContentPage, ContentContext and ContentInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

ContentList

Returned by $client->content->v1->contents. See also Twilio::ListResource.

create

my $content = $client->content->v1->contents->create(\%body);

Create a Content resource. Returns a ContentInstance.

%body is sent as JSON. It takes the names Twilio's API documentation uses.

Its fields are:

friendly_name

User defined name of the content

language

Required. Language code for the content

types

Required. No description in the specification.

variables

Key value pairs of variable name to value

read

my @records = $client->content->v1->contents->read(\%options, $limit, $page_size);

Retrieve a list of Contents belonging to the account used to make the request. Returns the records as a list, fetching as many pages as it needs.

stream

my $stream = $client->content->v1->contents->stream(\%options, $limit, $page_size);

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

page

my $page = $client->content->v1->contents->page(\%options, $page_size, $page_token, $page_number);

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

get_page

my $page = $client->content->v1->contents->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->content->v1->contents->get_context($sid);

Returns a ContentContext, and makes no request.

ContentPage

A Twilio::Page of ContentInstance objects.

records_key

build_instance

Used by Twilio::Page.

ContentContext

Returned by $client->content->v1->contents($sid). It makes no request until one of these methods is called.

fetch

my $content = $client->content->v1->contents($sid)->fetch;

Fetch a Content resource by its unique Content Sid. Returns a ContentInstance.

update

my $content = $client->content->v1->contents($sid)->update(\%body);

Update a Content resource. Returns a ContentInstance.

%body is sent as JSON. It takes the names Twilio's API documentation uses.

Its fields are:

friendly_name

User defined name of the content

language

Language code for the content

types

Required. No description in the specification.

variables

Key value pairs of variable name to value

delete

$client->content->v1->contents($sid)->delete;

Deletes a Content resource. Returns true.

approval_create

my $list = $object->approval_create;

See Twilio::Rest::Content::V1::Content::ApprovalCreate.

approval_fetch

my $context = $object->approval_fetch;

See Twilio::Rest::Content::V1::Content::ApprovalFetch.

ContentInstance

See also Twilio::InstanceResource.

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

Its fields are:

account_sid

The SID of the Account that created Content resource.

date_created

The date and time in GMT that 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 that the resource was last updated specified in RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

friendly_name

A string name used to describe the Content resource. Not visible to the end recipient.

language

Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in.

A list of links related to the Content resource, such as approval_fetch and approval_create

sid

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

types

The Content types (e.g. twilio/text) for this Content resource.

url

The URL of the resource, relative to https://content.twilio.com.

variables

Defines the default placeholder values for variables included in the Content resource. e.g. {"1": "Customer_Name"}.

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.