NAME

Twilio::Rest::Conversations::V2::Action - The Action resource

SYNOPSIS

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

my $action = $client->conversations->v2->actions($conversation_id)->create(\%body);
my $action = $client->conversations->v2->actions($conversation_id, $action_id)->fetch;

DESCRIPTION

This file holds ActionList, ActionContext and ActionInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

ActionList

Returned by $client->conversations->v2->actions($conversation_id). See also Twilio::ListResource.

create

my $action = $client->conversations->v2->actions($conversation_id)->create(\%body);

Creates an Action within a Conversation. Currently supports SEND_MESSAGE, which sends a message to recipients via the configured channel. Returns 202 Accepted with the Action in PENDING status. Poll GET /v2/Conversations/{ConversationId}/Actions/{ActionId} to check completion. Returns a ActionInstance.

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

get_context

my $context = $client->conversations->v2->actions($conversation_id)->get_context($action_id);

Returns a ActionContext, and makes no request.

ActionContext

Returned by $client->conversations->v2->actions($conversation_id, $action_id). It makes no request until one of these methods is called.

fetch

my $action = $client->conversations->v2->actions($conversation_id, $action_id)->fetch;

Retrieve the current status of an Action. Returns a ActionInstance.

ActionInstance

See also Twilio::InstanceResource.

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

Its fields are:

completed_at

Timestamp when the action reached a terminal status. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

conversation_id

The conversation this action belongs to.

created_at

Timestamp when the action was created. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

failure_reason

Human-readable failure reason. Null unless status is FAILED.

id

Unique identifier for this Action.

Named identifiers from downstream. For SEND_MESSAGE: - messageSid: The downstream message SID (present when PENDING or COMPLETED) - communicationId: The Communication ID (present when COMPLETED) For START_FLOW: - executionSid: The Studio Flow execution SID (present when COMPLETED)

status

Current status of the Action. - PENDING: Action accepted, awaiting downstream confirmation - COMPLETED: Downstream backend confirmed the action (for START_FLOW, the Studio Flow was triggered) - FAILED: Downstream backend reported a failure One of PENDING, COMPLETED or FAILED.

type

The type of action: action-send-message or action-start-flow.

updated_at

Timestamp when the action was last updated. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

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.