NAME
Twilio::Rest::Messaging::V1::Service::UsAppToPerson - The UsAppToPerson resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $us_app_to_person = $client->messaging->v1->services($messaging_service_sid)->us_app_to_person->create($brand_registration_sid, $description, $message_flow, $message_samples, $us_app_to_person_usecase, $has_embedded_links, $has_embedded_phone, \%options);
for my $us_app_to_person ($client->messaging->v1->services($messaging_service_sid)->us_app_to_person->read({}, 20)) {
...
}
my $us_app_to_person = $client->messaging->v1->services($messaging_service_sid)->us_app_to_person($sid)->fetch;
$client->messaging->v1->services($messaging_service_sid)->us_app_to_person($sid)->update($has_embedded_links, $has_embedded_phone, $message_samples, $message_flow, $description, $age_gated, $direct_lending, \%options);
$client->messaging->v1->services($messaging_service_sid)->us_app_to_person($sid)->delete;
DESCRIPTION
A service for (fetch/create/delete) A2P Campaign for a Messaging Service
This file holds UsAppToPersonList, UsAppToPersonPage, UsAppToPersonContext and UsAppToPersonInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
UsAppToPersonList
Returned by $client->messaging->v1->services($messaging_service_sid)->us_app_to_person. See also Twilio::ListResource.
create
my $us_app_to_person = $client->messaging->v1->services($messaging_service_sid)->us_app_to_person->create($brand_registration_sid, $description, $message_flow, $message_samples, $us_app_to_person_usecase, $has_embedded_links, $has_embedded_phone, \%options);
Returns a UsAppToPersonInstance.
The required values are:
$brand_registration_sid-
A2P Brand Registration SID
$description-
A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters.
$message_flow-
Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum.
$message_samples-
An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. An array reference.
$us_app_to_person_usecase-
A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING..]
$has_embedded_links-
Indicates that this SMS campaign will send messages that contain links.
$has_embedded_phone-
Indicates that this SMS campaign will send messages that contain phone numbers.
The options are:
age_gated-
A boolean that specifies whether campaign is age gated or not.
direct_lending-
A boolean that specifies whether campaign allows direct lending or not.
help_keywords-
End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. An array reference.
help_message-
When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum.
opt_in_keywords-
If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. An array reference.
opt_in_message-
If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. 20 character minimum. 320 character maximum.
opt_out_keywords-
End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. An array reference.
opt_out_message-
Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum.
privacy_policy_url-
The URL of the privacy policy for the campaign.
subscriber_opt_in-
A boolean that specifies whether campaign has Subscriber Optin or not.
terms_and_conditions_url-
The URL of the terms and conditions for the campaign.
x_twilio_api_version-
The version of the Messaging API to use for this request
read
my @records = $client->messaging->v1->services($messaging_service_sid)->us_app_to_person->read(\%options, $limit, $page_size);
Returns the records as a list, fetching as many pages as it needs.
The options are:
x_twilio_api_version-
The version of the Messaging API to use for this request
stream
my $stream = $client->messaging->v1->services($messaging_service_sid)->us_app_to_person->stream(\%options, $limit, $page_size);
Takes the same arguments as "read", and returns a Twilio::Stream.
page
my $page = $client->messaging->v1->services($messaging_service_sid)->us_app_to_person->page(\%options, $page_size, $page_token, $page_number);
Fetches one page, and returns a Twilio::Page.
get_page
my $page = $client->messaging->v1->services($messaging_service_sid)->us_app_to_person->get_page($url);
Fetches the page at a URL given by Twilio.
get_context
my $context = $client->messaging->v1->services($messaging_service_sid)->us_app_to_person->get_context($sid);
Returns a UsAppToPersonContext, and makes no request.
UsAppToPersonPage
A Twilio::Page of UsAppToPersonInstance objects.
records_key
build_instance
Used by Twilio::Page.
UsAppToPersonContext
Returned by $client->messaging->v1->services($messaging_service_sid)->us_app_to_person($sid). It makes no request until one of these methods is called.
fetch
my $us_app_to_person = $client->messaging->v1->services($messaging_service_sid)->us_app_to_person($sid)->fetch(\%options);
Returns a UsAppToPersonInstance.
The options are:
x_twilio_api_version-
The version of the Messaging API to use for this request
update
my $us_app_to_person = $client->messaging->v1->services($messaging_service_sid)->us_app_to_person($sid)->update($has_embedded_links, $has_embedded_phone, $message_samples, $message_flow, $description, $age_gated, $direct_lending, \%options);
Returns a UsAppToPersonInstance.
The required values are:
$has_embedded_links-
Indicates that this SMS campaign will send messages that contain links.
$has_embedded_phone-
Indicates that this SMS campaign will send messages that contain phone numbers.
$message_samples-
An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. An array reference.
$message_flow-
Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum.
$description-
A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters.
$age_gated-
A boolean that specifies whether campaign requires age gate for federally legal content.
$direct_lending-
A boolean that specifies whether campaign allows direct lending or not.
The options are:
privacy_policy_url-
The URL of the privacy policy for the campaign.
terms_and_conditions_url-
The URL of the terms and conditions for the campaign.
x_twilio_api_version-
The version of the Messaging API to use for this request
delete
$client->messaging->v1->services($messaging_service_sid)->us_app_to_person($sid)->delete;
Returns true.
UsAppToPersonInstance
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 the Campaign belongs to.
- age_gated
-
A boolean that specifies whether campaign is age gated or not.
- brand_registration_sid
-
The unique string to identify the A2P brand.
- campaign_id
-
The Campaign Registry (TCR) Campaign ID.
- campaign_status
-
Campaign status. Examples: IN_PROGRESS, VERIFIED, FAILED.
- date_created
-
The date and time in GMT when the resource was created specified in ISO 8601 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 ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- description
-
A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters.
- direct_lending
-
A boolean that specifies whether campaign allows direct lending or not.
- errors
-
Details indicating why a campaign registration failed. These errors can indicate one or more fields that were incorrect or did not meet review requirements.
- has_embedded_links
-
Indicate that this SMS campaign will send messages that contain links.
- has_embedded_phone
-
Indicates that this SMS campaign will send messages that contain phone numbers.
- help_keywords
-
End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum.
- help_message
-
When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum.
- is_externally_registered
-
Indicates whether the campaign was registered externally or not.
- message_flow
-
Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum.
- message_samples
-
An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars.
- messaging_service_sid
-
The SID of the Messaging Service that the resource is associated with.
- mock
-
A boolean that specifies whether campaign is a mock or not. Mock campaigns will be automatically created if using a mock brand. Mock campaigns should only be used for testing purposes.
- opt_in_keywords
-
If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum.
- opt_in_message
-
If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. 20 character minimum. 320 character maximum.
- opt_out_keywords
-
End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum.
- opt_out_message
-
Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum.
- privacy_policy_url
-
The URL of the privacy policy for the campaign.
- rate_limits
-
Rate limit and/or classification set by each carrier, Ex. AT&T or T-Mobile.
- sid
-
The unique string that identifies a US A2P Compliance resource
QE2c6890da8086d771620e9b13fadeba0b. - subscriber_opt_in
-
A boolean that specifies whether campaign has Subscriber Optin or not.
- terms_and_conditions_url
-
The URL of the terms and conditions for the campaign.
- url
-
The absolute URL of the US App to Person resource.
- us_app_to_person_usecase
-
A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING, SOLE_PROPRIETOR...]. SOLE_PROPRIETOR campaign use cases can only be created by SOLE_PROPRIETOR Brands, and there can only be one SOLE_PROPRIETOR campaign created per SOLE_PROPRIETOR Brand.
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.