CentralCSP
APIAlerts

Update an alert channel

Changes a channel's name, destination, or enabled state. Leave url, secret, botToken, chatId, or to out to keep what is stored. A channel switched off after repeated delivery failures is cleared and starts fresh when you enable it again.

Requires the manager role on the website and the alerting plan feature.

PATCH
/v1/workspaces/{workspaceId}/websites/{websiteId}/alerts/channels/{channelId}

Authorization

AuthorizationBearer <token>

An OpenID Connect access token issued by Keycloak, acting as the signed-in user.

In: header

Path Parameters

workspaceId*string
websiteId*string
channelId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

name?string

Display name for the channel.

Length1 <= length <= 255
url?string

An https URL on a public host. It is checked again on every send, and never returned.

Length1 <= length <= 2048
secret?string

Shared secret used to sign each delivery, so the receiver can check it came from us. Stored and never returned.

Length8 <= length <= 255
botToken?string

The bot's token from @BotFather, like 1234567890:AA…. Stored and never returned.

Length1 <= length <= 255
chatId?string

The chat to notify: a numeric chat or group id (groups are negative), or a public channel's @username. The bot must be a member of the chat.

Length1 <= length <= 64
to?array<>

Between 1 and 10 addresses to notify.

Items1 <= items <= 10
enabled?boolean

Enabling a channel that was switched off after failures resets its failure count.

Response Body

application/json

curl -X PATCH "https://api-next.centralcsp.com/v1/workspaces/string/websites/string/alerts/channels/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "workspaceId": "string",  "websiteId": "string",  "name": "Security channel",  "type": "string",  "configPreview": "https://hooks.slack.com/…AbCd",  "hasSecret": true,  "emailRecipients": [    "string"  ],  "enabled": true,  "disabledReason": "string",  "consecutiveFailures": 0,  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}