# EventForge API reference

[Quickstart](https://event-forge.app/docs.md) | [OpenAPI YAML](https://event-forge.app/openapi.yaml)

EventForge receives webhooks for your projects, stores every request,
forwards it to the URLs your routing rules name, and lets you replay any event.

New here? The [Quickstart](https://event-forge.app/docs) takes you from an API
key to a signed delivery you verify and replay.

Requests and responses are JSON (`Content-Type: application/json`, in any letter
case). A request body is one JSON value: anything after it gets `400 validation_error`. The
webhook inbox is the exception: it accepts JSON, form, XML or any other text in
UTF-8.
Property names are case-sensitive. A property whose name differs from a
documented one only by case, such as `Password` for `password`, gets
`400 validation_error`; other properties this specification does not list
are ignored.

## Authentication

Most operations need one of two credentials:

- **An API key** (`ApiKeyAuth`) for scripts and integrations, in the
  `Authorization` header:

  ```
  Authorization: Bearer efk_...
  ```

  Create one on the Settings page or with `POST /api/v1/api-keys`. The full key
  starts with `efk_` and is shown only once. A `read` key calls all `GET`
  operations and may carry `projects:write`, `rules:write`, or `deliveries:replay`
  grants. Creating a project returns its webhook secret. A `full` key calls
  every operation that accepts keys, including project deletion.
  Managing API keys, billing and the webhook secret need a signed-in session:
  an API key there gets `403 insufficient_scope`.
- **The session cookie** (`SessionAuth`) of the web app. `POST /api/v1/auth/login`
  sets it in the browser together with a CSRF cookie; the session lasts 30 days
  from sign-in, and `POST /api/v1/auth/logout` or a new password ends it sooner.
  The session cookie is `HttpOnly`: page scripts never read it. A request with
  it that changes data (`POST`, `PUT`, `PATCH` or `DELETE`) must also carry the
  site's own `Origin` and, in the `X-CSRF-Token` header, the value of the CSRF
  cookie; otherwise it gets `403 csrf_failed`.

A request with an `Authorization` header is judged by that header alone: it
takes an API key, and anything else gets `401 unauthorized`, whatever cookie
comes with it.

Operations marked as public need neither. A missing, invalid, revoked or
expired session or API key gets `401 unauthorized` with the header
`WWW-Authenticate: Bearer`. The request is checked against this specification
before its credentials, so a malformed request gets `400 validation_error` even
without them.

## Errors

Every error has the same JSON body:

```json
{
  "error": "validation_error",
  "message": "limit: number must be at most 100",
  "details": {"in": "query", "field": "limit"}
}
```

- `error` is a stable code. Branch on it and on the HTTP status.
- `message` explains the problem to a person. Its wording may change.
- `details` comes only with `validation_error`. `in` says where the problem is
  (`body`, `query`, `path` or `header`), and `field` names the field or parameter.
  Only the first problem found is reported.

| Status | `error` | Meaning |
|---|---|---|
| 400 | `validation_error` | The request does not match this specification (a parameter, the body, malformed JSON) or breaks a business rule |
| 400 | `invalid_token` | The link from an email (email confirmation, password reset) is invalid or has expired |
| 401 | `unauthorized` | The session or API key is missing, invalid or expired |
| 401 | `invalid_credentials` | Sign-in with a wrong email or password |
| 401 | `email_not_verified` | Sign-in before the email address is confirmed |
| 402 | `limit_exceeded` | A limit of your plan is reached |
| 403 | `checkout_required` | Paid plans start through checkout |
| 403 | `insufficient_scope` | The API key cannot call this operation: a key lacking the required grant, or any key on API key management, billing and the webhook secret |
| 403 | `csrf_failed` | A request with the session cookie that changes data lacks the site's own `Origin` or the right `X-CSRF-Token`, or a sign-in or sign-out comes from another origin |
| 404 | `not_found` | The resource does not exist or belongs to another account, or no operation has this path. The billing portal also answers it to an account that has no Stripe customer yet |
| 405 | `method_not_allowed` | The path exists, but not with this method. The `Allow` header lists the methods it accepts |
| 409 | `managed_by_stripe` | A paid subscription is changed in the Stripe billing portal |
| 409 | `checkout_in_progress` | An earlier checkout request of the account is still creating its session; try again in a few seconds |
| 409 | `subscription_not_changeable` | The current billing state needs Billing Management for this change |
| 409 | `limit_exceeded` | The account already has 10 API keys in use |
| 413 | `payload_too_large` | The request body is over the limit (see Limits) |
| 429 | `quota_exceeded` | Public inbox monthly quota exhausted; no Retry-After, event not stored |
| 429 | `rate_limited` | Too many requests. Wait for the number of seconds in the `Retry-After` header |
| 409 | `idempotency_conflict` | Within its independent operation namespace, an active key targets another event or selected delivery |
| 409 | `replay_in_progress` | Retry the same key after Retry-After |
| 409 | `delivery_not_failed` | Select the latest terminal failed attempt for that receiver |
| 409 | `rule_unavailable` | Its rule is disabled or deleted |
| 409 | `recovery_busy` | Retry the same recovery action after Retry-After |
| 409 | `recovery_conflict` | Recovery transition or bounded operation capacity refused |
| 422 | `recovery_window_too_large` | Narrow the preview window; no partial snapshot was saved |
| 504 | `timeout` | The request or operation deadline expired; a mutation may already have applied |
| 500 | `internal_error` | Something failed on our side |
| 503 | `billing_not_configured` | Billing settings are unavailable; no Stripe webhook is trusted without a signing secret |
| 503 | `email_unavailable` | Account mail capacity is full or stopping. Retry after one second; no account/token changes |
| 403 | `inbox_unavailable` | This inbox is unavailable; contact the inbox owner. |
| 402 | `project_plan_suspended` | Choose the project in plan resources or change capacity. |
| 402 | `rule_plan_suspended` | Choose the rule in plan resources or change capacity. |
| 503 | `inbound_unavailable` | Source writers or activation are unavailable, an operator key is missing, or a bounded source operation is busy; Retry-After is 1. |
| 503 | `listen_busy` | Native listen capacity is unavailable; retry after one second. |
| 409 | `inbound_settings_conflict` | Source revision, path or credential settings conflict; refresh before writing again. |
| 409 | `inbound_identity_conflict` | An authenticated identity was reused with different body bytes; no event or quota charge. |
| 401 | `inbound_verification_failed` | Required configured-source signature, identity or freshness verification failed. |
| 503 | `destinations_unavailable` | New destination writers are disabled or their deployed reader floor is absent. |
| 409 | `destination_conflict` | This receiver requires explicit destination rebind. |
| 409 | `failure_digest_busy` | Digest preference lock busy; Retry-After is 1. |
| 422 | `header_search_too_broad` | Diagnostic window exceeds candidate/byte/decoded limits; narrow the window, no partial result. |
| 503 | `header_search_unavailable` | Temporary header-search capacity/configuration/lock refusal; Retry-After: 1. |
| 409 | `resource_limits_busy` | Owner or preference lock busy; Retry-After is 1. Public inbox uses 503. |

New codes may appear. Handle an unknown code like other errors with the same status.

Every path can answer `404 not_found` and `405 method_not_allowed`, so the
operations below do not list them.

## API request retries

A `504 timeout` has no `Retry-After`. Reads may be retried. For a mutation,
the outcome is uncertain: the change may have applied even though the response
timed out. Inspect current state before retrying, especially before rotating
a webhook secret or creating an API key, project or rule. A key is shown only
once; inspect the key list and revoke an unwanted key before creating another.
A repeated secret rotation can replace the previous secret's grace window.
A DELETE returning 404 after a timeout can mean the first deletion succeeded.
Retry Replay only with the same `Idempotency-Key` within its 24-hour window;
each request still counts against its rate limit. Operation-specific guarantees
apply; there is no general at-most-once guarantee for API mutations.

This JSON response covers classified request/operation deadlines. Stripe's
webhook ledger retains its retryable 500 contract, and sanitized Stripe price
validation failures remain 500. Body reads, provider failures and proxy-generated
errors do not necessarily use `504 timeout` or even this JSON format.

## Lists

A list response is an object with the items in `data`. An empty list is
`{"data": []}`.

Event lists default to offset pagination (`total`, `limit`, `offset`).
For efficient historical iteration, request `pagination=cursor&limit=100`;
pass the returned `nextCursor` as `cursor` with the same project/status/since/until/method
until `hasMore` is false. Cursor pages have no `total` or `offset`, do not
count the project, and return no body/headers. Cursors are positions, not
snapshots or a stream of new events: late commits, new arrivals above a
passed boundary, retention, deletion and changed statuses can affect what
is visited. Recheck current events individually when acting on them.
Require a boolean `hasMore` on every cursor response. During rollback or
a mixed-version switch an older server can ignore the new parameters and
return a 200 offset page without `hasMore`. That response does not support
cursor pagination: fail the walk instead of treating a missing field as
false or assuming history is complete. Older cursor-capable binaries can
also ignore since/until/method while returning hasMore: wait for old slots
to drain before relying on filters. Filtered v2 cursors require filter
support; unfiltered v1 cursors stay compatible. Filter bounds are UTC
microseconds: since is inclusive and until exclusive.

## Limits

- Request bodies: up to 64 KB for the JSON API, up to 5 MB for the inbox and
  `/webhook/stripe`. A larger body gets `413 payload_too_large`.
- Request rates: sign-up, sign-in, email confirmation, password reset and each
  project inbox are rate limited. The limits may change. A
  request over a limit gets `429 rate_limited`; wait for the number of seconds
  in the `Retry-After` header before you try again.
- Account mail: registration, forgot-password and resend share a process-local
  client bucket (default capacity 3, one token per 20 minutes), then address
  and site buckets. Admitted no-mail requests also spend these budgets.
  A dispatch refusal refunds these mail budgets; the general per-IP auth
  request limiter still counts the request.
  Welcome mail and background quota notices spend only the same site and
  dispatch capacity and may be omitted or deferred.
  Restarts reset limits; overlapping app slots have separate allowances.
- Plan limits: your plan caps the number of projects, the rules per project and
  the events per month (see `GET /api/v1/subscription/plans`). A request over a
  limit gets `402 limit_exceeded` on authenticated operations. The public inbox
  refuses exhausted monthly quota with `429 quota_exceeded`, no Retry-After,
  and no stored event or extra quota charge. Usage resets each UTC calendar
  month; changing plans does not reset it. Confirmed owners may receive
  best-effort 80% and 100% email notices; check in-app usage too.
- API keys: an account can have 10 API keys in use; another gets
  `409 limit_exceeded`.

## Signed deliveries

EventForge signs every delivery to the target URL of a rule as
[Standard Webhooks](https://www.standardwebhooks.com) describes, so the receiver
can check that the request came from EventForge and was not changed. Each
delivery carries three headers:

- `webhook-id`: the ID of the message, `msg_` and a UUID. The retries of a
  delivery keep it, so a receiver can drop a message it has already processed;
  a replay gets a new one.
- `webhook-timestamp`: when this attempt was sent, in Unix seconds.
- `webhook-signature`: `v1,` and the base64 HMAC-SHA256 of
  `{webhook-id}.{webhook-timestamp}.{body}`, where the body is the request body
  byte for byte.

The key is the webhook secret of the project, which
`GET /api/v1/projects/{projectId}/webhook-secret` returns (and `createProject`
in `webhookSecret`): drop the `whsec_` prefix and decode the rest from base64.
To check a delivery:

1. Refuse it if `webhook-timestamp` is more than 5 minutes away from your clock.
2. Compute the signature and compare it, in constant time, with each `v1,`
   signature in `webhook-signature`; they are separated by spaces. One match is
   enough.

Verify against the raw request body, before any JSON parsing: a body that was
parsed and serialized again does not match the signature.

After a rotation (`POST /api/v1/projects/{projectId}/webhook-secret/rotate`),
deliveries carry two signatures for 24 hours, one with the new secret and one
with the previous, so a receiver that still has the previous secret keeps
working. The Standard Webhooks libraries do these checks for you.

`GET /api/v1/events/{eventId}` shows the same ID as `messageId` on each
delivery, so a webhook your endpoint logged can be matched to its delivery.

If the original request carried Standard Webhooks headers of its own, the
delivery keeps them as `X-Original-Webhook-Id`, `X-Original-Webhook-Timestamp`
and `X-Original-Webhook-Signature`, so a receiver can still check the sender's
signature: the body is forwarded byte for byte.

The inbox does not check signatures yet. Providers sign the same headers with
their own secrets, so the inbox stores every request, signed or not.

EventForge's signature proves that a delivery came through the project's
inbox, not who sent the webhook there. Deliveries do not forward these
credential headers: `Authorization`, `Cookie`, `Proxy-Authorization`,
`X-Api-Key`, `Api-Key`, `X-Auth-Token`, `X-Access-Token` and
`X-Gitlab-Token`. A receiver cannot check a sender's token sent in one of
these credential headers because they are not forwarded.

Every delivery, retry and replay also omits proxy metadata: header names
starting with `X-Forwarded-` or `X-Original-Forwarded-`, including unknown
suffixes, and the exact names `Forwarded`, `X-Real-IP`, `True-Client-IP`,
`Via`, `CF-Connecting-IP`, `CF-Connecting-IPv6`, `CF-Pseudo-IPv4`,
`Fastly-Client-IP`, `Fly-Client-IP`, `X-Client-IP`, `X-Cluster-Client-IP` and
`X-Envoy-External-Address`, all case-insensitively. This applies to historical
stored events at send time too; stored headers stay unchanged. This bounded
forwarding policy does not remove every identifying or custom header.
Application/tracing headers such as `traceparent`, `tracestate` and `CF-Ray`
remain subject to the credential and hop-by-hop rules. Connection headers
(including `Host` and Connection-nominated headers), `Accept-Encoding`,
`X-Webhook-Signature` and `X-Webhook-Timestamp` are also omitted.

Other forwarded headers keep the value the sender sent, except that
EventForge API keys (`efk_`) and webhook secrets (`whsec_`) in them arrive
masked, as `EventDetail.headers` shows.

A sender that signs the body, such as GitHub (`X-Hub-Signature-256`), Stripe, Shopify or
Standard Webhooks, can still be checked: the body arrives byte for byte with
their signature headers, the Standard Webhooks ones as
`X-Original-Webhook-*`.

## Retries

EventForge makes up to seven delivery attempts, with randomized retry times
targeting 1, 5 and 30 minutes, then 2, 6 and 24 hours after the first
attempt. It retries network errors, timeouts and 408, 425, 429 and 5xx
answers; other answers are not retried. Retries go to the rule's current
target URL, and disabling or deleting the rule stops them. Slow attempts,
outages or `Retry-After` can shift retries or reduce their number.
`Retry-After` is honoured up to 24 hours after the first attempt, and a
retry scheduled within that window may be sent later if processing is
delayed. Each attempt is a new delivery with the next `attemptNumber` and
the same `messageId`, so the receiver sees the same `webhook-id`; while it
waits, `nextAttemptAt` says when it is due. After the last attempt the
delivery stays `failed`; replay the event to send it again.

## Servers

- **Base URL:** `https://event-forge.app`

## Reading this reference

Each operation below includes its request and response definitions as JSON. A `$ref` points to the named definition in **Shared definitions** at the end. The OpenAPI YAML contains the same definitions.

## GET /api/v1/api-keys

List API keys

Returns the API keys of the signed-in user, newest first: the keys in use and the ones revoked or expired in the last 30 days. Full keys are never shown again.

**Authentication:** SessionAuth.

```json
{
  "operationId": "listApiKeys",
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ApiKeyList"
          }
        }
      },
      "description": "The API keys."
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScope"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "SessionAuth": []
    }
  ],
  "tags": [
    "api-keys"
  ]
}
```

## POST /api/v1/api-keys

Create an API key

Creates an API key and returns it in `key`. This is the only time the full key is shown, so store it right away. An account can have 10 API keys in use; another gets `409 limit_exceeded`.

**Authentication:** SessionAuth.

```json
{
  "operationId": "createApiKey",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/CreateApiKeyRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/CreatedApiKey"
          }
        }
      },
      "description": "The new API key, with the full key."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`limit_exceeded`: the account already has 10 API keys in use. Revoke one first."
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "SessionAuth": []
    }
  ],
  "tags": [
    "api-keys"
  ]
}
```

## DELETE /api/v1/api-keys/{keyId}

Revoke an API key

Revokes an API key at once: requests with it get `401 unauthorized`. Revoking a revoked key again changes nothing.

**Authentication:** SessionAuth.

```json
{
  "operationId": "revokeApiKey",
  "parameters": [
    {
      "$ref": "#/components/parameters/ApiKeyId"
    }
  ],
  "responses": {
    "204": {
      "description": "The key is revoked."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "SessionAuth": []
    }
  ],
  "tags": [
    "api-keys"
  ]
}
```

## PATCH /api/v1/api-keys/{keyId}

Rename an API key

Changes only the name; permissions and the secret remain unchanged.

**Authentication:** SessionAuth.

```json
{
  "operationId": "renameApiKey",
  "parameters": [
    {
      "$ref": "#/components/parameters/ApiKeyId"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/RenameApiKeyRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ApiKey"
          }
        }
      },
      "description": "The renamed key, without its secret."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "SessionAuth": []
    }
  ],
  "tags": [
    "api-keys"
  ]
}
```

## POST /api/v1/auth/forgot-password

Request a password reset

Sends a password reset link when the address belongs to an account. The answer is the same for every address. For an unconfirmed account the old confirmation link is invalidated and choosing newPassword also confirms the address. Mail is best effort and queued in memory; acceptance does not guarantee delivery. A full or stopping dispatcher returns 503 before changes.

**Authentication:** public (no credential required).

```json
{
  "operationId": "forgotPassword",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ForgotPasswordRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MessageResponse"
          }
        }
      },
      "description": "Accepted. The answer is the same whether or not an email was sent."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "$ref": "#/components/responses/EmailUnavailable"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [],
  "tags": [
    "auth"
  ]
}
```

## POST /api/v1/auth/login

Sign in

Checks the email and password and starts a session of 30 days. The answer sets two cookies: the session cookie (`SessionAuth`), which is `HttpOnly`, and the CSRF cookie, whose value page scripts send in `X-CSRF-Token`. The body carries no token, only when the session ends. A session cookie the browser already had stops working. The request must carry the site's own `Origin`; from another origin it gets `403 csrf_failed` and no cookie.

**Authentication:** public (no credential required).

```json
{
  "operationId": "login",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/LoginRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/LoginResponse"
          }
        }
      },
      "description": "Signed in."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`invalid_credentials`: wrong email or password. `email_not_verified`: the address is not confirmed yet."
    },
    "403": {
      "$ref": "#/components/responses/CSRFFailed"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [],
  "tags": [
    "auth"
  ]
}
```

## POST /api/v1/auth/logout

Sign out

Ends the session of the session cookie and clears both cookies. Without a session cookie it only clears them. The request must carry the site's own `Origin`, and with a session cookie also the CSRF token in `X-CSRF-Token`; otherwise it gets `403 csrf_failed` and the cookies stay. It has no body.

**Authentication:** public (no credential required).

```json
{
  "operationId": "logout",
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MessageResponse"
          }
        }
      },
      "description": "Signed out; both cookies are cleared."
    },
    "403": {
      "$ref": "#/components/responses/CSRFFailed"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [],
  "tags": [
    "auth"
  ]
}
```

## POST /api/v1/auth/register

Sign up

Starts a sign-up. A new address gets an account and a confirmation link by email. An address that already has an account gets an email for its owner instead. The answer is the same in both cases, so it does not reveal which addresses have accounts. Mail is queued in memory with one best-effort SMTP attempt; acceptance does not guarantee delivery. A full or stopping dispatcher returns 503 before account or token changes and refunds client, address and site account-mail admission. The separate per-IP auth request limit still applies.

**Authentication:** public (no credential required).

```json
{
  "operationId": "register",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/RegisterRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "202": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MessageResponse"
          }
        }
      },
      "description": "Accepted. The answer is the same for new and existing addresses."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "$ref": "#/components/responses/EmailUnavailable"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [],
  "tags": [
    "auth"
  ]
}
```

## POST /api/v1/auth/resend-verification

Recover an unconfirmed signup

Sends a password-reset link when the address belongs to an unconfirmed account. Choosing newPassword completes signup and ends existing sessions; the old confirmation link becomes invalid. Unknown and confirmed addresses send nothing. The response is generic. Mail is best effort and queued in memory; acceptance does not guarantee delivery. A full or stopping dispatcher returns 503 before changes.

**Authentication:** public (no credential required).

```json
{
  "operationId": "resendVerification",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ResendVerificationRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MessageResponse"
          }
        }
      },
      "description": "Accepted. The answer is the same whether or not an email was sent."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "$ref": "#/components/responses/EmailUnavailable"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [],
  "tags": [
    "auth"
  ]
}
```

## POST /api/v1/auth/reset-password

Reset the password

Sets a new password with the token from the password reset link. Every session of the account ends, and the answer clears the session cookies of the browser that sent it.

**Authentication:** public (no credential required).

```json
{
  "operationId": "resetPassword",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ResetPasswordRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MessageResponse"
          }
        }
      },
      "description": "The password is changed."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [],
  "tags": [
    "auth"
  ]
}
```

## POST /api/v1/auth/verify-email

Confirm an email address

Confirms the address with the token from the confirmation link. The web app calls this from the page the link opens.

**Authentication:** public (no credential required).

```json
{
  "operationId": "verifyEmail",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/VerifyEmailRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MessageResponse"
          }
        }
      },
      "description": "The address is confirmed."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [],
  "tags": [
    "auth"
  ]
}
```

## GET /api/v1/bulk-retries/{operationId}

Get durable recovery progress

Reads an owned operation whose project still belongs to the caller. Read keys may inspect. Counts reconcile as plannedDeliveries = created + skipped + remaining; skippedReasons explains each skipped item. Counts describe scheduling, not network sends or success. Terminal states free the active slot and preserve remaining counts. stopped_quota never resumes automatically: after changing billing create a new preview. Jobs expire logically after 24 hours even across rollback; metadata is retained for at least seven days after completion, cancellation, quota stop or logical expiry, then becomes eligible for physical cleanup. It may remain readable longer while bounded GC catches up. A new preview reclaims this owner's eligible terminal metadata before checking the twenty-record capacity, independently of other owners' cleanup backlog. Cancellation does not recall committed deliveries. The snapshot owner can still read/cancel this safe metadata after project deletion. A missing project cancels the whole remainder before per-event admission; starting work in another owned project also releases an orphaned active slot. Bulk competes with interactive replay/retry for the same rate allowance. A short scheduler reservation precedes admission. Failed groups or runner crashes retain a thirty-second retry delay, allowing other owners to progress; committed item progress remains atomic. Busy job rows are skipped before charging the rate bucket.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "getBulkRetry",
  "parameters": [
    {
      "$ref": "#/components/parameters/RecoveryOperationId"
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/BulkRetryOperation"
          }
        }
      },
      "description": "Durable scheduling progress."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "events"
  ]
}
```

## POST /api/v1/bulk-retries/{operationId}/cancel

Cancel a recovery snapshot

Idempotent transition of an existing owned snapshot. Start accepts only an unexpired planned snapshot and allows one running operation per user. Cancel stops future event groups after its row lock wins; previously committed deliveries remain scheduled. Repeating either action on its resulting state returns current progress. Terminal operations cannot be restarted. These transitions schedule no event group and do not consume replay rate capacity; each runner group separately consumes shared capacity.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "cancelBulkRetry",
  "parameters": [
    {
      "$ref": "#/components/parameters/RecoveryOperationId"
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/BulkRetryOperation"
          }
        }
      },
      "description": "Current durable scheduling progress."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Recovery conflict (recovery_conflict); recovery_busy or resource_limits_busy has Retry-After: 1. Retry the same action.",
      "headers": {
        "Retry-After": {
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "events"
  ]
}
```

