Skip to content

Alert channels

POST /darkcrawl/v1/channels

Copy page

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

POST /darkcrawl/v1/channels

Authentication: your key as a bearer token.

Body

FieldTypeRequiredDefault
kindstring Values: webhook, slack, emailRequired
namestringRequired
digestMinutesintegerOptional0
enabledbooleanOptionaltrue
includeTextbooleanOptionalfalse
recipientsstring[] | nullOptional
urlstring | nullOptional

Request

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"}'

Response

Status 200.

Response
{
  "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

CodeStatus
BAD_REQUEST400
SECRETS_UNAVAILABLE503
BLOCKLIST_UNAVAILABLE503

What each code means, and what to do about it: 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 shows what a webhook channel is sent.