Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

A2P 10DLC - Event Streams Setup


Customers who are registering Brands, Campaigns and 10DLC Phone Numbers for A2P Messaging can now set up subscriptions to events which will notify them when a Brand, Campaign or Phone Number's status has changed. This setup and subscription is handled through Twilio's Event Streams product, which allows users to define a sink (in this case a webhook) to which an event notification will be sent for any events to which the user has subscribed - in this case, when a Brand or Campaign has been either successfully submitted or not, and whether successfully-submitted Brands and Campaigns are ultimately approved or rejected, or what a phone number's status is in it's A2P registration or deregistration process. With these event notifications now 'pushed' to customers via the Event Streams framework, it will no longer be necessary to repeatedly query the Brand and Campaign creation APIs, be in limbo about the number's registration status, or continually visit the A2P Console pages, in order to be kept up to date on registration status.

This document will cover the following topics:

  • How to set up event sinks and subscriptions via the Event Streams APIs, which will be the most likely path for Independent Software Vendors (SVs) managing the registration of large numbers of secondary brands, either Sole Proprietor or Standard/Low-Volume Standard.
  • How to set up event sinks and subscriptions via the Event Streams Console, which will be the likely path for Direct customers who make use of the Event Streams service.
  • How to read the json payloads sent in messages for various events, with example payloads for each event.

Set up Event Streams via the Event Streams API

set-up-event-streams-via-the-event-streams-api page anchor

Setting up webhook sinks and event subscriptions via the Event Streams API entails the following steps:

  1. Creating a sink resource
  2. Note the possible event types you're interested in
  3. Creating a subscription to specific events, for a specified sink

NOTE: If you are an ISV using separate subaccounts for each of your secondary clients, the Event Stream setup (both Sink and Subscription) will need to be done for each subaccount.

1 Create a new sink resource

1-create-a-new-sink-resource page anchor

A new sink is created via a POST/create call to the sinksendpoint of the Events API.

Sinks are the destinations to which events selected in a subscription will be delivered. Each sink has a sink_type property. At this time, the Sink resource supports three types: AWS Kinesis indicated by the value kinesis, Webhooks (which you will be using) indicated by the value webhook, and Segment indicated by the value segment . Each Sink has a sink_configuration property which expresses its set up. Finally, each sink resource has a friendly-name description parameter.

Again, if you are configuring a secondary customer whose Profile/Brand/Campaign resides in a subaccount, the account_sid and auth_token parameters used in this call (as well as the Subscription creation call in Step 1.3 below) must be those of the subaccount.

Sink_configuration is an object parameter whose elements are different for each sink_type. For the Webhook type, sink_configuration is formatted as follows:


_10
"sink_configuration": {
_10
_10
"destination": "http://example.org/webhook",
_10
_10
"method": "<POST|GET>",
_10
_10
"batch_events": <true|false>
_10
_10
}

ParameterDescription
destinationThe customers' url endpoint i.e http://example.org/webhook(link takes you to an external page)
methodThe HTTP method for updating the data on the webhook. The currently available options are GET and POST.
batch_eventsfalse if you want to receive single events and true if you want events sent in batches. Batched events currently have a 64kB data limit.

Note finally that the sid return parameter from this call will become the sink_sid parameter used in Step 1.3 below.

Create Sink

create-sink page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_24
// Download the helper library from https://www.twilio.com/docs/node/install
_24
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_24
_24
// Find your Account SID and Auth Token at twilio.com/console
_24
// and set the environment variables. See http://twil.io/secure
_24
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_24
const authToken = process.env.TWILIO_AUTH_TOKEN;
_24
const client = twilio(accountSid, authToken);
_24
_24
async function createSink() {
_24
const sink = await client.events.v1.sinks.create({
_24
description: "My A2P Sink",
_24
sinkConfiguration: {
_24
destination: "http://example.org/webhook",
_24
method: "<POST|GET>",
_24
batch_events: "<true|false>",
_24
},
_24
sinkType: "webhook",
_24
});
_24
_24
console.log(sink.dateCreated);
_24
}
_24
_24
createSink();

