CentralCSP
APIAlerts

Update an alert channel

Changes a channel's name, destination, or enabled state. Leave url, secret, botToken, chatId, or memberIds out to keep what is stored. Sending memberIds replaces the whole recipient list and accepts at most 5. 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
memberIds?array<>

The id of each membership to notify, between 1 and 5. A recipient is a member of the workspace who already has access to this website, so the alert only reaches someone who could open it in the dashboard. Their address is resolved from their profile on every send. Add another channel to reach more people.

Items1 <= items <= 5
enabled?boolean

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

Response Body

application/json

curl -X PATCH "https://example.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": [    {      "memberId": "string",      "userId": "string",      "hasAccess": true,      "email": "string",      "firstName": "string",      "lastName": "string",      "picture": "string"    }  ],  "enabled": true,  "disabledReason": "string",  "consecutiveFailures": 0,  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}