> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Register a new webhook

> Register a new webhook

### Path parameters

<ParamField path="tenant_id" type="string" required>
  Tenant identifier
</ParamField>

### Request body

`object`

<ParamField body="source" type="string" required />

<ParamField body="topic" type="string" required />

<ParamField body="url" type="string" />

### Response

`object`

<ResponseField name="received" type="boolean" required />

<ResponseField name="webhookId" type="string (uuid)" />

### Status codes

| Code  | Meaning            |
| ----- | ------------------ |
| `201` | Webhook registered |
| `400` | Invalid request    |
| `401` | Unauthorized       |
| `404` | Tenant not found   |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.sync.stateset.com/v1/tenants/{tenant_id}/webhooks/register' \
    --header 'x-stateset-api-key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "source": "string",
    "topic": "string",
    "url": "https://example.com/webhooks/stateset"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "received": true,
    "webhookId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  }
  ```
</ResponseExample>