Output

_18
{
_18
"status": "initialized",
_18
"sink_configuration": {
_18
"arn": "arn:aws:kinesis:us-east-1:111111111:stream/test",
_18
"role_arn": "arn:aws:iam::111111111:role/Role",
_18
"external_id": "1234567890"
_18
},
_18
"description": "My A2P Sink",
_18
"sid": "DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_18
"date_created": "2015-07-30T20:00:00Z",
_18
"sink_type": "webhook",
_18
"date_updated": "2015-07-30T20:00:00Z",
_18
"url": "https://events.twilio.com/v1/Sinks/DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_18
"links": {
_18
"sink_test": "https://events.twilio.com/v1/Sinks/DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Test",
_18
"sink_validate": "https://events.twilio.com/v1/Sinks/DGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Validate"
_18
}
_18
}

2 Event types and type IDs

2-event-types-and-type-ids page anchor

You can fetch a list of all subscribable event types from the event_type endpoint of the Events API. You must pass all of these inside the types parameter object when you create your subscription in the next step.

Brand and Campaign Registration Events

brand-and-campaign-registration-events page anchor

The following is a list of all six event types associated with A2P Brand and Campaign registration, and the corresponding Event Type ID string.

Event TypeEvent type ID
Brand Registration Failurecom.twilio.messaging.compliance.brand-registration.brand-failure
Brand Registered Unverifiedcom.twilio.messaging.compliance.brand-registration.brand-unverified
Brand Registeredcom.twilio.messaging.compliance.brand-registration.brand-registered
Campaign Registration Submittedcom.twilio.messaging.compliance.campaign-registration.campaign-submitted
Campaign Registration Failed or Rejectedcom.twilio.messaging.compliance.campaign-registration.campaign-failure
Campaign Registration Approvedcom.twilio.messaging.compliance.campaign-registration.campaign-approved

Phone Number Registration Events

phone-number-registration-events page anchor

The following is a list of all six event types associated with A2P Number Registration, and the corresponding Event Type ID string.

Event TypeEvent type ID
Number Deregistration Failedcom.twilio.messaging.compliance.number-deregistration.failed
Number Deregistration Pendingcom.twilio.messaging.compliance.number-deregistration.pending
Number Deregistration Successfulcom.twilio.messaging.compliance.number-deregistration.successful
Number Registration Failedcom.twilio.messaging.compliance.number-registration.failed
Number Registration Pendingcom.twilio.messaging.compliance.number-registration.pending
Number Registration Successfulcom.twilio.messaging.compliance.number-registration.successful

3 Create a subscription to specific events, for a specific sink

3-create-a-subscription-to-specific-events-for-a-specific-sink page anchor

To create a new subscription, use a POST/create call to the subscriptions endpoint of the Events API. This call must associate a specific array of event types with a specific sink to which these event messages will be sent when they are raised.

The subscription create call has the following parameters:

description - a brief human-readable description of the subscription, which should be clearly associated with the sink you're specifying here

sink_sid - the SID of the new sink you created in Step 1.1 above

types - an object containing a delimited list of all the event type IDs for the events you wish to subscribe to, in this case all of the IDs enumerated in 1.2 above. The exact syntax of the types object will vary depending the library you are using; please refer to the code snippet below. In python, for example, the syntax would be:


_10
types=[
_10
{'type': 'com.twilio.messaging.message.delivered'},
_10
{'type': 'com.twilio.messaging.message.sent', 'schema_version': 2}
_10
],

In the above example we are subscribing to only two events: messaging.message.delivered and messaging.message.sent, but in your create call you will include all 6 events enumerated in Step 1.2 above. Note that in this example, the second event also specifies a schema_version of 2; if this is not specified, the default schema used will be 1 (currently only schema 1 is available for A2P events, so schema_version need not be specified).

Create a new Subscription

