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

**tenant\_id** `string` *required*

Tenant identifier

### Request body

`object`

**source** `string` *required*

**topic** `string` *required*

**url** `string`

### Response

`object`

**received** `boolean` *required*

**webhookId** `string (uuid)`

### Status codes

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

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

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.