# Send event

`opensend.events.send(input)`

Tells the workspace that something happened to one person. Every active automation that listens for the event starts a run, runs that wait for it go on, and runs it is an exit for end. The answer says how many of each.

Needs the scope: `events:write`

## Input

- `name` (string, required): The name of the event, such as `order.paid`. A new name is defined as it is sent.
- `email` (string): The address of the person it is about. Give this or `contactId`. Up to 120 characters.
- `contactId` (string): The id of the contact it is about. Give this or `email`. Up to 64 characters.
- `data` (Record<string, unknown>): Values that come with the event, up to 10 KB. They fill `{{name}}` slots in emails and can be tested by conditions.
- `idempotencyKey` (string): A key of your own that makes a repeat of this request answer with the first result and start nothing. The `Idempotency-Key` header does the same.

## 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_receipt"): Always `event_receipt`.
- `id` (string): The id of this one event that was sent.
- `name` (string): The name of the event.
- `email` (string): The address of the person it was about.
- `contactId` (string | null): The id of their contact, or `null`.
- `data` (Record<string, unknown>): The data that came with it.
- `started` (integer): How many runs it started.
- `resumed` (integer): How many waiting runs it let go on.
- `exited` (integer): How many runs it ended.
- `createdAt` (string): When it was received.

## Example

TypeScript:

```ts
await opensend.events.send({
  name: 'order.paid',
  email: 'ada@example.com',
  data: {
    order_id: '1042',
    total: 49,
  },
})
```

CLI:

```bash
opensend events send \
  --name order.paid \
  --email ada@example.com \
  --data '{"order_id":"1042","total":49}'
```

Answer:

```json
{
  "object": "event_receipt",
  "id": "rcp_04",
  "name": "order.paid",
  "email": "ada@example.com",
  "contactId": null,
  "data": {
    "order_id": "1042",
    "total": 49
  },
  "started": 1,
  "resumed": 0,
  "exited": 0,
  "createdAt": "2026-11-27T09:30:00.000Z"
}
```
