Skip to content

Create Webhook

POST
/v0/webhooks
curl -s -X POST "https://api.yoagent.dev/v0/webhooks" \
-H "Authorization: Bearer $YOAGENT_KEY" \
-H "Content-Type: application/json" \
-d '{"project_id":"prj_01je56wqswfmn9pgbc1wq8tjgq","url":"https://ci.example.com/hooks/yoagent","event_types":["domain.verified"],"scope":"project","inbox_ids":[],"client_id":"ci-run-1842"}'

Subscribe a public https URL to events (message.received) of a project, of chosen inboxes, or only of mail that came through the catch-all.

Media typeapplication/json
WebhookCreate

Subscribe a URL to events of a project: of every inbox (scope project, the default), of chosen ones (inboxes with inbox_ids), or only mail that came through the catch-all (catch_all, a paid feature).

object
project_id
Project Id

The project; omitted: the first project, in the dashboard’s order, where the caller may create it.

Any of:
string
/^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$/
url
required
Url

Where it POSTs the events: an https URL.

string format: uri
>= 1 characters <= 2000 characters
event_types
Event Types

Which events it receives (only those its scope reaches: an event of the whole project, such as domain.verified, only with scope project); omitted: every type its scope reaches now.

Array<string>
>= 1 items
Allowed values: domain.verified message.bounced message.complained message.delivered message.received message.rejected message.sent message.unsubscribed
scope
WebhookScope

Whose mail it gets: every inbox’s (project), chosen ones’ (inboxes) or the catch-all’s (catch_all).

string
default: project
Allowed values: project inboxes catch_all
inbox_ids
Inbox Ids

The inboxes of scope inboxes (1 to 100); not given with another scope.

Array<string>
default: <= 100 items
client_id
Client Id

Your idempotency key, one per organization: creating again with the same client_id returns the same webhook.

Any of:
string
>= 1 characters <= 100 characters

Successful Response

Media typeapplication/json
WebhookOut

A webhook; secret verifies the webhook-signature header (Standard Webhooks).

object
version
required
Version

Goes up by one on every change: of two copies, the one with the higher version is the newer.

integer
webhook_id
required
Webhook Id
string
/^whk_[0-7][0-9a-hjkmnp-tv-z]{25}$/
project_id
required
Project Id
string
/^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$/
url
required
Url

Where it POSTs; whole (with its user and password, sent as Basic auth, its path and query) only to a caller who may create the project’s webhooks (webhook_create), like secret; to others its scheme, host and port.

string
event_types
required
Event Types
Array<string>
Allowed values: domain.verified message.bounced message.complained message.delivered message.received message.rejected message.sent message.unsubscribed
scope
required
WebhookScope

What mail of its project a webhook receives.

string
Allowed values: project inboxes catch_all
inboxes
required
Inboxes

The inboxes of scope inboxes (empty once they are all deleted: it then receives nothing).

Array<object>
WebhookInboxOut

An inbox a webhook is limited to.

object
inbox_id
required
Inbox Id
string
/^inb_[0-7][0-9a-hjkmnp-tv-z]{25}$/
address
required
Address

Null when the caller does not see the inbox; its local part may come from a sender (auto-create).

Any of:
string
enabled
required
Enabled
boolean
disabled_reason
required

failing: we paused it after its URL failed deliveries in a row (how many: the webhooks’ event docs); null when on or paused by a person.

Any of:
DisabledReason

Why a webhook is paused by us rather than by a person.

string
Allowed values: failing
client_id
required
Client Id
Any of:
string
secret
required
Secret

Shown to a caller who may create the project’s webhooks (webhook_create); null for one who may only read them.

Any of:
string
editable
required
Editable

Whether the caller may pause it, turn it on and change it (webhook_update in its project).

boolean
deletable
required
Deletable

Whether the caller may delete it (webhook_delete in its project).

boolean
created_at
required
Created At
string format: date-time

Example

{
"version": 1,
"webhook_id": "whk_01je56wqswfmn9pgbc1wq8tjgq",
"project_id": "prj_01je56wqswfmn9pgbc1wq8tjgq",
"url": "https://ci.example.com/hooks/yoagent",
"event_types": [
"domain.verified"
],
"scope": "project",
"inboxes": [],
"enabled": true,
"disabled_reason": null,
"client_id": "ci-run-1842",
"secret": "whsec_…",
"editable": true,
"deletable": true,
"created_at": "2026-12-01T12:00:00Z"
}

An error (400, 401, 403, 404, 405, 409, 413, 429, 500, 503), in the one shape every call answers: Errors.