create-a-new-subscription page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_28
// Download the helper library from https://www.twilio.com/docs/node/install
_28
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_28
_28
// Find your Account SID and Auth Token at twilio.com/console
_28
// and set the environment variables. See http://twil.io/secure
_28
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_28
const authToken = process.env.TWILIO_AUTH_TOKEN;
_28
const client = twilio(accountSid, authToken);
_28
_28
async function createSubscription() {
_28
const subscription = await client.events.v1.subscriptions.create({
_28
description: '"My A2P Subscription"',
_28
sinkSid: '"DGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"',
_28
types: [
_28
{
_28
type: "com.twilio.messaging.message.delivered",
_28
},
_28
{
_28
type: "com.twilio.messaging.message.sent",
_28
schema_version: 2,
_28
},
_28
],
_28
});
_28
_28
console.log(subscription.accountSid);
_28
}
_28
_28
createSubscription();

Output

_12
{
_12
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_12
"date_created": "2015-07-30T20:00:00Z",
_12
"date_updated": "2015-07-30T20:01:33Z",
_12
"sid": "DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_12
"sink_sid": "\"DGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"",
_12
"description": "\"My A2P Subscription\"",
_12
"url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_12
"links": {
_12
"subscribed_events": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedEvents"
_12
}
_12
}


Set up Webhooks and subscribe to A2P Registration Events via the Event Streams Console

set-up-webhooks-and-subscribe-to-a2p-registration-events-via-the-event-streams-console page anchor
  1. From your Twilio Console home, search for Event Streams > Manage in the search bar:
Console_home_search_for_Event_Streams.
  1. Clicking on the Manage link will bring up the Manage sinks and subscriptions page. Unless you already have sinks and subscriptions, here you will be invited to create your first sink:
Manage sinks and subscriptions page.
  1. The blue Create new sink button will take you to the Create new sink page:
Choose type of sink to create.
  1. Again, a sink is a destination type for the event messages you'll be subscribing to. In this case you want to configure a Webhook as your sink. Enter a sink description , such as "A2P Registration Event Sink", then select Webhook and press Next step :
Create a new webhook sink.
  1. For Destination you will need to indicate the url endpoint that this webhook will call to deliver its event message payload, in this case as a POST . This endpoint will need to be a dedicated page on your own public site, which you have coded to parse and respond to that json payload (example payloads for each event message will be indicated in Part 3 below).
  2. Click Finish when you're done. You'll now get a success dialog that invites you to either test this new sink immediately (which will send a generic message payload to your specified endpoint), or move on creating a subscription to listen for specific events:
Sink creation success dialog.
  1. Let's click Create subscription , which will bring up the Create a new subscription page. On this page, you will first be asked to select the Sink where these events will be delivered. From the dropdown you will select the sink you just created (in our case "A2P Registration Event Sink." You'll then be asked to name your new subscription; here you'll probably want to stick to a similar naming convention, e.g. "A2P Registration Event Subscription":
Create New Subscription.
  1. Next you will choose the particular events you'd like to subscribe to. There are a vast number of different events generated by various Twilio products; in this case, under Product groups you will select Messaging , and the first set of Messaging events you will see is an A2P collection of 12 events. The way you indicate that you're selecting a particular event group is to choose a schema for it. In the case of A2P events, for the time being there will only be a single schema, 1, for you to choose in the dropdown; this being the case you will want to select 1 under Apply schema version to all for this event collection:
Select A2 events to subscribe to.
  1. Finally, click the blue Create subscription button in the lower right. You're now finished with the Event Streams setup.

Again, IF you are an ISV with secondary customer Brands and Campaigns created or phone number registered immediately within your own top-level account, you would only need to perform this Event Streams setup once; your sink will capture Brand and Campaign registration events subscription for any and all of your clients (you will be able to identify which client a given event message pertains to by way of the Brand or Campaign/Messaging SID indicated in the message payload). If instead you are an ISV whose architecture features a separate subaccount for Brand, Campaign and Number registration for each of your secondary clients, then you will need to do both Event Sink and Subscription setup in each subaccount. Prior to the first step under Part 2 above you would need to switch from your main account to the relevant subaccount, then perform all of the steps indicated in the workflow]


Read the Payloads for each event message

read-the-payloads-for-each-event-message page anchor

