Create Webhook
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"}'const response = await fetch("https://api.yoagent.dev/v0/webhooks", { method: "POST", headers: { Authorization: `Bearer ${process.env.YOAGENT_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "project_id": "prj_01je56wqswfmn9pgbc1wq8tjgq", "url": "https://ci.example.com/hooks/yoagent", "event_types": [ "domain.verified" ], "scope": "project", "inbox_ids": [], "client_id": "ci-run-1842" }),});if (!response.ok) throw new Error(await response.text());const data = await response.json();import os
import requests
response = requests.post( "https://api.yoagent.dev/v0/webhooks", headers={"Authorization": f"Bearer {os.environ['YOAGENT_KEY']}"}, json={ "project_id": "prj_01je56wqswfmn9pgbc1wq8tjgq", "url": "https://ci.example.com/hooks/yoagent", "event_types": [ "domain.verified", ], "scope": "project", "inbox_ids": [], "client_id": "ci-run-1842", }, timeout=60,)response.raise_for_status()data = response.json()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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”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
Where it POSTs the events: an https URL.
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.
Whose mail it gets: every inbox’s (project), chosen ones’ (inboxes) or the catch-all’s
(catch_all).
The inboxes of scope inboxes (1 to 100); not given with another scope.
Responses
Section titled “Responses”Successful Response
A webhook; secret verifies the webhook-signature header (Standard Webhooks).
object
Goes up by one on every change: of two copies, the one with the higher version is the newer.
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.
What mail of its project a webhook receives.
The inboxes of scope inboxes (empty once they are all deleted: it then receives nothing).
An inbox a webhook is limited to.
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.
Why a webhook is paused by us rather than by a person.
Whether the caller may pause it, turn it on and change it (webhook_update in its project).
Whether the caller may delete it (webhook_delete in its project).
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"}default
Section titled “default”An error (400, 401, 403, 404, 405, 409, 413, 429, 500, 503), in the one shape every call answers: Errors.