## POST /api/v1/bulk-retries/{operationId}/start

Start a recovery snapshot

Idempotent transition of an existing owned snapshot. Start accepts only an unexpired planned snapshot and allows one running operation per user. Cancel stops future event groups after its row lock wins; previously committed deliveries remain scheduled. Repeating either action on its resulting state returns current progress. Terminal operations cannot be restarted. These transitions schedule no event group and do not consume replay rate capacity; each runner group separately consumes shared capacity.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "startBulkRetry",
  "parameters": [
    {
      "$ref": "#/components/parameters/RecoveryOperationId"
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/BulkRetryOperation"
          }
        }
      },
      "description": "Current durable scheduling progress."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "402": {
      "$ref": "#/components/responses/PlanSuspended"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Recovery conflict (recovery_conflict); recovery_busy or resource_limits_busy has Retry-After: 1. Retry the same action.",
      "headers": {
        "Retry-After": {
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "events"
  ]
}
```

## POST /api/v1/deliveries/{deliveryId}/alternate-replay

Replay a failed receiver to an explicit alternate target

Creates one fresh message for the same logical source-rule receiver as the selected latest terminal failed delivery. The original rule is never edited and must still exist and be enabled. Choose exactly one same-project destinationId or literal targetUrl. The literal form signs with the source rule's destination; convert an unbound legacy rule before using it. The chosen URL and signing identity are pinned at admission through retries and lease recovery; URL edits/rebinding do not retarget that chain, but live signing-key rotation remains effective. The rule's disabled/deleted stop contract still applies. Schedule-time URL validation and guarded send-time resolved addresses both apply; redirects and forwarding-policy bypasses are never allowed. A success supersedes only that logical receiver, and confirms the alternate attempt, not delivery to the original physical URL. Other receivers are not resent. Ownership/retention, effective-plan quota and plan-resource admission apply; one productive admission costs one monthly unit and uses the shared replay rate bucket. Idempotency-Key is required for this separate namespace: repeats recheck current source and chosen-destination access and return the original identities for 24 hours without another charge. Different selected delivery or explicit input under the same key returns idempotency_conflict. A changed live destination URL does not retarget or conflict with an accepted repeat. Retain the same key and input after an uncertain response. At-least-once delivery does not guarantee receiver processing. This path is absent on old servers; the old no-body current-target /retry operation is unchanged.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "alternateReplayDelivery",
  "parameters": [
    {
      "description": "Selected latest terminal failed attempt of the logical receiver.",
      "in": "path",
      "name": "deliveryId",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    {
      "description": "Stable key for this deliberate alternate action; preserve the key and body after uncertain responses for 24 hours.",
      "in": "header",
      "name": "Idempotency-Key",
      "required": true,
      "schema": {
        "maxLength": 128,
        "minLength": 1,
        "pattern": "^[A-Za-z0-9._:-]+$",
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/AlternateReplayRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "202": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/DeliveryRetryResponse"
          }
        }
      },
      "description": "Fresh alternate message scheduled or original committed result."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "402": {
      "$ref": "#/components/responses/PaymentRequired"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "destination_conflict or resource_limits_busy; a bounded lock refusal has Retry-After: 1."
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "$ref": "#/components/responses/DestinationsUnavailable"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "events",
    "destinations"
  ]
}
```

## POST /api/v1/deliveries/{deliveryId}/retry

Retry one failed receiver

Creates one fresh message for the selected latest terminal failed attempt of the latest message for its receiver, using the enabled rule's current URL. Successful, pending and historical receivers are not resent. Deleted or disabled rules return rule_unavailable; superseded or non-failed attempts return delivery_not_failed. Current event ownership and retention always apply (404). One productive retry costs one current UTC-month effective-plan quota unit. Shares the event replay rate bucket, including repeats and refusals after admission. Optional Idempotency-Key protects a deliberate action for 24 hours; repeats return the original deliveryId/messageId before checking eligibility again. Its namespace is independent of event replay: the same raw key is allowed on both operations. Within targeted retry, reuse for another selected delivery returns idempotency_conflict. Without a key never retry an uncertain response automatically. recovery_busy is retryable with the same key. Delivery remains at-least-once; this does not guarantee receiver processing.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "retryDelivery",
  "parameters": [
    {
      "description": "ID of the selected latest failed delivery attempt.",
      "in": "path",
      "name": "deliveryId",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    {
      "description": "A UUID per deliberate targeted retry; retain through uncertain responses for 24 hours.",
      "in": "header",
      "name": "Idempotency-Key",
      "schema": {
        "maxLength": 128,
        "minLength": 1,
        "pattern": "^[A-Za-z0-9._:-]+$",
        "type": "string"
      }
    }
  ],
  "responses": {
    "202": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/DeliveryRetryResponse"
          }
        }
      },
      "description": "Fresh message scheduled, or the original committed result."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "402": {
      "$ref": "#/components/responses/PaymentRequired"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "idempotency_conflict, delivery_not_failed or rule_unavailable; recovery_busy or resource_limits_busy has Retry-After: 1. Retry the same action with the same key.",
      "headers": {
        "Retry-After": {
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "events"
  ]
}
```

## GET /api/v1/destinations/{destinationId}

Read destination metadata

Owned metadata only; signing secrets are never included.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "getDestination",
  "parameters": [
    {
      "$ref": "#/components/parameters/DestinationId"
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Destination"
          }
        }
      },
      "description": "Current destination metadata."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "destinations"
  ]
}
```

## PUT /api/v1/destinations/{destinationId}

Replace destination metadata

Session or full API key only. Changes the canonical URL of every rule bound to this destination without changing rule matching, enabled state or priority. Ordinary attempts follow the current URL; already admitted alternate attempts retain their pinned URL. maxAttempts applies to future message admissions; existing chains retain their admitted cap. No delivery or mail is created.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "updateDestination",
  "parameters": [
    {
      "$ref": "#/components/parameters/DestinationId"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/DestinationWriteRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Destination"
          }
        }
      },
      "description": "Updated destination metadata."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "destination_conflict or resource_limits_busy; a bounded lock refusal has Retry-After: 1."
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "$ref": "#/components/responses/DestinationsUnavailable"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "destinations"
  ]
}
```

## PUT /api/v1/destinations/{destinationId}/project-signing-compatibility

Disable legacy project signing compatibility

Explicit owner browser session and CSRF only. Accepts enabled=false after the receiver has adopted its destination key. A migrated destination signs with its own keys plus live current/unexpired previous project keys until this action; it is not cryptographically isolated while compatibility is on. No automatic compatibility expiry. New destinations start with compatibility off; this endpoint cannot turn it on. No delivery or mail is created.

**Authentication:** SessionAuth.

```json
{
  "operationId": "disableDestinationProjectSigning",
  "parameters": [
    {
      "$ref": "#/components/parameters/DestinationId"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/DestinationProjectSigningRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Destination"
          }
        }
      },
      "description": "Current metadata after explicit compatibility-off."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "destination_conflict or resource_limits_busy; a bounded lock refusal has Retry-After: 1."
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "$ref": "#/components/responses/DestinationsUnavailable"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "SessionAuth": []
    }
  ],
  "tags": [
    "destinations"
  ]
}
```

## GET /api/v1/destinations/{destinationId}/signing-secret

Read destination signing secret

Owner browser session only; no-store. API keys never read this endpoint.

**Authentication:** SessionAuth.

```json
{
  "operationId": "getDestinationSecret",
  "parameters": [
    {
      "$ref": "#/components/parameters/DestinationId"
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/DestinationSecret"
          }
        }
      },
      "description": "Current signing secret; do not cache."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScope"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "SessionAuth": []
    }
  ],
  "tags": [
    "destinations"
  ]
}
```

## POST /api/v1/destinations/{destinationId}/signing-secret/rotate

Rotate destination signing secret

Owner browser session and CSRF only; no-store. The current own key becomes the previous key for 24 hours; an earlier previous key stops working. Alternate chains keep their signing identity and use its live current keys. Project signing compatibility, when enabled, remains separate and unchanged.

**Authentication:** SessionAuth.

```json
{
  "operationId": "rotateDestinationSecret",
  "parameters": [
    {
      "$ref": "#/components/parameters/DestinationId"
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/DestinationSecret"
          }
        }
      },
      "description": "New current secret and previous-key expiry."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "destination_conflict or resource_limits_busy; a bounded lock refusal has Retry-After: 1."
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "$ref": "#/components/responses/DestinationsUnavailable"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "SessionAuth": []
    }
  ],
  "tags": [
    "destinations"
  ]
}
```

## GET /api/v1/events/{eventId}

Get an event

Returns the stored request with its headers and body, and every delivery of the event.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "getEvent",
  "parameters": [
    {
      "$ref": "#/components/parameters/EventId"
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/EventDetail"
          }
        }
      },
      "description": "The event."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "events"
  ]
}
```

## GET /api/v1/events/{eventId}/body

Download an event body

Returns the exact saved body bytes under current ownership and event retention checks. Available to read keys and signed-in users; creates no delivery, quota usage or mail. The attachment always uses octet-stream, never the sender's MIME type. R1 intake still refuses binary/NUL bodies; these readers support future byte-format rows without enabling writers.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "downloadEventBody",
  "parameters": [
    {
      "$ref": "#/components/parameters/EventId"
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/octet-stream": {
          "schema": {
            "format": "binary",
            "type": "string"
          }
        }
      },
      "description": "The saved body bytes, including an empty body.",
      "headers": {
        "Cache-Control": {
          "description": "private, no-store",
          "schema": {
            "type": "string"
          }
        },
        "Content-Disposition": {
          "description": "Fixed event UUID attachment filename.",
          "schema": {
            "type": "string"
          }
        },
        "X-Content-Type-Options": {
          "schema": {
            "enum": [
              "nosniff"
            ],
            "type": "string"
          }
        }
      }
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "events"
  ]
}
```

## POST /api/v1/events/{eventId}/replay

Replay an event

Forwards the event again: creates a new delivery for every enabled rule of the project that matches the event. One monthly quota unit is charged when at least one delivery is created; zero matches return 202 with deliveriesCreated=0 without a charge. Optional Idempotency-Key binds a key to this user, endpoint and event for 24 hours. Repeat the same key after an uncertain response to reuse the committed result, including zero matches. An active key for another event gets 409 idempotency_conflict; a busy key gets retryable 409 replay_in_progress with Retry-After. Ownership and retention still apply. After 24 hours key reuse may create a new operation. Without a key each call is a new replay; never automatically retry an ambiguous headerless request. All authenticated valid calls share the user's PostgreSQL rate bucket across projects, credentials and instances: burst 5, refill one request per 2 seconds by default. Repeats also consume rate capacity; a 429 has Retry-After in seconds. This does not guarantee exactly-once processing by receivers.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "replayEvent",
  "parameters": [
    {
      "$ref": "#/components/parameters/EventId"
    },
    {
      "description": "Use a UUID per deliberate replay; retain it for retries of that action.",
      "in": "header",
      "name": "Idempotency-Key",
      "schema": {
        "maxLength": 128,
        "minLength": 1,
        "pattern": "^[A-Za-z0-9._:-]+$",
        "type": "string"
      }
    }
  ],
  "responses": {
    "202": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ReplayResponse"
          }
        }
      },
      "description": "Replay accepted: the count may be zero when no rule matches, or repeat a stored result."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "402": {
      "$ref": "#/components/responses/PaymentRequired"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "idempotency_conflict; replay_in_progress or resource_limits_busy has Retry-After in seconds. Retry with the same key.",
      "headers": {
        "Retry-After": {
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "events"
  ]
}
```

## GET /api/v1/inbound-sources/{sourceId}

Get inbound source metadata

Read saved metadata for one source in an owned project. hasCredential reports credential presence only. previousValidUntil is present during a live previous-credential overlap. This read is available during the staged rollout.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "getInboundSource",
  "parameters": [
    {
      "$ref": "#/components/parameters/InboundSourceId"
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/InboundSource"
          }
        }
      },
      "description": "Current owned source metadata without credentials."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "projects"
  ]
}
```

## PUT /api/v1/inbound-sources/{sourceId}

Rename or disable an inbound source

Requires a browser session and enabled inbound settings writes. Use expectedRevision from a fresh read and set enabled to false. Source activation is unavailable. Disabled sources refuse new ingress and subsequent sends. In-flight requests can still complete. Entry path, profile and duplicate policy are immutable. A stale or uncertain write requires a fresh metadata read before another write.

**Authentication:** SessionAuth.

```json
{
  "operationId": "replaceInboundSource",
  "parameters": [
    {
      "$ref": "#/components/parameters/InboundSourceId"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ReplaceInboundSourceRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/InboundSource"
          }
        }
      },
      "description": "Updated safe source metadata."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "$ref": "#/components/responses/InboundSettingsConflict"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "$ref": "#/components/responses/InboundUnavailable"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "SessionAuth": []
    }
  ],
  "tags": [
    "projects"
  ]
}
```

## POST /api/v1/inbound-sources/{sourceId}/credential

Replace an inbound source credential

Requires a browser session and enabled inbound settings writes. No-store. Supply secret or request generation where the sender accepts owner-configured credentials, never both. Saves no plaintext and returns no supplied/saved credential. An explicit overlap of 0 through 86400 seconds retains at most the immediately previous credential; zero revokes it at once. Match provider cutover behavior (Shopify propagation can take an hour; Stripe roll overlap is at most 24 hours). Rotation does not reset duplicate claims or rewrite evidence. Equal effective inbound/outbound credentials within the project are refused; shared-app credentials cannot isolate stores/topics by headers.

**Authentication:** SessionAuth.

```json
{
  "operationId": "replaceInboundSourceCredential",
  "parameters": [
    {
      "$ref": "#/components/parameters/InboundSourceId"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ReplaceInboundCredentialRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/CreatedInboundSource"
          }
        }
      },
      "description": "Safe metadata and optional newly generated credential only."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "$ref": "#/components/responses/InboundSettingsConflict"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "$ref": "#/components/responses/InboundUnavailable"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "SessionAuth": []
    }
  ],
  "tags": [
    "projects"
  ]
}
```

## GET /api/v1/plan-resources/projects

Inspect plan project selection

Owner-only resource selection. Enforcement defaults OFF; withinPlan describes selection and planSuspended describes actual enforcement on this process. Disabled rules consume slots. Reads remain available during suspension. Preferences are a full ordered replacement (at most 1000 IDs); omitted resources follow in oldest createdAt/id order. An empty prefix resets it. PUT requires a session with Origin/CSRF or a full API key; restricted keys cannot replace preferences. Pages are oldest first, independent of preference order, and are current snapshots rather than a consistent export.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "listPlanProjects",
  "parameters": [
    {
      "description": "Page size, independent of planLimit in the response.",
      "in": "query",
      "name": "limit",
      "schema": {
        "default": 50,
        "maximum": 100,
        "minimum": 1,
        "type": "integer"
      }
    },
    {
      "description": "Opaque position from the previous page; bound to owner and scope.",
      "in": "query",
      "name": "cursor",
      "schema": {
        "maxLength": 512,
        "minLength": 1,
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PlanResourcePage"
          }
        }
      },
      "description": "Private current selection metadata; no-store."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "$ref": "#/components/responses/ResourceLimitsBusy"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "plan-resources"
  ]
}
```

