# POST /darkcrawl/v1/channels

> Create an alert channel: a webhook, a Slack address or an email list.

POST `/darkcrawl/v1/channels`

**Authentication:** your key as a [bearer token](https://darkcrawl.dev/docs/api-reference/authentication/).

## Body

| Field           | Type                                         | Required | Default |
| --------------- | -------------------------------------------- | -------- | ------- |
| `kind`          | `string` Values: `webhook`, `slack`, `email` | Required |         |
| `name`          | `string`                                     | Required |         |
| `digestMinutes` | `integer`                                    | Optional | `0`     |
| `enabled`       | `boolean`                                    | Optional | `true`  |
| `includeText`   | `boolean`                                    | Optional | `false` |
| `recipients`    | `string[] \| null`                           | Optional |         |
| `url`           | `string \| null`                             | Optional |         |

## Request

**curl**

```bash
curl -X POST https://api.darkcrawl.dev/darkcrawl/v1/channels \
  -H "Authorization: Bearer $DARKCRAWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind":"webhook","name":"Ops webhook","url":"https://hooks.example.com/darkcrawl"}'
```

**Python**

```python
import os
import requests

resp = requests.post(
    "https://api.darkcrawl.dev/darkcrawl/v1/channels",
    headers={"Authorization": "Bearer " + os.environ["DARKCRAWL_API_KEY"]},
    json={
        "kind": "webhook",
        "name": "Ops webhook",
        "url": "https://hooks.example.com/darkcrawl",
    },
    timeout=330,
)
print(resp.json())
```

**Node**

```javascript
const resp = await fetch("https://api.darkcrawl.dev/darkcrawl/v1/channels", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.DARKCRAWL_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "kind": "webhook",
    "name": "Ops webhook",
    "url": "https://hooks.example.com/darkcrawl"
  }),
  signal: AbortSignal.timeout(330000),
});
console.log(await resp.json());
```

## Response

Status `200`.

```json
{
  "id": "01K0EXAMPLECHANNEL0000000A",
  "name": "Ops webhook",
  "kind": "webhook",
  "urlHint": "https://hooks.example.com/…rawl",
  "secretHint": "whsec_…LE0=",
  "recipients": [],
  "digestMinutes": 0,
  "includeText": false,
  "enabled": true,
  "createdAt": "2026-11-26T10:00:00.000000+00:00",
  "updatedAt": "2026-11-26T10:00:00.000000+00:00",
  "lastDeliveryAt": null,
  "lastError": null,
  "secret": "whsec_EXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLE0="
}
```

## Errors

| Code                    | Status |
| ----------------------- | ------ |
| `BAD_REQUEST`           | 400    |
| `SECRETS_UNAVAILABLE`   | 503    |
| `BLOCKLIST_UNAVAILABLE` | 503    |

What each code means, and what to do about it: [Errors](https://darkcrawl.dev/docs/api-reference/errors/).

## Notes

- A webhook's reply holds its signing `secret`, once. Keep it: it cannot be read again, and `POST /darkcrawl/v1/channels/{channel_id}/secret` makes a new one. The address and the secret are stored sealed. A reply shows only `urlHint` and `secretHint`.
- The address must be `https` and public: never an onion, a private or local address, or one with user info. The name takes letters, digits, spaces and `. _ -`.
- An email channel takes `recipients`, who must be active members of your company.
- `digestMinutes` above zero batches the events of a window into one message. `includeText` is `false` unless you turn it on, and a channel then gets the type, name, address and counts, never page lines.
- Without a way to store the address, a webhook or Slack channel is `503 SECRETS_UNAVAILABLE`, and nothing is created. [Webhooks](https://darkcrawl.dev/docs/api-reference/webhooks/) shows what a webhook channel is sent.
