---
title: "Events"
description: "The account's event log: page back through it, or poll it forward."
url: https://doorman.fyi/docs/reference/events
markdown: https://doorman.fyi/docs/reference/events.md
area: "API reference"
section: "API reference"
---

# Events

The account's event log: page back through it, or poll it forward.

Source: https://doorman.fyi/docs/reference/events

## List or poll events

`GET /v1/events`

Access `any`: any API key, or a console session.

The account's event log. Without `after`: newest first as a page, with `nextCursor` to continue (events with a smaller `seq`). With `after`: the events with a larger `seq`, oldest first, with `latestSeq` to poll from next; start from the newest `seq` you have, or 0. `after` and `cursor` cannot be combined. Filters apply before paging or polling, across all stored history. Inbox-scoped keys see their inbox's events only.

OAuth: allowed with all of `events:read`, `mail:read`. [App permissions](https://doorman.fyi/docs/oauth.md#scopes) apply in addition to account and resource checks.

Also available as [`client.events.list`](https://doorman.fyi/docs/sdk/reference/events.md#events-list) in TypeScript, [`client.events.list`](https://doorman.fyi/docs/python/reference/events.md#events-list) in Python, the [`events_list`](https://doorman.fyi/docs/mcp/tools/events.md#events-list) tool and [`doorman events list`](https://doorman.fyi/docs/cli/commands/events.md#events-list) on the command line.

Organizations: a member's console session needs `mail:read`. API keys and app tokens are not held to member permissions. See [Roles and permissions](https://doorman.fyi/docs/organizations.md#roles).

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `inboxId` | query | `string` | no | Only this inbox. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`. |
| `threadId` | query | `string` | no | Only events whose stored payload names this thread. Can be combined with inboxId and type. A valid id with no visible matching events returns an empty result, including ids from another account or inbox. Trashing a thread does not remove its stored events. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`. |
| `type` | query | `"message.received" \| "message.sent" \| "thread.updated" \| "inbox.created" \| "inbox.deleted" \| "delivery.failed" \| "message.held" \| "send.held" \| "send.discarded" \| "sign_in.requested" \| "sign_in.completed"` | no | Only this event type. |
| `limit` | query | `integer` | no | Page size, 1 to 100. Defaults to 50. |
| `cursor` | query | `string` | no | Page from here: events with a smaller `seq`. Example: `1041`. |
| `after` | query | `string` | no | Poll from here: events with a larger `seq`, oldest first. Example: `1042`. |

Answers `200`: A page, or a poll.

**Response 200: EventList**
One of:

EventPage: Events newest first, the answer to a `cursor` (or no cursor) request.
- `data` (Event[])
- `nextCursor` (string | null): The `seq` to pass as `cursor` for the next page, as a string; null on the last page. Example: `1041`

EventPoll: Events oldest first, the answer to an `after` request.
- `data` (Event[])
- `latestSeq` (integer): The `seq` to poll from next: the last event of a full page, otherwise the account's newest.

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 400 | `validation_error` | A field is missing or invalid; the message names it. |
| 401 | `unauthorized` | The credential was missing, malformed, revoked or belongs to an inactive account. |
| 401 | `session_invalid` | The console session token could not be verified. |
| 401 | `session_expired` | The console session token has expired. |
| 401 | `session_claims_missing` | The session token does not carry a verified email address. |
| 403 | `insufficient_scope` | The app's token lacks a required scope, or the operation cannot be delegated. |
| 403 | `account_suspended` | The account is suspended. |
| 403 | `account_deleted` | The account was deleted. |
| 403 | `permission_denied` | The signed-in member's role in the organization lacks a permission the operation needs; `permission` names it. An admin of the organization can do it, or change the member's role. |
| 403 | `member_deactivated` | The signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again. |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 409 | `account_mismatch` | The request named another account in `x-doorman-account` than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again. |
| 500 | `internal_error` | Something went wrong on the server. |

curl:
```sh
curl -s "https://api.doorman.fyi/v1/events" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/events", {
  headers: {
    authorization: `Bearer ${process.env.DOORMAN_API_KEY}`,
  },
  redirect: "manual", credentials: "omit",
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();
```

Python:
```python
import os
import requests

response = requests.get(
    "https://api.doorman.fyi/v1/events",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Read an event

`GET /v1/events/{eventId}`

Access `any`: any API key, or a console session.

The event, the payload exactly as it was signed and sent, and every delivery it produced with its status, attempts and last error. Inbox-scoped keys see the inbox webhook's delivery only.

OAuth: allowed with all of `events:read`, `mail:read`. [App permissions](https://doorman.fyi/docs/oauth.md#scopes) apply in addition to account and resource checks.

Also available as [`client.events.get`](https://doorman.fyi/docs/sdk/reference/events.md#events-get) in TypeScript, [`client.events.get`](https://doorman.fyi/docs/python/reference/events.md#events-get) in Python, the [`events_get`](https://doorman.fyi/docs/mcp/tools/events.md#events-get) tool and [`doorman events get`](https://doorman.fyi/docs/cli/commands/events.md#events-get) on the command line.

Organizations: a member's console session needs `mail:read`. API keys and app tokens are not held to member permissions. See [Roles and permissions](https://doorman.fyi/docs/organizations.md#roles).

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `eventId` | path | `string` | yes | The event. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`. |

Answers `200`: The event, its payload and its deliveries.

**Response 200: EventDetail**
An event, the payload exactly as it was signed and sent, and the deliveries it produced.
- `event` (Event)
- `payload` (WebhookEvent | object): The typed event payload, or an unknown future event object.
- `deliveries` (Delivery[]): Inbox-scoped keys see the inbox webhook's delivery only.

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 401 | `unauthorized` | The credential was missing, malformed, revoked or belongs to an inactive account. |
| 401 | `session_invalid` | The console session token could not be verified. |
| 401 | `session_expired` | The console session token has expired. |
| 401 | `session_claims_missing` | The session token does not carry a verified email address. |
| 403 | `insufficient_scope` | The app's token lacks a required scope, or the operation cannot be delegated. |
| 403 | `account_suspended` | The account is suspended. |
| 403 | `account_deleted` | The account was deleted. |
| 403 | `permission_denied` | The signed-in member's role in the organization lacks a permission the operation needs; `permission` names it. An admin of the organization can do it, or change the member's role. |
| 403 | `member_deactivated` | The signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again. |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 409 | `account_mismatch` | The request named another account in `x-doorman-account` than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again. |
| 500 | `internal_error` | Something went wrong on the server. |

curl:
```sh
curl -s "https://api.doorman.fyi/v1/events/evt_01jc5e5f6g7h8j9k0m1n2p3q4r" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/events/evt_01jc5e5f6g7h8j9k0m1n2p3q4r", {
  headers: {
    authorization: `Bearer ${process.env.DOORMAN_API_KEY}`,
  },
  redirect: "manual", credentials: "omit",
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();
```

Python:
```python
import os
import requests

response = requests.get(
    "https://api.doorman.fyi/v1/events/evt_01jc5e5f6g7h8j9k0m1n2p3q4r",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```
