# Events API

> Read the event stream behind webhooks: deliveries, bounces, opens and more.

Base URL: `https://api.emailit.com/v2`. Authenticate with `Authorization: Bearer <API key>`.

## List events — GET /events

> List the events in your workspace, newest first, by type and date. Events are the same records that webhooks deliver.

# List events

Returns the events in your workspace, newest first. Every webhook delivery is built from one of these events, so you can use this endpoint to backfill events your endpoint missed. Requires an API key with `full` scope.

`GET /events`

## Query parameters

- `page` (integer): Page number, starting at `1`. Default `1`. Pages deeper than 2,500 events (`(page - 1) × limit > 2500`) return `422`.

- `limit` (integer): Events per page, from `1` to `100`. Default `100`.

- `type` (string): Event type, or a comma-separated list of types, for example `email.delivered,email.bounced`. See [Event types](/docs/webhooks/event-types/).

- `include_data` (boolean): Set to `true` to include each event's `data` payload. Default `false`, which returns only `object`, `id`, `type` and `created_at`.

- `match`, `order`, `direction`: see [Filtering](https://emailit.com/docs/api-reference/filtering/).

## Filters and sort

Filter and sort keys: see [Filtering](https://emailit.com/docs/api-reference/filtering/).

Without a `created_at` filter, the list only covers the last 2 days. To look further back, add one, for example `created_at.after=2026-09-01T00:00:00Z`. Older events are available for as long as your plan's [data retention](/docs/data-retention/) keeps them.

## Returns

Returns `200 OK` with the events in `data`, plus `next_page_url` and `previous_page_url` (`null` at either end). The page URLs keep `type`, `limit` and `include_data`.

Returns `422` with `code: "events_offset_too_large"` when the page is too deep. Narrow the date range or the types instead of paging further.

**Request** `GET /events`

**Node.js**

```javascript
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

const events = await emailit.events.list({ type: 'email.delivered' });
```

**Python**

```python
from emailit import EmailitClient
client = EmailitClient("your_api_key")

events = client.events.list({"type": "email.delivered"})
```

**PHP**

```php
$emailit = Emailit::client('your_api_key');

$events = $emailit->events()->list(['type' => 'email.delivered']);
```

**Ruby**

```ruby
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

events = client.events.list(type: "email.delivered")
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

events, err := client.Events.List(&emailit.ListEventsRequest{Type: "email.delivered"})
```

**Rust**

```rust
use emailit::Emailit;
let emailit = Emailit::new("your_api_key");

let events = emailit.events.list(Some(emailit::types::ListEventsParams { r#type: Some("email.delivered".into()), ..Default::default() })).await?;
```

**Java**

```java
import com.emailit.*;
import com.emailit.params.*;

EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject events = emailit.events().list();
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var events = emailit.Events.List(new EventListOptions { Type = "email.delivered" });
```

**Laravel**

```php
use Emailit\Laravel\Facades\Emailit;

$events = Emailit::events()->list(['type' => 'email.delivered']);
```

**cURL**

```bash
curl -X GET "https://api.emailit.com/v2/events?type=email.delivered" \
  -H "Authorization: Bearer your_api_key" \
  -H "Content-Type: application/json"
```

**200**

```json
{
  "data": [
    {
      "object": "event",
      "id": "evt_2xLc9Rr4Tn6Wb1Qm8Ks3Vf0Hd7a",
      "type": "email.delivered",
      "created_at": "2026-10-01T10:02:15.912000+00:00"
    }
  ],
  "next_page_url": "/v2/events?page=2&limit=100&type=email.delivered",
  "previous_page_url": null
}
```

**200 with data**

```json
{
  "data": [
    {
      "object": "event",
      "id": "evt_2xLc9Rr4Tn6Wb1Qm8Ks3Vf0Hd7a",
      "type": "email.delivered",
      "data": {
        "object": {
          "id": "em_2xLc8Mm3Pq5Vn0Ra7Jt2Wd9Fb4e",
          "object": "email",
          "from": "hello@acme.com",
          "to": "ada@example.com",
          "subject": "Your order has shipped",
          "status": "delivered",
          "meta": { "order_id": "1042" },
          "updated_at": "2026-10-01T10:02:14.307000+00:00",
          "created_at": "2026-10-01T10:02:11.583000+00:00"
        }
      },
      "created_at": "2026-10-01T10:02:15.912000+00:00"
    }
  ],
  "next_page_url": "/v2/events?page=2&limit=100&type=email.delivered&include_data=true",
  "previous_page_url": null
}
```

**422**

```json
{
  "error": "Page is too deep. Narrow the type or date filter, or open an earlier page.",
  "code": "events_offset_too_large"
}
```

---
Source: https://emailit.com/docs/api-reference/events/list/

## Retrieve an event — GET /events/{id}

> Retrieve one event by its ID, with the full data payload that Emailit sent, or would send, to your webhooks.

# Retrieve an event

Returns one event with its full `data` payload. The `id` is the same value webhooks send as `event_id`, so you can look up any event you received. Requires an API key with `full` scope.

`GET /events/:id`

## Path parameters

- `id` (string, required): Event ID, for example `evt_2xLc9Rr4Tn6Wb1Qm8Ks3Vf0Hd7a`.

## Returns

Returns `200 OK` with the event: `object` (`event`), `id`, `type`, `data` and `created_at`. `data.object` has the same shape as in the webhook payload for that type; see the [webhook event reference](/docs/webhooks/event-types/).

Returns `404` with `error: "Event not found"` if the ID doesn't exist in your workspace.

**Request** `GET /events/{id}`

**Node.js**

```javascript
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

const event = await emailit.events.get('evt_2xLc9Rr4Tn6Wb1Qm8Ks3Vf0Hd7a');
```

**Python**

```python
from emailit import EmailitClient
client = EmailitClient("your_api_key")

event = client.events.get("evt_2xLc9Rr4Tn6Wb1Qm8Ks3Vf0Hd7a")
```

**PHP**

```php
$emailit = Emailit::client('your_api_key');

$event = $emailit->events()->get('evt_2xLc9Rr4Tn6Wb1Qm8Ks3Vf0Hd7a');
```

**Ruby**

```ruby
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

event = client.events.get("evt_2xLc9Rr4Tn6Wb1Qm8Ks3Vf0Hd7a")
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

event, err := client.Events.Get("evt_2xLc9Rr4Tn6Wb1Qm8Ks3Vf0Hd7a")
```

**Rust**

```rust
use emailit::Emailit;
let emailit = Emailit::new("your_api_key");

let event = emailit.events.get("evt_2xLc9Rr4Tn6Wb1Qm8Ks3Vf0Hd7a").await?;
```

**Java**

```java
import com.emailit.*;
import com.emailit.params.*;

EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject event = emailit.events().get("evt_2xLc9Rr4Tn6Wb1Qm8Ks3Vf0Hd7a");
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var ev = emailit.Events.Get("evt_2xLc9Rr4Tn6Wb1Qm8Ks3Vf0Hd7a");
```

**Laravel**

```php
use Emailit\Laravel\Facades\Emailit;

$event = Emailit::events()->get('evt_2xLc9Rr4Tn6Wb1Qm8Ks3Vf0Hd7a');
```

**cURL**

```bash
curl https://api.emailit.com/v2/events/evt_2xLc9Rr4Tn6Wb1Qm8Ks3Vf0Hd7a \
  -H "Authorization: Bearer your_api_key"
```

**200**

```json
{
  "object": "event",
  "id": "evt_2xLc9Rr4Tn6Wb1Qm8Ks3Vf0Hd7a",
  "type": "email.delivered",
  "data": {
    "object": {
      "id": "em_2xLc8Mm3Pq5Vn0Ra7Jt2Wd9Fb4e",
      "object": "email",
      "from": "hello@acme.com",
      "to": "ada@example.com",
      "subject": "Your order has shipped",
      "status": "delivered",
      "meta": { "order_id": "1042" },
      "updated_at": "2026-10-01T10:02:14.307000+00:00",
      "created_at": "2026-10-01T10:02:11.583000+00:00"
    }
  },
  "created_at": "2026-10-01T10:02:15.912000+00:00"
}
```

**404**

```json
{
  "error": "Event not found"
}
```

---
Source: https://emailit.com/docs/api-reference/events/get/
