This API Reference page is meant to supplement the ISV API Onboarding Guides. Do not attempt to use this API Resource without following the appropriate guide, or you may incur delays in registration and unintended fees.
The UsAppToPerson resource represents an A2P 10DLC Campaign. This resource contains information about the Campaign such as message contents, opt-in and opt-out behavior, and the purpose of the messages.
This resource is part of the A2P 10DLC registration process and is intended only for use by Independent Software Vendors (ISVs).
Not an ISV? Check out the Standard and Low-Volume Brand Onboarding Guide or the Sole Proprietor Brand Onboarding Guide.
The unique string that identifies a US A2P Compliance resource QE2c6890da8086d771620e9b13fadeba0b
.
^QE[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Account that the Campaign belongs to.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The unique string to identify the A2P brand.
^BN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Messaging Service that the resource is associated with.
^MG[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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
This request creates a UsAppToPerson resource, which represents an A2P 10DLC Campaign. Creating this resource submits the Campaign for review and incurs fees.
Learn more about the formats and contents of each parameter in the Gather the Required Business Information doc.
The SID of the Messaging Service to create the resources from.
^MG[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
A2P Brand Registration SID
^BN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createUsAppToPerson() {11const usAppToPerson = await client.messaging.v112.services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.usAppToPerson.create({14brandRegistrationSid: "BNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15description: "Description",16hasEmbeddedLinks: false,17hasEmbeddedPhone: false,18messageFlow:19"End users opt-in by visiting www.example.com and adding their phone number. They then check a box agreeing to receive text messages from Example Brand. Additionally, end users can also opt-in by texting START to (111) 222-3333 to opt in. Term and Conditions at www.example.com/tc. Privacy Policy at www.example.com/privacy",20messageSamples: [21"EXPRESS: Denim Days Event is ON. Reply STOP to unsubscribe.",22"LAST CHANCE: Book your next flight for just 1 (ONE) EUR",23],24usAppToPersonUsecase: "UsAppToPersonUsecase",25});2627console.log(usAppToPerson.sid);28}2930createUsAppToPerson();
1{2"sid": "QE2c6890da8086d771620e9b13fadeba0b",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"brand_registration_sid": "BNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"description": "Description",7"message_samples": [8"EXPRESS: Denim Days Event is ON",9"LAST CHANCE: Book your next flight for just 1 (ONE) EUR"10],11"us_app_to_person_usecase": "UsAppToPersonUsecase",12"has_embedded_links": false,13"has_embedded_phone": false,14"subscriber_opt_in": false,15"age_gated": false,16"direct_lending": false,17"campaign_status": "PENDING",18"campaign_id": "CFOOBAR",19"is_externally_registered": false,20"rate_limits": {21"att": {22"mps": 600,23"msg_class": "A"24},25"tmobile": {26"brand_tier": "TOP"27}28},29"message_flow": "End users opt-in by visiting www.example.com and adding their phone number. They then check a box agreeing to receive text messages from Example Brand. Additionally, end users can also opt-in by texting START to (111) 222-3333 to opt in. Term and Conditions at www.example.com/tc. Privacy Policy at www.example.com/privacy",30"opt_in_message": "Acme Corporation: You are now opted-in. For help, reply HELP. To opt-out, reply STOP",31"opt_out_message": "You have successfully been unsubscribed from Acme Corporation. You will not receive any more messages from this number.",32"help_message": "Acme Corporation: Please visit www.example.com to get support. To opt-out, reply STOP.",33"opt_in_keywords": [34"START"35],36"opt_out_keywords": [37"STOP"38],39"help_keywords": [40"HELP"41],42"date_created": "2021-02-18T14:48:52Z",43"date_updated": "2021-02-18T14:48:52Z",44"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Compliance/Usa2p/QE2c6890da8086d771620e9b13fadeba0b",45"mock": false,46"errors": []47}
GET https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/Compliance/Usa2p/{Sid}
This request returns a UsAppToPerson resource. The UsAppToPerson resource represents an A2P 10DLC Campaign.
The value of Sid
is always the US A2P Compliance resource identifier: QE2c6890da8086d771620e9b13fadeba0b
.
The SID of the Messaging Service to fetch the resource from.
^MG[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the US A2P Compliance resource to fetch QE2c6890da8086d771620e9b13fadeba0b
.
^QE[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchUsAppToPerson() {11const usAppToPerson = await client.messaging.v112.services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.usAppToPerson("QEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.fetch();1516console.log(usAppToPerson.sid);17}1819fetchUsAppToPerson();
1{2"sid": "QEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"brand_registration_sid": "BNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"description": "Send marketing messages about sales to opted in customers.",7"message_samples": [8"EXPRESS: Denim Days Event is ON",9"LAST CHANCE: Book your next flight for just 1 (ONE) EUR"10],11"us_app_to_person_usecase": "MARKETING",12"has_embedded_links": true,13"has_embedded_phone": false,14"subscriber_opt_in": true,15"age_gated": false,16"direct_lending": false,17"campaign_status": "PENDING",18"campaign_id": "CFOOBAR",19"is_externally_registered": false,20"rate_limits": {21"att": {22"mps": 600,23"msg_class": "A"24},25"tmobile": {26"brand_tier": "TOP"27}28},29"message_flow": "End users opt-in by visiting www.example.com and adding their phone number. They then check a box agreeing to receive text messages from Example Brand. Additionally, end users can also opt-in by texting START to (111) 222-3333 to opt in.",30"opt_in_message": "Acme Corporation: You are now opted-in. For help, reply HELP. To opt-out, reply STOP",31"opt_out_message": "You have successfully been unsubscribed from Acme Corporation. You will not receive any more messages from this number.",32"help_message": "Acme Corporation: Please visit www.example.com to get support. To opt-out, reply STOP.",33"opt_in_keywords": [34"START"35],36"opt_out_keywords": [37"STOP"38],39"help_keywords": [40"HELP"41],42"date_created": "2021-02-18T14:48:52Z",43"date_updated": "2021-02-18T14:48:52Z",44"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Compliance/Usa2p/QE2c6890da8086d771620e9b13fadeba0b",45"mock": false,46"errors": []47}
You can use this request to check the campaign_status
of the Campaign represented by this UsAppToPerson resource. Possible statuses are listed below:
PENDING
- The Campaign has not yet been viewed by TCR.
IN_PROGRESS
- TCR has begun the review process for the Campaign.
FAILED
- The Campaign has failed the verification process.
VERIFIED
- TCR has approved the Campaign.
If campaign_status
is FAILED
, the errors
property of the UsAppToPerson resource is populated with a list of reasons why the Campaign was not approved. See the Troubleshooting Campaigns guide for more information.
GET https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/Compliance/Usa2p
This request retrieves all UsAppToPerson resources associated with a specific Messaging Service.
The SID of the Messaging Service to fetch the resource from.
^MG[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listUsAppToPerson() {11const usAppToPeople = await client.messaging.v112.services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.usAppToPerson.list({ limit: 20 });1415usAppToPeople.forEach((u) => console.log(u.sid));16}1718listUsAppToPerson();
1{2"compliance": [3{4"sid": "QE2c6890da8086d771620e9b13fadeba0b",5"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"brand_registration_sid": "BNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",7"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",8"description": "Send marketing messages about sales to opted in customers.",9"message_samples": [10"EXPRESS: Denim Days Event is ON",11"LAST CHANCE: Book your next flight for just 1 (ONE) EUR"12],13"us_app_to_person_usecase": "MARKETING",14"has_embedded_links": true,15"has_embedded_phone": false,16"subscriber_opt_in": true,17"age_gated": false,18"direct_lending": false,19"campaign_status": "PENDING",20"campaign_id": "CFOOBAR",21"is_externally_registered": false,22"rate_limits": {23"att": {24"mps": 600,25"msg_class": "A"26},27"tmobile": {28"brand_tier": "TOP"29}30},31"message_flow": "End users opt-in by visiting www.example.com and adding their phone number. They then check a box agreeing to receive text messages from Example Brand. Additionally, end users can also opt-in by texting START to (111) 222-3333 to opt in.",32"opt_in_message": "Acme Corporation: You are now opted-in. For help, reply HELP. To opt-out, reply STOP",33"opt_out_message": "You have successfully been unsubscribed from Acme Corporation. You will not receive any more messages from this number.",34"help_message": "Acme Corporation: Please visit www.example.com to get support. To opt-out, reply STOP.",35"opt_in_keywords": [36"START"37],38"opt_out_keywords": [39"STOP"40],41"help_keywords": [42"HELP"43],44"date_created": "2021-02-18T14:48:52Z",45"date_updated": "2021-02-18T14:48:52Z",46"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Compliance/Usa2p/QE2c6890da8086d771620e9b13fadeba0b",47"mock": false,48"errors": []49}50],51"meta": {52"page": 0,53"page_size": 20,54"first_page_url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Compliance/Usa2p?PageSize=20&Page=0",55"previous_page_url": null,56"next_page_url": null,57"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Compliance/Usa2p?PageSize=20&Page=0",58"key": "compliance"59}60}
DELETE https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/Compliance/Usa2p/{Sid}
This request deletes a UsAppToPerson resource.
Deleting an approved UsAppToPerson resource blocks all A2P 10DLC messaging from the Messaging Service.
You must create a new UsAppToPerson resource and wait for the associated Campaign to be approved by TCR in order to send A2P 10DLC messages from the Messaging Service again. This can take several days.
The SID of the Messaging Service to delete the resource from.
^MG[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the US A2P Compliance resource to delete QE2c6890da8086d771620e9b13fadeba0b
.
^QE[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The value of Sid
is always the US A2P Compliance resource identifier: QE2c6890da8086d771620e9b13fadeba0b
.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function deleteUsAppToPerson() {11await client.messaging.v112.services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.usAppToPerson("QEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.remove();15}1617deleteUsAppToPerson();