# Register a webhook endpoint

Source: https://docs.levelfour.ai/api-reference/webhooks/post-webhooks-endpoints


## POST /api/v1/webhooks/endpoints

### Authentication

Send `Authorization: Bearer <token>`.

### Request body

Required. Content type `application/json`.

- `url` (string, required): Webhook endpoint URL
- `event_types` (array of string, required): Event types to subscribe to
- `description` (string, nullable)

### Responses

#### 201: Successful Response

- `success` (boolean, default `true`)
- `timestamp` (date-time string)
- `data` (object, required)
  - `id` (string, required)
  - `url` (string, required)
  - `event_types` (array of string, required)
  - `description` (string, nullable)
  - `created_at` (string, nullable)

#### Errors

- `400`: Bad Request
- `401`: Authentication Error
- `403`: Authorization Error
- `404`: Not Found
- `409`: Conflict
- `422`: Validation Error
- `429`: Rate Limit Exceeded
- `500`: Internal Server Error

Body of `400`, `401`, `403`, `404`, `409`, `422`, `429`, `500`:

- `success` (`false`, required)
- `error` (object, required)
  - `code` (string, required)
  - `message` (string, required)
  - `details` (any)
- `timestamp` (date-time string, required)
