> ## Documentation Index
> Fetch the complete documentation index at: https://docs.personal.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Emit Event

> Send an event that can start recipes

## Overview

Publishes an event in your workspace. Any [recipe](https://docs.personal.ai/composer/assistant/skills-and-recipes.md) that runs on that event type starts. For events coming from a device or outside system, use [Inbound Webhooks](https://docs.personal.ai/composer_apis/inbound-webhooks.md).

> [!NOTE]
>
> Changes data, so it needs a key that isn't read-only.

Operation name: `event.emit`.

## Authorization

**x-api-key** `string` *required*

Your Composer API key

## Headers

**Content-Type** `string` *required*

Must be set to application/json

## Body

**event\_type** `string` *required*

The event type, such as `doc.uploaded`. Recipes match on this.

```json Example theme={null}
"event_type": "doc.uploaded"
```

**data** `object`

The event's details.

**subject** `string`

The id of what the event is about.

```json Example Request theme={null}
{
  "event_type": "doc.uploaded",
  "data": {
    "filename": "menu.pdf"
  }
}
```

***

## Response

**emitted** `boolean`

True when the event was published.

**type** `string`

The event type.

```json Example Success Response theme={null}
{
  "emitted": true,
  "type": "doc.uploaded"
}
```

***

## Example cURL

```bash cURL theme={null}
curl --request POST 'https://composer.personal.ai/lab/api/v1/op/event.emit' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <your-api-key>' \
--data '{"event_type": "doc.uploaded", "data": {"filename": "menu.pdf"}}'
```

***

## Error Codes

| Code | Description |
| - | - |
| 400 | The body doesn't match the fields above, or the operation failed. The response body says why. |
| 401 | Missing or invalid API key |
| 403 | This key isn't allowed to call this operation (for example, a read-only key) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.