# Retrieve event

`opensend.events.get(id)`

One event by its id or its name, with the latest times it was sent and what each one set off.

Needs the scope: `events:read`

## Input

`id` goes first, on its own, and the rest in one object. One object that holds `id` works too.

- `id` (string, required): The id or the name of the event. Up to 120 characters.

## Returns

The call resolves to the answer, already parsed. A call the API refuses throws `OpenSendError` with the code and the message of the answer. [SDK](https://opensend.sh/docs/sdk) lists the errors of the client itself.

- `object` ("event"): Always `event`.
- `id` (string): The id of the event.
- `name` (string): The name of the event, such as `order.paid`.
- `schema` (Record<string, string> | null): The type of each value its data has to carry: `string`, `number`, `boolean` or `date`. `null` takes any data.
- `received` (integer): How many times it has been sent.
- `lastReceivedAt` (string | null): When it was last sent, or `null`.
- `createdAt` (string): When the event was first defined or sent.
- `recent` (object[]): The latest times it was sent, newest first, with what each one set off.
- `recent[].object` ("event_receipt"): Always `event_receipt`.
- `recent[].id` (string): The id of this one event that was sent.
- `recent[].name` (string): The name of the event.
- `recent[].email` (string): The address of the person it was about.
- `recent[].contactId` (string | null): The id of their contact, or `null`.
- `recent[].data` (Record<string, unknown>): The data that came with it.
- `recent[].started` (integer): How many runs it started.
- `recent[].resumed` (integer): How many waiting runs it let go on.
- `recent[].exited` (integer): How many runs it ended.
- `recent[].createdAt` (string): When it was received.

## Example

TypeScript:

```ts
await opensend.events.get('order.paid')
```

CLI:

```bash
opensend events get order.paid
```

Answer:

```json
{
  "object": "event",
  "id": "evt_order.paid",
  "name": "order.paid",
  "schema": {
    "total": "number"
  },
  "received": 5310,
  "lastReceivedAt": "2026-11-27T09:22:00.000Z",
  "createdAt": "2026-09-08T09:30:00.000Z",
  "recent": [
    {
      "object": "event_receipt",
      "id": "rcp_03",
      "name": "order.paid",
      "email": "katherine@example.com",
      "contactId": null,
      "data": {
        "order_id": "1038"
      },
      "started": 1,
      "resumed": 0,
      "exited": 0,
      "createdAt": "2026-11-27T04:30:00.000Z"
    }
  ]
}
```
