On-Call API › Slack
Set the default Slack channel
PUT/api/v1/slack/default-channel
Sets the channel every alert is posted to. channel_id is Slack's channel id
(capital letters and digits); channel_name is kept only to display it and a
leading # is dropped. An empty channel_id clears the default.
Permission (API-key scope): oncall:settings:write.
Authorization
bearerAuth(oncall:settings:write)apiKeyHeader(oncall:settings:write)
Request body required
channel_idstringchannel_namestring
Responses
200
The default channel.
dataobject requireddefault_channel_idstringdefault_channel_namestring
successboolean required
400
The body is not JSON (INVALID_REQUEST), or the channel id or name is malformed (VALIDATION_ERROR).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
401
No API key was sent, or it is unknown, revoked or expired (UNAUTHORIZED).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
403
The key lacks the scope this endpoint needs (FORBIDDEN).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
409
Slack is not connected (SLACK_NOT_CONNECTED).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
429
Too many requests (RATE_LIMITED). Wait Retry-After seconds.
Retry-AfterintegerSeconds to wait.
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
500
Something went wrong on EvoHub's side (INTERNAL_ERROR). Retry later.
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
Example request
curl -X PUT 'https://evohub.io/api/v1/slack/default-channel' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"channel_id": "C0123ABCD",
"channel_name": "#alerts"
}'