DocsApps and developers
Web API
Read conversations and post as your app’s bot, with a bot token, over plain HTTPS and JSON.
| Setting | Value |
|---|---|
| Base address | https://www.kinnlo.com/api/bot/v1 |
| Sign-in | Authorization: Bearer knb_… |
| Format | JSON in, JSON out |
| Rate | 120 requests a minute per token |
Use the www address. kinnlo.com redirects to it, and most HTTP clients drop the Authorization header when they follow a redirect to another host.
Bot tokens
Make one on the app’s Bot tokens tab with Make a token. A token is knb_ and 40 letters or digits. It is shown once: Kinnlo keeps only a fingerprint of it, and lists it by its first ten characters. Tokens made before Kinnlo took its name start hvb_ and still work.
An app can have 10 working tokens. Revoke stops one at once.
curl https://www.kinnlo.com/api/bot/v1/auth.test \
-H "Authorization: Bearer knb_…"curl -X POST https://www.kinnlo.com/api/bot/v1/messages \
-H "Authorization: Bearer knb_…" \
-H "Content-Type: application/json" \
-d '{"channelId": "…", "text": "Deploy *finished* on main"}'What a bot can see
Every public channel, and the private channels and conversations it has been added to, as a member would. It joins a public channel with channels/:id/join, or by posting there. Only a person can add it to a private channel. It never sees email addresses.
Endpoints
| Method | Path | What it does |
|---|---|---|
GET | auth.test | The app, its bot and the workspace. |
GET | channels | Every public channel, and the others the bot is in, with isMember. |
POST | channels/:id/join | Join a public channel. |
GET | channels/:id/messages | Messages, oldest first. limit (1 to 100, 30 by default) and before (a message’s seq). Answers {messages, hasMore}. |
POST | messages | Post. Body {channelId, text, blocks?, threadRootId?}. |
GET | messages/:id | One message. |
PATCH | messages/:id | Edit one of the bot’s own messages: {text, blocks}. |
DELETE | messages/:id | Delete one of the bot’s own messages. |
POST | messages/:id/reactions | Add a reaction, or take it back if it is there: {emoji}. |
GET | threads/:id | A thread’s first message and its replies: {root, replies}. |
GET | members | People, bots and agents. Email addresses are always empty. |
GET | members/:id | One member. |
GET | search | Search what the bot can read: q, and optionally channelId and limit (1 to 50, 20 by default). |
Every :id is a UUID.
Writing a message
textis Kinnlo’s formatting:**bold**,_italic_, `code`, lists and quotes.- Mention someone with
<@member id>.<!channel>and<!here>notify everyone in the conversation. - Send
blocksfor cards with buttons. With blocks alone, the text is made from them. - Posting in a public channel the bot isn’t in joins it first. Posting in a private one it isn’t in answers
404.
Errors
A refusal answers with the matching status and one shape:
{"error": {"code": "invalid-token", "message": "That token was revoked or never existed."}}| Status | code | When |
|---|---|---|
| 400 | invalid | A missing or wrong field, or a body that isn’t a JSON object. |
| 401 | invalid-token | No token, a revoked one, or one whose app was deleted. |
| 403 | forbidden | The bot is turned off, the channel is archived, or the message isn’t the bot’s own. |
| 404 | not-found | No such address, or something the bot can’t see. |
| 405 | method | The address is right but the method isn’t. |
| 413 | too-large | A body over 256 KB. |
| 429 | rate-limited | More than 120 requests in a minute. Wait for the next minute. |