As indicated in Section One above, there are total of 12 events to which you'll be subscribing for A2P Brand, Campaign and Number registration. Below is the JSON payload for each of the 12 events, with explanations of key return parameters where necessary.

Brand Registered Unverified

brand-registered-unverified page anchor

This event message indicates that a Brand has been successfully submitted for registration, but it has not yet been verified (for example in the case of a Sole Proprietor Brand, the designated contact has not yet completed the OTP request).


_20
[
_20
{
_20
"data": {
_20
"accountsid": "ACXXXXXXXXX",
_20
"brandsid": "BNXXXXXXXXX",
_20
"brandstatus": "registered",
_20
"createddate": 1686837061258,
_20
"externalbrandid": "XXXXXXX",
_20
"identitystatus": "unverified",
_20
"updateddate": 1686837061258
_20
},
_20
"datacontenttype": "application/ison",
_20
"dataschema": "https://events-schemas.dev.twilio.com/A2P.BrandRegisteredUnver\nfied/1",
_20
"id": "CE000000000000000000000000000000",
_20
"source": "CA000000000000000000000000000000",
_20
"specversion": "1.0",
_20
"time": "2023-06-15713:51:04.528Z",
_20
"type": "com. twilio.messaging compliance.brand-registration.brand-unverified"
_20
}
_20
]

Here accountsid will be either the account or subaccount in which this Brand was registered, and brandsid will be the SID returned when the Brand was created. Type is the full event type ID, in this case com.twilio.messaging compliance.brand-registration.brand-unverified.

Once the customer has responded to the OTP request, the Brand will be fully approved and its status will be changed to Registered, which will issue the next event message.

This event message indicates that the Brand has been successfully registered (and any OTP or other necessary customer action has been completed). Upon receipt of this event message, you should now focus on the status of the associated Campaign.


_20
[
_20
{
_20
"data": {
_20
"accountsid": "ACXXXXXXXXX",
_20
"brandsid": "BNXXXXXXXXX",
_20
"brandstatus": "registered",
_20
"createddate": 1686837061258,
_20
"externalbrandid": "XXXXXXX",
_20
"identitystatus": "verified",
_20
"updateddate": 1686837061258,
_20
},
_20
"datacontenttype": "application/ison",
_20
"dataschema": "https://events-schemas.dev.twilio.com/A2P.BrandRegisteredUnver\nfied/1",
_20
"id": "CE000000000000000000000000000000",
_20
"source": "CA000000000000000000000000000000",
_20
"specversion": "1.0",
_20
"time": "2023-06-15713:51:04.528Z",
_20
"type": "com. twilio.messaging compliance.brand-registration.brand-registered"
_20
}
_20
]

Again, accountsid will be either the account or subaccount in which this Brand was registered, and brandsid will be the sid returned when the Brand was created. Type is the full event type ID, in this case com.twilio.messaging compliance.brand-registration.brand-registered

Brand Registration Failure

brand-registration-failure page anchor

This event can be raised either if the initial Brand submission fails (i.e. it fails the Twilio API data check) or if that submission is successful and the Brand undergoes TCR review, but the outcome of that review is a rejection of the Brand.

Schema version 2 now includes brandregistrationerrors


