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 for a Messaging Service.
An A2P Campaign is built around a specific use case that will indicate the intent of the messages you send with your Messaging Service, in association with your A2P Brand. Some example A2P campaign use cases are:
With this REST API you can:
This resource is part of the A2P 10DLC registration process. For Independent Software Vendors (ISVs), please see this guide for registering your customers as Standard and Low-Volume Standard Brands for A2P messaging Campaigns via our API. See this guide for registering your customers as Sole Proprietor Brands for A2P messaging Campaigns.
The unique string that identifies a US A2P Compliance resource QE2c6890da8086d771620e9b13fadeba0b
.
The SID of the Messaging Service that the resource is associated with.
A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters.
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.
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.
Indicate that this SMS campaign will send messages that contain links.
Indicates that this SMS campaign will send messages that contain phone numbers.
A boolean that specifies whether campaign has Subscriber Optin or not.
A boolean that specifies whether campaign allows direct lending or not.
Indicates whether the campaign was registered externally or not.
Rate limit and/or classification set by each carrier, Ex. AT&T or T-Mobile.
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.
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.
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.
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.
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.
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.
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.
The date and time in GMT when the resource was created specified in ISO 8601 format.
The date and time in GMT when the resource was last updated specified in ISO 8601 format.
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.
Details indicating why a campaign registration failed. These errors can indicate one or more fields that were incorrect or did not meet review requirements.
POST https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/Compliance/Usa2p
The SID of the Messaging Service to create the resources from.
A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters.
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.
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.
A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING..]
Indicates that this SMS campaign will send messages that contain links.
Indicates that this SMS campaign will send messages that contain phone numbers.
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.
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.
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.
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.
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.
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.
A boolean that specifies whether campaign has Subscriber Optin or not.
A boolean that specifies whether campaign allows direct lending or not.
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.
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
.
The SID of the US A2P Compliance resource to fetch QE2c6890da8086d771620e9b13fadeba0b
.
In the json response to this fetch
call, you would be looking in particular at the campaign_status
attribute. The possible statuses for campaigns will vary depending on what stage the Campaign is at in the review process. A newly-created Campaign that has yet to be considered by TCR will be PENDING, assuming that the Twilio API itself has accepted it (i.e., all the data is basically conforming); otherwise it will be FAILED. Once TCR has begun its own review process on a successfully-submitted Campaign, the Campaign will be IN_PROGRESS until that review has finished. At that point the campaign_status
will be either VERIFIED (approved) or FAILED (rejected).
If campaign_status
is FAILED, the response will contain an "errors" attribute with the information on why the registration failed (this errors[]
attribute is present in the return for other statuses as well, but will be empty) . The populated errors[] attribute is particularly helpful if the campaign registration failed during Twilio's internal review or External campaign review by our partners.
If your Campaign is marked as FAILED, please see this Guide to Troubleshooting A2P Brands and Campaignsto understand Campaign error messages and how to rectify these
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.
GET https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/Compliance/Usa2p
How many resources to return in each list page. The default is 50, and the maximum is 1000.
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
.
The SID of the US A2P Compliance resource to delete QE2c6890da8086d771620e9b13fadeba0b
.