# Webhook endpoints

Register endpoints and inspect deliveries.

Base URL: https://api.audiobly.com

### POST /v1/webhooks/zoom/{organization_id}

Zoom callback

Zoom cloud-recording webhook (sub-plan 12b-1). The org id is in the path so we
can load that org's credential before verifying the per-app signature. Handles the
url_validation challenge and enqueues ingest on recording.completed.

Scope: any key

Parameters:

- `organization_id` (path, string (uuid), required)

Responses:

- 200: Successful Response
- 422: The request did not validate.
- 401: The key is missing, unknown, revoked or expired.
- 403: The key lacks the scope this call needs, or the organisation is not on Enterprise.
- 429: Over the request rate. Wait for Retry-After seconds.

### POST /v1/webhooks/teams/{organization_id}

Teams callback

Microsoft Graph change-notification webhook for Teams recordings (12b-2).

Graph validates the endpoint by calling it with a `validationToken` query param,
which must be echoed back as text/plain. Real notifications carry a `clientState`
shared secret we verify against the stored credential.

Scope: any key

Parameters:

- `organization_id` (path, string (uuid), required)

Responses:

- 200: Successful Response
- 422: The request did not validate.
- 401: The key is missing, unknown, revoked or expired.
- 403: The key lacks the scope this call needs, or the organisation is not on Enterprise.
- 429: Over the request rate. Wait for Retry-After seconds.

### POST /v1/webhooks/webex/{organization_id}

Webex callback

Webex recording webhook (sub-plan 12b-3). Verified by the `X-Spark-Signature`
HMAC over the raw body; enqueues ingest on recordings/created.

Scope: any key

Parameters:

- `organization_id` (path, string (uuid), required)

Responses:

- 200: Successful Response
- 422: The request did not validate.
- 401: The key is missing, unknown, revoked or expired.
- 403: The key lacks the scope this call needs, or the organisation is not on Enterprise.
- 429: Over the request rate. Wait for Retry-After seconds.

### POST /v1/webhooks/live/{organization_id}

Live callback

Live-stream recorder webhook (sub-plan 12c-1). HMAC-verified with the org's
`live` secret; correlates a session by the hashed stream key and, on
recording.ready, routes the recording into the normal pipeline.

Scope: any key

Parameters:

- `organization_id` (path, string (uuid), required)

Responses:

- 200: Successful Response
- 422: The request did not validate.
- 401: The key is missing, unknown, revoked or expired.
- 403: The key lacks the scope this call needs, or the organisation is not on Enterprise.
- 429: Over the request rate. Wait for Retry-After seconds.

### POST /v1/webhooks/live/{organization_id}/transcript

Live transcript ingest

Real-time transcript segments from the edge relay (sub-plan 12c-2). HMAC-verified
with the org's `live` secret; upserted by (session, seq) so re-posts are idempotent
and a final replaces its interim.

Scope: any key

Parameters:

- `organization_id` (path, string (uuid), required)

Responses:

- 200: Successful Response
- 422: The request did not validate.
- 401: The key is missing, unknown, revoked or expired.
- 403: The key lacks the scope this call needs, or the organisation is not on Enterprise.
- 429: Over the request rate. Wait for Retry-After seconds.

### POST /v1/webhook-endpoints

Create webhook

Register a webhook endpoint for your organisation. The response includes the
signing `secret` (prefixed `whsec_`) — it is shown only once, so store it to verify
delivery signatures. Requires organisation-management permission.

Scope: org_manage

Body (JSON):

- `subscribed_events` (array of string, required): The event types this endpoint should receive.
- `url` (string, required): The https address that receives the notifications.
- `enabled` (boolean): Whether the endpoint receives notifications; the default is true.

Responses:

- 201: Successful Response
- 422: The request did not validate.
- 401: The key is missing, unknown, revoked or expired.
- 403: The key lacks the scope this call needs, or the organisation is not on Enterprise.
- 429: Over the request rate. Wait for Retry-After seconds.

### GET /v1/webhook-endpoints

List webhook endpoints

List your organisation's webhook endpoints, newest first and paginated. Requires
organisation-management permission.

Scope: org_manage

Parameters:

- `limit` (query, integer)
- `offset` (query, integer)

Responses:

- 200: Successful Response
- 422: The request did not validate.
- 401: The key is missing, unknown, revoked or expired.
- 403: The key lacks the scope this call needs, or the organisation is not on Enterprise.
- 429: Over the request rate. Wait for Retry-After seconds.

### PUT /v1/webhook-endpoints/{endpoint_id}

Update webhook

Update a webhook endpoint (only the fields sent change). Re-enabling a disabled
endpoint clears its failure count and disabled reason, and sends the events held while it
was off (deliveries with status `held`: the newest 1,000 from the last 7 days, of the event
types it subscribes to), oldest first; `?discard_held=true` deletes them instead. Returns
404 for an unknown endpoint.

Scope: org_manage

Parameters:

- `endpoint_id` (path, string (uuid), required)
- `discard_held` (query, boolean): When this call switches the endpoint back on: delete the events held while it was off instead of sending them.

Body (JSON):

- `subscribed_events` (array of string): The event types this endpoint should receive.
- `url` (string): The https address that receives the notifications.
- `enabled` (boolean): Whether the endpoint receives notifications.

Responses:

- 200: Successful Response
- 422: The request did not validate.
- 401: The key is missing, unknown, revoked or expired.
- 403: The key lacks the scope this call needs, or the organisation is not on Enterprise.
- 429: Over the request rate. Wait for Retry-After seconds.

### DELETE /v1/webhook-endpoints/{endpoint_id}

Delete webhook

Delete a webhook endpoint. Returns 204, or 404 for an unknown endpoint. Requires
organisation-management permission.

Scope: org_manage

Parameters:

- `endpoint_id` (path, string (uuid), required)

Responses:

- 204: Successful Response
- 422: The request did not validate.
- 401: The key is missing, unknown, revoked or expired.
- 403: The key lacks the scope this call needs, or the organisation is not on Enterprise.
- 429: Over the request rate. Wait for Retry-After seconds.

### GET /v1/webhook-deliveries

List webhook deliveries

List webhook delivery attempts, newest first and paginated, optionally filtered by
`status` (`pending`, `succeeded`, `failed`, `exhausted`, or `held`: waiting for its
switched-off endpoint to be switched on) and `endpoint_id`. Requires organisation-management permission.

Scope: org_manage

Parameters:

- `status` (query, string)
- `endpoint_id` (query, string (uuid))
- `limit` (query, integer)
- `offset` (query, integer)

Responses:

- 200: Successful Response
- 422: The request did not validate.
- 401: The key is missing, unknown, revoked or expired.
- 403: The key lacks the scope this call needs, or the organisation is not on Enterprise.
- 429: Over the request rate. Wait for Retry-After seconds.

### POST /v1/webhook-deliveries/{delivery_id}/redeliver

Redeliver webhook delivery

Queue a past webhook delivery to be sent again (attempts reset to zero). Returns 202
with the delivery, 404 for an unknown delivery, or 409 CONFLICT if its endpoint is
disabled.

Scope: org_manage

Parameters:

- `delivery_id` (path, string (uuid), required)

Responses:

- 202: Successful Response
- 422: The request did not validate.
- 401: The key is missing, unknown, revoked or expired.
- 403: The key lacks the scope this call needs, or the organisation is not on Enterprise.
- 429: Over the request rate. Wait for Retry-After seconds.
