> ## 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.

# Inbound Webhooks

> Send events from a device or outside system to start recipes

## Overview

Lets a device or another system, such as a doorbell, a POS or a form tool, send events into Composer. Each accepted event can start a [recipe](https://docs.personal.ai/composer/assistant/skills-and-recipes.md).

Each device is registered as an **instance**, declares the event types it sends, and has its own webhook key. A webhook key can only send events for its own instance.

To see what a device has sent and why anything was refused, use [List Webhook Deliveries](https://docs.personal.ai/composer_apis/endpoint/webhook-deliveries.md).

## Authorization

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

The device's webhook key. `Authorization: Bearer <key>` also works.

## Path

**instance** `string` *required*

The device's instance slug.

## Body

**type** `string` *required*

The event type. It must be one the instance declares.

```json Example theme={null}
"type": "doorbell.pressed"
```

**data** `object`

The event's details. Checked against the event type's schema.

**id** `string`

Your own id for the event. An event sent again with the same `id` is accepted once.

**version** `integer`

The event type's version. Default 1.

```json Example Request theme={null}
{
  "type": "doorbell.pressed",
  "id": "evt_01",
  "data": { "door": "front" }
}
```

***

## Response

`202 Accepted` for a new event:

```json Example Success Response theme={null}
{
  "accepted": true,
  "event_id": "8c7b6a59-4837-4261-9f0e-1d2c3b4a5968",
  "type": "doorbell.pressed"
}
```

`200` for an event with an `id` that was already received:

```json theme={null}
{ "accepted": true, "duplicate": true }
```

***

## Example cURL

```bash cURL theme={null}
curl --request POST 'https://composer.personal.ai/hook/v1/front-door' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <webhook-key>' \
--data '{"type": "doorbell.pressed", "id": "evt_01", "data": {"door": "front"}}'
```

***

## Error Codes

Errors come back as JSON: `{ "error": "..." }`.

| Code | Description |
| - | - |
| 400 | The body isn't valid JSON, has no `type`, or `data` doesn't match the event type's schema |
| 401 | Missing or invalid key |
| 403 | The key doesn't belong to this instance, or the instance doesn't declare this event type |
| 413 | The body is larger than 64 KB |
| 429 | More than 120 events in a minute from this instance |


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