Uptime API › Notification channels
Create a notification channel
Creates a channel. Link it to monitors afterwards with
POST /api/v1/monitors/{id}/channels/{chId}.
type |
config |
|---|---|
chat |
chat_channel_id: one of the IDs from GET /api/v1/notification-channels/chat-apps. EvoHub stores the channel's ID, name and app; any other key is ignored. |
webhook |
url: the address to POST to. secret: optional, sent back in the X-Webhook-Secret header. |
slack |
url: a Slack incoming webhook URL. Kept for existing channels; use chat for new Slack channels. |
A webhook receives a JSON body with event (triggered or
resolved), monitor_id, monitor_name, monitor_url, cause,
timestamp and, on resolved, down_duration_seconds.
Any other type, email included, is refused with 400
VALIDATION_ERROR.
The answer shows the channel as every later read will: the URL and secret are not returned.
Requires the uptime:channel:write scope.
Authorization
Request body required
namestring requiredtypestring requiredconfigobjectDepends ontype; see the table above.
Responses
201
The channel was created.
dataNotificationChannelShow NotificationChannel properties
idstringStarts withnch_.org_idstringnamestringtypestringconfigobjecturl_hoststringurl_hintstringhas_secretbooleanchat_channel_idstringchat_channel_namestringchat_channel_kindstring
created_atstring (date-time)
400
The body is not JSON (INVALID_JSON); name or type is missing
or invalid, or a chat channel has no config.chat_channel_id
(VALIDATION_ERROR); or the chat channel is not one of the
organization's (CHAT_CHANNEL_NOT_FOUND).
errorobject requiredcodestring requiredmessagestring requiredrequest_idstring
401
No API key was sent, or it is unknown, revoked or expired (UNAUTHORIZED).
errorobject requiredcodestring requiredmessagestring requiredrequest_idstring
403
The key lacks the scope this endpoint needs (FORBIDDEN).
errorobject requiredcodestring requiredmessagestring requiredrequest_idstring
409
Chat apps are not available, so a chat channel cannot be created (CHAT_NOT_AVAILABLE).
errorobject requiredcodestring requiredmessagestring requiredrequest_idstring
429
Too many requests (RATE_LIMITED). Wait for Retry-After seconds.
Retry-AfterintegerSeconds to wait before retrying.
errorobject requiredcodestring requiredmessagestring requiredrequest_idstring
500
Something went wrong on EvoHub's side (INTERNAL_ERROR). Retry later.
errorobject requiredcodestring requiredmessagestring requiredrequest_idstring
502
The organization's chat apps could not be read right now (CHAT_UNAVAILABLE). Retry shortly.
errorobject requiredcodestring requiredmessagestring requiredrequest_idstring
Example request
curl -X POST 'https://evohub.io/api/v1/notification-channels' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"name": "#ops-alerts",
"type": "chat",
"config": {
"chat_channel_id": "slack:C04ABCDEF12"
}
}'