_44
[
_44
{
_44
"data": {
_44
"a2pusecase": "MIXED",
_44
"accountsid": "ACXXXXXXXXX",
_44
"brandsid": "BNXXXXXXXXX",
_44
"campaignregistrationstatus": "pending",
_44
"campaignsid": "CMXXXXXXXXX",
_44
"createddate": 1687892791272,
_44
"brandregistrationerrors": [
_44
{
_44
"registrationerrorcode": 30796,
_44
"registrationerrordescription": "Brand Registration Feedback: The submitted stock symbol and stock exchange could not be verified for the submitted legal company nan
_44
e.","registrationerrorurl": "https://www.twilio.com/docs/api/errors/30796",
_44
"registrationerrorfields": [
_44
"stock_ticker",
_44
"stock_exchange",
_44
"business name"
_44
]
_44
},
_44
{
_44
"registrationerrorcode": 30795,
_44
"registrationerrordescription": "Brand Registration Feedback: The submitted legal company name does not match with US EIN.",
_44
"registrationerrorurl": "https://www.twilio.com/docs/api/errors/30795",
_44
"registrationerrorfields": [
_44
"business_registration_number",
_44
"business_registration_identifier",
_44
"business_name"
_44
]
_44
}
_44
],
_44
"messagingservicesid": "MGXXXXXXXXX",
_44
"timestamp": 1687892792294,
_44
"updateddate": 1687892791272
_44
},
_44
"datacontenttype": "application/json",
_44
"dataschema": "https://events-schemas.stage.twilio.com/A2P.CampaignRegistrationSubmitted/1",
_44
"id": "CE000000000000000000000000000000",
_44
"source": "CA000000000000000000000000000000",
_44
"specversion": "1.0",
_44
"time": "2023-06-27T19:06:32.294Z",
_44
"type": "com.twilio.messaging.compliance.campaign-registration.campaign-submitted"
_44
}
_44
]

The type of this event is com.twilio.messaging.compliance.brand-registration.brand-failure

A further parameter brandfailurereason will be added to this payload in a subsequent release, which will give details on the reason for the Brand's failure. In the meantime, upon receipt of this event, you can learn details about the failure reason for this Brand by fetching the BrandRegistration resource.

The type of this event is com.twilio.messaging.compliance.brand-registration.brand-failure

Campaign Registration Submitted

campaign-registration-submitted page anchor

This event message indicates that the Campaign has been successfully submitted, and is currently awaiting approval by TCR. No further action is required of the customer at this time.


_22
[
_22
{
_22
"data": {
_22
"a2pusecase": "MIXED",
_22
"accountsid": "ACXXXXXXXXX",
_22
"brandsid": "BNXXXXXXXXX",
_22
"campaignregistrationstatus": "pending",
_22
"campaignsid": "CMXXXXXXXXX",
_22
"createddate": 1687892791272,
_22
"messagingservicesid": "MGXXXXXXXXX",
_22
"timestamp": 1687892792294,
_22
"updateddate": 1687892791272
_22
},
_22
"datacontenttype": "application/json",
_22
"dataschema": "https://events-schemas.stage.twilio.com/A2P.CampaignRegistrationSubmitted/1",
_22
"id": "CE000000000000000000000000000000",
_22
"source": "CA000000000000000000000000000000",
_22
"specversion": "1.0",
_22
"time": "2023-06-27T19:06:32.294Z",
_22
"type": "com.twilio.messaging.compliance.campaign-registration.campaign-submitted"
_22
}
_22
]

Here brandsid and/or campaignsid can be used to identify which customer's campaign this event pertains to. The type of this event is com.twilio.messaging.compliance.campaign-registration.campaign-submitted

Campaign Registration Approved

campaign-registration-approved page anchor

This event will be issued after the Campaign has received all required approvals. After this event we will register any and all numbers in the number pool of the Messaging service associated with that Campaign. Once this phone number registration is complete the new Campaign is ready for operation.


_24
[
_24
{
_24
"data": {
_24
"a2pusecase": "MIXED",
_24
"accountsid": "ACXXXXXXXXX",
_24
"brandsid": "BNXXXXXXXXX",
_24
"campaignregistrationstatus": "success",
_24
"campaignsid": "CMXXXXXXXXX",
_24
"createddate": 1687892791272,
_24
"externalcampaignid": "XXXXXXX",
_24
"messagingservicesid": "MGXXXXXXXXX",
_24
"timestamp": 1687892792294,
_24
"updateddate": 1687892791272,
_24
_24
},
_24
"datacontenttype": "application/json",
_24
"dataschema": "https://events-schemas.stage.twilio.com/A2P.CampaignRegistrationApproved/1",
_24
"id": "CE000000000000000000000000000000",
_24
"source": "CA000000000000000000000000000000",
_24
"specversion": "1.0",
_24
"time": "2023-06-27T19:06:32.294Z",
_24
"type": "com.twilio.messaging.compliance.campaign-registration.campaign-approved"
_24
}
_24
]

