Skip to contentSkip to navigationSkip to topbar
Rate this page:
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


EventType Properties

eventtype-properties page anchor
Property nameTypePIIDescription
typestring
Not PII

A string that uniquely identifies this Event Type.


schema_idstring

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


date_createdstring<date-time>

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


date_updatedstring<date-time>

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


descriptionstring

A human readable description for this Event Type.


statusstring

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_urlstring

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


urlstring<uri>

The URL of this resource.


linksobject<uri-map>

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 Type

fetch-event-type page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function fetchEventType() {
_18
const eventType = await client.events.v1
_18
.eventTypes("com.twilio.messaging.message.delivered")
_18
.fetch();
_18
_18
console.log(eventType.type);
_18
}
_18
_18
fetchEventType();

Output

_14
{
_14
"date_created": "2020-08-13T13:28:20Z",
_14
"date_updated": "2020-08-13T13:28:20Z",
_14
"type": "com.twilio.messaging.message.delivered",
_14
"schema_id": "Messaging.MessageStatus",
_14
"public": true,
_14
"status": "available",
_14
"documentation_url": "/docs/voice/voice-insights/event-streams",
_14
"description": "Messaging- delivered message",
_14
"url": "https://events.twilio.com/v1/Types/com.twilio.messaging.message.delivered",
_14
"links": {
_14
"schema": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions"
_14
}
_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.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

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

Output

_41
{
_41
"types": [
_41
{
_41
"date_created": "2020-08-13T13:28:20Z",
_41
"date_updated": "2020-08-13T13:28:20Z",
_41
"type": "com.twilio.messaging.message.delivered",
_41
"schema_id": "Messaging.MessageStatus",
_41
"public": true,
_41
"status": "available",
_41
"documentation_url": null,
_41
"description": "Messaging- delivered message",
_41
"url": "https://events.twilio.com/v1/Types/com.twilio.messaging.message.delivered",
_41
"links": {
_41
"schema": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions"
_41
}
_41
},
_41
{
_41
"date_created": "2020-08-13T13:28:19Z",
_41
"date_updated": "2020-08-13T13:28:19Z",
_41
"type": "com.twilio.messaging.message.failed",
_41
"schema_id": "Messaging.MessageStatus",
_41
"public": true,
_41
"status": "deprecated",
_41
"documentation_url": "/docs/voice/voice-insights/event-streams",
_41
"description": "Messaging- failed message",
_41
"url": "https://events.twilio.com/v1/Types/com.twilio.messaging.message.failed",
_41
"links": {
_41
"schema": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions"
_41
}
_41
}
_41
],
_41
"meta": {
_41
"page": 0,
_41
"page_size": 20,
_41
"first_page_url": "https://events.twilio.com/v1/Types?PageSize=20&Page=0",
_41
"previous_page_url": null,
_41
"url": "https://events.twilio.com/v1/Types?PageSize=20&Page=0",
_41
"next_page_url": null,
_41
"key": "types"
_41
}
_41
}


Rate this page: