> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cadrooms.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cadrooms.com/_mcp/server.

# Webhooks

Webhooks allow your application to receive notifications when specific events occur in CAD ROOMS without repeatedly polling the API.

When a subscribed event occurs in a project within your workspace, CAD ROOMS sends an HTTP POST request containing the event details to your registered endpoint.

You can use webhooks to automate workflows, such as synchronizing released revisions with your ERP system or triggering actions when an engineering change order (ECO) is closed.

## Supported events

The following webhook events are available in v1:

* `contribution.created`
  * **Trigger:** A user contributes changes to a project. A release also creates a contribution, triggering both this event and `revision.released`.
  * **`data.object`:** The contribution, including its `projectId` and affected `files`.
* `revision.released`
  * **Trigger:** Files are released, either manually or through an ECO. Each release triggers a single event, regardless of the number of files released.
  * **`data.object`:** The released revisions, up to 100, with `hasMore` set to `true` if the release contains additional revisions.
* `eco.created`
  * **Trigger:** A new ECO is created.
  * **`data.object`:** The newly created ECO.
* `eco.released`
  * **Trigger:** An ECO is released.
  * **`data.object`:** The released ECO.
* `eco.closed`
  * **Trigger:** An ECO is closed.
  * **`data.object`:** The closed ECO.
* `annotation.created`
  * **Trigger:** An annotation is created.
  * **`data.object`:** The newly created annotation.
* `annotation.replied`
  * **Trigger:** A reply is added to an annotation.
  * **`data.object`:** The reply, including its `projectId`, `path`, `revisionId`, and `annotationNumber`.

Each webhook payload includes the associated resource in the `data.object` field.

Five more events are in preview: `eco.opened`, `eco.reviewed`, `annotation.resolved`, `member.added`, and `member.removed`. See [Webhook endpoints](/api-reference/webhooks) for their payloads.

## Register a webhook endpoint

To receive webhook events, register a publicly accessible HTTPS endpoint that accepts POST requests. Webhook endpoints are configured at the workspace level. Only workspace owners and admins can create or delete them.

Specify the endpoint URL and the events you want to subscribe to:

```bash
curl https://api.cadrooms.workers.dev/v1/webhook-endpoints \
  -H "Authorization: Bearer <apiKey>" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://erp.example.com/hooks/cadrooms",
    "enabledEvents": ["revision.released", "eco.released"],
    "description": "ERP sync"
  }'
```

Example response:

```json
{
  "id": "ffd0a773-c891-4288-a7fa-457e911b9537",
  "url": "https://erp.example.com/hooks/cadrooms",
  "enabledEvents": ["revision.released", "eco.released"],
  "description": "ERP sync",
  "createdAt": "2026-10-06T09:00:00Z",
  "secret": "3f9a7c2e1b8d4f6a9c0e2b5d7f1a3c5e"
}
```

The response includes a `secret` used to verify webhook signatures.

The secret is returned only when the endpoint is created. Store it securely, as it cannot be retrieved later.

Once registered, the endpoint immediately begins receiving subscribed events.

You can list, retrieve, and delete endpoints using the [Webhook endpoints](/api-reference/webhooks) API. To modify an endpoint, create a new endpoint and then delete the existing one. The new endpoint will have a different ID and signing secret.

## Receive webhook events

Each event is delivered as an HTTP POST request containing a JSON payload.

Example delivery:

```http
POST /hooks/cadrooms HTTP/1.1
Content-Type: application/json
CadRooms-Signature: t=1791381791,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd

{
  "id": "084b5dc1-94a3-4ebd-af28-b2e7f39e3ddb",
  "type": "eco.released",
  "createdAt": "2026-10-07T14:03:11Z",
  "data": {
    "object": {
      "id": "7f4c46a5-6b6e-409e-aec9-416bc7365c3a",
      "projectId": "356d9a6c-31e9-4d9c-ad55-de709172d893",
      "displayNumber": "ECO-2026-0014",
      "title": "Gearbox v2 housing change",
      "description": "Thicken mounting flange",
      "status": "released",
      "reasonType": "product",
      "autoRelease": false,
      "assignee": { "id": "f008611c-2eef-4880-af86-94dbc7ecf9f7", "displayName": "Jane Doe" },
      "reviewers": [
        { "user": { "id": "f008611c-2eef-4880-af86-94dbc7ecf9f7", "displayName": "Jane Doe" }, "decision": "approved" }
      ],
      "effectiveDate": null,
      "createdBy": { "id": "40a078d1-1f99-459a-a09a-f21da9c5dce4", "displayName": "John Doe" },
      "createdAt": "2026-10-01T08:12:00Z",
      "updatedAt": "2026-10-07T14:03:11Z"
    }
  }
}
```

When your endpoint receives a webhook, follow these steps:

1. **Read the raw request body.** Preserve the original request body before parsing it as JSON, as signature verification requires the exact content received.
2. **Verify the signature.** Validate the `CadRooms-Signature` header to confirm that the request originated from CAD ROOMS.
3. **Acknowledge the delivery.** Promptly return a `2xx` HTTP response to confirm receipt.
4. **Process the event.** Perform any additional work, such as updating your database or calling the CAD ROOMS API, asynchronously using a background worker or queue.

Avoid performing time-consuming operations before acknowledging the delivery, as this may trigger unnecessary retries.

## Delivery and retry behavior

### Automatic retries

If your endpoint returns a non-`2xx` response or fails to respond, CAD ROOMS automatically retries the delivery.

CAD ROOMS retries failed deliveries up to 8 times over a 4-hour period, using exponential backoff.

Each retry includes a new timestamp and signature. Deleting an endpoint stops all further delivery attempts to that endpoint.

### Duplicate events

Webhook events may be delivered more than once.

Each event has a unique `id` that remains unchanged across retries. To prevent duplicate processing, store the IDs of processed events and ignore events you have already handled.

### Event ordering

Webhook events are not guaranteed to arrive in chronological order.

If your application requires the latest state of a resource, retrieve it directly from the CAD ROOMS API rather than relying on the order of incoming events.

## Verify webhook signatures

Every webhook delivery includes a `CadRooms-Signature` header that allows you to verify the authenticity of the request.

Example header:

```
CadRooms-Signature: t=1791381791,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd
```

The header contains two values:

* **`t`:** A Unix timestamp (in seconds) indicating when the delivery was sent.
* **`v1`:** An HMAC-SHA256 signature encoded as a hexadecimal string.

### Signature verification process

To verify a webhook delivery:

1. Extract `t` and `v1` from the `CadRooms-Signature` header.
2. Construct the signed payload by combining the timestamp, a period (`.`), and the raw request body: `<t>.<raw body>`.
3. Compute an HMAC-SHA256 signature using your webhook endpoint's secret as the key.
4. Compare the computed signature with `v1` using a constant-time comparison.
5. Verify that the timestamp is within 5 minutes of your server's current time to protect against replay attacks.

Reject the request if either the signature or timestamp validation fails.

### Example: Node.js

```javascript
import { createHmac, timingSafeEqual } from "node:crypto";

export function verify(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  const expected = createHmac("sha256", secret)
    .update(`${parts.t}.${rawBody}`)
    .digest("hex");
  const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
  return fresh && timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}
```

> **Use the raw request body**
>
> Always verify the signature against the original request body before parsing or serializing it as JSON.
>
> Parsing and re-serializing JSON may alter its formatting or byte representation, causing signature verification to fail even for legitimate deliveries.