API reference
3 endpoints, served at https://orbitwrite.com/api/v1. Each one lists the credentials it accepts, its parameters and every response it can give.
The bot a channel must have as an administrator (with Post Messages) before POST /integrations/telegram/channels can connect it, plus deep links that add it.
An API key or OAuth access token as a bearer token, or a signed-in session.
200objectThe bot
botTelegramBotRequiredusernamestringRequiredThe bot's @name, without the @.
addToChannelUrlstringRequiredOpens Telegram's picker to add the bot to a channel as an administrator, with Post Messages pre-selected.
addToGroupUrlstringRequiredOpens Telegram's picker to add the bot to a group.
curl -X GET "https://orbitwrite.com/api/v1/integrations/telegram/bot" \
-H "Authorization: Bearer $ORBITWRITE_API_KEY"{
"bot": {
"username": "OrbitwriteBot",
"addToChannelUrl": "string",
"addToGroupUrl": "string"
}
}Checks a Telegram channel is connectable — it exists, the bot is in it and can post — and returns the verification code its description must carry before POST /integrations/telegram/channels will connect it. Refuses exactly what the connect would, with the same messages. Requires account:connect.
An API key or OAuth access token as a bearer token, or a signed-in session.
organizationIdstringSession callers only — an API key already determines the workspace.
At least 1 character.
chatstringRequiredThe channel to connect: @username, a t.me/username link, or the numeric chat id for a private channel. The bot must already be an administrator of the channel with the Post Messages right, and the channel's description must carry this workspace's verification code — the first attempt without it is refused with the code to add.
Between 1 and 256 characters.
200objectThe channel is connectable; here is its code
verificationTelegramChannelVerificationRequiredchatobjectRequiredtitlestringRequireddisplayHandlestringRequiredtypestringRequired"group""supergroup""channel"verificationCodestringRequiredAdd this to the channel's description, then call POST /integrations/telegram/channels. It can be removed once the channel is connected.
verifiedbooleanRequiredWhether the description already carries the code.
curl -X POST "https://orbitwrite.com/api/v1/integrations/telegram/channels/verification" \
-H "Authorization: Bearer $ORBITWRITE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chat": "string"
}'{
"verification": {
"chat": {
"title": "string",
"displayHandle": "string",
"type": "group"
},
"verificationCode": "orbitwrite-verify-0123456789abcdef0123",
"verified": true
}
}Adds a Telegram channel or group to the workspace's channels, so posts can be published to it. Telegram has no OAuth flow: a person adds the bot (see GET /integrations/telegram/bot) to the channel as an administrator in Telegram itself, and this call names it. The bot's presence and its Post Messages right are both verified, and the channel's description must carry this workspace's verification code — the bot is shared by every workspace, so its presence proves nothing about who controls the channel. The first attempt without the code is refused with a 400 whose message carries the code to add. Requires account:connect.
An API key or OAuth access token as a bearer token, or a signed-in session.
organizationIdstringSession callers only — an API key already determines the workspace.
At least 1 character.
chatstringRequiredThe channel to connect: @username, a t.me/username link, or the numeric chat id for a private channel. The bot must already be an administrator of the channel with the Post Messages right, and the channel's description must carry this workspace's verification code — the first attempt without it is refused with the code to add.
Between 1 and 256 characters.
200ConnectTelegramChannelResultThe channel is connected
channelConnectedTelegramChannelRequiredidstringRequireddisplayHandlestringRequiredcreatedbooleanRequiredrestoredbooleanRequiredbecamePrimarybooleanRequiredcurl -X POST "https://orbitwrite.com/api/v1/integrations/telegram/channels" \
-H "Authorization: Bearer $ORBITWRITE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chat": "string"
}'{
"channel": {
"id": "string",
"displayHandle": "string",
"created": true,
"restored": true,
"becamePrimary": true
}
}