# POST /darkcrawl/v1/channels/{channel_id}/secret

> Make a new signing secret for a webhook channel.

POST `/darkcrawl/v1/channels/{channel_id}/secret`

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

## Path parameters

| Field        | Type     | Required | Default |
| ------------ | -------- | -------- | ------- |
| `channel_id` | `string` | Required |         |

## Request

**curl**

```bash
curl -X POST https://api.darkcrawl.dev/darkcrawl/v1/channels/CHANNEL_ID/secret \
  -H "Authorization: Bearer $DARKCRAWL_API_KEY"
```

**Python**

```python
import os
import requests

resp = requests.post(
    "https://api.darkcrawl.dev/darkcrawl/v1/channels/CHANNEL_ID/secret",
    headers={"Authorization": "Bearer " + os.environ["DARKCRAWL_API_KEY"]},
    timeout=330,
)
print(resp.json())
```

**Node**

```javascript
const resp = await fetch("https://api.darkcrawl.dev/darkcrawl/v1/channels/CHANNEL_ID/secret", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.DARKCRAWL_API_KEY,
  },
  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-26T11:00:00.000000+00:00",
  "lastDeliveryAt": null,
  "lastError": null,
  "secret": "whsec_EXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLEEXAMPLE0="
}
```

## Errors

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

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

## Notes

- The new `secret` is in the reply, once, and the old one stops working at once. Give the new one to your receiver first.
- Only a webhook channel has a signing secret, else `400 BAD_REQUEST`.
- An unknown id, and another company's channel, answer `404 NOT_FOUND`.
