> 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.

# Create a webhook endpoint

POST https://api.cadrooms.workers.dev/v1/webhook-endpoints
Content-Type: application/json

Creates a webhook endpoint to receive notifications for selected CAD ROOMS events.Provide an HTTPS URL and specify the events you want to subscribe to. Once created, the endpoint immediately begins receiving matching events from all projects in the workspace.The response includes a signing secret used to verify webhook deliveries. This secret is returned only once, when the endpoint is created. Store it securely.A workspace can have up to 10 webhook endpoints. Attempting to exceed this limit returns `400` with `VALIDATION_FAILED`. Delete an existing endpoint before creating another.With a session token, send `workspaceId` to name the workspace. With an API key, `workspaceId` is optional and must be the key's workspace.Required permission: Workspace owner or admin.

Reference: https://docs.cadrooms.com/api-reference/webhooks/create-webhook-endpoint

## Authentication

- `Authorization` header (bearer token, required) — An API key associated with your user account and workspace. API requests inherit your existing workspace permissions.
- `Authorization` header (bearer token, required) — The session token of a user signed in to the CAD ROOMS app. Every endpoint accepts it in place of an API key.

## Request

### Body (application/json)

This endpoint expects a WebhookEndpointCreate.

- `url` (string, required) — HTTPS URL where webhook events will be delivered, up to 2,048 characters.
- `enabledEvents` (list of enum, required) — List of events to send to this endpoint.
  - Allowed values: `contribution.created`, `revision.released`, `eco.created`, `eco.opened`, `eco.reviewed`, `eco.released`, `eco.closed`, `annotation.created`, `annotation.replied`, `annotation.resolved`, `member.added`, `member.removed`
- `workspaceId` (string, optional) — The workspace to create the endpoint in. Required with a session token. With an API key, defaults to the key's workspace.
- `description` (string, optional) — Optional description of the endpoint's purpose.

## Response

### 201

Returns the newly created webhook endpoint, including its signing secret. **Important:** Save the `secret` from this response. It is not included when listing or retrieving webhook endpoints.

- `id` (string, required) — Unique identifier for the webhook endpoint.
- `url` (string, required) — HTTPS URL where webhook events are delivered.
- `enabledEvents` (list of enum, required) — Events subscribed to by this endpoint.
  - Allowed values: `contribution.created`, `revision.released`, `eco.created`, `eco.opened`, `eco.reviewed`, `eco.released`, `eco.closed`, `annotation.created`, `annotation.replied`, `annotation.resolved`, `member.added`, `member.removed`
- `description` (string, required, nullable) — Optional description of the endpoint's purpose, or `null` if none was provided.
- `createdAt` (datetime, required) — Timestamp when the webhook endpoint was created.
- `createdBy` (User, required, nullable) — User who created the endpoint, or `null` if their account has been deleted.
- `secret` (string, required) — Signing secret used to verify the `CadRooms-Signature` header. Only returned at creation.

## Errors

### 400 Bad Request Error

The request contains invalid or missing parameters. See `details` for specific validation errors.

- `error` (ErrorError, required)

### 401 Unauthorized Error

The API key is missing, invalid, expired, or revoked.

- `error` (ErrorError, required)

### 404 Not Found Error

The requested resource does not exist or is not accessible to your account. Both cases return the same response.

- `error` (ErrorError, required)

### 429 Too Many Requests Error

The rate limit has been exceeded. Wait for the duration specified in the `Retry-After` header before retrying.

- `error` (ErrorError, required)

### 500 Internal Server Error

An unexpected server error occurred. Retry later. Include the `requestId` when contacting support.

- `error` (ErrorError, required)

## Types

### User

Represents a CAD ROOMS user.

- `id` (string, required) — Unique identifier for the user.
- `displayName` (string, required) — User's display name in the CAD ROOMS app.

### ErrorError

- `code` (string, required) — Stable error identifier for programmatic error handling. Every endpoint can return the general codes listed on the Errors page. Where a business condition applies, an endpoint returns a more specific code, documented on that endpoint.
- `message` (string, required) — Human-readable error description. May change over time.
- `requestId` (string, required) — Unique request identifier used for troubleshooting. The same value is returned in the `Request-Id` header of every response. Include this when contacting support.
- `details` (list of ErrorErrorDetailsItems, optional) — Optional. Contains field-level validation errors for `400` responses.

### ErrorErrorDetailsItems

- `field` (string, required) — Name of the request field that failed validation.
- `message` (string, required) — Description of the validation issue.

## Examples

### Example

**Response**

```json
{
  "id": "ffd0a773-c891-4288-a7fa-457e911b9537",
  "url": "https://erp.example.com/hooks/cadrooms",
  "enabledEvents": [
    "contribution.created",
    "revision.released",
    "eco.released"
  ],
  "description": "ERP sync",
  "createdAt": "2026-10-06T09:00:00Z",
  "createdBy": {
    "id": "40a078d1-1f99-459a-a09a-f21da9c5dce4",
    "displayName": "John Doe"
  },
  "secret": "3f9a7c2e1b8d4f6a9c0e2b5d7f1a3c5e"
}
```

**SDK Code**