Again brandsid and/or campaignsid can be used to identify which customer's campaign this event pertains to. The type of this event is com.twilio.messaging.compliance.campaign-registration.campaign-approved

Campaign Registration Failure

campaign-registration-failure page anchor

For the time being, this event message is being raised BOTH in the case where a Campaign has not been successfully submitted (i.e there was some issue on the initial create call to the Twilio API), AND in the case where the Campaign was successfully submitted to TCR, but the vetting process has resulted in the Campaign being rejected.

As before, brandsid and/or campaignsid can be used to identify which customer's campaign this event pertains to.

Schema version 2 now includes campaignregistrationerrors.


_41
[
_41
{
_41
"data": {
_41
"a2pusecase": "MIXED",
_41
"accountsid": "ACXXXXXXXXX",
_41
"brandsid": "BNXXXXXXXXX",
_41
"campaignregistrationerrors": [
_41
{
_41
"registrationerrorcode": 30886,
_41
"registrationerrordescription": "The campaign submission has been reviewed and it was rejected because of invalid campaign description.",
_41
"registrationerrorurl": "https://www.twilio.com/docs/api/errors/30886",
_41
"registrationerrorfields": [
_41
"USE_CASE DESCRIPTION"
_41
]
_41
},
_41
{
_41
"registrationerrorcode": 30893,
_41
"registrationerrordescription": "The campaign submission has been reviewed and it was rejected because of invalid sample message content.",
_41
"registrationerrorurl": "https://www.twilio.com/docs/api/errors/30893",
_41
"registrationerrorfields": [
_41
"SAMPLE MESSAGE_1"
_41
]
_41
}
_41
],
_41
"campaignregistrationstatus"; "failure",
_41
"campaignregistrationstatus": "failure",
_41
"campaignsid": "CMXXXXXXXXX",
_41
"createddate": 1687892791272,
_41
"messagingservicesid": "MGXXXXXXXXX",
_41
"timestamp": 1687892792294,
_41
"updateddate": 1687892791272
_41
},
_41
"datacontenttype": "application/json",
_41
"dataschema": "https://events-schemas.stage.twilio.com/A2P.CampaignRegistrationFailure/1",
_41
"id": "CE000000000000000000000000000000",
_41
"source": "CA000000000000000000000000000000",
_41
"specversion": "1.0",
_41
"time": "2023-06-27T19:06:32.294Z",
_41
"type": "com.twilio.messaging.compliance.campaign-registration.campaign-failure"
_41
}
_41
]

Number Deregistration Failed

number-deregistration-failed page anchor

This event message indicates that number deregistration has failed. Below is an example of what the event payload might look like.

  • accountsid is the account or subaccount in which this phone number was registered
  • campaignsid is the SID from which the number was attempting to be removed
  • externalstatus field points to the current registration status for the phone number which in this case is a failure
  • failurereason provides the customer more information about this failure. At this point your phone number has failed to be deregistered and cannot be used to send messages, nor can it be used in another messaging service.
  • type is the full event type ID, in this case com.twilio.messaging.compliance.number-deregistration.failed .

_22
[
_22
{
_22
"specversion": "1.0",
_22
"type": "com.twilio.messaging.compliance.number-deregistration.failed",
_22
"source": "CA000000000000000000000000000000",
_22
"id": "CE000000000000000000000000000000",
_22
"dataschema": "https://events-schemas.twilio.com/A2P.NumberDeregistrationFailed/1",
_22
"datacontenttype": "application/json",
_22
"time": "2024-03-13T15:51:10.552Z",
_22
"data": {
_22
"accountsid": "ACXXXXXXXXXXXXXXXXXXXXXXXX",
_22
"timestamp": 1710345070552,
_22
"id": "fd902aed-ca5a-8e26-85ee-35bdbf3503ea",
_22
"campaignsid": "CMXXXXXXXXXXXXXXXX",
_22
"externalstatus": "failure",
_22
"failureReason": "https://www.twilio.com/docs/api/errors/30126",
_22
"phonenumbersid": "PNXXXXXXXXXXXXXXXX",
_22
"updateddate": 1710345070476,
_22
"phonenumber": "1234567890"
_22
}
_22
}
_22
]