## PUT /api/v1/plan-resources/projects

Replace preferred project order

Owner-only resource selection. Enforcement defaults OFF; withinPlan describes selection and planSuspended describes actual enforcement on this process. Disabled rules consume slots. Reads remain available during suspension. Preferences are a full ordered replacement (at most 1000 IDs); omitted resources follow in oldest createdAt/id order. An empty prefix resets it. PUT requires a session with Origin/CSRF or a full API key; restricted keys cannot replace preferences. Pages are oldest first, independent of preference order, and are current snapshots rather than a consistent export.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "replacePlanProjectPreferences",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/PlanResourcePreferences"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PlanResourcePreferenceResult"
          }
        }
      },
      "description": "Private current selection metadata; no-store."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "$ref": "#/components/responses/ResourceLimitsBusy"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "plan-resources"
  ]
}
```

## GET /api/v1/projects

List projects

Returns the projects of the signed-in user, newest first.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "listProjects",
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ProjectList"
          }
        }
      },
      "description": "The projects."
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "projects"
  ]
}
```

## POST /api/v1/projects

Create a project

Creates a project with its own inbox URL and webhook secret. This answer is the only place an API key sees the secret: later only a signed-in session reads it. Your plan limits the number of projects.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "createProject",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/CreateProjectRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/CreatedProject"
          }
        }
      },
      "description": "The new project, with its webhook secret."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "402": {
      "$ref": "#/components/responses/PaymentRequired"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "409": {
      "$ref": "#/components/responses/ResourceLimitsBusy"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "projects"
  ]
}
```

## DELETE /api/v1/projects/{projectId}

Delete a project

Deletes the project with its events, rules and deliveries.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "deleteProject",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    }
  ],
  "responses": {
    "204": {
      "description": "The project is deleted."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "projects"
  ]
}
```

## GET /api/v1/projects/{projectId}

Get a project

Returns one project of the signed-in user.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "getProject",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Project"
          }
        }
      },
      "description": "The project."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "projects"
  ]
}
```

## POST /api/v1/projects/{projectId}/bulk-retries

Preview failed receiver recovery

Persists an immutable snapshot of retry-eligible failed receivers in received-time window [receivedFrom, receivedTo), intersected with current retention. RFC3339 offsets are normalized to UTC; the window must be positive and at most 31 days. No deliveries or quota charges occur. Maximum 1000 receivers; oversized or too-costly selection returns 422 recovery_window_too_large with guidance to narrow the window, without a partial snapshot. Selection has a two-second database budget. Preview expires in 15 minutes. At most three planned previews, one running operation and twenty retained operations per user. Creation consumes the shared replay rate allowance, including admitted refusals. Preview counts eligible receivers, not all failures: stopped or deleted rules can leave visible failures. Start this exact ID, never rerun the query to start. A lost preview response may leave an unused preview until expiry.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "previewBulkRetry",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/BulkRetryWindow"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/BulkRetryOperation"
          }
        }
      },
      "description": "Preview saved; counts are planned new deliveries, not external sends."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "402": {
      "$ref": "#/components/responses/PlanSuspended"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Recovery conflict (recovery_conflict); recovery_busy or resource_limits_busy has Retry-After: 1. Retry the same action.",
      "headers": {
        "Retry-After": {
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "422": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Narrow the received-time window; nothing was saved."
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "events"
  ]
}
```

## GET /api/v1/projects/{projectId}/destinations

List reusable destinations

Lists metadata for this owned project, oldest first by createdAt and ID. Never returns signing secrets or sends mail. Cursor pages are positions, not snapshots. writesEnabled describes this process's current admission setting; existing destination deliveries continue when new writes are off.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "listDestinations",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    },
    {
      "description": "Maximum metadata rows in this page.",
      "in": "query",
      "name": "limit",
      "schema": {
        "default": 50,
        "maximum": 100,
        "minimum": 1,
        "type": "integer"
      }
    },
    {
      "description": "Opaque oldest-first position bound to this project; not a snapshot.",
      "in": "query",
      "name": "cursor",
      "schema": {
        "maxLength": 512,
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/DestinationList"
          }
        }
      },
      "description": "Destination metadata page."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "destinations"
  ]
}
```

## POST /api/v1/projects/{projectId}/destinations

Create a destination

Creates a receiver in this owned project, with an independent generated signing secret. Session or full API key only. The response returns the secret once; later secret reads and rotation require a browser session. Creating metadata schedules no delivery or mail. New feature writes default off and require a separately established deployed reader floor. No destination alert controls are implemented here; consecutive-failure alerts remain tracked in issue 79.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "createDestination",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/DestinationWriteRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/DestinationCreated"
          }
        }
      },
      "description": "Destination and one-time secret; do not cache."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "destination_conflict or resource_limits_busy; a bounded lock refusal has Retry-After: 1."
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "$ref": "#/components/responses/DestinationsUnavailable"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "destinations"
  ]
}
```

## GET /api/v1/projects/{projectId}/events

List events of a project

Returns events in descending (receivedAt, id) order. The default offset mode preserves total, limit and offset. Use pagination=cursor for an efficient walk without an exact count: omit cursor on the first page, then pass nextCursor with the same project, status, since, until and method filters. Cursor pages return data, limit, hasMore and, only when hasMore, nextCursor. Do not combine cursor mode with offset. Cursors are positions, not authorization or snapshots: ownership and retention apply on every request. New arrivals above a passed boundary are excluded; deletion, retention and status changes can change later pages. Inspect an event by ID for its body and headers; neither list mode returns them. Paired headerName/headerValue enables bounded diagnostic search described below; it internally reads admitted header sources before filtering the whole candidate window. Both modes accept since (inclusive), until (exclusive), and an exact case-sensitive recorded method. Times require an RFC3339 timezone and exact microsecond precision; equivalent offsets share cursor context. For example: /api/v1/projects/{projectId}/events?pagination=cursor&since=2026-11-02T10:00:00Z&until=2026-11-02T11:00:00Z&method=POST. Preserve all filters on subsequent pages; changing limit is allowed. Empty, repeated or invalid filters return 400 with the query field. Intake still accepts POST only. During mixed versions, older slots may ignore these filters even with a valid cursor response: wait until all old slots drain before relying on filtered results. Legacy unfiltered v1 cursors remain supported; filtered v2 cursors require this version.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "listEvents",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    },
    {
      "description": "Return only events with this `deliveryStatus`.",
      "in": "query",
      "name": "status",
      "schema": {
        "enum": [
          "no_match",
          "pending",
          "success",
          "failed"
        ],
        "type": "string"
      }
    },
    {
      "description": "Inclusive receivedAt boundary, RFC3339 with timezone; normalized to UTC. Must be exactly representable in microseconds. When both are set, since must be before until.",
      "in": "query",
      "name": "since",
      "schema": {
        "format": "date-time",
        "minLength": 1,
        "type": "string",
        "x-go-type": "string"
      }
    },
    {
      "description": "Exclusive receivedAt boundary, RFC3339 with timezone; normalized to UTC. Must be exactly representable in microseconds.",
      "in": "query",
      "name": "until",
      "schema": {
        "format": "date-time",
        "minLength": 1,
        "type": "string",
        "x-go-type": "string"
      }
    },
    {
      "description": "Exact case-sensitive recorded HTTP method, a nonempty ASCII HTTP token. Does not enable new inbox methods (intake accepts POST).",
      "in": "query",
      "name": "method",
      "schema": {
        "maxLength": 32,
        "minLength": 1,
        "pattern": "^[!#$%&'*+.^_`|~0-9A-Za-z-]+$",
        "type": "string"
      }
    },
    {
      "allowEmptyValue": true,
      "description": "Exact case-sensitive diagnostic sender-claimed type. No provider authentication is implied; historical and unavailable claims do not match. Empty disables this filter. Do not include secrets; URLs may enter browser history.",
      "in": "query",
      "name": "eventType",
      "schema": {
        "maxLength": 128,
        "type": "string"
      }
    },
    {
      "description": "One safe exact header predicate, paired exactly once with headerValue. ASCII case-insensitive name; requires since/until <=7 days. Diagnostic cap128 candidates and 4MiB; overflow returns422 without partial results. Captured searches all values; SQL NULL metadata searches legacy first values only; unavailable/malformed never falls back.",
      "in": "query",
      "name": "headerName",
      "schema": {
        "maxLength": 128,
        "minLength": 1,
        "type": "string"
      }
    },
    {
      "allowEmptyValue": true,
      "description": "Paired with headerName. Exact whole case-sensitive value, including explicit empty string; commas are not split. At most1024 UTF-8 bytes; known credentials, redaction artifacts and control/format characters are unsupported. Values are never echoed in errors or cursors.",
      "in": "query",
      "name": "headerValue",
      "schema": {
        "maxLength": 1024,
        "type": "string"
      }
    },
    {
      "description": "Page size: how many events to return.",
      "in": "query",
      "name": "limit",
      "schema": {
        "default": 50,
        "maximum": 100,
        "minimum": 1,
        "type": "integer"
      }
    },
    {
      "description": "How many events to skip.",
      "in": "query",
      "name": "offset",
      "schema": {
        "default": 0,
        "minimum": 0,
        "type": "integer"
      }
    },
    {
      "description": "offset preserves the existing response; cursor avoids counting or skipping preceding rows.",
      "in": "query",
      "name": "pagination",
      "schema": {
        "default": "offset",
        "enum": [
          "offset",
          "cursor"
        ],
        "type": "string"
      }
    },
    {
      "description": "Opaque nextCursor from the preceding cursor page. Requires pagination=cursor and the same project/status/since/until/method/eventType/headerName/headerValue (equivalent UTC bounds and header-name case are accepted; v3/v4 use server-keyed context, key rotation invalidates them). Changing limit is allowed. Omit for the first page.",
      "in": "query",
      "name": "cursor",
      "schema": {
        "maxLength": 512,
        "minLength": 1,
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EventList"
              },
              {
                "$ref": "#/components/schemas/CursorEventList"
              }
            ]
          }
        }
      },
      "description": "One page of events."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "422": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "header_search_too_broad. Diagnostic window exceeds128 candidates,272KiB/source,4MiB aggregate or decoded metadata limits. No partial result. Later cursor pages can refuse after new arrivals; a cursor is not a snapshot."
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "header_search_unavailable. Two process-local searches already active, missing search configuration or temporary database lock contention. Each app slot has its own capacity.",
      "headers": {
        "Retry-After": {
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "events"
  ]
}
```

## GET /api/v1/projects/{projectId}/failure-digest

Read terminal failure digest preferences

Owned project. Default disabled; current confirmed owner only. GET has no mail side effects. PUT needs a full key or session with Origin/CSRF. enabledSince is not full coverage during mixed slots. Bounded best-effort samples settle for five minutes, with at most one admission per project per hour; shared process budgets may defer or skip alerts. Claimed means unknown and is never automatically retried; sent means SMTP accepted DATA. Reads and saves do not promise delivery at a particular time.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "getProjectFailureDigest",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/FailureDigestSettings"
          }
        }
      },
      "description": "Private current metadata; no-store."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "projects"
  ]
}
```

## PUT /api/v1/projects/{projectId}/failure-digest

Explicitly opt into terminal failure digests

Owned project. Default disabled; current confirmed owner only. GET has no mail side effects. PUT needs a full key or session with Origin/CSRF. enabledSince is not full coverage during mixed slots. Bounded best-effort samples settle for five minutes, with at most one admission per project per hour; shared process budgets may defer or skip alerts. Claimed means unknown and is never automatically retried; sent means SMTP accepted DATA. Reads and saves do not promise delivery at a particular time.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "replaceProjectFailureDigest",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/FailureDigestPreference"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/FailureDigestSettings"
          }
        }
      },
      "description": "Private current metadata; no-store."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/Forbidden"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "$ref": "#/components/responses/FailureDigestBusy"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "projects"
  ]
}
```

## GET /api/v1/projects/{projectId}/inbound-policy

Get unmatched inbox path policy

Read the saved unmatched-path policy for an owned project. This read is available during the staged rollout while policy edits are unavailable.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "getInboundPolicy",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/InboundPolicy"
          }
        }
      },
      "description": "Current unmatched-path policy."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "projects"
  ]
}
```

## PUT /api/v1/projects/{projectId}/inbound-policy

Replace unmatched inbox path policy

Requires a browser session and enabled inbound settings writes. legacy admits unmatched traffic as unverified legacy with access only to unbound rules; reject refuses it without event or quota. Neither setting changes exact protected matching or historical evidence. Last committed replacement wins.

**Authentication:** SessionAuth.

```json
{
  "operationId": "replaceInboundPolicy",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/InboundPolicy"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/InboundPolicy"
          }
        }
      },
      "description": "Committed unmatched-path policy."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "$ref": "#/components/responses/InboundSettingsConflict"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "$ref": "#/components/responses/InboundUnavailable"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "SessionAuth": []
    }
  ],
  "tags": [
    "projects"
  ]
}
```

## GET /api/v1/projects/{projectId}/inbound-sources

List configured inbound sources

Read saved source metadata for an owned project. This read is available while settings writes are OFF. The enabled field reports saved state. Paths are exact and case-sensitive. Follow nextAfter while hasMore is true. An empty cursor page marks the end of that traversal.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "listInboundSources",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    },
    {
      "description": "Return source UUIDs strictly after this cursor within the owned project.",
      "in": "query",
      "name": "after",
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    {
      "description": "Maximum number of source metadata rows in this page, from 1 through 100.",
      "in": "query",
      "name": "limit",
      "schema": {
        "default": 50,
        "maximum": 100,
        "minimum": 1,
        "type": "integer"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/InboundSourceList"
          }
        }
      },
      "description": "A bounded source metadata page."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "projects"
  ]
}
```

## POST /api/v1/projects/{projectId}/inbound-sources

Create an inbound source

Requires a browser session and enabled inbound settings writes. Path, profile and duplicate policy are immutable after creation. Use a new source for a different trust identity. A required profile uses the sender's supplied credential independently from outbound keys. Open requires dedupMode=off and neither secret nor generateSecret. Body-only profiles require an explicit coalesce_identical_body or off choice: coalescing can merge legitimate byte-identical occurrences. Generated credentials are offered only for Standard Webhooks, GitHub and generic body HMAC, and appear once in this no-store response. Supplied secrets are never echoed. Slack creation is unavailable until challenge support. Creation defaults to disabled; no fallback from an exact protected path to open or legacy traffic is permitted.

**Authentication:** SessionAuth.

```json
{
  "operationId": "createInboundSource",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/CreateInboundSourceRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/CreatedInboundSource"
          }
        }
      },
      "description": "Safe metadata and an optional one-time generated credential."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "$ref": "#/components/responses/InboundSettingsConflict"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "$ref": "#/components/responses/InboundUnavailable"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "SessionAuth": []
    }
  ],
  "tags": [
    "projects"
  ]
}
```

## GET /api/v1/projects/{projectId}/listen

Stream saved event identifiers to a native development client

Optional native HTTP/1.1 WebSocket endpoint, OFF by default. A read key
suffices on every plan. Requires subprotocol eventforge.listen.v1 and
no Origin or query parameters. The API key belongs only in Authorization.
No server Replay, delivery, quota charge, fresh signature or signing
secret is provided. Handshake and ordinary detail GET request budgets apply.

Within five seconds send ListenStart (from=tail OR cursor, never both).
The server sends ListenFrame ready with the chosen public cursor and
actual floor. ACK ready after durably saving it. Then one event cursor
at a time is sent; ACK exactly that cursor after local completion.
A cursor is base64url of ListenCursor JSON, not authentication. Every
resume checks current key/owner, epoch and durable eventId anchor.
Positions are per-project committed journal order, not receivedAt order.
Capture begins at the actual capture migration commit; no historical
backfill. Empty projects have a stable epoch and position zero.

The window is the newest 100000 positions and an eventual 24h prefix
cleanup target. Current event read retention can end recovery earlier.
Expired/invalid/missing-anchor cursors or unavailable events return a
fixed ListenFrame error and end the socket, never an implicit new tail.
After101 these are protocol errors, not HTTP410 responses. Reconnect is
at-least-once while journal and events remain readable; local ambiguity
requires explicit reconciliation. Restores require epoch invalidation;
anchor matching cannot detect every history rewind.

Frame limit2KiB; one outstanding cursor, ACK deadline30s, heartbeat20s,
max lifetime30m. Bounds and key/ownership checks are process-local and
shared across a bounded process poller. Slow/unauthorized clients close.
No frame contents, cursor, payload or raw error text are logged.

**Authentication:** ApiKeyAuth.

```json
{
  "operationId": "listenEvents",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    }
  ],
  "responses": {
    "101": {
      "description": "WebSocket upgrade; subsequent frames follow ListenStart, ListenAck and ListenFrame."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Process connection or database capacity unavailable; Retry-After 1.",
      "headers": {
        "Retry-After": {
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    "Events"
  ]
}
```

## GET /api/v1/projects/{projectId}/plan-resources/rules

Inspect plan rule selection

Owner-only resource selection. Enforcement defaults OFF; withinPlan describes selection and planSuspended describes actual enforcement on this process. Disabled rules consume slots. Reads remain available during suspension. Preferences are a full ordered replacement (at most 1000 IDs); omitted resources follow in oldest createdAt/id order. An empty prefix resets it. PUT requires a session with Origin/CSRF or a full API key; restricted keys cannot replace preferences. Pages are oldest first, independent of preference order, and are current snapshots rather than a consistent export.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "listPlanRules",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    },
    {
      "description": "Page size, independent of planLimit in the response.",
      "in": "query",
      "name": "limit",
      "schema": {
        "default": 50,
        "maximum": 100,
        "minimum": 1,
        "type": "integer"
      }
    },
    {
      "description": "Opaque position from the previous page; bound to owner and scope.",
      "in": "query",
      "name": "cursor",
      "schema": {
        "maxLength": 512,
        "minLength": 1,
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PlanResourcePage"
          }
        }
      },
      "description": "Private current selection metadata; no-store."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "$ref": "#/components/responses/ResourceLimitsBusy"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "plan-resources"
  ]
}
```

## PUT /api/v1/projects/{projectId}/plan-resources/rules

Replace preferred rule order

Owner-only resource selection. Enforcement defaults OFF; withinPlan describes selection and planSuspended describes actual enforcement on this process. Disabled rules consume slots. Reads remain available during suspension. Preferences are a full ordered replacement (at most 1000 IDs); omitted resources follow in oldest createdAt/id order. An empty prefix resets it. PUT requires a session with Origin/CSRF or a full API key; restricted keys cannot replace preferences. Pages are oldest first, independent of preference order, and are current snapshots rather than a consistent export.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "replacePlanRulePreferences",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/PlanResourcePreferences"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PlanResourcePreferenceResult"
          }
        }
      },
      "description": "Private current selection metadata; no-store."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "$ref": "#/components/responses/ResourceLimitsBusy"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "plan-resources"
  ]
}
```

## GET /api/v1/projects/{projectId}/rules

List rules of a project

Returns the routing rules of the project, lowest `priority` first.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "listRules",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/RuleList"
          }
        }
      },
      "description": "The rules."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "rules"
  ]
}
```

