---
title: "Register webhook"
method: POST
path: "/v1/email/webhooks"
tags: ["email"]
---

# Register webhook

`POST /v1/email/webhooks`

## Request

- Base URL: `https://agentlair.dev`
- URL: `https://agentlair.dev/v1/email/webhooks`
- Auth: HTTP bearer

Register a webhook URL to receive real-time `email.received` events.
AgentLair will POST a JSON payload to your URL within seconds of inbound delivery.

If `secret` is provided, requests include `X-AgentLair-Signature: sha256=<hmac-sha256-hex-of-json-body>`.

## Request body

- object
  - `address` string, required
  - `url` string, uri, required
  - `secret` string: Optional HMAC secret for signature verification

## Response `201`

Webhook registered

- Webhook
  - `id` string
  - `address` string
  - `url` string, uri
  - `has_secret` boolean
  - `events` string[]
  - `created_at` string, date-time

## Other responses

- `400`: Invalid parameters

---

[API](https://skmtc.dev/agentlair/apis/agentlair-api.md) · [All operations](https://skmtc.dev/agentlair/apis/agentlair-api/llms.txt) · [OpenAPI document](https://skmtc.dev/agentlair/apis/agentlair-api/revisions/fac95ff4995d?raw)
