Menu

Expand
Rate this page:

US App to Person Campaign Resource

This resource is related to United States A2P 10DLC registration. For more information on A2P 10DLC registration, please see our support article What is A2P 10DLC?

The US App to Person (A2P) Campaign Resource allows you to create a US A2P Campaign Use Case for a Messaging Service.

You can think of an A2P campaign use case as a use case for your brand that will show the intent of the messages you send with your Messaging Service. Some example A2P campaign use cases are:

  • Marketing messages
  • Notifications
  • Verification messages

With this REST API you can:

This resource is part of the A2P 10DLC registration process. For Independent Software Vendors (ISVs), please see the ISV A2P 10DLC API registration guide for a step-by-step walkthrough on registering your customers for A2P 10DLC.

US App to Person Campaign Resource Properties

Updates are coming to Twilio’s Starter Brand registration based on changes from The Campaign Registry (TCR) and mobile carriers. We will provide updates on how this change may impact US A2P 10DLC registration as soon as they are available. Brands with EINs will no longer be able to use Twilio's Starter Brand registration going forward.

In the meantime, if you are registering on behalf of an organization with an EIN/Tax ID, please complete a Standard registration.

Resource Properties in REST API format
sid
sid<QE> Not PII

The unique string that identifies a US A2P Compliance resource QE2c6890da8086d771620e9b13fadeba0b.

account_sid
sid<AC> Not PII

The SID of the Account that the Campaign belongs to.

brand_registration_sid
sid<BN> Not PII

The unique string to identify the A2P brand.

messaging_service_sid
sid<MG> Not PII

The SID of the Messaging Service that the resource is associated with.

description
string Not PII

A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters.

message_samples
string[] Not PII

Message samples, at least 1 and up to 5 sample messages (at least 2 for starter/sole proprietor), >=20 chars, <=1024 chars each.

us_app_to_person_usecase
string Not PII

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.

has_embedded_links
boolean Not PII

Indicate that this SMS campaign will send messages that contain links.

has_embedded_phone
boolean Not PII

Indicates that this SMS campaign will send messages that contain phone numbers.

campaign_status
string Not PII

Campaign status. Examples: IN_PROGRESS, VERIFIED, FAILED.

campaign_id
string Not PII

The Campaign Registry (TCR) Campaign ID.

is_externally_registered
boolean Not PII

Indicates whether the campaign was registered externally or not.

rate_limits
object Not PII

Rate limit and/or classification set by each carrier, Ex. AT&T or T-Mobile.

message_flow
string Not PII

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.

opt_in_message
string Not PII

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_message
string Not PII

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.

help_message
string Not PII

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
string[] Not PII

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_out_keywords
string[] Not PII

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.

help_keywords
string[] Not PII

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.

date_created
date_time<iso8601> Not PII

The date and time in GMT when the resource was created specified in ISO 8601 format.

date_updated
date_time<iso8601> Not PII

The date and time in GMT when the resource was last updated specified in ISO 8601 format.

url
url Not PII

The absolute URL of the US App to Person resource.

mock
boolean Not PII

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.

errors
object[] Not PII

Details indicating why a campaign registration failed. These errors can indicate one or more fields that were incorrect or did not meet review requirements.

Create a US A2P Campaign Use Case

post
https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/Compliance/Usa2p
Parameters
Parameters in REST API format
messaging_service_sid
Path
post sid<MG> Not PII

The SID of the Messaging Service to create the resources from.

brand_registration_sid
Required
post sid<BN> Not PII

A2P Brand Registration SID

description
Required
post string Not PII

A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters.

message_flow
Required
post string Not PII

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
Required
post string[] Not PII

Message samples, at least 1 and up to 5 sample messages (at least 2 for sole proprietor), >=20 chars, <=1024 chars each.

us_app_to_person_usecase
Required
post string Not PII

A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING..]

has_embedded_links
Required
post boolean Not PII

Indicates that this SMS campaign will send messages that contain links.

has_embedded_phone
Required
post boolean Not PII

Indicates that this SMS campaign will send messages that contain phone numbers.

opt_in_message
Optional
post string Not PII

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_message
Optional
post string Not PII

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.

help_message
Optional
post string Not PII

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
Optional
post string[] Not PII

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_out_keywords
Optional
post string[] Not PII

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.

help_keywords
Optional
post string[] Not PII

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.

If you use Twilio's default opt-out or advanced opt-out, you do not need to submit opt-out and help keywords and messages when creating a Campaign. Twilio will automatically complete those fields for you with the default or your advanced opt-out and help messaging.

If you manage opt-out and help yourself, you must pass the opt-out and help parameters when creating a Campaign.

Example 1
Loading Code Sample...
        
        

        Create a US A2P Campaign Use Case

        Fetch a US A2P Campaign Use Case

        get
        https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/Compliance/Usa2p/{Sid}

        Example 1: The value of Sid will always be the US A2P Compliance resource identifier: QE2c6890da8086d771620e9b13fadeba0b.

        Parameters
        Parameters in REST API format
        messaging_service_sid
        Path
        get sid<MG> Not PII

        The SID of the Messaging Service to fetch the resource from.

        sid
        Path
        get sid<QE> Not PII

        The SID of the US A2P Compliance resource to fetch QE2c6890da8086d771620e9b13fadeba0b.

        Example 1
        Loading Code Sample...
              
              

              Fetch a US A2P Campaign Use Case

              Fetch a list of possible US A2P Campaign Use Cases

              To fetch a list of possible US A2P campaign use cases for a Messaging Service, provide the BrandRegistrationSID (BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) as shown in Example 2.

              If you haven not yet created a brand, please see one of the following US A2P ISV API guides on how to do so:

              For more information on possible campaign use cases for Messaging Services, head over to the US App to Person Messaging Service Use Case Resource.

              Example 2
              Loading Code Sample...
                    
                    

                    Fetch a list of possible US A2P Campaign Use Cases

                    Read a List of US A2P Campaign Use Cases

                    get
                    https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/Compliance/Usa2p
                    Parameters
                    Parameters in REST API format
                    messaging_service_sid
                    Path
                    get sid<MG> Not PII

                    The SID of the Messaging Service to fetch the resource from.

                    Example 1
                    Loading Code Sample...
                          
                          

                          Read a List of US A2P Campaign Use Cases

                          Delete a US A2P Campaign Use Case

                          delete
                          https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/Compliance/Usa2p/{Sid}

                          Note: The value of Sid will always be the US A2P Compliance resource identifier: QE2c6890da8086d771620e9b13fadeba0b.

                          Parameters
                          Parameters in REST API format
                          messaging_service_sid
                          Path
                          delete sid<MG> Not PII

                          The SID of the Messaging Service to delete the resource from.

                          sid
                          Path
                          delete sid<QE> Not PII

                          The SID of the US A2P Compliance resource to delete QE2c6890da8086d771620e9b13fadeba0b.

                          Example 1
                          Loading Code Sample...
                                
                                

                                Delete a US A2P Campaign Use Case

                                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 by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

                                Loading Code Sample...
                                      
                                      
                                      

                                      Thank you for your feedback!

                                      Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                                      Sending your feedback...
                                      🎉 Thank you for your feedback!
                                      Something went wrong. Please try again.

                                      Thanks for your feedback!

                                      thanks-feedback-gif