Number Deregistration pending

number-deregistration-pending page anchor

This event message indicates that the number deregistration process is pending. Below is an example of what the event payload might look like.

  • accountsid is the account or subaccount in which this phone number was registered
  • campaignsid is the SID from which the number was attempting to be removed
  • externalstatus field points to the current registration status for the phone number which in this case is pending. At this point this phone number is in the process of removal from a campaign and cannot be used to send messages, nor can it be used in another messaging service.
  • type is the full event type ID, in this case com.twilio.messaging.compliance.number-deregistration.pending .

_22
_22
[
_22
{
_22
"specversion": "1.0",
_22
"type": "com.twilio.messaging.compliance.number-deregistration.pending",
_22
"source": "CA000000000000000000000000000000",
_22
"id": "CE000000000000000000000000000000",
_22
"dataschema": "https://events-schemas.twilio.com/A2P.NumberDeregistrationPending/1",
_22
"datacontenttype": "application/json",
_22
"time": "2024-03-13T15:51:10.552Z",
_22
"data": {
_22
"accountsid": "ACXXXXXXXXXXXXXXXXXXXXXXXX",
_22
"timestamp": 1710345070552,
_22
"id": "fd902aed-ca5a-8e26-85ee-35bdbf3503ea",
_22
"campaignsid": "CMXXXXXXXXXXXXXXXX",
_22
"externalstatus": "pending_deregistration",
_22
"phonenumbersid": "PNXXXXXXXXXXXXXXXX",
_22
"updateddate": 1710345070476,
_22
"phonenumber": "1234567890"
_22
}
_22
}
_22
]

Number Deregistration Successful

number-deregistration-successful page anchor

This event message indicates that the number deregistration process is successful. Below is an example of what the event payload might look like.

  • accountsid is the account or subaccount in which this phone number was registered
  • note that there is no campaignsid as the number doesn't currently belong to any campaign
  • externalstatus field points to the current registration status for the phone number which in this case is unregistered. At this point your phone number has completed the deregistration process and can no longer be used to send messages. You can now use this number in another messaging service/campaign or re-add it to the same messaging service/campaign.
  • type is the full event type ID, in this case com.twilio.messaging.compliance.number-deregistration.successful .

_21
_21
[
_21
{
_21
"specversion": "1.0",
_21
"type": "com.twilio.messaging.compliance.number-deregistration.successful",
_21
"source": "CA000000000000000000000000000000",
_21
"id": "CE000000000000000000000000000000",
_21
"dataschema": "https://events-schemas.twilio.com/A2P.NumberDeregistrationSuccessful/1",
_21
"datacontenttype": "application/json",
_21
"time": "2024-03-13T15:51:10.552Z",
_21
"data": {
_21
"accountsid": "ACXXXXXXXXXXXXXXXXXXXXXXXX",
_21
"timestamp": 1710345070552,
_21
"id": "fd902aed-ca5a-8e26-85ee-35bdbf3503ea",
_21
"externalstatus": "unregistered",
_21
"phonenumbersid": "PNXXXXXXXXXXXXXXXX",
_21
"updateddate": 1710345070476,
_21
"phonenumber": "1234567890"
_21
}
_21
}
_21
]

Number Registration Failed

number-registration-failed page anchor

This event message indicates that Number Registration has failed. Below is an example of what the event payload might look like.

  • accountsid is the account or subaccount in which this phone number was registered
  • campaignsid is the SID to which the number was attempting to be added
  • externalstatus field points to the current registration status for the phone number which in this case is a failure
  • failurereason provides the customer more information about this failure. At this point your phone number has failed to be registered and cannot be used to send messages.
  • type is the full event type ID, in this case com.twilio.messaging.compliance.number-registration.failed .