```python Example
import requests

url = "https://api.cadrooms.workers.dev/v1/webhook-endpoints"

headers = {"Authorization": "Bearer <API key>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Example
const url = 'https://api.cadrooms.workers.dev/v1/webhook-endpoints';
const options = {method: 'POST', headers: {Authorization: 'Bearer <API key>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.cadrooms.workers.dev/v1/webhook-endpoints"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <API key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Example
require 'uri'
require 'net/http'

url = URI("https://api.cadrooms.workers.dev/v1/webhook-endpoints")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <API key>'

response = http.request(request)
puts response.read_body
```

```java Example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.cadrooms.workers.dev/v1/webhook-endpoints")
  .header("Authorization", "Bearer <API key>")
  .asString();
```

```php Example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.cadrooms.workers.dev/v1/webhook-endpoints', [
  'headers' => [
    'Authorization' => 'Bearer <API key>',
  ],
]);

echo $response->getBody();
```

```csharp Example
using RestSharp;

var client = new RestClient("https://api.cadrooms.workers.dev/v1/webhook-endpoints");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <API key>");
IRestResponse response = client.Execute(request);
```

```swift Example
import Foundation

let headers = ["Authorization": "Bearer <API key>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cadrooms.workers.dev/v1/webhook-endpoints")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Webhooks_createWebhookEndpoint_example

**Request**

```json
{
  "url": "https://erp.example.com/hooks/cadrooms",
  "enabledEvents": [
    "contribution.created",
    "revision.released",
    "eco.released"
  ],
  "description": "ERP sync"
}
```

**Response**

```json
{
  "id": "ffd0a773-c891-4288-a7fa-457e911b9537",
  "url": "https://erp.example.com/hooks/cadrooms",
  "enabledEvents": [
    "contribution.created",
    "revision.released",
    "eco.released"
  ],
  "description": "ERP sync",
  "createdAt": "2026-10-06T09:00:00Z",
  "createdBy": {
    "id": "40a078d1-1f99-459a-a09a-f21da9c5dce4",
    "displayName": "John Doe"
  },
  "secret": "3f9a7c2e1b8d4f6a9c0e2b5d7f1a3c5e"
}
```

**SDK Code**

```python Webhooks_createWebhookEndpoint_example
import requests

url = "https://api.cadrooms.workers.dev/v1/webhook-endpoints"

payload = {
    "url": "https://erp.example.com/hooks/cadrooms",
    "enabledEvents": ["contribution.created", "revision.released", "eco.released"],
    "description": "ERP sync"
}
headers = {
    "Authorization": "Bearer <API key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Webhooks_createWebhookEndpoint_example
const url = 'https://api.cadrooms.workers.dev/v1/webhook-endpoints';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <API key>', 'Content-Type': 'application/json'},
  body: '{"url":"https://erp.example.com/hooks/cadrooms","enabledEvents":["contribution.created","revision.released","eco.released"],"description":"ERP sync"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Webhooks_createWebhookEndpoint_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.cadrooms.workers.dev/v1/webhook-endpoints"

	payload := strings.NewReader("{\n  \"url\": \"https://erp.example.com/hooks/cadrooms\",\n  \"enabledEvents\": [\n    \"contribution.created\",\n    \"revision.released\",\n    \"eco.released\"\n  ],\n  \"description\": \"ERP sync\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <API key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Webhooks_createWebhookEndpoint_example
require 'uri'
require 'net/http'

url = URI("https://api.cadrooms.workers.dev/v1/webhook-endpoints")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <API key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"url\": \"https://erp.example.com/hooks/cadrooms\",\n  \"enabledEvents\": [\n    \"contribution.created\",\n    \"revision.released\",\n    \"eco.released\"\n  ],\n  \"description\": \"ERP sync\"\n}"

response = http.request(request)
puts response.read_body
```

```java Webhooks_createWebhookEndpoint_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.cadrooms.workers.dev/v1/webhook-endpoints")
  .header("Authorization", "Bearer <API key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"url\": \"https://erp.example.com/hooks/cadrooms\",\n  \"enabledEvents\": [\n    \"contribution.created\",\n    \"revision.released\",\n    \"eco.released\"\n  ],\n  \"description\": \"ERP sync\"\n}")
  .asString();
```

```php Webhooks_createWebhookEndpoint_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.cadrooms.workers.dev/v1/webhook-endpoints', [
  'body' => '{
  "url": "https://erp.example.com/hooks/cadrooms",
  "enabledEvents": [
    "contribution.created",
    "revision.released",
    "eco.released"
  ],
  "description": "ERP sync"
}',
  'headers' => [
    'Authorization' => 'Bearer <API key>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Webhooks_createWebhookEndpoint_example
using RestSharp;

var client = new RestClient("https://api.cadrooms.workers.dev/v1/webhook-endpoints");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <API key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"url\": \"https://erp.example.com/hooks/cadrooms\",\n  \"enabledEvents\": [\n    \"contribution.created\",\n    \"revision.released\",\n    \"eco.released\"\n  ],\n  \"description\": \"ERP sync\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Webhooks_createWebhookEndpoint_example
import Foundation

let headers = [
  "Authorization": "Bearer <API key>",
  "Content-Type": "application/json"
]
let parameters = [
  "url": "https://erp.example.com/hooks/cadrooms",
  "enabledEvents": ["contribution.created", "revision.released", "eco.released"],
  "description": "ERP sync"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cadrooms.workers.dev/v1/webhook-endpoints")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```