# 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](/docs/events/event-streams/schema-resource) for more information.

> \[!NOTE]
>
> Not seeing an event type you would like to configure? [Submit an event type request](https://docs.google.com/forms/d/e/1FAIpQLSdisoYf5v4UNgREID_NHyo29qrLuqRS13AD2Bny1c_DwWHEZQ/viewform).

## Type Properties

```json
{"type":"object","refName":"events.v1.event_type","modelName":"events_v1_event_type","properties":{"type":{"type":"string","nullable":true,"description":"A string that uniquely identifies this Event Type."},"schema_id":{"type":"string","nullable":true,"description":"A string that uniquely identifies the Schema this Event Type adheres to."},"date_created":{"type":"string","format":"date-time","nullable":true,"description":"The date that this Event Type was created, given in ISO 8601 format."},"date_updated":{"type":"string","format":"date-time","nullable":true,"description":"The date that this Event Type was updated, given in ISO 8601 format."},"description":{"type":"string","nullable":true,"description":"A human readable description for this Event Type."},"status":{"type":"string","nullable":true,"description":"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_url":{"type":"string","nullable":true,"description":"The URL to the documentation or to the most relevant Twilio Changelog entry of this Event Type."},"url":{"type":"string","format":"uri","nullable":true,"description":"The URL of this resource."},"links":{"type":"object","format":"uri-map","nullable":true}}}
```

## Fetch an EventType resource

`GET https://events.twilio.com/v1/Types/{Type}`

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

### Path parameters

```json
[{"name":"Type","in":"path","description":"A string that uniquely identifies this Event Type.","schema":{"type":"string"},"required":true}]
```

Fetch Event Type

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchEventType() {
  const eventType = await client.events.v1
    .eventTypes("com.twilio.messaging.message.delivered")
    .fetch();

  console.log(eventType.type);
}

fetchEventType();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

event_type = client.events.v1.event_types(
    "com.twilio.messaging.message.delivered"
).fetch()

print(event_type.type)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Events.V1;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var eventType =
            await EventTypeResource.FetchAsync(pathType: "com.twilio.messaging.message.delivered");

        Console.WriteLine(eventType.Type);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.events.v1.EventType;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        EventType eventType = EventType.fetcher("com.twilio.messaging.message.delivered").fetch();

        System.out.println(eventType.getType());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	resp, err := client.EventsV1.FetchEventType("com.twilio.messaging.message.delivered")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Type != nil {
			fmt.Println(*resp.Type)
		} else {
			fmt.Println(resp.Type)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$event_type = $twilio->events->v1
    ->eventTypes("com.twilio.messaging.message.delivered")
    ->fetch();

print $event_type->type;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

event_type = @client
             .events
             .v1
             .event_types('com.twilio.messaging.message.delivered')
             .fetch

puts event_type.type
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:events:v1:types:fetch \
   --type com.twilio.messaging.message.delivered
```

```bash
curl -X GET "https://events.twilio.com/v1/Types/com.twilio.messaging.message.delivered" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "date_created": "2020-08-13T13:28:20Z",
  "date_updated": "2020-08-13T13:28:20Z",
  "type": "com.twilio.messaging.message.delivered",
  "schema_id": "Messaging.MessageStatus",
  "status": "available",
  "documentation_url": "/docs/voice/voice-insights/event-streams",
  "description": "Messaging- delivered message",
  "url": "https://events.twilio.com/v1/Types/com.twilio.messaging.message.delivered",
  "links": {
    "schema": "https://events.twilio.com/v1/Schemas/Messaging.MessageStatus/Versions"
  }
}
```

## Read multiple EventType resources

`GET https://events.twilio.com/v1/Types`

### Query parameters

```json
[{"name":"SchemaId","in":"query","description":"A string parameter filtering the results to return only the Event Types using a given schema.","schema":{"type":"string"},"examples":{"readResultsWithSchemaId":{"value":"Messaging.MessageStatus"}}},{"name":"PageSize","in":"query","description":"How many resources to return in each list page. The default is 50, and the maximum is 1000.","schema":{"type":"integer","format":"int64","minimum":1,"maximum":1000}},{"name":"Page","in":"query","description":"The page index. This value is simply for client state.","schema":{"type":"integer","minimum":0}},{"name":"PageToken","in":"query","description":"The page token. This is provided by the API.","schema":{"type":"string"}}]
```

Read Event Type

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function listEventType() {
  const eventTypes = await client.events.v1.eventTypes.list({ limit: 20 });

  eventTypes.forEach((e) => console.log(e.type));
}

listEventType();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

event_types = client.events.v1.event_types.list(limit=20)

for record in event_types:
    print(record.type)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Events.V1;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var eventTypes = await EventTypeResource.ReadAsync(limit: 20);

        foreach (var record in eventTypes) {
            Console.WriteLine(record.Type);
        }
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.events.v1.EventType;
import com.twilio.base.ResourceSet;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        ResourceSet<EventType> eventTypes = EventType.reader().limit(20).read();

        for (EventType record : eventTypes) {
            System.out.println(record.getType());
        }
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	events "github.com/twilio/twilio-go/rest/events/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &events.ListEventTypeParams{}
	params.SetLimit(20)

	resp, err := client.EventsV1.ListEventType(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		for record := range resp {
			if resp[record].Type != nil {
				fmt.Println(*resp[record].Type)
			} else {
				fmt.Println(resp[record].Type)
			}
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$eventTypes = $twilio->events->v1->eventTypes->read([], 20);

foreach ($eventTypes as $record) {
    print $record->type;
}
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

event_types = @client
              .events
              .v1
              .event_types
              .list(limit: 20)

event_types.each do |record|
   puts record.type
end
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:events:v1:types:list
```

```bash
curl -X GET "https://events.twilio.com/v1/Types?PageSize=20" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

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