_22
[
_22
{
_22
"specversion": "1.0",
_22
"type": "com.twilio.messaging.compliance.number-registration.failed",
_22
"source": "CA000000000000000000000000000000",
_22
"id": "CE000000000000000000000000000000",
_22
"dataschema": " "dataschema": "https://events-schemas.twilio.com/A2P.NumberRegistrationFailed/1",
_22
"datacontenttype": "application/json",
_22
"time": "2024-03-13T15:51:10.552Z",
_22
"data": {
_22
"accountsid": "ACXXXXXXXXXXXXXXXXXXXXXXXX",
_22
"timestamp": 1710345070552,
_22
"id": "fd902aed-ca5a-8e26-85ee-35bdbf3503ea",
_22
"campaignsid": "CMXXXXXXXXXXXXXXXX",
_22
"externalstatus": "failure",
_22
"failureReason": "https://www.twilio.com/docs/api/errors/30126",
_22
"phonenumbersid": "PNXXXXXXXXXXXXXXXX",
_22
"updateddate": 1710345070476,
_22
"phonenumber": "1234567890"
_22
}
_22
}
_22
]

Number Registration Pending

number-registration-pending page anchor

This event message indicates that the Number Registration process is pending. Below is an example of what the event payload might look like.

  • accountsid is the account/subaccount in which this phone number was registered,
  • campaignsid is the SID of the Usa2p Resource with which the phone number is associated.
  • externalstatus field is the current registration status for the phone number.
  • type is the full event type ID, in this case com.twilio.messaging.compliance.number-registration.pending .

In the example below, the externalstatus is pending, which means that the phone number is not fully registered and cannot yet be used to send messages.


_21
[
_21
{
_21
"specversion": "1.0",
_21
"type": "com.twilio.messaging.compliance.number-registration.pending",
_21
"source": "CA000000000000000000000000000000",
_21
"id": "CE000000000000000000000000000000",
_21
"dataschema": "https://events-schemas.twilio.com/A2P.NumberRegistrationPending/1",
_21
"datacontenttype": "application/json",
_21
"time": "2024-03-13T15:51:10.552Z",
_21
"data": {
_21
"accountsid": "ACXXXXXXXXXXXXXXXXXXXXXXXX",
_21
"timestamp": 1710345070552,
_21
"id": "fd902aed-ca5a-8e26-85ee-35bdbf3503ea",
_21
"campaignsid": "CMXXXXXXXXXXXXXXXX",
_21
"externalstatus": "pending_registration",
_21
"phonenumbersid": "PNXXXXXXXXXXXXXXXX",
_21
"updateddate": 1710345070476,
_21
"phonenumber": "1234567890"
_21
}
_21
}
_21
]

Number Registration Successful

number-registration-successful page anchor

This event message indicates that the Number Registration process is successful. Below is an example of what the event payload might look like.

  • accountsid is the account or subaccount in which this phone number was registered
  • campaignsid is the SID to which the number was added
  • Externalstatus field points to the current registration status for the phone number which in this case is registered. At this point your phone number is fully registered and can be used to send messages to your customer.
  • type is the full event type ID, in this case com.twilio.messaging.compliance.number-registration.successful .

_21
[
_21
{
_21
"specversion": "1.0",
_21
"type": "com.twilio.messaging.compliance.number-registration.successful",
_21
"source": "CA000000000000000000000000000000",
_21
"id": "CE000000000000000000000000000000",
_21
"dataschema": "https://events-schemas.twilio.com/A2P.NumberRegistrationSuccessful/1",
_21
"datacontenttype": "application/json",
_21
"time": "2024-03-13T15:51:10.552Z",
_21
"data": {
_21
"accountsid": "ACXXXXXXXXXXXXXXXXXXXXXXXX",
_21
"timestamp": 1710345070552,
_21
"id": "fd902aed-ca5a-8e26-85ee-35bdbf3503ea",
_21
"campaignsid": "CMXXXXXXXXXXXXXXXX",
_21
"externalstatus": "registered",
_21
"phonenumbersid": "PNXXXXXXXXXXXXXXXX",
_21
"updateddate": 1710345070476,
_21
"phonenumber": "1234567890"
_21
}
_21
}
_21
]


Rate this page: