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 itsprojectIdand affectedfiles.
- Trigger: A user contributes changes to a project. A release also creates a contribution, triggering both this event and
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, withhasMoreset totrueif 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 itsprojectId,path,revisionId, andannotationNumber.
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 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:
Example response:
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. 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:
When your endpoint receives a webhook, follow these steps:
- Read the raw request body. Preserve the original request body before parsing it as JSON, as signature verification requires the exact content received.
- Verify the signature. Validate the
CadRooms-Signatureheader to confirm that the request originated from CAD ROOMS. - Acknowledge the delivery. Promptly return a
2xxHTTP response to confirm receipt. - 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:
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:
- Extract
tandv1from theCadRooms-Signatureheader. - Construct the signed payload by combining the timestamp, a period (
.), and the raw request body:<t>.<raw body>. - Compute an HMAC-SHA256 signature using your webhook endpoint’s secret as the key.
- Compare the computed signature with
v1using a constant-time comparison. - 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
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.