Skip to contentSkip to navigationSkip to topbar
On this page

Event Type Resource


Event types describe the various kinds of events that are accessible through the Event Streams APIs. Each Event Type resource includes a reference to the schema which defines the event type that the resource represents. See the Schema resource documentation for more information.

(information)

Info


Type Properties

type-properties page anchor
Property nameTypeRequiredDescriptionChild properties
typestringOptional
Not PII

A string that uniquely identifies this Event Type.


schema_idstringOptional

A string that uniquely identifies the Schema this Event Type adheres to.


date_createdstring<date-time>Optional

The date that this Event Type was created, given in ISO 8601 format.


date_updatedstring<date-time>Optional

The date that this Event Type was updated, given in ISO 8601 format.


descriptionstringOptional

A human readable description for this Event Type.


statusstringOptional

A string that describes how this Event Type can be used. For example: available, deprecated, restricted, discontinued. When the status is available, the Event Type can be used normally.


documentation_urlstringOptional

The URL to the documentation or to the most relevant Twilio Changelog entry of this Event Type.


urlstring<uri>Optional

The URL of this resource.


linksobject<uri-map>Optional

Fetch an EventType resource

fetch-an-eventtype-resource page anchor
GET https://events.twilio.com/v1/Types/{Type}

Fetch the list of all available event types in ascending order by event type.

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
Typestringrequired

A string that uniquely identifies this Event Type.

Fetch Event TypeLink to code sample: Fetch Event Type
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchEventType() {
11
const eventType = await client.events.v1
12
.eventTypes("com.twilio.messaging.message.delivered")
13
.fetch();
14
15
console.log(eventType.type);
16
}
17
18
fetchEventType();

Output

1
{
2
"date_created": "2020-08-13T13:28:20Z",
3
"date_updated": "2020-08-13T13:28:20Z",
4
"type": "com.twilio.messaging.message.delivered",
5
"schema_id": "Messaging.MessageStatus",
6
"public": true,
7
"status": "available",
8
"documentation_url": "/docs/voice/voice-insights/event-streams",
9
"description": "Messaging- delivered message",
10
"url": "https://events.twilio.com/v1/Types/com.twilio.messaging.message.delivered",
11
"links": {
12
"schema": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions"
13
}
14
}

Read multiple EventType resources

read-multiple-eventtype-resources page anchor
GET https://events.twilio.com/v1/Types

Property nameTypeRequiredPIIDescription
SchemaIdstringOptional

A string parameter filtering the results to return only the Event Types using a given schema.


PageSizeintegerOptional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

PageintegerOptional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listEventType() {
11
const eventTypes = await client.events.v1.eventTypes.list({ limit: 20 });
12
13
eventTypes.forEach((e) => console.log(e.type));
14
}
15
16
listEventType();

Output

1
{
2
"types": [
3
{
4
"date_created": "2020-08-13T13:28:20Z",
5
"date_updated": "2020-08-13T13:28:20Z",
6
"type": "com.twilio.messaging.message.delivered",
7
"schema_id": "Messaging.MessageStatus",
8
"public": true,
9
"status": "available",
10
"documentation_url": null,
11
"description": "Messaging- delivered message",
12
"url": "https://events.twilio.com/v1/Types/com.twilio.messaging.message.delivered",
13
"links": {
14
"schema": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions"
15
}
16
},
17
{
18
"date_created": "2020-08-13T13:28:19Z",
19
"date_updated": "2020-08-13T13:28:19Z",
20
"type": "com.twilio.messaging.message.failed",
21
"schema_id": "Messaging.MessageStatus",
22
"public": true,
23
"status": "deprecated",
24
"documentation_url": "/docs/voice/voice-insights/event-streams",
25
"description": "Messaging- failed message",
26
"url": "https://events.twilio.com/v1/Types/com.twilio.messaging.message.failed",
27
"links": {
28
"schema": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions"
29
}
30
}
31
],
32
"meta": {
33
"page": 0,
34
"page_size": 20,
35
"first_page_url": "https://events.twilio.com/v1/Types?PageSize=20&Page=0",
36
"previous_page_url": null,
37
"url": "https://events.twilio.com/v1/Types?PageSize=20&Page=0",
38
"next_page_url": null,
39
"key": "types"
40
}
41
}