# Create a webhook endpoint

`POST https://api.cademi.com.br/api/v3/webhooks`

Operation ID: `webhooks.create` · API v3

Creates a webhook endpoint that receives events for the subscribed event types.

The destination URL must use HTTPS and point to a public host on port 443, 80, or 8443. Private IP addresses and other non-public destinations are rejected before the endpoint is created. `http://localhost` is accepted only in sandbox accounts.

The response includes the signing secret. It is returned only once and cannot be retrieved again.

Required permissions: `webhooks.create`.

## Request body

Content type: `application/json`, required.

| Field | Type | Required | Description |
|---|---|---|---|
| `description` | string or null | no |  |
| `event_types` | array of string | yes |  |
| `resource_filters` | object or null | no |  |
| `url` | string (uri) | yes |  |

## Responses

### 201

Returns the newly created webhook endpoint, including its signing secret. The secret is shown only in this response.

Body: `data`: Webhook.

Fields of Webhook:

| Field | Type | Required | Description |
|---|---|---|---|
| `created_at` | string (date-time) | yes |  |
| `description` | string or null | no |  |
| `event_types` | array of string | yes |  |
| `health` | object or null | no |  |
| `id` | string | yes |  |
| `max_per_second` | integer | no |  |
| `object` | string, one of `webhook` | yes |  |
| `payload_version` | integer | no |  |
| `resource_filters` | object or null | no |  |
| `revision` | integer | yes |  |
| `secret` | string or null | no | Secret of the webhook destination. Returned only when the webhook is created or its secret is rotated, and shown only once. |
| `status` | string, one of `active`, `inactive` | yes |  |
| `timeout_ms` | integer | no |  |
| `updated_at` | string (date-time) | yes |  |
| `url` | string (uri) | yes |  |

### 401

The credential is missing, malformed, expired, or revoked.

Body: Error.

### 403

The current credentials do not have the permission required by this operation.

Body: Error.

### 422

The request body or query parameters failed validation.

Body: ValidationFailed.

Full schema: https://cademi.dev/openapi/v3.json
