Back to API Overview

Alert channels API

Alert channels: where agents and automations send their messages to you.

4 endpoints

Endpoints

POST
/api/v1/channels/list

List the signed-in person's OWN notification channels: where their AI agents reach them outside Serenities (approval requests, questions, failures, run reports) through a Telegram bot of their own. Takes no params. Returns rows { id, kind ("telegram"), name, isActive, lastUsedAt, createdAt, botUsername, defaultAgentId (the agent that answers plain messages sent to the bot), linked (whether the bot is linked to their Telegram chat), bindCode (always null here) }. A Telegram bot is connected by the person on the channels screen (More → Channels): they paste the token BotFather gave them there, never in the chat, and a new bot's link code is shown only there. Email alerts are not available yet (they will come later, sent from the person's own sender account). Refused while they work in someone else's workspace: they switch back to their own first.

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/channels/list \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{}'
POST
/api/v1/channels/setDefaultAgent

Choose which of the signed-in person's agents answers plain messages they send to one of their OWN Telegram bot channels, or clear the choice. Params: channelId (a Telegram channel from channels_list), agentId (an agent id from aiAgent_listSpecialists, or null for none). Only the person's own channel and own agent are accepted. Call it only when the person asks. Refused while they work in someone else's workspace. Returns { success }.

Parameters

channelIdstringrequired
agentIdstringnullrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/channels/setDefaultAgent \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "channelId": "example",
  "agentId": {}
}'
POST
/api/v1/channels/setActive

Turn one of the signed-in person's OWN notification channels on or off. A channel that is off gets no approval requests or alerts; nothing is deleted. Params: channelId (from channels_list), isActive (true or false). Call it only when the person asks, and say which channel changed. Refused while they work in someone else's workspace. Returns { success }.

Parameters

channelIdstringrequired
isActivebooleanrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/channels/setActive \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "channelId": "example",
  "isActive": true
}'
POST
/api/v1/channels/remove

Delete one of the signed-in person's OWN notification channels for good; a Telegram bot is also disconnected from Serenities. Approval requests and alerts stop going there. Param: channelId (from channels_list). Call it only when the person asks, naming the channel back to them. Refused while they work in someone else's workspace. Returns { success }. Act only on what the person named or picked.

Parameters

channelIdstringrequired

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/channels/remove \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "channelId": "example"
}'