## POST /api/v1/projects/{projectId}/rules

Create a rule

Adds a routing rule to the project. Every enabled rule that matches an event forwards the event to its `targetUrl`. Your plan limits the rules per project.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "createRule",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/CreateRuleRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Rule"
          }
        }
      },
      "description": "The new rule."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "402": {
      "$ref": "#/components/responses/PaymentRequired"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "$ref": "#/components/responses/ResourceLimitsBusy"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "$ref": "#/components/responses/DestinationsUnavailable"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "rules"
  ]
}
```

## GET /api/v1/projects/{projectId}/webhook-secret

Get the webhook secret

Returns the secret that signs the deliveries of the project (see Signed deliveries in the introduction). After a rotation, `previousSecretExpiresAt` says until when the previous secret still signs deliveries.

**Authentication:** SessionAuth.

```json
{
  "operationId": "getWebhookSecret",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/WebhookSecret"
          }
        }
      },
      "description": "The webhook secret."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScope"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "SessionAuth": []
    }
  ],
  "tags": [
    "projects"
  ]
}
```

## POST /api/v1/projects/{projectId}/webhook-secret/rotate

Rotate the webhook secret

Replaces the secret that signs the deliveries of the project. For 24 hours deliveries carry a signature with the new secret and one with the previous, so receivers can switch without losing deliveries. Rotating again within those 24 hours stops signing with the older secret at once. The inbox does not check signatures, so a rotation changes nothing for requests to it.

**Authentication:** SessionAuth.

```json
{
  "operationId": "rotateWebhookSecret",
  "parameters": [
    {
      "$ref": "#/components/parameters/ProjectId"
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/WebhookSecret"
          }
        }
      },
      "description": "The new webhook secret."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "SessionAuth": []
    }
  ],
  "tags": [
    "projects"
  ]
}
```

## DELETE /api/v1/rules/{ruleId}

Delete a rule

Deletes the rule. It forwards no new events, and its pending retries stop.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "deleteRule",
  "parameters": [
    {
      "$ref": "#/components/parameters/RuleId"
    }
  ],
  "responses": {
    "204": {
      "description": "The rule is deleted."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "rules"
  ]
}
```

## PATCH /api/v1/rules/{ruleId}

Change some fields of a rule

Changes the fields you send and keeps the others. Send at least one field; `null` and unknown fields get `400 validation_error`. The result must be a valid rule, as for `PUT`: switching to `header_equals` needs `conditionKey` and `conditionValue`, sent now or already stored. Unlike `PUT`, a `PATCH` may keep a condition on a credential header that the rule already has (see `PatchRuleRequest.conditionKey`). Switching to a condition type that does not use `conditionKey` or `conditionValue` clears them.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "patchRule",
  "parameters": [
    {
      "$ref": "#/components/parameters/RuleId"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/PatchRuleRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Rule"
          }
        }
      },
      "description": "The updated rule."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "$ref": "#/components/responses/Conflict"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "New destination writes or attested rule activation are unavailable.",
      "headers": {
        "Retry-After": {
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "rules"
  ]
}
```

## PUT /api/v1/rules/{ruleId}

Update a rule

Replaces the rule. Fields you leave out get their default values; to change only some fields, use `PATCH`.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "updateRule",
  "parameters": [
    {
      "$ref": "#/components/parameters/RuleId"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/UpdateRuleRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Rule"
          }
        }
      },
      "description": "The updated rule."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "$ref": "#/components/responses/Conflict"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "New destination writes or attested rule activation are unavailable.",
      "headers": {
        "Retry-After": {
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "rules"
  ]
}
```

## PUT /api/v1/rules/{ruleId}/inbound-source

Bind a rule to one inbound source or legacy-only traffic

