Skip to content

An open-source, faster Devin alternative

TypeScript

docs(webhooks): API reference pages + camelCase consistency fix

Igor Zalutski3c701297ba9d
diff --git a/docs/api-reference/sandboxes/create.mdx b/docs/api-reference/sandboxes/create.mdx
index bf24129f..da19b24d 100644
--- a/docs/api-reference/sandboxes/create.mdx
+++ b/docs/api-reference/sandboxes/create.mdx
@@ -45,6 +45,14 @@ If both `cpuCount` and `memoryMB` are provided, they must match a platform tier.
Name of a pre-built snapshot for instant boot
</ParamField>
+<ParamField body="webhooks" type="object[]">
+ Register [webhook](/sandboxes/webhooks) destination(s) for this sandbox's lifecycle events, atomically with create — so you receive `sandbox.created` / `sandbox.ready` (which fire before a separate create call could know the id). Each is pinned to this sandbox.
+
+ - `url` *(string, required)*: HTTPS endpoint.
+ - `secret` *(string)*: signing secret; omit and one is generated and returned once on the response (`webhooks[].secret`).
+ - `eventTypes` *(string[])*: event-type allow-list (default all).
+</ParamField>
+
<ParamField body="previewAuth" type="object">
Opt in to bearer-token authentication on the sandbox's preview URLs. When set, every request to `https://sb-<id>-p<port>.<domain>` must include an `Authorization: Bearer <token>` (or `X-OC-Preview-Token: <token>`) header; missing or wrong → 401.
diff --git a/docs/api-reference/webhooks/create.mdx b/docs/api-reference/webhooks/create.mdx
new file mode 100644
index 00000000..e8fc36f3
--- /dev/null
+++ b/docs/api-reference/webhooks/create.mdx
@@ -0,0 +1,51 @@
+---
+title: 'Create Webhook'
+api: 'POST /api/webhooks'
+---
+
+Register a webhook destination for sandbox lifecycle events. See [Webhooks](/sandboxes/webhooks).
+
+<ParamField body="url" type="string" required>
+ HTTPS endpoint to deliver to. Private, loopback, link-local, and cloud-metadata addresses are refused.
+</ParamField>
+
+<ParamField body="eventTypes" type="string[]">
+ Event-type allow-list — exact (`sandbox.stopped`) or prefix (`sandbox.*`). Default: all event types.
+</ParamField>
+
+<ParamField body="sandboxId" type="string">
+ Scope to a single sandbox. Omit to receive events for all of the org's sandboxes.
+</ParamField>
+
+<ParamField body="secret" type="string">
+ Signing secret. Omit and one is generated (`whsec_…`) and returned **once** in the response.
+</ParamField>
+
+<ParamField body="name" type="string">
+ Optional unique name (per org). Makes create get-or-create: the same `name` with the same config returns the existing destination; a different config under that name returns `409`.
+</ParamField>
+
+<ParamField body="enabled" type="boolean">
+ Whether the destination is active. Default `true`. `false` pauses delivery.
+</ParamField>
+
+Pass an **`Idempotency-Key`** header to make a timed-out retry safe — it returns the same destination instead of creating a duplicate.
+
+<ResponseExample>
+```json 201
+{
+ "id": "whk_3f9a2c",
+ "name": "prod",
+ "url": "https://app.example.com/oc-webhook",
+ "eventTypes": ["sandbox.stopped"],
+ "sandboxId": null,
+ "enabled": true,
+ "hasSecret": true,
+ "secret": "whsec_Hk9…",
+ "createdAt": "2026-06-24T12:00:00Z",
+ "updatedAt": "2026-06-24T12:00:00Z"
+}
+```
+
+`secret` is present **only** when OpenComputer generated it (you passed none). Read it once and store it — it is never returned again.
+</ResponseExample>
diff --git a/docs/api-reference/webhooks/delete.mdx b/docs/api-reference/webhooks/delete.mdx
new file mode 100644
index 00000000..4d1dbc82
--- /dev/null
+++ b/docs/api-reference/webhooks/delete.mdx
@@ -0,0 +1,15 @@
+---
+title: 'Delete Webhook'
+api: 'DELETE /api/webhooks/{id}'
+---
+
+Soft-delete a destination. It stops receiving events and drops out of [list](/api-reference/webhooks/list), but its delivery history is retained; any non-terminal deliveries are moved to `canceled`. See [Webhooks](/sandboxes/webhooks).
+
+<ParamField path="id" type="string" required>
+ Destination ID (`whk_…`).
+</ParamField>
+
+<ResponseExample>
+```json 204
+```
+</ResponseExample>
diff --git a/docs/api-reference/webhooks/deliveries-list.mdx b/docs/api-reference/webhooks/deliveries-list.mdx
new file mode 100644
index 00000000..c39db850
--- /dev/null
+++ b/docs/api-reference/webhooks/deliveries-list.mdx
@@ -0,0 +1,48 @@
+---
+title: 'List Deliveries'
+api: 'GET /api/webhooks/{id}/deliveries'
+---
+
+List a destination's deliveries, cursor-paginated. See [Webhooks](/sandboxes/webhooks#deliveries).
+
+<ParamField path="id" type="string" required>
+ Destination ID (`whk_…`).
+</ParamField>
+
+<ParamField query="status" type="string">
+ Filter by status: `pending`, `delivering`, `delivered`, `failed`, `dead_letter`, or `canceled`.
+</ParamField>
+
+<ParamField query="cursor" type="string">
+ Opaque pagination cursor from a previous response's `nextCursor`.
+</ParamField>
+
+<ParamField query="limit" type="integer">
+ Page size (default 50).
+</ParamField>
+
+<ResponseExample>
+```json 200
+{
+ "data": [
+ {
+ "id": "whd_8c1d",
+ "destination": "whk_3f9a2c",
+ "eventId": "sb-3f9a…:3:142",
+ "eventType": "sandbox.stopped",
+ "status": "delivered",
+ "attempts": 1,
+ "retryCount": 0,
+ "lastAttemptAt": "2026-06-24T12:00:01Z",
+ "responseCode": 200,
+ "error": null,
+ "createdAt": "2026-06-24T12:00:00Z",
+ "updatedAt": "2026-06-24T12:00:01Z",
+ "deliveredAt": "2026-06-24T12:00:01Z"
+ }
+ ],
+ "nextCursor": null,
+ "hasMore": false
+}
+```
+</ResponseExample>
diff --git a/docs/api-reference/webhooks/delivery-get.mdx b/docs/api-reference/webhooks/delivery-get.mdx
new file mode 100644
index 00000000..f24a66d9
--- /dev/null
+++ b/docs/api-reference/webhooks/delivery-get.mdx
@@ -0,0 +1,34 @@
+---
+title: 'Get Delivery'
+api: 'GET /api/webhooks/{id}/deliveries/{deliveryId}'
+---
+
+Fetch one delivery in detail. See [Webhooks](/sandboxes/webhooks#deliveries).
+
+<ParamField path="id" type="string" required>
+ Destination ID (`whk_…`).
+</ParamField>
+
+<ParamField path="deliveryId" type="string" required>
+ Delivery ID (`whd_…`).
+</ParamField>
+
+<ResponseExample>
+```json 200
+{
+ "id": "whd_8c1d",
+ "destination": "whk_3f9a2c",
+ "eventId": "sb-3f9a…:3:142",
+ "eventType": "sandbox.stopped",
+ "status": "delivered",
+ "attempts": 1,
+ "retryCount": 0,
+ "lastAttemptAt": "2026-06-24T12:00:01Z",
+ "responseCode": 200,
+ "error": null,
+ "createdAt": "2026-06-24T12:00:00Z",
+ "updatedAt": "2026-06-24T12:00:01Z",
+ "deliveredAt": "2026-06-24T12:00:01Z"
+}
+```
+</ResponseExample>
diff --git a/docs/api-reference/webhooks/get.mdx b/docs/api-reference/webhooks/get.mdx
new file mode 100644
index 00000000..baeb9118
--- /dev/null
+++ b/docs/api-reference/webhooks/get.mdx
@@ -0,0 +1,26 @@
+---
+title: 'Get Webhook'
+api: 'GET /api/webhooks/{id}'
+---
+
+Fetch one webhook destination. The signing secret is never returned — only `hasSecret`. See [Webhooks](/sandboxes/webhooks).
+
+<ParamField path="id" type="string" required>
+ Destination ID (`whk_…`).
+</ParamField>
+
+<ResponseExample>
+```json 200
+{
+ "id": "whk_3f9a2c",
+ "name": "prod",
+ "url": "https://app.example.com/oc-webhook",
+ "eventTypes": ["sandbox.stopped"],
+ "sandboxId": null,
+ "enabled": true,
+ "hasSecret": true,
+ "createdAt": "2026-06-24T12:00:00Z",
+ "updatedAt": "2026-06-24T12:00:00Z"
+}
+```
+</ResponseExample>
diff --git a/docs/api-reference/webhooks/list.mdx b/docs/api-reference/webhooks/list.mdx
new file mode 100644
index 00000000..901c731f
--- /dev/null
+++ b/docs/api-reference/webhooks/list.mdx
@@ -0,0 +1,26 @@
+---
+title: 'List Webhooks'
+api: 'GET /api/webhooks'
+---
+
+List the org's webhook destinations. Soft-deleted destinations are excluded. See [Webhooks](/sandboxes/webhooks).
+
+<ResponseExample>
+```json 200
+{
+ "data": [
+ {
+ "id": "whk_3f9a2c",
+ "name": "prod",
+ "url": "https://app.example.com/oc-webhook",
+ "eventTypes": ["sandbox.stopped"],
+ "sandboxId": null,
+ "enabled": true,
+ "hasSecret": true,
+ "createdAt": "2026-06-24T12:00:00Z",
+ "updatedAt": "2026-06-24T12:00:00Z"
+ }
+ ]
+}
+```
+</ResponseExample>
diff --git a/docs/api-reference/webhooks/redeliver.mdx b/docs/api-reference/webhooks/redeliver.mdx
new file mode 100644
index 00000000..3feddffa
--- /dev/null
+++ b/docs/api-reference/webhooks/redeliver.mdx
@@ -0,0 +1,23 @@
+---
+title: 'Redeliver'
+api: 'POST /api/webhooks/{id}/deliveries/{deliveryId}/redeliver'
+---
+
+Re-send any delivery (not only dead-lettered). Re-enqueues it with a fresh retry budget; the redelivery carries the **same** `webhook-id`, so a receiver that dedupes treats it as the same message. Use it when the original never landed. See [Webhooks](/sandboxes/webhooks#deliveries).
+
+<ParamField path="id" type="string" required>
+ Destination ID (`whk_…`).
+</ParamField>
+
+<ParamField path="deliveryId" type="string" required>
+ Delivery ID (`whd_…`).
+</ParamField>
+
+<ResponseExample>
+```json 202
+{
+ "id": "whd_8c1d",
+ "status": "pending"
+}
+```
+</ResponseExample>
diff --git a/docs/api-reference/webhooks/test.mdx b/docs/api-reference/webhooks/test.mdx
new file mode 100644
index 00000000..56d4cc93
--- /dev/null
+++ b/docs/api-reference/webhooks/test.mdx
@@ -0,0 +1,21 @@
+---
+title: 'Test Webhook'
+api: 'POST /api/webhooks/{id}/test'
+---
+
+Send a synthetic `sandbox.test` event to the destination and return the result inline. It bypasses the `eventTypes` filter, is signed like a real delivery, is not retried, and does not appear in delivery history. See [Webhooks](/sandboxes/webhooks).
+
+<ParamField path="id" type="string" required>
+ Destination ID (`whk_…`).
+</ParamField>
+
+<ResponseExample>
+```json 200
+{
+ "delivered": true,
+ "responseCode": 200
+}
+```
+</ResponseExample>
+
+`delivered` is `false` with an `error` string when the endpoint didn't return `2xx`.
diff --git a/docs/api-reference/webhooks/update.mdx b/docs/api-reference/webhooks/update.mdx
new file mode 100644
index 00000000..fa842bb0
--- /dev/null
+++ b/docs/api-reference/webhooks/update.mdx
@@ -0,0 +1,46 @@
+---
+title: 'Update Webhook'
+api: 'PATCH /api/webhooks/{id}'
+---
+
+Update a destination — pause/resume, retune filters, change the URL, or rotate the secret. See [Webhooks](/sandboxes/webhooks).
+
+<ParamField path="id" type="string" required>
+ Destination ID (`whk_…`).
+</ParamField>
+
+<ParamField body="url" type="string">
+ New HTTPS endpoint (re-validated against the SSRF rules).
+</ParamField>
+
+<ParamField body="eventTypes" type="string[]">
+ Replace the event-type allow-list. Pass `null` to clear it (deliver all types).
+</ParamField>
+
+<ParamField body="enabled" type="boolean">
+ Pause (`false`) or resume (`true`) delivery.
+</ParamField>
+
+<ParamField body="secret" type="string">
+ Rotate the signing secret. A generated rotation is returned once (like create).
+</ParamField>
+
+<ParamField body="name" type="string">
+ Rename the destination.
+</ParamField>
+
+<ResponseExample>
+```json 200
+{
+ "id": "whk_3f9a2c",
+ "name": "prod",
+ "url": "https://app.example.com/oc-webhook",
+ "eventTypes": ["sandbox.stopped", "sandbox.ready"],
+ "sandboxId": null,
+ "enabled": true,
+ "hasSecret": true,
+ "createdAt": "2026-06-24T12:00:00Z",
+ "updatedAt": "2026-06-24T12:05:00Z"
+}
+```
+</ResponseExample>
diff --git a/docs/docs.json b/docs/docs.json
index 7f21929c..58836d4e 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -194,6 +194,26 @@
}
]
},
+ {
+ "group": "Webhooks",
+ "tag": "Preview",
+ "pages": [
+ "api-reference/webhooks/create",
+ "api-reference/webhooks/list",
+ "api-reference/webhooks/get",
+ "api-reference/webhooks/update",
+ "api-reference/webhooks/delete",
+ "api-reference/webhooks/test",
+ {
+ "group": "Deliveries",
+ "pages": [
+ "api-reference/webhooks/deliveries-list",
+ "api-reference/webhooks/delivery-get",
+ "api-reference/webhooks/redeliver"
+ ]
+ }
+ ]
+ },
{
"group": "Usage",
"tag": "Preview",
diff --git a/docs/sandboxes/webhooks.mdx b/docs/sandboxes/webhooks.mdx
index 9046a0cb..f7f81609 100644
--- a/docs/sandboxes/webhooks.mdx
+++ b/docs/sandboxes/webhooks.mdx
@@ -30,7 +30,7 @@ The envelope is camelCase, with top-level routing fields, your sandbox [`metadat
## Events
-Subscribe to all events, or filter with `event_types` (exact like `sandbox.stopped`, or a prefix like `sandbox.*`).
+Subscribe to all events, or filter with `eventTypes` (exact like `sandbox.stopped`, or a prefix like `sandbox.*`).
| Event | When | `event.data` |
| --- | --- | --- |
@@ -71,14 +71,14 @@ Content-Type: application/json
{
"url": "https://app.example.com/oc-webhook",
- "event_types": ["sandbox.stopped", "sandbox.ready"],
+ "eventTypes": ["sandbox.stopped", "sandbox.ready"],
"name": "prod"
}
```
</CodeGroup>
-Every destination is **signed**. If you don't pass a `secret`, OpenComputer generates one (`whsec_…`) and returns it **once** on create — store it then; it's never shown again (reads return only `has_secret`). Pass `name` (unique per org) or an `Idempotency-Key` header to make create safe to retry: the same request returns the same destination instead of a duplicate; a different config under the same `name` is rejected with `409`.
+Every destination is **signed**. If you don't pass a `secret`, OpenComputer generates one (`whsec_…`) and returns it **once** on create — store it then; it's never shown again (reads return only `hasSecret`). Pass `name` (unique per org) or an `Idempotency-Key` header to make create safe to retry: the same request returns the same destination instead of a duplicate; a different config under the same `name` is rejected with `409`.
<Tabs>
@@ -88,7 +88,7 @@ Every destination is **signed**. If you don't pass a `secret`, OpenComputer gene
| --- | --- |
| `webhooks.create(params)` | Register a destination (returns `secret` once if generated). |
| `webhooks.list()` | List destinations. |
-| `webhooks.get(id)` | Fetch one (`has_secret`, never the secret). |
+| `webhooks.get(id)` | Fetch one (`hasSecret`, never the secret). |
| `webhooks.update(id, params)` | Pause/resume (`enabled`), retune `eventTypes`, change `url`, rotate `secret`. |
| `webhooks.delete(id)` | Soft-delete — history is retained, pending deliveries canceled. |
| `webhooks.test(id)` | Send a synthetic `sandbox.test` event and return the result inline. |
@@ -102,7 +102,7 @@ Every destination is **signed**. If you don't pass a `secret`, OpenComputer gene
| `POST /api/webhooks` | Register a destination. |
| `GET /api/webhooks` | List destinations. |
| `GET /api/webhooks/:id` | Fetch one. |
-| `PATCH /api/webhooks/:id` | Pause/resume, retune `event_types`, change `url`, rotate `secret`. |
+| `PATCH /api/webhooks/:id` | Pause/resume, retune `eventTypes`, change `url`, rotate `secret`. |
| `DELETE /api/webhooks/:id` | Soft-delete (history retained). |
| `POST /api/webhooks/:id/test` | Send a synthetic `sandbox.test` event. |
@@ -163,12 +163,12 @@ Every send and its outcome — the data behind a deliveries dashboard.
</Tabs>
-A delivery moves `pending → delivering → delivered`, or `failed` (retrying) → `dead_letter` after the max attempts. Deleting a destination moves its in-flight deliveries to `canceled`. List responses are cursor-paginated: `{ data, next_cursor, has_more }`.
+A delivery moves `pending → delivering → delivered`, or `failed` (retrying) → `dead_letter` after the max attempts. Deleting a destination moves its in-flight deliveries to `canceled`. List responses are cursor-paginated: `{ data, nextCursor, hasMore }`.
```
Delivery = {
- id, destination, event_id, event_type, status, attempts, retry_count,
- last_attempt_at, response_code?, error?, created_at, updated_at, delivered_at?
+ id, destination, eventId, eventType, status, attempts, retryCount,
+ lastAttemptAt, responseCode?, error?, createdAt, updatedAt, deliveredAt?
}
```