# Webhooks and events

> Get every event that matters delivered to your server, signed, with retries.

Everything that happens on the platform is an **event**: an operation finished, a person answered, a connection broke, a spend cap was reached. A **webhook** is an endpoint on your server that NoClick sends the events you choose to, each one signed so you know it came from NoClick. Use them instead of polling: your server hears about an agent's reply or a failed run within a second or two of it happening.

## Add an endpoint

```python
import noclick

hook = noclick.Webhook.create(
    "https://api.yourco.test/noclick/events",
    events=["operation.succeeded", "operation.failed", "human.answered"],
)
print(hook.secret)   # nk_whsec_...: shown this once
```

```ts
import { Webhook } from "noclick";

const hook = await Webhook.create("https://api.yourco.test/noclick/events", {
  events: ["operation.succeeded", "operation.failed", "human.answered"],
});
console.log(hook.secret);   // nk_whsec_...: shown this once
```

The URL must be `https` and reachable from the internet. `events` names the [event types](https://www.noclick.com/docs/guide/webhooks.md#event-types) it receives, and `*` matches the rest of a name: `operation.*` is both operation events, and `*` is everything.

`hook.secret` signs every delivery to this endpoint. It's on the object `create` returns, so store it where your receiver reads it, like `NOCLICK_WEBHOOK_SECRET`. You can also add endpoints in the console, under **Settings > Webhooks**.

To own the endpoint in code, use `from_name` with the URL in a setup script or at startup. It creates the endpoint on first use and, after that, sets the `events` and `description` you pass every time it runs; one you leave out is never changed. `Webhook.create(..., allow_existing=True)` makes it once and leaves it alone after. A receiver that starts from code can then read the secret itself with `reveal_secret()`, which needs a key with the `webhooks:reveal` [scope](https://www.noclick.com/docs/guide/keys.md):

```python
hook = noclick.Webhook.from_name(
    "https://api.yourco.test/noclick/events",
    create_if_missing=True,
    events=["operation.succeeded", "operation.failed", "human.answered"],
)
secret = hook.secret or hook.reveal_secret()   # set when this call created it
```

```ts
import { Webhook } from "noclick";

const hook = await Webhook.fromName("https://api.yourco.test/noclick/events", {
  createIfMissing: true,
  events: ["operation.succeeded", "operation.failed", "human.answered"],
}).hydrate();
const secret = hook.secret ?? (await hook.revealSecret());   // set when this call created it
```

Every reveal is recorded with the key that made it, in your [API request log](https://www.noclick.com/docs/guide/activity.md) (the console's **Logs > API requests**). A scope has one endpoint per URL: creating a second raises `noclick.Conflict` with the first one's id.

Your account's endpoints receive every event, your users' included; each event's `user_id` says whose it was. An endpoint created for a user receives only that user's events:

```python
with noclick.as_user("acme"):
    hook = noclick.Webhook.create("https://api.yourco.test/acme/events", events=["connection.*"])
```

```ts
import { Webhook, asUser } from "noclick";

await asUser("acme", async () => {
  const hook = await Webhook.create("https://api.yourco.test/acme/events", { events: ["connection.*"] });
});
```

Such an endpoint is read acting for its user too (`Webhook.get(hook_id, user="acme")`, or inside `as_user`): from your account's own scope its id raises `noclick.NotFound`.

## Verify each delivery

Every delivery is a `POST` with the event as its JSON body and a `NoClick-Signature` header. Check it with `noclick.Webhook.verify`, which needs the raw body exactly as it arrived:

```python
import os
from flask import Flask, request

app = Flask(__name__)

@app.post("/noclick/events")
def noclick_events():
    try:
        event = noclick.Webhook.verify(request.get_data(), request.headers, os.environ["NOCLICK_WEBHOOK_SECRET"])
    except noclick.WebhookSignatureError:
        return "", 400
    if event.type == "human.answered":
        print(event.data["answer"])
    return "", 204
```

```ts
import { Webhook, WebhookSignatureError, type Event } from "noclick";

// A fetch-style handler: Next.js route handlers, Hono, Bun, Deno and Workers all take one.
export async function POST(request: Request): Promise<Response> {
  let event: Event;
  try {
    event = await Webhook.verify(await request.text(), request.headers, process.env.NOCLICK_WEBHOOK_SECRET!);
  } catch (err) {
    if (err instanceof WebhookSignatureError) return new Response(null, { status: 400 });
    throw err;
  }
  if (event.type === "human.answered") {
    console.log(event.data.answer);
  }
  return new Response(null, { status: 204 });
}
```

`verify` returns the [`noclick.Event`](https://www.noclick.com/docs/reference/python/Webhook.md#Event) the body carries and sends nothing. It raises `noclick.WebhookSignatureError` when the header is missing or malformed, when no signature matches the body, or when the delivery was signed more than 5 minutes from now, so a captured delivery can't be replayed later. Pass `tolerance_s=` to change that window.

Parse the body only after verifying it: a framework that parses JSON and serializes it again changes the bytes, and the signature no longer matches.

If you verify without the SDK, the header is `t=<unix seconds>,v1=<signature>`, and the signature is the hex HMAC-SHA256 of `<t>.<body>` keyed with the secret. While you [rotate the secret](https://www.noclick.com/docs/guide/webhooks.md#rotate-the-secret) the header carries two `v1=` values; accept the delivery if either matches.

## What a delivery holds

```json
{
  "object": "event",
  "id": "7c1e9a4b-2d3f-4a8e-9b6c-0f5d2e8a1b37",
  "type": "operation.failed",
  "user_id": "user_42",
  "created_at": "2026-09-26T16:02:11Z",
  "data": {
    "object": "operation",
    "id": "40000000-0000-4000-8000-000000000009",
    "kind": "agent.message",
    "status": "failed",
    "error": { "type": "spend_cap_exceeded", "message": "Acme Corp reached its $50 monthly cap." }
  }
}
```

`data` is the object the event is about, as its own read returns it: an operation's event holds the operation (with its `summary`), a person's answer the request, a connection's the connection, a wake-up's the wake-up. Two carry a record of their own: `agent.turn.*` holds an `agent_turn` (the turn's operation `id`, the `agent_id` and its name as `agent`, the `conversation`, what `started_by` it: `message`, `wakeup`, `trigger` or `channel`, and the `reply` with its `tool_calls` and `cost_usd` as it settled, which its operation may complete a moment later, or the `error`), and `spend.cap_reached` a `spend_cap` (its `scope`, `key`, `user` or `agent`, the `id` it's about, `cap_usd`, `spent_usd` and when it `resets_at`). `usage.recorded` holds a `usage` record (see [Usage, as it happens](https://www.noclick.com/docs/guide/spend.md#usage-as-it-happens)), whose `id` is the event's, and `user.spending.*` the user's `spending`, as `user.spending` reads it. A very large object is cut to its plain fields with `truncated: true`; read the whole of it by its id.

The same event can arrive more than once (a retry after your server timed out, a redelivery), so use `event.id` to skip one you've already handled. Events can arrive out of order; compare `created_at` if order matters.

## Answer quickly, work after

Answer with any `2xx` within 10 seconds and the delivery succeeds. Anything else, including a redirect or a timeout, counts as a failure. If handling an event takes longer, put it on a queue and answer first.

## Retries

A failed delivery is retried with growing gaps (a minute, five minutes, half an hour, two hours, five hours, then every 12 hours) for 3 days, then marked `failed`. The endpoint's `status` turns `failing` while its latest attempt failed, and back to `healthy` once one succeeds; `success_rate_24h` is the share of its attempts in the last day your server answered `2xx`, and `last_failure` its latest failed attempt. NoClick never turns an endpoint off on its own.

See what went wrong, and send what your server missed once it's fixed:

```python
hook = noclick.Webhook.from_id("5e2d8c1a-7b4f-4e93-a6d0-3c9f1b2e8a54")
print(hook.status, hook.success_rate_24h, hook.last_failure)

for delivery in hook.deliveries(status=["retrying", "failed"]):
    print(delivery.event_type, delivery.attempts, delivery.response_status, delivery.next_retry_at)
    hook.redeliver(delivery)
```

```ts
import { Webhook } from "noclick";

const hook = await Webhook.fromId("5e2d8c1a-7b4f-4e93-a6d0-3c9f1b2e8a54").hydrate();
console.log(hook.status, hook.successRate24h, hook.lastFailure);

for (const delivery of await hook.deliveries({ status: ["retrying", "failed"] })) {
  console.log(delivery.eventType, delivery.attempts, delivery.responseStatus, delivery.nextRetryAt);
  await hook.redeliver(delivery);
}
```

A delivery's `status` is `pending`, `retrying`, `succeeded` or `failed`; `response_status` and `response_body` (its first 4 KB) are your server's latest answer, and `error` says why the latest attempt failed. `redeliver` sends the same event again now, the same bytes with a fresh signature, whatever its status: one still retrying keeps its retries, and one that had settled stays settled. Deliveries are kept for 30 days.

## Send a test event

```python
sent = hook.test("human.answered")
print(sent.status, sent.response_status, sent.response_body)
```

```ts
const sent = await hook.test("human.answered");
console.log(sent.status, sent.responseStatus, sent.responseBody);
```

`test` signs and sends a sample event of that type right away and waits up to 10 seconds for your answer. Its `data` is a sample with `test: true`. Test events aren't retried, don't appear in the event log, and don't count toward the endpoint's health.

## Try it on your machine

Your laptop isn't reachable from the internet, so let the [CLI](https://www.noclick.com/docs/guide/cli.md) forward events to it. It reads the event log every two seconds and prints a secret for the session to verify with:

```bash
noclick webhooks listen --forward-to http://localhost:3000/noclick/events
```

## Rotate the secret

```python
new_secret = hook.rotate_secret()
```

```ts
const newSecret = await hook.rotateSecret();
```

For a day after a rotation, each delivery is signed with both the new secret and the old one, so your receiver keeps verifying while you deploy the new secret. Pass both to `verify` in that window: `noclick.Webhook.verify(body, headers, [new_secret, old_secret])`. If the old secret leaked, pass `grace_s=0` to stop using it at once.

## Change, pause or delete an endpoint

```python
hook.update(events=["operation.*", "human.*"])
hook.update(enabled=False)   # pause
hook.update(enabled=True)
hook.delete()
```

```ts
await hook.update({ events: ["operation.*", "human.*"] });
await hook.update({ enabled: false });   // pause
await hook.update({ enabled: true });
await hook.delete();
```

While an endpoint is paused, events aren't queued for it: what happens meanwhile isn't delivered later. Read it from the event log instead. Deliveries it was already retrying wait while it's paused and carry on once it's enabled, unless their 3 days ran out.

## Read past events

Every event is kept for 30 days, whether or not an endpoint received it:

```python
from datetime import datetime, timedelta, timezone

week = datetime.now(timezone.utc) - timedelta(days=7)
for event in noclick.Event.list(type="domain.*", since=week):
    print(event.created_at, event.type, event.data["name"])

event = noclick.Event.get("7c1e9a4b-2d3f-4a8e-9b6c-0f5d2e8a1b37")
for delivery in event.deliveries:
    print(delivery.webhook_id, delivery.status)
```

```ts
import { Event } from "noclick";

const week = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
for (const event of await Event.list({ type: "domain.*", since: week })) {
  console.log(event.createdAt, event.type, event.data.name);
}

const event = await Event.get("7c1e9a4b-2d3f-4a8e-9b6c-0f5d2e8a1b37");
for (const delivery of event.deliveries) {
  console.log(delivery.webhookId, delivery.status);
}
```

Like other reads, `Event.list` reads your account's own events outside `as_user`, and `user_filter=noclick.ALL_USERS` reads your users' too. `since` takes the events at that moment and after, `until` those before it. `Event.get` reads any of your account's events by id, as `Operation.from_id` does; acting for a user, it reads only that user's, with the deliveries to that user's own endpoints. The console's **Logs > Events** shows the same log, with each event's deliveries.

## Your agents and channels hear them too

The events your webhooks receive can also wake your agents and post in your channels, with no server of yours in between:

- **A wake-up** waits for one: `agent.wake(conversation, when="connection.connected", filters={"name": "gmail"}, note=...)`. See [Wake it up later](https://www.noclick.com/docs/guide/agents.md#wake-it-up-later).
- **A trigger** gives an agent a turn on each: `noclick.OnPlatformEvent("operation.failed", filters={"kind": "agent.task"})`. See [Triggers](https://www.noclick.com/docs/guide/triggers.md#wake-it-on-a-noclick-event).
- **A channel** posts each one in its room: `room.subscribe("connection.disconnected")`. See [Channels](https://www.noclick.com/docs/guide/channels.md).

They hear the way endpoints do: one of your account's hears every event, your users' included, and a user's hears only that user's. `filters` are dotted paths into the event's `data` and the values they must have. An agent never hears what its own turns caused, and a channel never hears its own halting or its agents' turns, so nothing feeds on itself.

What an agent or a channel reads of an event leaves out a person's contact details, as everything an agent reads does: how to reach whoever a request was sent to (your account's owner, for a call NoClick held for them) or a conversation was handed to, a held call's personal arguments (a domain registrant's), and the summary and input of a request's operation, which name its recipient. Their names stay. Your webhooks and `noclick.Event.list()` get every event whole, as the API answers your own code.

## Email alerts to your account's owner

Beside the events your webhooks get, NoClick emails your account's owner about their own account: an automation that failed, a balance running low, the monthly cap reached, a connected account that stopped working, the weekly digest. Each kind can be turned off, as Settings → Notifications in the NoClick app does, and every alert email carries a one-click link that turns its own kind off. Any of your account's own keys reads and changes them, as do its MCP connections and your NoClick assistant; a key held to one of your users gets `noclick.PermissionDenied`, since they're the owner's. An agent changes them only on the owner's own word: on a turn their message started, never a schedule's, an event's, a wake-up's or another agent's, and never on the word of someone who joined one of your spaces.

```python
alerts = noclick.Notifications.get()
print(alerts.categories["digest"])   # True until it's turned off

noclick.Notifications.update({"digest": False, "run_failure": True})
```

```ts
import { Notifications } from "noclick";

const alerts = await Notifications.get();
console.log(alerts.categories.digest); // true until it's turned off

await Notifications.update({ digest: false, run_failure: true });
```

Over HTTP it's `GET /v1/notifications`, and `PATCH /v1/notifications` with `{"categories": {"digest": false}}`. A kind you leave out stays as it is, a kind never turned off is on, and a kind NoClick doesn't send raises `noclick.InvalidRequest`, changing nothing. The kinds:

| Kind | Emailed when |
| --- | --- |
| `run_failure` | an automation started by a webhook, schedule or email fails |
| `credits` | the balance runs low, or a run stops because it ran out |
| `topup` | funds added fall below their line, or auto top-up pauses or stops |
| `credential_revoked` | a connected account stops working and needs connecting again |
| `channel_disconnected` | a live channel connection (like WhatsApp) drops and messages stop arriving |
| `sign_in_expiring` | a Claude sign-in your agents use is a few days from expiring |
| `approvals` | an agent waits for an approval to act with an account you restricted |
| `schedule_paused` | a schedule pauses because its runs kept failing the same way |
| `spend_cap` | the account reaches its [monthly cap](https://www.noclick.com/docs/guide/spend.md#your-account-s-monthly-cap) and work that costs money stops |
| `platform_paused` | the balance can't pay for apps and databases: before they pause, and when they do |
| `referrals` | someone the owner invited starts using NoClick |
| `machines` | NoClick decides a request for [machines](https://www.noclick.com/docs/guide/machines.md) |
| `phone_numbers` | the carrier approves, sends back or ends a [number's](https://www.noclick.com/docs/guide/phone-numbers.md) order |
| `digest` | each Monday, a summary of runs, failures and what they spent |

## Popups in the NoClick app

The NoClick app shows its owner a few popups and banners they can turn off: `run_results`, the outputs shown after a workflow runs; `invite_banner`, the nudge to share a workflow's live invite link; and `publish_banner`, the nudge to publish an interface. A popup's own "Don't show again" turns it off, and Settings → Popups turns it back on. Any of your account's own keys reads and switches them, as do its MCP connections and agents; a key held to one of your users gets `noclick.PermissionDenied`.

```python
shown = noclick.Popups.get().popups   # {"run_results": True, "invite_banner": False, ...}
noclick.Popups.update({"invite_banner": True})
```

```ts
import { Popups } from "noclick";

const { popups } = await Popups.get();
await Popups.update({ invite_banner: true });
```

Over HTTP it's `GET /v1/popups`, and `PATCH /v1/popups` with `{"popups": {"invite_banner": true}}`. A popup you leave out stays as it is, and one the app doesn't have raises `noclick.InvalidRequest`.

## Event types

`noclick.Event.types()` returns this catalog:

| Type | When |
| --- | --- |
| `operation.succeeded` | An [operation](https://www.noclick.com/docs/guide/operations.md) finished: an agent turn, a connect link, a call. |
| `operation.failed` | An operation failed, was canceled or expired; `data.error` says why. |
| `human.answered` | A person answered a request, an approval or a form. |
| `human.expired` | A request to a person expired unanswered. |
| `approval.requested` | A call waits for [approval](https://www.noclick.com/docs/guide/policy.md#hear-them-as-they-re-held): a purchase, a deletion that can't be undone, a raised spending limit, a call your policy holds. `data` is the approval as [`noclick.Approval`](https://www.noclick.com/docs/reference/python/Approval.md#Approval) reads it, never its link; a key holding `approvals:answer` answers it. |
| `approval.decided` | An approval was decided: `data.status` is `approved`, `declined`, `expired` (nobody answered it within its day) or `canceled` (its call was withdrawn), and `data.decided_by` is `owner` or `code` (with `data.decided_by_key`). |
| `approvals.policy.changed` | Your account's [approval switches](https://www.noclick.com/docs/guide/policy.md#switch-them-for-your-account) changed, or a change still waiting was undone: `data.changes` is each kind it set (or `data.undone` the change taken back), and `data.changed_by` is `owner` or `key` (with `data.key_id`). |
| `connection.connected` | A connection's account was connected, or reconnected. |
| `connection.disconnected` | A connection stopped working: its account was revoked or removed at the provider. |
| `connection.deleted` | A connection was deleted, and its account disconnected with it. |
| `agent.turn.completed` | An agent finished a turn; `data` holds the reply. |
| `agent.turn.failed` | An agent's turn failed. |
| `agent.conversation.handed_off` | An agent handed a conversation to a person with its `hand_off` tool; `data` names the agent, the conversation, its user, the person (`to`), the agent's summary and the person's request (`request_id`). On a call it's the transfer: `to` is the phone, with the call's `call_sid`. |
| `agent.wakeup.delivered` | A [wake-up](https://www.noclick.com/docs/guide/agents.md#wake-it-up-later) started its turn; `data` is the wake-up, with the turn's `operation_id`. |
| `agent.wakeup.missed` | A routine (a recurring wake-up) came due and its turn couldn't be paid for, so it missed that time and comes round at its next; `data.reason` is `credits`, `spend_cap` (your account's monthly cap) or `budget` (the agent's, its key's or its user's), and `data.error` says why. |
| `agent.wakeup.failed` | A wake-up's turn couldn't run and it won't come again: a one-off your account couldn't pay for, or the agent expired; `data.error` says why. |
| `agent.job.update` | A job sent its parent an [update](https://www.noclick.com/docs/guide/sub-agents.md#what-the-child-reports-and-when); `data` is the update, with its `job_id` and the `agent_id` of the agent doing the work. |
| `agent.asked_owner` | An [agent built in the app](https://www.noclick.com/docs/guide/agents.md#agents-built-in-the-app) messaged you with its `message_coordinator` tool; `data` names the agent (`agent_id`), its `workflow_id`, the `conversation` and its `message`. |
| `workflow.run.failed` | A [workflow](https://www.noclick.com/docs/guide/workflows.md)'s run failed; `data` names the workflow, the `run_id`, the failing `step`, the `error` and `failed_runs_last_24h`. Failures of one workflow within six hours fold into the first, so a workflow failing every minute sends one. |
| `workflow.approval.requested` | A workflow's run waits at its [Approval step](https://www.noclick.com/docs/guide/workflows.md#answer-its-approval-steps): `data` is the step as [`noclick.WorkflowApproval`](https://www.noclick.com/docs/reference/python/Workflow.md#WorkflowApproval) reads it (its title, form fields and values), never its link; NoClick sent the owner its link (`data.sent_to`), and a key holding `approvals:answer` answers it. |
| `workflow.approval.decided` | A workflow's Approval step was answered and its run goes on down that branch: `data.status` is `approved` or `declined`, and `data.decided_by` is `owner`, `code` (with `data.decided_by_key`) or `app` (someone who may edit the workflow, in the NoClick app). |
| `payment.completed` | A person paid one of a refusal's [offers](https://www.noclick.com/docs/guide/errors.md#money-refusals-carry-their-way-past); `data` says what (`kind`, `what`, `price_usd`) and names its `operation_id`. |
| `inbox.message.received` | Mail arrived at an inbox. |
| `phone.call.completed` | A call an agent placed from one of your numbers ended; `data` holds the transcript. |
| `channel.halted` | A channel stopped: its budget ran out, it hit its turn limit, or it was closed. |
| `channel.idle` | A [channel](https://www.noclick.com/docs/guide/channels.md)'s agents finished: a turn ended and none is running or waiting to run, so the run the last message started is done, hand-offs included; `data` is the channel. |
| `sandbox.terminated` | A sandbox stopped: its time ran out, it was terminated, or it failed. |
| `machine.restarted` | A [machine](https://www.noclick.com/docs/guide/machines.md) is running again after a restart you asked for, or one NoClick did when it stopped answering (`data.reason`); turns it interrupted failed as interrupted. |
| `machine.failed` | A machine failed: it didn't come up, or kept failing after a restart and a rebuild on a new host; `data.status_reason` says which. |
| `machine.restored` | A machine's host failed and NoClick rebuilt it on a new one from its last backup (`data.restored_from`, null when it had none yet). |
| `machine.online` | Your own machine is answering: its server was just set up, or it's back after it went offline. |
| `machine.offline` | Your own machine stopped answering (`data.last_seen_at` is when it last did): its agents' turns fail until it's back. NoClick never restarts it. |
| `machine.unpaid` | Your balance couldn't pay a machine's daily charge: it keeps running for `data.stops_after_hours`, then stops until the balance covers what it owes; unpaid for `data.deleted_after_days`, it's deleted. |
| `machine.vetting.decided` | NoClick decided your request for machines: `data.status` is `approved` (you can create machines now) or `rejected`, with `data.reason`; a rejected one can ask again. |
| `repo.pushed` | A [repo](https://www.noclick.com/docs/guide/repos.md#hear-about-pushes)'s branch moved: a git push, or a commit through the API; `data` names the `branch` and its commits `before` and `after`. |
| `deployment.ready` | An app's deployment is live. |
| `deployment.failed` | An app's deployment failed to build or start. |
| `schedule.paused` | An agent's trigger (a schedule, a webhook, an app event) kept failing the same way and stopped until the agent is resumed, or an [app's schedule](https://www.noclick.com/docs/guide/apps.md#run-on-a-schedule) did until it's resumed; `data` is the trigger or the schedule. |
| `domain.active` | A domain's records are in place and it's serving. |
| `domain.expiring` | A domain expires within 30 days and won't renew on its own. |
| `database.quota_warning` | A database reached 80% of its size limit. |
| `card.authorization.requested` | A [card](https://www.noclick.com/docs/guide/cards.md) purchase waits for a person's approval: announced first (`data.kind` `purchase`), or held at the merchant (`charge`). |
| `card.transaction.declined` | A card charge was declined; `data.decline_reason` says why. |
| `card.transaction.refunded` | A merchant refunded a card charge. |
| `card.dispute.updated` | A card dispute moved on: `submitted`, `won`, `lost` or `expired`. |
| `card.balance.negative` | Your company's card balance went below zero, so every card is frozen until it's funded; `data.top_up_url` is where to fund it. |
| `card.balance.funded` | The card balance is funded again after going below zero: the cards NoClick froze pay again. |
| `spend.cap_reached` | A key, user or agent reached its monthly spend cap, and work it would have paid for is refused; `data.scope` says which. Once a month per cap. |
| `usage.recorded` | Spend for one of your users settled: a turn, an AI request, a tool run, a call, a stretch of a sandbox, an email, a text, a purchase or a renewal, or a day of storage; `data` is the [usage record](https://www.noclick.com/docs/guide/spend.md#usage-as-it-happens), to bill them on. |
| `user.spending.paused` | You [paused a user's spending](https://www.noclick.com/docs/guide/users.md#pause-a-user-s-spending); `data` is their spending: the `message` and `action` they're told, and `since`. |
| `user.spending.resumed` | You resumed a user's spending; `data.replayed` is how many of their held messages are running now. |

A job ends as an operation does: a spawned child's task sends `operation.succeeded` or `operation.failed` with `data.kind` `agent.task`, so there's no separate type for it.

When a spend cap is reached, NoClick also emails your account's owner, at most once a day while it refuses work. It never writes to your users about money: the event is how your own code decides whether and how to tell them.

Some types are in the catalog before anything sends them, so your code can subscribe ahead of the primitives behind them: `repo.pushed`, `deployment.ready`, `deployment.failed`, `domain.active`, `domain.expiring`, `database.quota_warning`, the `card.*` types, the `machine.*` types other than `machine.vetting.decided`, `machine.online` and `machine.offline`, and `spend.cap_reached` for an app's budget (`data.scope` `project`). `EventType.emitted` says which types NoClick sends today. A call to a user's own number that an agent answered isn't an event yet; calls an agent placed are.

New types are added over time; ignore the ones you don't handle.

## Limits and billing

An account has up to 16 endpoints, your users' included; more raises `noclick.QuotaExceeded`. A URL that isn't `https`, or that points at a private network address, is refused with `noclick.InvalidRequest`, and so is a delivery to an address that later turns private. Events, deliveries and retries are free.

## Errors

| Error | When |
| --- | --- |
| `noclick.WebhookSignatureError` | `verify` couldn't prove a delivery came from NoClick. Answer it with a `400`. |
| `noclick.InvalidRequest` | The URL isn't `https`, points at a private address, or an event type isn't in the catalog. |
| `noclick.Conflict` | The scope already has an endpoint for that URL (`existing_id` names it). |
| `noclick.PermissionDenied` | `reveal_secret()` without the `webhooks:reveal` scope. |
| `noclick.QuotaExceeded` | The account already has 16 endpoints. |
| `noclick.NotFound` | No webhook, delivery or event has that id (events and deliveries go after 30 days). |

See the reference for [`Webhook`](https://www.noclick.com/docs/reference/python/Webhook.md#Webhook), [`Webhook.verify`](https://www.noclick.com/docs/reference/python/Webhook.md#Webhook.verify) and [`Event.list`](https://www.noclick.com/docs/reference/python/Webhook.md#Event.list).