Requires enabled inbound settings writes and a session or full key. rules:write does not grant this security mutation. sourceId=null means legacy-only, never any-source. An all rule still cannot cross this boundary. enabled is the effective state; bound rules retain legacy enabled=false in storage. A rebind can stop queued incompatible events at next send but cannot recall an in-flight request. raw_attested_v1 carries the historical verdict authenticated by a separate MAC. Binding this mode requires a source in the rule's project with a supported signature verification profile. The attested worker floor must be 1 before enabling an attested rule. Delivery requires verified evidence from that source. The consumer verifies the configured project, source and profile. Source activation remains unavailable.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "replaceRuleInboundSource",
  "parameters": [
    {
      "$ref": "#/components/parameters/RuleId"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ReplaceRuleInboundSourceRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "204": {
      "description": "Rule source binding and effective state committed."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "$ref": "#/components/responses/InboundSettingsConflict"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "$ref": "#/components/responses/InboundUnavailable"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "rules"
  ]
}
```

## GET /api/v1/rules/{ruleId}/test

Test a saved rule on a saved event

Read-only diagnostic, available to read/full API keys and sessions. Uses current saved rule and retention-visible event. Both must belong to the caller and the same project; otherwise 404. Creates no event, delivery or quota usage and changes no rule or retention state. A result is an observation, not a delivery promise or transactional snapshot. Limited per user/process to a burst of 30 tests, refilling at 30/minute. Responses are private, no-store. Save edits before testing.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "testRule",
  "parameters": [
    {
      "$ref": "#/components/parameters/RuleId"
    },
    {
      "description": "Saved event in the rule's project, within the caller's retention.",
      "in": "query",
      "name": "eventId",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/RuleTestResult"
          }
        }
      },
      "description": "Current match result, without side effects."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "rules"
  ]
}
```

## POST /api/v1/subscription/cancel

Switch to Free at the end of the billing period

Asks Stripe to cancel the signed-in account's bound subscription at the end of its current billing period. Requires an active, trialing or past_due subscription with one catalog-priced item and no schedule or pending update. Sends only cancel_at_period_end=true, with a key for this request's Stripe retries; repeating an already scheduled cancellation returns its current end date without another update. No request body or Stripe IDs are accepted. The response reports Stripe's accepted state; local plan and limits still follow signed webhooks. A Stripe failure can leave the outcome unknown: repeat this request to read the current state before updating again. Other billing states get 409 subscription_not_changeable; use Billing Management.

**Authentication:** SessionAuth.

```json
{
  "operationId": "cancelSubscription",
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/SubscriptionCancellationResponse"
          }
        }
      },
      "description": "Stripe has scheduled the cancellation. Paid access remains subject to the subscription's native status until it ends."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "$ref": "#/components/responses/Conflict"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "SessionAuth": []
    }
  ],
  "tags": [
    "subscription"
  ]
}
```

## POST /api/v1/subscription/change

Change the plan

Switches the signed-in user to another plan. A paid plan starts through checkout instead (`403 checkout_required`), and a paid subscription is changed in the billing portal (`409 managed_by_stripe`).

**Authentication:** SessionAuth.

```json
{
  "operationId": "changeSubscriptionPlan",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ChangeSubscriptionRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/SubscriptionStatus"
          }
        }
      },
      "description": "The changed subscription."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/Forbidden"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "$ref": "#/components/responses/Conflict"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "SessionAuth": []
    }
  ],
  "tags": [
    "subscription"
  ]
}
```

## POST /api/v1/subscription/checkout

Start a checkout

Creates a Stripe Checkout session for a paid plan, or returns the account's open one. Send the user to `sessionUrl`. An account has at most one open checkout: a repeated request for the same plan and interval returns the same session, and a request for another plan or interval expires the open session and creates a new one. An account with a bound Stripe subscription, or whose checkout was just paid and is not active yet, gets `409 managed_by_stripe`; use the billing portal to change its plan. While an earlier request of the account is still creating its session, the answer is `409 checkout_in_progress`; try again in a few seconds. A plan that cannot be bought through checkout, such as the free plan, gets `400 validation_error` for `planId`; a plan that has no price for the requested `billingInterval` gets `400 validation_error` for `billingInterval`.

**Authentication:** SessionAuth.

```json
{
  "operationId": "createCheckoutSession",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/CreateCheckoutRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/CheckoutSessionResponse"
          }
        }
      },
      "description": "The checkout session."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "$ref": "#/components/responses/Conflict"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "SessionAuth": []
    }
  ],
  "tags": [
    "subscription"
  ]
}
```

## GET /api/v1/subscription/current

Get the current subscription

Returns the subscription of the signed-in user, its plan and the usage this month.

**Authentication:** SessionAuth or ApiKeyAuth.

```json
{
  "operationId": "getCurrentSubscription",
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/SubscriptionStatus"
          }
        }
      },
      "description": "The subscription."
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "tags": [
    "subscription"
  ]
}
```

## GET /api/v1/subscription/plans

List plans

Returns the plans with their limits and prices.

**Authentication:** public (no credential required).

```json
{
  "operationId": "listPlans",
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PlanList"
          }
        }
      },
      "description": "The plans."
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [],
  "tags": [
    "subscription"
  ]
}
```

## POST /api/v1/subscription/portal

Open the billing portal

Creates a Stripe billing portal session. Send the user to `portalUrl`. Omit planId and billingInterval for Billing Management; an account with no Stripe customer gets 404, while a paid Checkout awaiting its webhook can already open its customer's portal. Send both planId and billingInterval to confirm a specific paid plan change in Stripe, including its price and prorations. The server derives the subscription and item from the signed-in account. Only an active or trialing, single-item subscription without a schedule, pending update or cancellation can use this flow; unsupported billing state gets 409 subscription_not_changeable, so open Billing Management instead. Free uses POST /api/v1/subscription/cancel. Creating a portal session changes no local plan or limits; signed Stripe webhooks apply the confirmed change.

**Authentication:** SessionAuth.

```json
{
  "operationId": "createPortalSession",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/CreatePortalRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/PortalSessionResponse"
          }
        }
      },
      "description": "The portal session."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/InsufficientScopeOrCSRF"
    },
    "404": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`not_found`: no Stripe customer for Billing Management, no bound subscription for a plan change, or no active target plan."
    },
    "409": {
      "$ref": "#/components/responses/Conflict"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [
    {
      "SessionAuth": []
    }
  ],
  "tags": [
    "subscription"
  ]
}
```

## POST /inbox/{publicId}

Receive a webhook

The URL to give a webhook provider. Stores the request as an event of the project and forwards it to every enabled rule that matches. The project public ID in the path is the address, so the operation is public. Any path may follow the public ID, such as `/inbox/{publicId}/github/push`: the request is this same operation with the same checks, its full path is stored in `Event.path`, and `path_prefix` rules match the part after the public ID. The path is at most 1000 characters of UTF-8 text without NUL bytes; another gets `400 validation_error`. The inbox takes only `POST`. Unconfigured legacy paths remain unverified. A configured exact source selects the server's fixed protocol before parsing/masking; an open source is explicitly unverified, a required source refuses failed signature/identity/freshness without event or quota, and a disabled exact source never falls back. Bound rules cannot match a different or legacy source even through all. Settings writers and activation are staged OFF in this implementation checkpoint. Signature headers remain diagnostic input; sender credentials are dropped or masked as EventDetail.headers says. Verified duplicate claims return 200 duplicate:true without eventId or any new event/delivery/quota, including after event deletion or quota exhaustion; authentication/freshness still apply. Identity retention is Standard7d, Stripe31d, GitHub body coalescing72h, Shopify/generic24h; body coalescing explicitly merges byte-identical occurrences, not unique provider event identities. Time-free HMAC cannot prove first-seen recency.

**Authentication:** public (no credential required).

```json
{
  "operationId": "receiveWebhook",
  "parameters": [
    {
      "description": "Public ID of the project, as in `Project.publicId`.",
      "in": "path",
      "name": "publicId",
      "required": true,
      "schema": {
        "pattern": "^proj_[a-zA-Z0-9]+$",
        "type": "string"
      }
    },
    {
      "description": "How many EventForge deliveries the webhook has already passed through. Providers do not send it. A delivery sends one more than the event it forwards, so a rule whose target is an EventForge inbox counts up. The inbox refuses a webhook that has passed through 5 deliveries with `400 validation_error`: it is not stored and does not count toward the quota. That ends a loop of rules that forward back to each other.",
      "in": "header",
      "name": "X-EventForge-Hops",
      "schema": {
        "maximum": 4,
        "minimum": 0,
        "type": "integer"
      }
    }
  ],
  "requestBody": {
    "content": {
      "*/*": {
        "schema": {
          "format": "binary",
          "type": "string"
        }
      }
    },
    "description": "The webhook payload: JSON, form, XML or other text in UTF-8, up to 5 MB. It is stored as received. A body that is not UTF-8 text, or that contains NUL bytes, is refused with `400 validation_error`."
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/WebhookResponse"
          }
        }
      },
      "description": "The webhook is stored."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Required inbound signature, authenticated identity or protocol freshness failed."
    },
    "403": {
      "$ref": "#/components/responses/InboxUnavailable"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Authenticated identity conflicts with retained original content; no new admission."
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/InboxQuotaExceeded"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Source configuration/key/revision or resource admission temporarily unavailable; no unverified fallback.",
      "headers": {
        "Retry-After": {
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    },
    "504": {
      "$ref": "#/components/responses/Timeout"
    }
  },
  "security": [],
  "tags": [
    "inbox"
  ]
}
```

## POST /webhook/stripe

Stripe webhook

Receives subscription and Checkout events from Stripe. Only Stripe calls it. Relevant events are deduplicated by event ID. Subscription events read the current Stripe subscription under a transaction lock before applying it; payload order does not decide the stored state. Temporary lookup or database failures get 500 so Stripe can retry. A permanently invalid event gets 200 after its rejection is recorded and logged for operator attention. Irrelevant events get 200. A missing, malformed, expired or wrong `Stripe-Signature` header gets `400 validation_error`; an event with an unreadable envelope or API version gets `500 internal_error`, as do retryable processing failures, and Stripe delivers it again later. A server without a webhook signing secret fails closed with `503 billing_not_configured`, before trusting or processing the event.

**Authentication:** public (no credential required).

```json
{
  "operationId": "stripeWebhook",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "description": "A Stripe event.",
          "type": "object"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MessageResponse"
          }
        }
      },
      "description": "The event is processed."
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "429": {
      "$ref": "#/components/responses/TooManyRequests"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "$ref": "#/components/responses/BillingNotConfigured"
    }
  },
  "security": [],
  "tags": [
    "subscription"
  ]
}
```

## Shared definitions

These are the `components` of the OpenAPI document: authentication schemes, parameters, request and response schemas, and reusable responses.

```json
{
  "parameters": {
    "ApiKeyId": {
      "description": "API key ID.",
      "in": "path",
      "name": "keyId",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    "DestinationId": {
      "description": "Reusable receiver UUID owned through its project.",
      "in": "path",
      "name": "destinationId",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    "EventId": {
      "description": "Event ID.",
      "in": "path",
      "name": "eventId",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    "InboundSourceId": {
      "description": "Server-configured source UUID of a currently owned project.",
      "in": "path",
      "name": "sourceId",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    "ProjectId": {
      "description": "Project ID.",
      "in": "path",
      "name": "projectId",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    "RecoveryOperationId": {
      "description": "ID of the immutable recovery snapshot returned by preview.",
      "in": "path",
      "name": "operationId",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    "RuleId": {
      "description": "Rule ID.",
      "in": "path",
      "name": "ruleId",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    }
  },
  "responses": {
    "BadRequest": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`validation_error`: the request does not match this specification or breaks a business rule; `details` says where. `invalid_token`: the link from an email is invalid or has expired."
    },
    "BillingNotConfigured": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`billing_not_configured`: billing settings are unavailable. No webhook event is trusted without a signing secret."
    },
    "CSRFFailed": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`csrf_failed`: the request does not come from the site itself: its `Origin` is missing or another, or, with a session cookie, its `X-CSRF-Token` is missing or wrong. No cookie is set or cleared."
    },
    "Conflict": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`managed_by_stripe`: change a paid subscription in the billing portal. `checkout_in_progress`: an earlier checkout request of the account is still creating its session. `subscription_not_changeable`: use Billing Management for the current billing state."
    },
    "DestinationsUnavailable": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "destinations_unavailable; new destination writes are not available. No admission or quota charge occurred."
    },
    "EmailUnavailable": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`email_unavailable`: account mail capacity is full or stopping. No account/token changes; client/address/site mail budgets refunded. The per-IP auth request limit still applies. Retry after one second.",
      "headers": {
        "Retry-After": {
          "schema": {
            "enum": [
              1
            ],
            "type": "integer"
          }
        }
      }
    },
    "FailureDigestBusy": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "failure_digest_busy; retry after one second.",
      "headers": {
        "Retry-After": {
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    },
    "Forbidden": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`checkout_required`: paid plans start through checkout. `insufficient_scope`: an API key cannot change the plan; sign in instead. `csrf_failed`: the request lacks the site's own `Origin` or the right `X-CSRF-Token`.",
      "headers": {
        "WWW-Authenticate": {
          "description": "`Bearer error=\"insufficient_scope\"` when the error is `insufficient_scope`.",
          "schema": {
            "type": "string"
          }
        }
      }
    },
    "InboundSettingsConflict": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Fixed conflict for a stale revision, duplicate path/credential or concurrent source mutation; refresh before retry."
    },
    "InboundUnavailable": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Settings writes are disabled or the project is outside the configured test-project scope, activation or the credential key is unavailable, or a source operation is temporarily busy.",
      "headers": {
        "Retry-After": {
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    },
    "InboxQuotaExceeded": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "Monthly quota refusal (`quota_exceeded`, no Retry-After) or burst rate refusal (`rate_limited`, Retry-After in seconds). A quota refusal stores no event or deliveries and consumes no extra quota. Contact the inbox owner or try after the next UTC month begins.",
      "headers": {
        "Retry-After": {
          "description": "Present only for rate_limited, never for quota_exceeded.",
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    },
    "InboxUnavailable": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "inbox_unavailable; constant public refusal without plan/owner/count/usage details. No event, delivery or quota charge."
    },
    "InsufficientScope": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`insufficient_scope`: the API key cannot call this operation. A restricted key needs the matching capability; API key management, billing and the webhook secret need a signed-in session.",
      "headers": {
        "WWW-Authenticate": {
          "description": "`Bearer error=\"insufficient_scope\"`.",
          "schema": {
            "type": "string"
          }
        }
      }
    },
    "InsufficientScopeOrCSRF": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`insufficient_scope`: the API key cannot call this operation. A restricted key needs the matching capability; API key management, billing and the webhook secret need a signed-in session. `csrf_failed`: the request has the session cookie but lacks the site's own `Origin` or the right `X-CSRF-Token`.",
      "headers": {
        "WWW-Authenticate": {
          "description": "`Bearer error=\"insufficient_scope\"` when the error is `insufficient_scope`.",
          "schema": {
            "type": "string"
          }
        }
      }
    },
    "InternalError": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`internal_error`: something failed on our side."
    },
    "NotFound": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`not_found`: the resource does not exist or belongs to another account."
    },
    "PayloadTooLarge": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`payload_too_large`: the request body is over the limit: 64 KB for the JSON API, 5 MB for webhooks."
    },
    "PaymentRequired": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`limit_exceeded`: a limit of your plan is reached. `project_plan_suspended` or `rule_plan_suspended`: choose the resource in plan resources or change capacity. See `GET /api/v1/subscription/plans`."
    },
    "PlanSuspended": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "project_plan_suspended or rule_plan_suspended; choose the resource in plan resources or change capacity in Subscription. No new work was stored."
    },
    "ResourceLimitsBusy": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "resource_limits_busy; retry the same action after one second (same replay/retry key).",
      "headers": {
        "Retry-After": {
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    },
    "Timeout": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`timeout`: the request or operation deadline expired; mutation outcome is uncertain. No Retry-After."
    },
    "TooManyRequests": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`rate_limited`: too many requests. Wait for the number of seconds in `Retry-After`.",
      "headers": {
        "Retry-After": {
          "description": "Seconds until the next request can succeed.",
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    },
    "Unauthorized": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "`unauthorized`: the session or API key is missing, invalid or expired.",
      "headers": {
        "WWW-Authenticate": {
          "description": "Always `Bearer`.",
          "schema": {
            "type": "string"
          }
        }
      }
    }
  },
  "schemas": {
    "AlternateReplayRequest": {
      "additionalProperties": false,
      "description": "Exactly one explicit target; the original rule is never changed.",
      "properties": {
        "destinationId": {
          "description": "Explicit same-project destination; its URL and identity are captured at admission.",
          "format": "uuid",
          "type": "string"
        },
        "targetUrl": {
          "description": "Literal exact alternate URL, signed by the source destination; cannot accompany destinationId.",
          "format": "uri",
          "maxLength": 2048,
          "type": "string"
        }
      },
      "type": "object"
    },
    "ApiKey": {
      "properties": {
        "capabilities": {
          "description": "Additional write permissions for a read key. Creating a project returns its webhook secret.",
          "items": {
            "$ref": "#/components/schemas/ApiKeyCapability"
          },
          "type": "array"
        },
        "createdAt": {
          "description": "When the key was created.",
          "format": "date-time",
          "type": "string"
        },
        "expiresAt": {
          "description": "When the key stops working. Absent for a key without an expiry date.",
          "format": "date-time",
          "type": "string"
        },
        "id": {
          "description": "API key ID.",
          "format": "uuid",
          "type": "string"
        },
        "lastUsedAt": {
          "description": "When the key was last used, to the minute. Absent for a key never used.",
          "format": "date-time",
          "type": "string"
        },
        "name": {
          "description": "The name given when the key was created.",
          "example": "CI deploy",
          "type": "string"
        },
        "prefix": {
          "description": "The start of the key, to tell keys apart: `efk_` and the first 8 characters of the secret.",
          "example": "efk_9Qm0Ab3x",
          "type": "string"
        },
        "revokedAt": {
          "description": "When the key was revoked. Absent for a key that is not revoked.",
          "format": "date-time",
          "type": "string"
        },
        "scope": {
          "description": "`read` grants GET operations and the listed capabilities; `full` grants every operation accepting keys.",
          "enum": [
            "read",
            "full"
          ],
          "type": "string"
        },
        "status": {
          "description": "`active` keys work; `expired` and `revoked` keys get `401 unauthorized`.",
          "enum": [
            "active",
            "expired",
            "revoked"
          ],
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "prefix",
        "scope",
        "status",
        "createdAt"
      ],
      "type": "object"
    },
    "ApiKeyCapability": {
      "enum": [
        "projects:write",
        "rules:write",
        "deliveries:replay"
      ],
      "type": "string"
    },
    "ApiKeyList": {
      "properties": {
        "data": {
          "description": "The API keys, newest first.",
          "items": {
            "$ref": "#/components/schemas/ApiKey"
          },
          "type": "array"
        }
      },
      "required": [
        "data"
      ],
      "type": "object"
    },
    "BulkRetryOperation": {
      "properties": {
        "created": {
          "description": "New deliveries committed by the runner; not external sends or successful outcomes.",
          "maximum": 1000,
          "minimum": 0,
          "type": "integer"
        },
        "createdAt": {
          "description": "Snapshot creation time; running work expires twenty-four hours later.",
          "format": "date-time",
          "type": "string"
        },
        "expiresAt": {
          "description": "Deadline for starting this planned snapshot, fifteen minutes after creation.",
          "format": "date-time",
          "type": "string"
        },
        "id": {
          "description": "Immutable operation ID; use this for start, progress and cancel.",
          "format": "uuid",
          "type": "string"
        },
        "plannedDeliveries": {
          "description": "Retry-eligible receivers selected by preview; at most one thousand.",
          "maximum": 1000,
          "minimum": 0,
          "type": "integer"
        },
        "plannedEvents": {
          "description": "Distinct events represented in the immutable snapshot.",
          "maximum": 1000,
          "minimum": 0,
          "type": "integer"
        },
        "projectId": {
          "description": "Original project whose receivers were snapshotted; owner-only metadata remains available after project deletion.",
          "format": "uuid",
          "type": "string"
        },
        "receivedFrom": {
          "description": "Inclusive received-time lower bound, normalized to UTC.",
          "format": "date-time",
          "type": "string"
        },
        "receivedTo": {
          "description": "Exclusive received-time upper bound, normalized to UTC.",
          "format": "date-time",
          "type": "string"
        },
        "remaining": {
          "description": "Selected items not admitted; retained even in terminal states.",
          "maximum": 1000,
          "minimum": 0,
          "type": "integer"
        },
        "skipped": {
          "description": "Selected receivers skipped after a current eligibility check.",
          "maximum": 1000,
          "minimum": 0,
          "type": "integer"
        },
        "skippedReasons": {
          "additionalProperties": {
            "minimum": 0,
            "type": "integer"
          },
          "description": "Counts for event_unavailable, delivery_not_failed and rule_unavailable.",
          "type": "object"
        },
        "state": {
          "description": "Durable scheduling state; every state except planned and running is terminal.",
          "enum": [
            "planned",
            "running",
            "completed",
            "stopped_quota",
            "expired",
            "canceled",
            "failed"
          ],
          "type": "string"
        }
      },
      "required": [
        "id",
        "projectId",
        "state",
        "receivedFrom",
        "receivedTo",
        "expiresAt",
        "createdAt",
        "plannedEvents",
        "plannedDeliveries",
        "created",
        "skipped",
        "remaining",
        "skippedReasons"
      ],
      "type": "object"
    },
    "BulkRetryWindow": {
      "additionalProperties": false,
      "properties": {
        "receivedFrom": {
          "description": "Inclusive received-time lower bound, normalized to UTC.",
          "format": "date-time",
          "type": "string"
        },
        "receivedTo": {
          "description": "Exclusive received-time upper bound, normalized to UTC.",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "receivedFrom",
        "receivedTo"
      ],
      "type": "object"
    },
    "ChangeSubscriptionRequest": {
      "properties": {
        "planId": {
          "description": "ID of the plan to switch to.",
          "format": "uuid",
          "type": "string"
        }
      },
      "required": [
        "planId"
      ],
      "type": "object"
    },
    "CheckoutSessionResponse": {
      "properties": {
        "sessionId": {
          "description": "Stripe Checkout session ID.",
          "type": "string"
        },
        "sessionUrl": {
          "description": "Stripe Checkout page to send the user to.",
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "sessionId",
        "sessionUrl"
      ],
      "type": "object"
    },
    "CreateApiKeyRequest": {
      "properties": {
        "capabilities": {
          "description": "Additional permissions for read keys; must be empty for full keys.",
          "items": {
            "$ref": "#/components/schemas/ApiKeyCapability"
          },
          "type": "array",
          "uniqueItems": true
        },
        "expiresIn": {
          "default": "90d",
          "description": "How long the key works: 30, 90 or 365 days, or `never` for no expiry date. 90 days if absent.",
          "enum": [
            "30d",
            "90d",
            "365d",
            "never"
          ],
          "type": "string"
        },
        "name": {
          "description": "Key name: 1 to 100 characters, not only spaces.",
          "example": "CI deploy",
          "maxLength": 100,
          "minLength": 1,
          "type": "string"
        },
        "password": {
          "description": "Current account password, checked again before issuing the key.",
          "format": "password",
          "type": "string"
        },
        "scope": {
          "description": "`read` grants GET operations plus capabilities; `full` grants every operation accepting keys.",
          "enum": [
            "read",
            "full"
          ],
          "type": "string"
        }
      },
      "required": [
        "name",
        "scope",
        "password"
      ],
      "type": "object"
    },
    "CreateCheckoutRequest": {
      "properties": {
        "billingInterval": {
          "description": "How often Stripe charges.",
          "enum": [
            "monthly",
            "yearly"
          ],
          "type": "string"
        },
        "planId": {
          "description": "ID of the paid plan to subscribe to.",
          "format": "uuid",
          "type": "string"
        }
      },
      "required": [
        "planId",
        "billingInterval"
      ],
      "type": "object"
    },
    "CreateInboundSourceRequest": {
      "additionalProperties": false,
      "description": "Credential equality checking has an operational bound of 1000 credential-bearing sources per project; this is independent of billing plans. Open sources carry no credential and do not consume that comparison budget.",
      "properties": {
        "dedupMode": {
          "$ref": "#/components/schemas/InboundDedupMode"
        },
        "entryPath": {
          "description": "Exact ASCII inbox-relative path, such as /stripe; no trailing slash except the root path.",
          "maxLength": 255,
          "minLength": 1,
          "pattern": "^(/|(/[A-Za-z0-9_-]+)+)$",
          "type": "string"
        },
        "generateSecret": {
          "default": false,
          "description": "Explicitly generate a new Standard Webhooks, GitHub or generic-HMAC credential instead of supplying one.",
          "type": "boolean"
        },
        "name": {
          "description": "Owner-facing label for the disabled new source.",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        },
        "profile": {
          "$ref": "#/components/schemas/InboundProfile"
        },
        "secret": {
          "description": "Supplied sender credential; never echoed or available in a saved read.",
          "maxLength": 1024,
          "minLength": 1,
          "type": "string",
          "writeOnly": true
        }
      },
      "required": [
        "name",
        "entryPath",
        "profile",
        "dedupMode"
      ],
      "type": "object"
    },
    "CreatePortalRequest": {
      "additionalProperties": false,
      "properties": {
        "billingInterval": {
          "description": "Price interval of the requested plan. Requires planId.",
          "enum": [
            "monthly",
            "yearly"
          ],
          "type": "string"
        },
        "planId": {
          "description": "Active paid catalog plan to confirm in Stripe. Requires billingInterval; omit both for Billing Management.",
          "format": "uuid",
          "type": "string"
        },
        "returnUrl": {
          "description": "Page of this site to come back to from the portal. Other URLs get 400.",
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "returnUrl"
      ],
      "type": "object"
    },
    "CreateProjectRequest": {
      "properties": {
        "name": {
          "description": "Project name: 1 to 255 characters, not only spaces.",
          "example": "My Production App",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "CreateRuleRequest": {
      "properties": {
        "conditionKey": {
          "description": "Header name for `header_equals`, up to 255 characters: letters, digits and ``!#$%&'*+-.^_`|~``. Letter case does not matter. Required for `header_equals`; other condition types do not keep it. For `header_equals`, a credential header (`Authorization`, `Cookie`, `Proxy-Authorization`, `X-Api-Key`, `Api-Key`, `X-Auth-Token`, `X-Access-Token`, `X-Gitlab-Token`) is refused with `400 validation_error`: EventForge does not store its value.",
          "maxLength": 255,
          "pattern": "^[-!#$%&'*+.^_`|~0-9A-Za-z]+$",
          "type": "string"
        },
        "conditionType": {
          "default": "all",
          "description": "Which events the rule matches; see `Rule.conditionType`.",
          "enum": [
            "header_equals",
            "path_prefix",
            "all",
            "conditions"
          ],
          "type": "string"
        },
        "conditionValue": {
          "description": "Up to 1000 characters. Required for `header_equals`, where it is the header value, and for `path_prefix`, where it starts with `/`. Rules of type `all` do not keep it.",
          "maxLength": 1000,
          "type": "string"
        },
        "conditions": {
          "description": "Required only for conditionType conditions: 1–8 AND conditions, at most 16 KiB serialized UTF-8 JSON. Other types reject a nonempty list and clear it when PATCH changes the type. An omitted PATCH list is kept; a supplied list replaces it. Unknown condition fields are refused.",
          "items": {
            "$ref": "#/components/schemas/RuleCondition"
          },
          "maxItems": 8,
          "minItems": 1,
          "type": "array"
        },
        "destinationId": {
          "description": "Explicit same-project destination binding; new writes must be enabled. Supply destinationId without targetUrl for compatibility-safe new clients. Legacy targetUrl-only requests remain supported; on a shared binding an unchanged current effective URL is accepted, a changed URL requires explicit detach/rebind. If both fields are sent they must agree.",
          "format": "uuid",
          "type": "string"
        },
        "enabled": {
          "default": true,
          "description": "A disabled rule forwards nothing.",
          "type": "boolean"
        },
        "name": {
          "description": "Rule name: 1 to 255 characters.",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        },
        "priority": {
          "default": 100,
          "description": "Orders the rules in lists, lowest first. Every enabled rule that matches an event forwards it, whatever its priority.",
          "type": "integer"
        },
        "targetUrl": {
          "description": "An http or https URL to forward events to, up to 2048 characters. Private and loopback addresses are refused.",
          "format": "uri",
          "maxLength": 2048,
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "CreatedApiKey": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ApiKey"
        },
        {
          "properties": {
            "key": {
              "description": "The full API key. Send it as `Authorization: Bearer <key>`. It is shown only once: store it now.",
              "example": "efk_9Qm0Ab3xR2LkPq7Vt4Yz8Wc1Nd5Fh6Js0Bm3Gx9Ke2",
              "type": "string"
            }
          },
          "required": [
            "key"
          ],
          "type": "object"
        }
      ],
      "description": "A new API key with the full key, which is shown only this once."
    },
    "CreatedInboundSource": {
      "additionalProperties": false,
      "properties": {
        "generatedSecret": {
          "description": "Present only for this newly generated credential; copy before closing the result.",
          "readOnly": true,
          "type": "string"
        },
        "source": {
          "$ref": "#/components/schemas/InboundSource"
        }
      },
      "required": [
        "source"
      ],
      "type": "object"
    },
    "CreatedProject": {
      "allOf": [
        {
          "$ref": "#/components/schemas/Project"
        },
        {
          "properties": {
            "webhookSecret": {
              "description": "The secret that signs the deliveries of the project: `whsec_` followed by base64. Later only a signed-in session reads it, with `GET /api/v1/projects/{projectId}/webhook-secret`.",
              "example": "whsec_/SK3OYD4nzRuI+f0E/IKliY+8C/w6Oa331+hVieCggE=",
              "type": "string"
            }
          },
          "required": [
            "webhookSecret"
          ],
          "type": "object"
        }
      ],
      "description": "A new project with its webhook secret."
    },
    "CursorEventList": {
      "properties": {
        "data": {
          "description": "One page of events in descending (receivedAt, id) order.",
          "items": {
            "$ref": "#/components/schemas/Event"
          },
          "type": "array"
        },
        "hasMore": {
          "description": "Another matching row existed when this page was read.",
          "type": "boolean"
        },
        "limit": {
          "description": "The requested page size used, including on a shorter final page.",
          "maximum": 100,
          "minimum": 1,
          "type": "integer"
        },
        "nextCursor": {
          "description": "Present only when hasMore; reuse with pagination=cursor and the same project, status, method and normalized since/until bounds (equivalent timezone offsets are accepted). Changing limit is allowed.",
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "data",
        "limit",
        "hasMore"
      ],
      "type": "object"
    },
    "Delivery": {
      "properties": {
        "attemptNumber": {
          "description": "Attempt number: 1 for the first attempt, higher for retries.",
          "minimum": 1,
          "type": "integer"
        },
        "createdAt": {
          "description": "When the delivery was created.",
          "format": "date-time",
          "type": "string"
        },
        "eventId": {
          "description": "Event this delivery forwards.",
          "format": "uuid",
          "type": "string"
        },
        "id": {
          "description": "Delivery ID.",
          "format": "uuid",
          "type": "string"
        },
        "lastError": {
          "description": "Why the latest attempt failed. Captured response text and recognizable credentials are masked with the responseBody policy before storage and when read.",
          "type": "string"
        },
        "messageId": {
          "description": "The `webhook-id` the receiver gets. Retries of a delivery keep it; a replay gets a new one.",
          "example": "msg_6f9e3c2a-1b4d-4e5f-8a7b-0c1d2e3f4a5b",
          "pattern": "^msg_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
          "type": "string"
        },
        "nextAttemptAt": {
          "description": "When this attempt is scheduled to start. Present while `status` is `pending`; a time in the past means the attempt is waiting for a worker or under way.",
          "format": "date-time",
          "type": "string"
        },
        "responseBody": {
          "description": "Diagnostic text from the first 10 KiB of the target's answer, normalized to UTF-8 without NULs. EventForge API keys (efk_), signing secrets (whsec_, including JSON-escaped slashes), Bearer tokens and string-valued Authorization/Proxy-Authorization fields (including underscore-prefixed names and header-value arrays) are masked before storage. Non-string Authorization metadata, such as objects or null, is preserved. A prefixed secret cut at the end is masked too. Masking can lengthen the captured text. The same policy covers old rows when read, including reads with API keys. It recognizes plain text and quoted fields, not arbitrary encoded credentials or every provider token. Conservative matching can also mask phrases such as \"Bearer token\". The original event payload and targetUrl are not changed by this policy.",
          "type": "string"
        },
        "responseStatus": {
          "description": "HTTP status the target answered with.",
          "example": 200,
          "type": "integer"
        },
        "retryEligible": {
          "description": "Advisory current eligibility for targeted retry; admission rechecks ownership, retention, latest receiver and enabled rule.",
          "type": "boolean"
        },
        "signingDestinationId": {
          "description": "Pinned alternate signing identity; no secret bytes.",
          "format": "uuid",
          "type": "string"
        },
        "status": {
          "description": "`pending` until the attempt finishes, then `success` or `failed`.",
          "enum": [
            "pending",
            "success",
            "failed"
          ],
          "type": "string"
        },
        "targetMode": {
          "description": "Ordinary current-rule target or explicitly pinned alternate replay.",
          "enum": [
            "rule",
            "alternate"
          ],
          "type": "string"
        },
        "targetUrl": {
          "description": "URL the event is forwarded to.",
          "format": "uri",
          "type": "string"
        },
        "updatedAt": {
          "description": "When the delivery row last changed, including an operator's cleanup of diagnostic text; not an exact attempt completion time.",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "id",
        "eventId",
        "messageId",
        "targetUrl",
        "status",
        "attemptNumber",
        "createdAt"
      ],
      "type": "object"
    },
    "DeliveryRetryResponse": {
      "properties": {
        "deliveryId": {
          "description": "ID of the fresh delivery, stable for committed repeats.",
          "format": "uuid",
          "type": "string"
        },
        "messageId": {
          "description": "Fresh Standard Webhooks webhook-id, preserved on committed repeats.",
          "pattern": "^msg_[0-9a-f-]{36}$",
          "type": "string"
        }
      },
      "required": [
        "deliveryId",
        "messageId"
      ],
      "type": "object"
    },
    "DeliverySummary": {
      "description": "The event's receivers by the outcome of the latest message each one was sent.",
      "properties": {
        "delivered": {
          "description": "Receivers whose latest message was delivered.",
          "minimum": 0,
          "type": "integer"
        },
        "failed": {
          "description": "Receivers whose latest message failed for good: no attempt is left.",
          "minimum": 0,
          "type": "integer"
        },
        "pending": {
          "description": "Receivers whose latest message is waiting for an attempt or under way.",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "delivered",
        "pending",
        "failed"
      ],
      "type": "object"
    },
    "Destination": {
      "description": "Reusable owned receiver metadata; signing keys are never included.",
      "properties": {
        "createdAt": {
          "description": "When this receiver was created.",
          "format": "date-time",
          "type": "string"
        },
        "id": {
          "description": "Reusable receiver ID.",
          "format": "uuid",
          "type": "string"
        },
        "maxAttempts": {
          "description": "Future-message attempt cap, first included, over the unchanged standard 24-hour schedule.",
          "maximum": 7,
          "minimum": 1,
          "type": "integer"
        },
        "name": {
          "description": "Owner supplied receiver name.",
          "type": "string"
        },
        "projectId": {
          "description": "Project that owns this receiver.",
          "format": "uuid",
          "type": "string"
        },
        "projectSigningCompatibility": {
          "description": "When true, live project keys also sign; destination-key isolation is not yet in effect.",
          "type": "boolean"
        },
        "targetUrl": {
          "description": "Canonical exact URL used by ordinary bound-rule deliveries.",
          "format": "uri",
          "type": "string"
        },
        "updatedAt": {
          "description": "When its metadata last changed.",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "id",
        "projectId",
        "name",
        "targetUrl",
        "maxAttempts",
        "projectSigningCompatibility",
        "createdAt",
        "updatedAt"
      ],
      "type": "object"
    },
    "DestinationCreated": {
      "properties": {
        "destination": {
          "$ref": "#/components/schemas/Destination"
        },
        "secret": {
          "description": "One-time generated Standard Webhooks secret. Store securely; never log or cache.",
          "type": "string"
        }
      },
      "required": [
        "destination",
        "secret"
      ],
      "type": "object"
    },
    "DestinationList": {
      "properties": {
        "data": {
          "description": "Owned metadata in oldest-first order; no signing secrets.",
          "items": {
            "$ref": "#/components/schemas/Destination"
          },
          "type": "array"
        },
        "hasMore": {
          "description": "Another row existed beyond this page when read.",
          "type": "boolean"
        },
        "nextCursor": {
          "description": "Position for the next page; absent on the last page.",
          "type": "string"
        },
        "writesEnabled": {
          "description": "Whether this process admits new destination writes after its durable reader floor.",
          "type": "boolean"
        }
      },
      "required": [
        "data",
        "hasMore",
        "writesEnabled"
      ],
      "type": "object"
    },
    "DestinationProjectSigningRequest": {
      "additionalProperties": false,
      "properties": {
        "enabled": {
          "description": "Must be false. Disables compatibility after the receiver adopts its own key.",
          "type": "boolean"
        }
      },
      "required": [
        "enabled"
      ],
      "type": "object"
    },
    "DestinationSecret": {
      "properties": {
        "previousSecretExpiresAt": {
          "description": "Database-clock expiry of the own key retained by the latest rotation; absent otherwise.",
          "format": "date-time",
          "type": "string"
        },
        "secret": {
          "description": "Current own signing key in Standard Webhooks whsec_ format; never cache or log.",
          "type": "string"
        }
      },
      "required": [
        "secret"
      ],
      "type": "object"
    },
    "DestinationWriteRequest": {
      "additionalProperties": false,
      "properties": {
        "maxAttempts": {
          "default": 7,
          "description": "Future-message attempt cap, first attempt included; omitted means seven.",
          "maximum": 7,
          "minimum": 1,
          "type": "integer"
        },
        "name": {
          "description": "Receiver name, 1 to 255 characters.",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        },
        "targetUrl": {
          "description": "Exact HTTP(S) receiver URL; userinfo and non-public literal addresses are refused.",
          "format": "uri",
          "maxLength": 2048,
          "type": "string"
        }
      },
      "required": [
        "name",
        "targetUrl"
      ],
      "type": "object"
    },
    "Error": {
      "properties": {
        "details": {
          "$ref": "#/components/schemas/ErrorDetails"
        },
        "error": {
          "description": "Stable error code. Branch on it and on the HTTP status. New codes may appear.\n\n- `validation_error` (400): the request does not match this specification or breaks a business rule.\n- `invalid_token` (400): an email link is invalid or has expired.\n- `unauthorized` (401): the session or API key is missing, invalid or expired.\n- `invalid_credentials` (401): wrong email or password.\n- `email_not_verified` (401): the email address is not confirmed yet.\n- `limit_exceeded` (402, 409): a limit of your plan is reached (402), or the account already has 10 API keys in use (409).\n- `checkout_required` (403): paid plans start through checkout.\n- `insufficient_scope` (403): the API key cannot call this operation: a key lacking the required grant, or any key on API key management, billing and the webhook secret.\n- `csrf_failed` (403): a request with the session cookie that changes data lacks the site's own `Origin` or the right `X-CSRF-Token`, or a sign-in or sign-out comes from another origin.\n- `not_found` (404): the resource does not exist or belongs to another account, or no operation has this path; the billing portal also answers it to an account that has no Stripe customer yet.\n- `method_not_allowed` (405): the path does not accept this method.\n- `managed_by_stripe` (409): a paid subscription is changed in the billing portal.\n- `checkout_in_progress` (409): an earlier checkout request of the account is still creating its session; try again in a few seconds.\n- `subscription_not_changeable` (409): the current billing state cannot use the selected plan-change or cancellation action; open Billing Management.\n- `payload_too_large` (413): the request body is over the limit.\n- `quota_exceeded` (429): public inbox monthly quota exhausted; event not stored, no Retry-After.\n- `rate_limited` (429): too many requests.\n- `idempotency_conflict` (409): an active key belongs to another event or selected delivery within its operation namespace.\n- `replay_in_progress` (409): retry the same key after Retry-After.\n- `delivery_not_failed` (409): selected attempt is not the latest terminal failure of its receiver.\n- `rule_unavailable` (409): its rule is disabled or deleted.\n- `recovery_busy` (409): recovery lock contention; retry the same action after Retry-After.\n- `recovery_conflict` (409): operation cannot transition, or bounded preview/job capacity is full.\n- `recovery_window_too_large` (422): narrow the preview window; nothing was saved.\n- `email_unavailable` (503): account mail capacity is full or stopping; retry after one second.\n- `billing_not_configured` (503): billing settings are unavailable; no webhook is trusted without a signing secret.\n- `timeout` (504): the request or operation deadline expired; mutation outcome is uncertain.\n- `internal_error` (500): something failed on our side.\n- `inbox_unavailable` (403): This inbox is unavailable; contact the inbox owner.\n- `project_plan_suspended` (402): Choose the project in plan resources or change capacity.\n- `rule_plan_suspended` (402): Choose the rule in plan resources or change capacity.\n- `failure_digest_busy` (409): digest preference lock busy; Retry-After is 1.\n- `header_search_too_broad` (422): Narrow the diagnostic time window; no partial result.\n- `header_search_unavailable` (503): Temporary search capacity/configuration/lock failure; Retry-After: 1.\n- `destinations_unavailable` (503): new destination writes are disabled or their deployed reader floor is not established.\n- `destination_conflict` (409): explicit detach/rebind is required or a destination is unavailable for the requested action.\n- `resource_limits_busy` (409, 503): Owner or preference lock busy; Retry-After is 1. Public inbox uses 503.\n- `inbound_unavailable` (503): Inbound settings writes or source activation are unavailable, an operator credential key is unavailable or a bounded source operation is busy; Retry-After is 1.\n- `inbound_settings_conflict` (409): Source revision/path/credential configuration conflicts; refresh before another write.\n- `inbound_identity_conflict` (409): A verified authenticated identity was reused with different original content; no event or quota charge.\n- `inbound_verification_failed` (401): Required source verification, authenticated identity or protocol freshness failed; no event or quota charge.\n- `listen_busy` (503): Native listen capacity unavailable; Retry-After is 1.\n",
          "example": "validation_error",
          "type": "string"
        },
        "message": {
          "description": "What went wrong, for a person. The wording may change.",
          "example": "limit: number must be at most 100",
          "type": "string"
        }
      },
      "required": [
        "error",
        "message"
      ],
      "type": "object"
    },
    "ErrorDetails": {
      "description": "Where a `validation_error` is. Only `validation_error` has details.",
      "properties": {
        "field": {
          "description": "The parameter, header or body field. Nested body fields are joined with dots. Absent when the problem is the body as a whole, such as malformed JSON.",
          "example": "limit",
          "type": "string"
        },
        "in": {
          "description": "Part of the request with the problem.",
          "enum": [
            "body",
            "query",
            "path",
            "header"
          ],
          "type": "string"
        }
      },
      "required": [
        "in"
      ],
      "type": "object"
    },
    "Event": {
      "properties": {
        "deliveryStatus": {
          "description": "The event's status over its receivers, the rules it was sent to: `failed` when the latest message to one receiver failed for good, otherwise `pending` while one is pending, otherwise `success`; `no_match` when the event has no deliveries. A replay is a new message, so a delivered replay replaces an earlier failure.",
          "enum": [
            "no_match",
            "pending",
            "success",
            "failed"
          ],
          "type": "string"
        },
        "deliverySummary": {
          "$ref": "#/components/schemas/DeliverySummary"
        },
        "eventType": {
          "description": "Diagnostic sender-claimed type; absent when unavailable. It is not authorization.",
          "type": "string"
        },
        "eventTypeBasis": {
          "description": "Origin of the claim: unsigned_body or unsigned_header; signed_body is reserved for separately verified sources.",
          "type": "string"
        },
        "id": {
          "description": "Event ID.",
          "format": "uuid",
          "type": "string"
        },
        "method": {
          "description": "HTTP method of the webhook request.",
          "example": "POST",
          "type": "string"
        },
        "path": {
          "description": "The request path, decoded, without the query string: `/inbox/{publicId}` and any path the sender added after it.",
          "example": "/inbox/proj_3f9a1c2b7d4e5f60",
          "type": "string"
        },
        "projectId": {
          "description": "Project the event belongs to.",
          "format": "uuid",
          "type": "string"
        },
        "receivedAt": {
          "description": "When the inbox received the webhook.",
          "format": "date-time",
          "type": "string"
        },
        "sourceIp": {
          "description": "IP address the webhook came from.",
          "example": "203.0.113.7",
          "type": "string"
        }
      },
      "required": [
        "id",
        "projectId",
        "method",
        "path",
        "receivedAt"
      ],
      "type": "object"
    },
    "EventDetail": {
      "properties": {
        "body": {
          "description": "Saved body as UTF-8 text when encoding=text (including JSON-escaped NUL), otherwise standard padded base64. Older servers omit encoding and return text. Decode only the declared format; unknown formats are unsupported, never text fallback. Binary-capable readers do not enable binary intake in this reader-first release.",
          "type": "string"
        },
        "deliveries": {
          "description": "Deliveries of the event, newest first.",
          "items": {
            "$ref": "#/components/schemas/Delivery"
          },
          "type": "array"
        },
        "encoding": {
          "description": "Body representation. Absent on older servers means text.",
          "enum": [
            "text",
            "base64"
          ],
          "type": "string"
        },
        "eventType": {
          "description": "Diagnostic sender-claimed type; absent when unavailable.",
          "type": "string"
        },
        "eventTypeBasis": {
          "description": "Origin of the diagnostic claim; not an authorization decision.",
          "type": "string"
        },
        "headerMetadata": {
          "$ref": "#/components/schemas/RequestMetadata"
        },
        "headers": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Request headers, each with the first value sent. `Cookie` and `Proxy-Authorization` are not stored. `Authorization` keeps only a known scheme (`Bearer [redacted]`), and `X-Api-Key`, `Api-Key`, `X-Auth-Token`, `X-Access-Token` and `X-Gitlab-Token` are stored as `[redacted]`. In other headers, EventForge API keys keep their first characters (`efk_12345678[redacted]`) and webhook secrets become `whsec_[redacted]`.",
          "type": "object"
        },
        "id": {
          "description": "Event ID.",
          "format": "uuid",
          "type": "string"
        },
        "inboundVerification": {
          "$ref": "#/components/schemas/InboundVerification"
        },
        "method": {
          "description": "HTTP method of the webhook request.",
          "type": "string"
        },
        "path": {
          "description": "The request path, decoded, without the query string: `/inbox/{publicId}` and any path the sender added after it.",
          "type": "string"
        },
        "projectId": {
          "description": "Project the event belongs to.",
          "format": "uuid",
          "type": "string"
        },
        "queryMetadata": {
          "$ref": "#/components/schemas/RequestMetadata"
        },
        "rawQueryCapture": {
          "$ref": "#/components/schemas/RawQueryCapture"
        },
        "receivedAt": {
          "description": "When the inbox received the webhook.",
          "format": "date-time",
          "type": "string"
        },
        "sourceIp": {
          "description": "IP address the webhook came from.",
          "type": "string"
        }
      },
      "required": [
        "id",
        "projectId",
        "method",
        "path",
        "receivedAt",
        "deliveries"
      ],
      "type": "object"
    },
    "EventList": {
      "properties": {
        "data": {
          "description": "One page of events, newest first.",
          "items": {
            "$ref": "#/components/schemas/Event"
          },
          "type": "array"
        },
        "limit": {
          "description": "The page size used.",
          "type": "integer"
        },
        "offset": {
          "description": "How many events were skipped.",
          "type": "integer"
        },
        "total": {
          "description": "How many events match the filter.",
          "type": "integer"
        }
      },
      "required": [
        "data",
        "total",
        "limit",
        "offset"
      ],
      "type": "object"
    },
    "FailureDigestDiagnostic": {
      "description": "Bounded historical mail admission; no inbox delivery guarantee.",
      "properties": {
        "claimedAt": {
          "description": "Durable admission time before volatile enqueue.",
          "format": "date-time",
          "type": "string"
        },
        "completedAt": {
          "description": "Time a known send or suppression outcome was recorded.",
          "format": "date-time",
          "type": "string"
        },
        "observedAt": {
          "description": "Last database observation of current sampled receivers.",
          "format": "date-time",
          "type": "string"
        },
        "receiverCount": {
          "description": "Current failed receiver count among the bounded sample at observation.",
          "maximum": 1000,
          "minimum": 0,
          "type": "integer"
        },
        "sampleTruncated": {
          "description": "More captured signals existed beyond the sample; their current state is unknown.",
          "type": "boolean"
        },
        "state": {
          "description": "sent means SMTP accepted DATA; claimed is unknown and never automatically retried.",
          "enum": [
            "claimed",
            "sent",
            "failed",
            "skipped"
          ],
          "type": "string"
        }
      },
      "required": [
        "state",
        "observedAt",
        "receiverCount",
        "sampleTruncated",
        "claimedAt"
      ],
      "type": "object"
    },
    "FailureDigestPreference": {
      "additionalProperties": false,
      "properties": {
        "enabled": {
          "description": "Explicit opt-in; false by default.",
          "type": "boolean"
        }
      },
      "required": [
        "enabled"
      ],
      "type": "object"
    },
    "FailureDigestSettings": {
      "properties": {
        "cadenceSeconds": {
          "description": "Minimum project admission spacing; shared capacity may defer or omit mail.",
          "enum": [
            3600
          ],
          "type": "integer"
        },
        "enabled": {
          "description": "Explicit opt-in; false by default.",
          "type": "boolean"
        },
        "enabledSince": {
          "description": "Start of the enabled generation; mixed old writers do not provide full coverage.",
          "format": "date-time",
          "nullable": true,
          "type": "string"
        },
        "lastDigest": {
          "$ref": "#/components/schemas/FailureDigestDiagnostic"
        },
        "maxSignalsPerDigest": {
          "description": "Maximum captured signals examined in one sample.",
          "enum": [
            1000
          ],
          "type": "integer"
        },
        "recipientEligible": {
          "description": "Whether the current owner has a confirmed email; never exposes the address.",
          "type": "boolean"
        },
        "settleSeconds": {
          "description": "Minimum captured signal age before sampling.",
          "enum": [
            300
          ],
          "type": "integer"
        },
        "signalLifetimeSeconds": {
          "description": "Logical lifetime of unclaimed signals; physical cleanup is eventual.",
          "enum": [
            86400
          ],
          "type": "integer"
        }
      },
      "required": [
        "enabled",
        "enabledSince",
        "recipientEligible",
        "cadenceSeconds",
        "settleSeconds",
        "signalLifetimeSeconds",
        "maxSignalsPerDigest"
      ],
      "type": "object"
    },
    "ForgotPasswordRequest": {
      "properties": {
        "email": {
          "description": "Address of the account.",
          "example": "user@example.com",
          "format": "email",
          "type": "string"
        }
      },
      "required": [
        "email"
      ],
      "type": "object"
    },
    "InboundDedupMode": {
      "description": "Standard/Stripe require authenticated_id. Open requires off. Body-only protocols require an explicit coalescing/off choice; identical bodies need not represent one legitimate occurrence. No unsigned ID is a key.",
      "enum": [
        "authenticated_id",
        "coalesce_identical_body",
        "off"
      ],
      "type": "string"
    },
    "InboundPolicy": {
      "additionalProperties": false,
      "properties": {
        "unmatchedPaths": {
          "description": "Admit unmatched traffic as unverified legacy-only or reject it. Exact configured paths never fall back.",
          "enum": [
            "legacy",
            "reject"
          ],
          "type": "string"
        }
      },
      "required": [
        "unmatchedPaths"
      ],
      "type": "object"
    },
    "InboundProfile": {
      "description": "Fixed server-configured protocol. Standard Webhooks supports the existing symmetric v1 HMAC format. Generic body HMAC uses literal UTF-8 keys and X-Webhook-Signature sha256=hex over raw bytes. Slack is not creatable before challenge support.",
      "enum": [
        "open",
        "standard_webhooks",
        "stripe",
        "github",
        "shopify",
        "body_sha256_hex_v1"
      ],
      "type": "string"
    },
    "InboundSource": {
      "additionalProperties": false,
      "description": "Safe owned source metadata without credential readback; paths and trust identity are immutable.",
      "properties": {
        "createdAt": {
          "description": "Source creation time in UTC.",
          "format": "date-time",
          "type": "string"
        },
        "credentialVersion": {
          "description": "Current credential generation, or zero for an open source. No credential bytes are returned.",
          "format": "int64",
          "minimum": 0,
          "type": "integer"
        },
        "dedupMode": {
          "$ref": "#/components/schemas/InboundDedupMode"
        },
        "enabled": {
          "description": "Current saved source state; false is the creation default and enabling is unavailable in this staged slice.",
          "type": "boolean"
        },
        "entryPath": {
          "description": "Exact case-sensitive inbox-relative path; immutable after creation.",
          "maxLength": 255,
          "type": "string"
        },
        "hasCredential": {
          "description": "Whether encrypted current credential material exists; not a public fingerprint.",
          "type": "boolean"
        },
        "id": {
          "description": "Immutable source UUID.",
          "format": "uuid",
          "type": "string"
        },
        "name": {
          "description": "Owner-facing source label.",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        },
        "previousValidUntil": {
          "description": "End of the still-active immediately previous credential overlap, according to database time.",
          "format": "date-time",
          "type": "string"
        },
        "profile": {
          "$ref": "#/components/schemas/InboundProfile"
        },
        "projectId": {
          "description": "Currently owning project UUID.",
          "format": "uuid",
          "type": "string"
        },
        "revision": {
          "description": "Current optimistic-concurrency revision; name, policy or credential changes advance it.",
          "format": "int64",
          "minimum": 1,
          "type": "integer"
        },
        "updatedAt": {
          "description": "Most recent source settings update time in UTC.",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "id",
        "projectId",
        "name",
        "entryPath",
        "profile",
        "dedupMode",
        "enabled",
        "revision",
        "credentialVersion",
        "hasCredential",
        "createdAt",
        "updatedAt"
      ],
      "type": "object"
    },
    "InboundSourceList": {
      "properties": {
        "data": {
          "description": "Owned source metadata in ascending UUID order; never includes saved credentials.",
          "items": {
            "$ref": "#/components/schemas/InboundSource"
          },
          "maxItems": 100,
          "type": "array"
        },
        "hasMore": {
          "description": "Whether another metadata page exists after this page.",
          "type": "boolean"
        },
        "nextAfter": {
          "description": "Pass as after for the next page; present only when hasMore is true.",
          "format": "uuid",
          "type": "string"
        }
      },
      "required": [
        "data",
        "hasMore"
      ],
      "type": "object"
    },
    "InboundVerification": {
      "additionalProperties": false,
      "description": "Immutable original intake evidence. Delivery retries and Replay do not repeat provider verification or refresh its original timestamp. Historical events remain legacy_unknown.",
      "properties": {
        "bodySha256": {
          "description": "Lowercase SHA-256 of the exact original admitted body bytes.",
          "pattern": "^[a-f0-9]{64}$",
          "type": "string"
        },
        "checkedAt": {
          "description": "UTC time of the original verification, not the time of retry or Replay.",
          "format": "date-time",
          "type": "string"
        },
        "freshness": {
          "description": "Whether the configured protocol authenticated a timestamp within its intake tolerance. Body-only protocols report unavailable.",
          "enum": [
            "unavailable",
            "passed"
          ],
          "type": "string"
        },
        "profile": {
          "$ref": "#/components/schemas/InboundProfile"
        },
        "result": {
          "description": "Historical intake verdict; absent historical capture remains legacy_unknown.",
          "enum": [
            "legacy_unknown",
            "open_unverified",
            "verified"
          ],
          "type": "string"
        },
        "signedAt": {
          "description": "Provider-authenticated timestamp when the fixed protocol carries one.",
          "format": "date-time",
          "type": "string"
        },
        "sourceId": {
          "description": "Immutable configured source UUID captured at intake.",
          "format": "uuid",
          "type": "string"
        },
        "toleranceSeconds": {
          "description": "Allowed past and future difference at the original check; present only for authenticated-time protocols.",
          "maximum": 300,
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "result",
        "freshness"
      ],
      "type": "object"
    },
    "ListenAck": {
      "additionalProperties": false,
      "properties": {
        "cursor": {
          "description": "Exact outstanding cursor saved durably by the client.",
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        },
        "type": {
          "description": "Acknowledges the outstanding ready or event frame.",
          "enum": [
            "ack"
          ],
          "type": "string"
        }
      },
      "required": [
        "type",
        "cursor"
      ],
      "type": "object"
    },
    "ListenCursor": {
      "additionalProperties": false,
      "properties": {
        "epoch": {
          "description": "Journal epoch invalidated after restore.",
          "format": "uuid",
          "type": "string"
        },
        "eventId": {
          "description": "Event anchor at this position; nil UUID at position zero.",
          "format": "uuid",
          "type": "string"
        },
        "position": {
          "description": "Signed64-bit nonnegative decimal; zero requires the nil event UUID.",
          "pattern": "^(0|[1-9][0-9]{0,18})$",
          "type": "string"
        },
        "projectId": {
          "description": "Owned project to which this position belongs.",
          "format": "uuid",
          "type": "string"
        },
        "version": {
          "description": "Cursor format version.",
          "enum": [
            1
          ],
          "type": "integer"
        }
      },
      "required": [
        "version",
        "projectId",
        "epoch",
        "position",
        "eventId"
      ],
      "type": "object"
    },
    "ListenFrame": {
      "additionalProperties": false,
      "description": "Ready has cursor and floor; event has cursor; error has only a fixed error code. The cursor encodes event ID and decimal position.",
      "properties": {
        "cursor": {
          "description": "Base64url ListenCursor to persist before acknowledging.",
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        },
        "error": {
          "description": "Fixed terminal protocol error; reconnect never silently chooses another tail.",
          "enum": [
            "listen_cursor_invalid",
            "listen_cursor_expired",
            "listen_stream_gap",
            "listen_event_unavailable",
            "listen_access_lost",
            "listen_busy"
          ],
          "type": "string"
        },
        "floor": {
          "description": "Lowest resumable boundary position observed in the ready snapshot.",
          "pattern": "^(0|[1-9][0-9]{0,18})$",
          "type": "string"
        },
        "type": {
          "description": "Connection readiness or the next event position or a terminal error.",
          "enum": [
            "ready",
            "event",
            "error"
          ],
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    },
    "ListenStart": {
      "additionalProperties": false,
      "description": "Exactly one of from and cursor must be present. Duplicate/case-variant fields are refused.",
      "properties": {
        "cursor": {
          "description": "Previously saved base64url ListenCursor; exclusive with from.",
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        },
        "from": {
          "description": "Start at the current committed tail without historical replay.",
          "enum": [
            "tail"
          ],
          "type": "string"
        },
        "type": {
          "description": "Starts this connection.",
          "enum": [
            "start"
          ],
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    },
    "LoginRequest": {
      "properties": {
        "email": {
          "description": "Email address of the account.",
          "example": "user@example.com",
          "format": "email",
          "type": "string"
        },
        "password": {
          "description": "Password of the account.",
          "example": "secretpassword123",
          "format": "password",
          "type": "string"
        }
      },
      "required": [
        "email",
        "password"
      ],
      "type": "object"
    },
    "LoginResponse": {
      "properties": {
        "expiresAt": {
          "description": "When the session ends, 30 days after sign-in. The session itself is in the cookie the answer sets.",
          "example": "2026-11-19T12:00:00Z",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "expiresAt"
      ],
      "type": "object"
    },
    "MessageResponse": {
      "properties": {
        "message": {
          "description": "A short confirmation for a person.",
          "example": "Operation successful",
          "type": "string"
        }
      },
      "required": [
        "message"
      ],
      "type": "object"
    },
    "PatchRuleRequest": {
      "additionalProperties": false,
      "description": "The fields to change; the others keep their values.",
      "minProperties": 1,
      "properties": {
        "conditionKey": {
          "description": "Header name for `header_equals`, up to 255 characters: letters, digits and ``!#$%&'*+-.^_`|~``. Letter case does not matter. A new `header_equals` condition on a credential header (`Authorization`, `Cookie`, `Proxy-Authorization`, `X-Api-Key`, `Api-Key`, `X-Auth-Token`, `X-Access-Token`, `X-Gitlab-Token`) is refused with `400 validation_error`: EventForge does not store its value. A rule created with such a condition before EventForge stopped storing these values never matches; a `PATCH` that keeps its condition (type, key in any letter case, and value) is accepted.",
          "maxLength": 255,
          "pattern": "^[-!#$%&'*+.^_`|~0-9A-Za-z]+$",
          "type": "string"
        },
        "conditionType": {
          "description": "Which events the rule matches; see `Rule.conditionType`.",
          "enum": [
            "header_equals",
            "path_prefix",
            "all",
            "conditions"
          ],
          "type": "string"
        },
        "conditionValue": {
          "description": "Up to 1000 characters: the header value for `header_equals`, a path that starts with `/` for `path_prefix`.",
          "maxLength": 1000,
          "type": "string"
        },
        "conditions": {
          "description": "Required only for conditionType conditions: 1–8 AND conditions, at most 16 KiB serialized UTF-8 JSON. Other types reject a nonempty list and clear it when PATCH changes the type. An omitted PATCH list is kept; a supplied list replaces it. Unknown condition fields are refused.",
          "items": {
            "$ref": "#/components/schemas/RuleCondition"
          },
          "maxItems": 8,
          "minItems": 1,
          "type": "array"
        },
        "destinationId": {
          "description": "Explicit same-project destination binding; new writes must be enabled. Supply destinationId without targetUrl for compatibility-safe new clients. Legacy targetUrl-only requests remain supported; on a shared binding an unchanged current effective URL is accepted, a changed URL requires explicit detach/rebind. If both fields are sent they must agree.",
          "format": "uuid",
          "type": "string"
        },
        "enabled": {
          "description": "A disabled rule forwards nothing.",
          "type": "boolean"
        },
        "name": {
          "description": "Rule name: 1 to 255 characters.",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        },
        "priority": {
          "description": "Orders the rules in lists, lowest first. Every enabled rule that matches an event forwards it, whatever its priority.",
          "type": "integer"
        },
        "targetUrl": {
          "description": "An http or https URL to forward events to, up to 2048 characters. Private and loopback addresses are refused.",
          "format": "uri",
          "maxLength": 2048,
          "type": "string"
        }
      },
      "type": "object"
    },
    "Plan": {
      "description": "A subscription plan: its limits and prices.",
      "properties": {
        "displayName": {
          "description": "Plan name to show to people.",
          "example": "Free Plan",
          "type": "string"
        },
        "eventRetentionDays": {
          "description": "Days the plan keeps events. Once deletion has started (see the pricing page), older events and their deliveries are deleted; when a paid plan ends, its retention applies for 14 more days.",
          "example": 7,
          "type": "integer"
        },
        "id": {
          "description": "Plan ID.",
          "format": "uuid",
          "type": "string"
        },
        "maxEventsPerMonth": {
          "description": "Most events received per month; -1 means unlimited.",
          "example": 1000,
          "type": "integer"
        },
        "maxProjects": {
          "description": "Most projects allowed; -1 means unlimited.",
          "example": 3,
          "type": "integer"
        },
        "maxRulesPerProject": {
          "description": "Most rules per project; -1 means unlimited.",
          "example": 5,
          "type": "integer"
        },
        "name": {
          "description": "Plan name used by the API.",
          "example": "free",
          "type": "string"
        },
        "priceMonthly": {
          "description": "Monthly price in EUR.",
          "example": 0,
          "format": "double",
          "type": "number"
        },
        "priceYearly": {
          "description": "Yearly price in EUR, as charged by Stripe.",
          "example": 0,
          "format": "double",
          "type": "number"
        }
      },
      "required": [
        "id",
        "name",
        "displayName",
        "maxProjects",
        "maxEventsPerMonth",
        "maxRulesPerProject",
        "eventRetentionDays",
        "priceMonthly",
        "priceYearly"
      ],
      "type": "object"
    },
    "PlanList": {
      "properties": {
        "data": {
          "description": "The plans.",
          "items": {
            "$ref": "#/components/schemas/Plan"
          },
          "type": "array"
        }
      },
      "required": [
        "data"
      ],
      "type": "object"
    },
    "PlanResource": {
      "properties": {
        "admissionAllowed": {
          "description": "New work is allowed by plan selection and manual rule enablement.",
          "type": "boolean"
        },
        "createdAt": {
          "description": "Creation timestamp in UTC; UUID breaks equal-time ties.",
          "format": "date-time",
          "type": "string"
        },
        "enabled": {
          "description": "Manual state, present only for rules; independent of plan selection.",
          "type": "boolean"
        },
        "id": {
          "description": "Owned resource identifier.",
          "format": "uuid",
          "type": "string"
        },
        "name": {
          "description": "Current resource name.",
          "type": "string"
        },
        "planSuspended": {
          "description": "Actual plan suspension, including parent suspension for a rule.",
          "type": "boolean"
        },
        "preferencePosition": {
          "description": "Stored explicit rank; gaps after deletion do not consume slots.",
          "maximum": 1000,
          "minimum": 1,
          "type": "integer"
        },
        "withinPlan": {
          "description": "Within this resource scope prefix, independent of manual and parent state.",
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "name",
        "createdAt",
        "withinPlan",
        "planSuspended",
        "admissionAllowed"
      ],
      "type": "object"
    },
    "PlanResourcePage": {
      "properties": {
        "data": {
          "description": "At most pageSize slim resource diagnostics, oldest first.",
          "items": {
            "$ref": "#/components/schemas/PlanResource"
          },
          "maxItems": 100,
          "type": "array"
        },
        "enforcementEnabled": {
          "description": "Setting of this process; mixed slots may differ until drained.",
          "type": "boolean"
        },
        "hasMore": {
          "description": "A further current resource page is available.",
          "type": "boolean"
        },
        "nextCursor": {
          "description": "Opaque position for the next page with the same owner and scope.",
          "maxLength": 512,
          "type": "string"
        },
        "pageSize": {
          "description": "Requested page size, independently of planLimit.",
          "maximum": 100,
          "minimum": 1,
          "type": "integer"
        },
        "planLimit": {
          "description": "Effective plan resource limit; -1 means all and 0 means none.",
          "minimum": -1,
          "type": "integer"
        },
        "preferredIds": {
          "description": "Complete ordered preference prefix; empty resets default order.",
          "items": {
            "format": "uuid",
            "type": "string"
          },
          "maxItems": 1000,
          "type": "array"
        },
        "projectId": {
          "description": "Owned project scope for rule metadata.",
          "format": "uuid",
          "type": "string"
        },
        "projectPlanSuspended": {
          "description": "Enforcement is enabled and the parent is outside its project prefix.",
          "type": "boolean"
        },
        "projectWithinPlan": {
          "description": "Parent project is within the selected project prefix.",
          "type": "boolean"
        }
      },
      "required": [
        "enforcementEnabled",
        "planLimit",
        "preferredIds",
        "data",
        "pageSize",
        "hasMore"
      ],
      "type": "object"
    },
    "PlanResourcePreferenceResult": {
      "properties": {
        "enforcementEnabled": {
          "description": "Enforcement setting of the responding process.",
          "type": "boolean"
        },
        "preferredIds": {
          "description": "Complete ordered preference prefix; empty resets default order.",
          "items": {
            "format": "uuid",
            "type": "string"
          },
          "maxItems": 1000,
          "type": "array"
        },
        "projectId": {
          "description": "Owned project scope for rule metadata.",
          "format": "uuid",
          "type": "string"
        }
      },
      "required": [
        "enforcementEnabled",
        "preferredIds"
      ],
      "type": "object"
    },
    "PlanResourcePreferences": {
      "additionalProperties": false,
      "properties": {
        "preferredIds": {
          "description": "Complete ordered preference prefix; empty resets default order.",
          "items": {
            "format": "uuid",
            "type": "string"
          },
          "maxItems": 1000,
          "type": "array",
          "uniqueItems": true
        }
      },
      "required": [
        "preferredIds"
      ],
      "type": "object"
    },
    "PortalSessionResponse": {
      "properties": {
        "portalUrl": {
          "description": "Stripe billing portal page to send the user to.",
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "portalUrl"
      ],
      "type": "object"
    },
    "Project": {
      "properties": {
        "createdAt": {
          "description": "When the project was created.",
          "format": "date-time",
          "type": "string"
        },
        "id": {
          "description": "Project ID.",
          "format": "uuid",
          "type": "string"
        },
        "name": {
          "description": "Project name.",
          "example": "My Production App",
          "type": "string"
        },
        "publicId": {
          "description": "Public ID of the project inbox: webhooks go to `/inbox/{publicId}`.",
          "example": "proj_3f9a1c2b7d4e5f60",
          "pattern": "^proj_[a-zA-Z0-9]+$",
          "type": "string"
        },
        "updatedAt": {
          "description": "When the project last changed.",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "publicId",
        "createdAt",
        "updatedAt"
      ],
      "type": "object"
    },
    "ProjectList": {
      "properties": {
        "data": {
          "description": "The projects, newest first.",
          "items": {
            "$ref": "#/components/schemas/Project"
          },
          "type": "array"
        }
      },
      "required": [
        "data"
      ],
      "type": "object"
    },
    "RawQueryCapture": {
      "additionalProperties": false,
      "description": "Safe lexical query diagnostics for the event owner. Older servers omit this field. Captured query text preserves parameter order, repeats and benign escape spelling. Credential values use whole-value masking. Delivery uses the configured target URL. This diagnostic has no routing, signature or forwarding authority. Unavailable capture contains only a reason. Arbitrary secrets in unknown names/values and nested encodings are outside the credential classification policy.",
      "properties": {
        "forceQuery": {
          "description": "Present only when captured. True for an explicitly empty query delimiter.",
          "type": "boolean"
        },
        "rawQuery": {
          "description": "Present only when captured, including empty text. The initial question mark is separate.",
          "type": "string"
        },
        "reason": {
          "description": "Present only when unavailable. not_captured includes old rows and writers.",
          "enum": [
            "not_captured",
            "invalid_query",
            "unsupported_text",
            "too_large",
            "invalid_metadata"
          ],
          "type": "string"
        },
        "redacted": {
          "description": "Present only when captured. True when credential values were masked.",
          "type": "boolean"
        },
        "status": {
          "description": "Whether query diagnostics were captured or are unavailable for this event.",
          "enum": [
            "captured",
            "unavailable"
          ],
          "type": "string"
        }
      },
      "required": [
        "status"
      ],
      "type": "object"
    },
    "RegisterRequest": {
      "properties": {
        "email": {
          "description": "Email address of the new account, at most 254 bytes: RFC 5322 syntax, no spaces or display name, and a domain with at least one dot.",
          "example": "user@example.com",
          "format": "email",
          "maxLength": 254,
          "minLength": 3,
          "type": "string"
        },
        "password": {
          "description": "At least 8 characters and at most 72 bytes in UTF-8 (the bcrypt limit).",
          "example": "secretpassword123",
          "format": "password",
          "maxLength": 72,
          "minLength": 8,
          "type": "string"
        }
      },
      "required": [
        "email",
        "password"
      ],
      "type": "object"
    },
    "RenameApiKeyRequest": {
      "properties": {
        "name": {
          "description": "Key name, not only spaces.",
          "maxLength": 100,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "ReplaceInboundCredentialRequest": {
      "additionalProperties": false,
      "properties": {
        "expectedRevision": {
          "description": "Revision read by the caller before replacing the credential.",
          "format": "int64",
          "minimum": 1,
          "type": "integer"
        },
        "generateSecret": {
          "default": false,
          "description": "Generate a supported new credential instead of supplying secret; false by default.",
          "type": "boolean"
        },
        "previousValidForSeconds": {
          "description": "Explicit previous-key overlap, from zero through 24 hours; zero immediately removes the old slot.",
          "maximum": 86400,
          "minimum": 0,
          "type": "integer"
        },
        "secret": {
          "description": "New supplied provider credential; never echoed or retrievable. Supply exactly one of secret or generateSecret.",
          "maxLength": 1024,
          "minLength": 1,
          "type": "string",
          "writeOnly": true
        }
      },
      "required": [
        "expectedRevision",
        "previousValidForSeconds"
      ],
      "type": "object"
    },
    "ReplaceInboundSourceRequest": {
      "additionalProperties": false,
      "properties": {
        "enabled": {
          "description": "Replacement saved state; true remains unavailable until activation is implemented and authorized.",
          "type": "boolean"
        },
        "expectedRevision": {
          "description": "Revision read by the caller; stale input is refused without overwriting current settings.",
          "format": "int64",
          "minimum": 1,
          "type": "integer"
        },
        "name": {
          "description": "Replacement owner-facing source label.",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "expectedRevision",
        "name",
        "enabled"
      ],
      "type": "object"
    },
    "ReplaceRuleInboundSourceRequest": {
      "additionalProperties": false,
      "properties": {
        "enabled": {
          "description": "Effective rule enabled state, separate from its legacy disabled storage shadow.",
          "type": "boolean"
        },
        "evidenceMode": {
          "description": "Explicit consumer contract. raw_attested_v1 requires a same-project source with a supported signature verification profile and verified evidence at delivery. Source activation remains unavailable.",
          "enum": [
            "raw",
            "raw_attested_v1"
          ],
          "type": "string"
        },
        "sourceId": {
          "description": "Owned same-project source UUID; null means legacy-only, never any-source.",
          "format": "uuid",
          "nullable": true,
          "type": "string"
        }
      },
      "required": [
        "sourceId",
        "enabled",
        "evidenceMode"
      ],
      "type": "object"
    },
    "ReplayResponse": {
      "properties": {
        "deliveriesCreated": {
          "description": "How many deliveries were created: one per enabled rule that matches the event.",
          "type": "integer"
        },
        "message": {
          "description": "A short confirmation for a person.",
          "example": "Replay initiated",
          "type": "string"
        }
      },
      "required": [
        "message",
        "deliveriesCreated"
      ],
      "type": "object"
    },
    "RequestMetadata": {
      "description": "Safe incoming diagnostics only; never used for routing or forwarding. Old servers omit this field. Unavailable has a reason and no values. Captured has values (including an empty object) and textNormalized. Query is a decoded map, not RawQuery; malformed queries are unavailable. Headers are Go-parsed slices in per-name order, with current credentials dropped/masked for every value. Host and wire ordering are not recorded. Invalid UTF-8/NUL header text is replaced and textNormalized is true. Capped at 64 KiB input and 1024 entries/values per kind, 256 KiB sanitized JSON. Exceeded bounds make the entire kind unavailable, not truncated. Known own credentials in names suppress the entire kind; arbitrary secrets in unknown names/values and nested encodings are not guaranteed hidden.",
      "properties": {
        "reason": {
          "description": "Present only when unavailable. not_captured includes old rows/writers; invalid_query is query-only.",
          "enum": [
            "not_captured",
            "invalid_query",
            "unsupported_text",
            "too_large",
            "invalid_metadata"
          ],
          "type": "string"
        },
        "status": {
          "description": "Captured parsed values or unavailable diagnostics; unavailable does not mean the incoming request was empty.",
          "enum": [
            "captured",
            "unavailable"
          ],
          "type": "string"
        },
        "textNormalized": {
          "description": "Present only when captured. True when invalid UTF-8/NUL header text was replaced with U+FFFD; always false for query diagnostics.",
          "type": "boolean"
        },
        "values": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "Present only when captured, including an empty object. Decoded names retain ordered repeated values; empty strings and empty header arrays remain distinct.",
          "type": "object"
        }
      },
      "required": [
        "status"
      ],
      "type": "object"
    },
    "ResendVerificationRequest": {
      "properties": {
        "email": {
          "description": "Address of the account to confirm.",
          "example": "user@example.com",
          "format": "email",
          "type": "string"
        }
      },
      "required": [
        "email"
      ],
      "type": "object"
    },
    "ResetPasswordRequest": {
      "properties": {
        "newPassword": {
          "description": "At least 8 characters and at most 72 bytes in UTF-8 (the bcrypt limit).",
          "format": "password",
          "maxLength": 72,
          "minLength": 8,
          "type": "string"
        },
        "token": {
          "description": "The token from the password reset link in the email.",
          "type": "string"
        }
      },
      "required": [
        "token",
        "newPassword"
      ],
      "type": "object"
    },
    "Rule": {
      "properties": {
        "conditionKey": {
          "description": "Header name for `header_equals`; letter case does not matter. A rule on a credential header, such as `Authorization`, never matches: EventForge does not store its value (see `EventDetail.headers`).",
          "type": "string"
        },
        "conditionType": {
          "description": "Which events the rule matches within its explicit source boundary. `all` matches every source-permitted event; an unbound rule is legacy-only. `header_equals` matches when the request has a header named `conditionKey`, in any letter case, whose first value equals `conditionValue` exactly. `path_prefix` matches when the path after `/inbox/{publicId}` starts with `conditionValue`, letter case included: `/github` matches `/inbox/{publicId}/github/push` and also `/githubber`, and `/` matches every request; the inbox URL itself has the path `/`. `conditions` requires every entry in `conditions` to match. Disabled rules never match. Intake, Replay and the saved-event diagnostic use the same matcher.",
          "enum": [
            "header_equals",
            "path_prefix",
            "all",
            "conditions"
          ],
          "type": "string"
        },
        "conditionValue": {
          "description": "For `header_equals`, the header value, compared exactly. For `path_prefix`, the start of the path after `/inbox/{publicId}`.",
          "type": "string"
        },
        "conditions": {
          "description": "Required only for conditionType conditions: 1–8 AND conditions, at most 16 KiB serialized UTF-8 JSON. Other types reject a nonempty list and clear it when PATCH changes the type. An omitted PATCH list is kept; a supplied list replaces it. Unknown condition fields are refused.",
          "items": {
            "$ref": "#/components/schemas/RuleCondition"
          },
          "maxItems": 8,
          "minItems": 1,
          "type": "array"
        },
        "createdAt": {
          "description": "When the rule was created.",
          "format": "date-time",
          "type": "string"
        },
        "destinationId": {
          "description": "Bound reusable receiver, absent for an unconverted legacy rule.",
          "format": "uuid",
          "type": "string"
        },
        "enabled": {
          "description": "A disabled rule forwards nothing.",
          "type": "boolean"
        },
        "evidenceMode": {
          "description": "Explicit consumer evidence contract. Raw payload bytes are preserved in either mode.",
          "enum": [
            "raw",
            "raw_attested_v1"
          ],
          "type": "string"
        },
        "id": {
          "description": "Rule ID.",
          "format": "uuid",
          "type": "string"
        },
        "inboundSourceId": {
          "description": "Explicit same-project source binding. Absent means legacy-only, not any-source.",
          "format": "uuid",
          "type": "string"
        },
        "name": {
          "description": "Rule name.",
          "type": "string"
        },
        "priority": {
          "default": 100,
          "description": "Orders the rules in lists, lowest first. Every enabled rule that matches an event forwards it, whatever its priority.",
          "type": "integer"
        },
        "projectId": {
          "description": "Project the rule belongs to.",
          "format": "uuid",
          "type": "string"
        },
        "targetUrl": {
          "description": "URL the rule forwards events to.",
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "id",
        "projectId",
        "name",
        "targetUrl",
        "enabled",
        "createdAt"
      ],
      "type": "object"
    },
    "RuleCondition": {
      "additionalProperties": false,
      "description": "A bounded predicate. JSON paths start at $ with .name (ASCII identifier) and [0] canonical array indexes 0–999999; at most 16 steps and 255 bytes. No wildcards, quoted keys, recursion or expressions. $ addresses the root. JSON supports eq/in/exists/prefix; method supports eq/in; header supports all four. eq/in use typed JSON scalars: no coercion, null equals null, and numbers compare by exact decimal value (1 equals 1.0). Missing paths fail every operator; exists matches present null/objects/arrays too. prefix compares strings, case sensitively, with an empty prefix allowed. Malformed/non-JSON bodies fail JSON predicates, even exists. Header names ignore case and use only the stored first value; credential names are refused and never match. Recognizable EventForge secrets in header operands are refused; historical header values follow inbox masking. Numeric operands must fit the validator's finite float64 range; their original decimal precision is retained for exact matching, without converting through float64. Event-body numbers have no such magnitude restriction and are compared without expanding powers. Method operands are uppercase HTTP tokens (at most 32 bytes); this adds no inbox methods. Header/method operands are strings. Each operand is at most 1000 UTF-8 bytes after storage/response JSON encoding, including quotes and HTML escaping of &, < and >. eq/prefix require value and forbid values; in requires values and forbids value; exists forbids both. Unused keys are refused. Invalid combinations return 400 validation_error.",
      "properties": {
        "key": {
          "description": "JSON path or HTTP header name; required except for method.",
          "maxLength": 255,
          "type": "string"
        },
        "operator": {
          "description": "Comparison operation.",
          "enum": [
            "eq",
            "in",
            "exists",
            "prefix"
          ],
          "type": "string"
        },
        "source": {
          "description": "Value to inspect.",
          "enum": [
            "json",
            "method",
            "header"
          ],
          "type": "string"
        },
        "value": {
          "description": "Scalar operand for eq, or string for prefix; explicit null is a scalar.",
          "nullable": true,
          "x-go-type": "json.RawMessage",
          "x-go-type-skip-optional-pointer": true,
          "x-omitempty": true
        },
        "values": {
          "description": "Scalar candidates for in (strings for method/header).",
          "items": {
            "nullable": true,
            "x-go-type": "json.RawMessage"
          },
          "maxItems": 16,
          "minItems": 1,
          "type": "array"
        }
      },
      "required": [
        "source",
        "operator"
      ],
      "type": "object"
    },
    "RuleList": {
      "properties": {
        "data": {
          "description": "The rules, lowest `priority` first.",
          "items": {
            "$ref": "#/components/schemas/Rule"
          },
          "type": "array"
        }
      },
      "required": [
        "data"
      ],
      "type": "object"
    },
    "RuleTestResult": {
      "properties": {
        "conditionResults": {
          "description": "Ordered predicate results (one result for a legacy rule), without event data or operand echoes.",
          "items": {
            "type": "boolean"
          },
          "type": "array"
        },
        "enabled": {
          "description": "Disabled rules return false for matched and every condition result.",
          "type": "boolean"
        },
        "matched": {
          "description": "Whether this saved rule currently matches the saved event; no delivery is created.",
          "type": "boolean"
        }
      },
      "required": [
        "matched",
        "enabled",
        "conditionResults"
      ],
      "type": "object"
    },
    "SubscriptionCancellationResponse": {
      "properties": {
        "cancelAtPeriodEnd": {
          "description": "Stripe has accepted cancellation at the period end.",
          "enum": [
            true
          ],
          "type": "boolean"
        },
        "currentPeriodEnd": {
          "description": "End of the current billing period, read from Stripe.",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "cancelAtPeriodEnd",
        "currentPeriodEnd"
      ],
      "type": "object"
    },
    "SubscriptionStatus": {
      "properties": {
        "billingPlan": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Plan"
            }
          ],
          "description": "The plan billed by a bound Stripe subscription. Present even while its access is limited to Free; paid changes use the billing portal."
        },
        "plan": {
          "allOf": [
            {
              "$ref": "#/components/schemas/Plan"
            }
          ],
          "description": "The plan whose limits currently apply."
        },
        "subscription": {
          "description": "The subscription of the signed-in user.",
          "properties": {
            "cancelAtPeriodEnd": {
              "description": "Whether Stripe has scheduled cancellation at the end of the billing period. Limits continue to follow stripeStatus until Stripe reports the subscription ended.",
              "type": "boolean"
            },
            "currentPeriodEnd": {
              "description": "End of the current billing period. Absent while the subscription has never had a billing period.",
              "format": "date-time",
              "type": "string"
            },
            "currentPeriodStart": {
              "description": "Start of the current billing period. Absent while the subscription has never had a billing period.",
              "format": "date-time",
              "type": "string"
            },
            "id": {
              "description": "Subscription ID.",
              "format": "uuid",
              "type": "string"
            },
            "status": {
              "description": "Legacy local access status. stripeStatus reports the exact Stripe status when known.",
              "enum": [
                "active",
                "trialing",
                "cancelled",
                "expired"
              ],
              "type": "string"
            },
            "stripeStatus": {
              "description": "Latest status fetched from Stripe. Absent for an unobserved legacy subscription or one never billed by Stripe. Terminal status may remain after the binding is cleared.",
              "enum": [
                "incomplete",
                "incomplete_expired",
                "trialing",
                "active",
                "past_due",
                "canceled",
                "unpaid",
                "paused"
              ],
              "type": "string"
            }
          },
          "required": [
            "id",
            "status",
            "cancelAtPeriodEnd"
          ],
          "type": "object"
        },
        "usage": {
          "description": "Usage of the signed-in user.",
          "properties": {
            "eventsCount": {
              "description": "Accepted incoming events plus productive replay operations this month.",
              "example": 450,
              "type": "integer"
            },
            "projectsCount": {
              "description": "Projects the user has.",
              "example": 2,
              "type": "integer"
            }
          },
          "required": [
            "projectsCount",
            "eventsCount"
          ],
          "type": "object"
        }
      },
      "required": [
        "subscription",
        "plan",
        "usage"
      ],
      "type": "object"
    },
    "UpdateRuleRequest": {
      "properties": {
        "conditionKey": {
          "description": "Header name for `header_equals`, up to 255 characters: letters, digits and ``!#$%&'*+-.^_`|~``. Letter case does not matter. Required for `header_equals`; other condition types do not keep it. For `header_equals`, a credential header (`Authorization`, `Cookie`, `Proxy-Authorization`, `X-Api-Key`, `Api-Key`, `X-Auth-Token`, `X-Access-Token`, `X-Gitlab-Token`) is refused with `400 validation_error`: EventForge does not store its value.",
          "maxLength": 255,
          "pattern": "^[-!#$%&'*+.^_`|~0-9A-Za-z]+$",
          "type": "string"
        },
        "conditionType": {
          "default": "all",
          "description": "Which events the rule matches; see `Rule.conditionType`.",
          "enum": [
            "header_equals",
            "path_prefix",
            "all",
            "conditions"
          ],
          "type": "string"
        },
        "conditionValue": {
          "description": "Up to 1000 characters. Required for `header_equals`, where it is the header value, and for `path_prefix`, where it starts with `/`. Rules of type `all` do not keep it.",
          "maxLength": 1000,
          "type": "string"
        },
        "conditions": {
          "description": "Required only for conditionType conditions: 1–8 AND conditions, at most 16 KiB serialized UTF-8 JSON. Other types reject a nonempty list and clear it when PATCH changes the type. An omitted PATCH list is kept; a supplied list replaces it. Unknown condition fields are refused.",
          "items": {
            "$ref": "#/components/schemas/RuleCondition"
          },
          "maxItems": 8,
          "minItems": 1,
          "type": "array"
        },
        "destinationId": {
          "description": "Explicit same-project destination binding; new writes must be enabled. Supply destinationId without targetUrl for compatibility-safe new clients. Legacy targetUrl-only requests remain supported; on a shared binding an unchanged current effective URL is accepted, a changed URL requires explicit detach/rebind. If both fields are sent they must agree.",
          "format": "uuid",
          "type": "string"
        },
        "enabled": {
          "default": true,
          "description": "A disabled rule forwards nothing.",
          "type": "boolean"
        },
        "name": {
          "description": "Rule name: 1 to 255 characters.",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        },
        "priority": {
          "default": 100,
          "description": "Orders the rules in lists, lowest first. Every enabled rule that matches an event forwards it, whatever its priority.",
          "type": "integer"
        },
        "targetUrl": {
          "description": "An http or https URL to forward events to, up to 2048 characters. Private and loopback addresses are refused.",
          "format": "uri",
          "maxLength": 2048,
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "VerifyEmailRequest": {
      "properties": {
        "token": {
          "description": "The token from the confirmation link in the email.",
          "type": "string"
        }
      },
      "required": [
        "token"
      ],
      "type": "object"
    },
    "WebhookResponse": {
      "properties": {
        "duplicate": {
          "description": "True for a freshly verified repeat covered by a retained claim. No eventId is returned; no event, deliveries or quota unit is created, even after original event deletion or quota exhaustion.",
          "type": "boolean"
        },
        "eventId": {
          "description": "ID of the stored event.",
          "format": "uuid",
          "type": "string"
        },
        "message": {
          "description": "A short confirmation for a person.",
          "example": "Webhook received",
          "type": "string"
        }
      },
      "required": [
        "message"
      ],
      "type": "object"
    },
    "WebhookSecret": {
      "properties": {
        "previousSecretExpiresAt": {
          "description": "Until when the secret before the last rotation still signs deliveries. Absent when there is none.",
          "format": "date-time",
          "type": "string"
        },
        "secret": {
          "description": "The webhook secret: `whsec_` followed by base64. The HMAC-SHA256 key is the base64 part, decoded.",
          "example": "whsec_/SK3OYD4nzRuI+f0E/IKliY+8C/w6Oa331+hVieCggE=",
          "type": "string"
        }
      },
      "required": [
        "secret"
      ],
      "type": "object"
    }
  },
  "securitySchemes": {
    "ApiKeyAuth": {
      "bearerFormat": "API key",
      "description": "An API key, sent as `Authorization: Bearer efk_...`. Create one on the Settings page or with `POST /api/v1/api-keys`. A `read` key calls all `GET` operations and may have additional write capabilities; a `full` key calls every operation that accepts API keys. An operation that does not list this scheme needs a signed-in session, and a key there gets `403 insufficient_scope`.",
      "scheme": "bearer",
      "type": "http"
    },
    "SessionAuth": {
      "description": "The session cookie of the web app, which `POST /api/v1/auth/login` sets. It is `HttpOnly`, so page scripts never read it, and lasts 30 days from sign-in unless `POST /api/v1/auth/logout` or a new password ends it sooner. Its name is `__Host-ef_session` on the site, where it is also `Secure`, and `ef_session_id` in local development over HTTP. The login also sets a CSRF cookie that page scripts read: `__Host-ef_csrf` on the site, `ef_csrf` in development. A request with the session cookie whose method changes data (`POST`, `PUT`, `PATCH` or `DELETE`) must also send the site's own `Origin` and the value of the CSRF cookie in the `X-CSRF-Token` header; otherwise it gets `403 csrf_failed`. A request with an `Authorization` header is judged by that header alone. Scripts and integrations use an API key instead.",
      "in": "cookie",
      "name": "__Host-ef_session",
      "type": "apiKey"
    }
  }
}
```

