For developers
Bots API
A bot writes into a group for you: the weather each morning, a build that finished, who is on call. You make one on your account page, add it to a group you run, and your program sends messages with one HTTP call. It works from anything that can make a request: a script, a scheduled job, a workflow tool.
A message can be plain words, or made of components the app draws itself: formatted text, charts, tables, polls, events, timers and cards of people.
A bot only writes. It can’t read the conversation, and nothing reaches your program when someone writes or mentions it. See what isn’t there yet.
Quick start
- On your account page, under Bots, make a bot: a name and a handle. You can give it a picture and a line about what it is for.
- Add it to a group. You have to be the group’s owner or one of its admins. Everyone in the group sees a line saying you added it. The group’s id appears under the bot once it is in.
- Make a key with “May send” ticked, and copy it. It is shown once.
- Send a message:
curl -X POST https://strong-bulldog-554.eu-west-1.convex.site/api/v1/messages \
-H "Authorization: Bearer $SKRAFA_KEY" \
-H "Content-Type: application/json" \
-d '{"conversation": "j57a2b3c4d5e6f7g8h9j0k1m2n3p4q5r", "text": "Sun and 14 degrees today"}'The answer is 201 with the new message’s id, and the message is in the group, from your bot.
{ "id": "k17d9x2m4q8r6t0v3w5y7z1a2b3c4d5e" }Keys
Every call carries one of the bot’s keys as a bearer token. A key starts with skb_.
Authorization: Bearer skb_...- A key is shown once, when you make it. We keep only a fingerprint of it, so we can’t show it again. If you lose it, revoke it and make another.
- Keep it on a server. Whoever has the key can write as your bot in every group it is in. Don’t put it in an app, a web page or a repository.
- A key has rights.
writelets it send messages.readis for reading, which bots can’t do yet: a key with onlyreadcan ask who it is and where the bot is, and nothing else. - Revoking is immediate. A bot can have up to 5 keys, so you can replace one without a gap: make the new one, switch your program over, revoke the old.
Endpoints
Everything is under https://strong-bulldog-554.eu-west-1.convex.site/api/v1. Requests and answers are JSON.
GET /me
Which bot the key belongs to. A quick way to check a key works.
curl https://strong-bulldog-554.eu-west-1.convex.site/api/v1/me -H "Authorization: Bearer $SKRAFA_KEY"{ "id": "kn7f3h5j8k2m4p6q9r1s3t5v7w9x1y2z", "name": "Weather", "handle": "weather" }GET /conversations
The groups the bot is in, which are the places it can send to. Use an id from here as conversation when you send.
curl https://strong-bulldog-554.eu-west-1.convex.site/api/v1/conversations -H "Authorization: Bearer $SKRAFA_KEY"{ "conversations": [{ "id": "j57a2b3c4d5e6f7g8h9j0k1m2n3p4q5r", "name": "Football" }] }POST /messages
Sends a message as the bot. Needs a key with write.
| Field | Type | What it is |
|---|---|---|
conversation | string | The id of a group the bot is in. |
text | string | Up to 4,000 characters. On its own, it is the message. With blocks, it is what stands in for them in a notification and in the list of conversations; leave it out and one is made from the blocks. |
blocks | array | 1 to 12 components, drawn one under the other. See Components. |
Send text, blocks, or both. The answer is 201 with the message’s id.
curl -X POST https://strong-bulldog-554.eu-west-1.convex.site/api/v1/messages \
-H "Authorization: Bearer $SKRAFA_KEY" \
-H "Content-Type: application/json" \
-d '{
"conversation": "j57a2b3c4d5e6f7g8h9j0k1m2n3p4q5r",
"text": "This week in the gym",
"blocks": [
{ "type": "text", "text": "## This week\n**Three sessions** done, one to go." },
{ "type": "chart", "title": "Minutes trained", "unit": "min",
"labels": ["Mon", "Tue", "Wed"], "values": [45, 0, 60] },
{ "type": "poll", "question": "Saturday session?", "options": ["10:00", "12:00"] }
]
}'Components
Components are drawn by the app itself, the same way for everyone, on a phone and in the browser. Nothing you send is run, and nothing is shown as HTML: there is no markup to escape and no way to send a script. A component the app can’t draw is turned away when you send it, with which one and why (see Errors).
Text
Words, with a little formatting.
{ "type": "text", "text": "## Today\n**Sun** and 14 degrees. [The forecast](https://example.com)" }| Field | Type | What it is |
|---|---|---|
text | string | 1 to 4,000 characters of light Markdown. |
The Markdown it takes: # Heading and ## Heading, - lists and 1. lists, **bold**, *italic*, `code`, and [links](https://…). A link has to start with http:// or https://. Anything else is shown as you wrote it.
Chart
Numbers as bars or as a line, each over what it is of.
{ "type": "chart", "kind": "line", "title": "Highs this week", "unit": "°C",
"labels": ["Mon", "Tue", "Wed", "Thu", "Fri"], "values": [12, 14, 9, 11, 15.5] }| Field | Type | What it is |
|---|---|---|
kind | "bar" or "line" | Optional; "bar" if left out. Bars stand on zero. A line is drawn between its lowest and highest number. |
labels | string[] | What each number is of. 1 to 24, each up to 40 characters. |
values | number[] | As many as there are labels. Negative numbers are fine. |
title | string | Optional. Up to 160 characters. |
unit | string | Optional: what the numbers are in. Up to 12 characters. |
With up to 8 numbers each one is written under its bar or point. With more, only some of the labels are shown.
Table
{ "type": "table", "columns": ["Day", "Wind"], "rows": [["Mon", "5 m/s"], ["Tue", "12 m/s"]] }| Field | Type | What it is |
|---|---|---|
columns | string[] | The headings. 1 to 8. |
rows | string[][] | Up to 40 rows, each with a cell for every column. A cell is up to 300 characters. |
Poll
A question people answer in the app. Everyone in the group sees how it stands. Your bot doesn’t: it can’t read the answers.
{ "type": "poll", "question": "Run on Saturday?", "options": ["Yes", "No", "Maybe"], "multiple": false }| Field | Type | What it is |
|---|---|---|
question | string | Up to 160 characters. |
options | string[] | 2 to 12 answers, each up to 160 characters. |
multiple | boolean | Optional: whether more than one may be picked. |
Event
Something happening at a time, which people say whether they are coming to.
{ "type": "event", "title": "Saturday run", "start": "2026-12-05T10:00:00Z",
"end": "2026-12-05T11:00:00Z", "place": "Laugardalur" }| Field | Type | What it is |
|---|---|---|
title | string | Up to 160 characters. |
start | time | When it starts. |
end | time | Optional. Not before the start. |
place | string | Optional. Up to 160 characters. |
A time is ISO 8601 with its zone (2026-12-05T10:00:00Z or 2026-12-05T10:00:00+01:00), or milliseconds since 1970. Each person sees it in their own time zone. A time without a zone is turned away, since there is no telling whose clock it is on.
Timer
A countdown, ticking on everyone’s screen.
{ "type": "timer", "label": "Until kick-off", "minutes": 30 }| Field | Type | What it is |
|---|---|---|
minutes | number | How long from now. Or: |
until | time | The moment it counts down to. |
label | string | Optional. Up to 160 characters. |
Person
A card of someone in the group: their picture, name and handle. Tapping it opens their page. Use it to point at someone: whose turn it is, who scored.
{ "type": "person", "handle": "anna_sig" }| Field | Type | What it is |
|---|---|---|
handle | string | Their handle, with or without the @. |
It has to be someone in that group. Nothing about them is sent with the message, only who: each reader’s app shows the person as that group knows them, with the nickname they have there.
Errors
A call that is turned away answers with a status and a body that says why, in words meant to be read:
{
"error": {
"code": "bad_blocks",
"message": "blocks[1] isn't a chart the app can draw: check its fields and their lengths."
}
}| Status | Code | What happened |
|---|---|---|
| 400 | bad_request | The body isn't JSON, or has no conversation, or neither text nor blocks, or the text is too long. |
| 400 | bad_blocks | A component can't be drawn. The message says which, by its place in the list, and why. |
| 401 | invalid_key | No key, or one that isn't a bot's, or one that has been revoked. |
| 403 | missing_scope | The key isn't allowed to do this: sending needs write. |
| 404 | no_such_conversation | The bot isn't in a group with that id. Said the same whether or not the group exists. |
| 409 | try_again | The group changed while the message was being sent. Send it again. |
| 429 | rate_limited | Too many messages. The Retry-After header says how many seconds to wait. |
| 503 | not_set_up | Bots aren't running on our side right now. |
Go by the status and the code. The message is for you to read, and its wording may change.
Limits
| What | How much |
|---|---|
| Messages into one group | 10 a minute for each bot, whichever key it uses |
| Messages with one key | 30 a minute, and 2,000 a day |
| Bots | 5 for each person |
| Keys | 5 for each bot |
| A message | 4,000 characters of text, 12 components |
A minute is a minute of the clock and a day is a UTC day: the count starts again when it turns. Over a limit the answer is 429 with a Retry-After header in seconds. Wait that long and send again; don’t retry in a loop.
The limits are there so that a bot with a bug can’t flood a group. If yours needs more, a group chat is probably not where its output belongs: send a summary.
What a bot can see
Messages in Skrafa are end-to-end encrypted: they are readable only on the devices of the people in a conversation. A bot fits into that like this:
- It can’t read the group. No message is encrypted for it, so there is nothing for it, or for us, to read. Adding a bot lets nobody read a conversation who couldn’t before.
- What it sends passes through our servers. Your program sends us the message as written. We encrypt it for the people in the group and store only that. We don’t keep or log the words.
- The group can see it is a bot. It is marked as one, a line in the conversation says who added it, and its page says whose it is and that it reads nothing. Whoever runs the group can take it out.
- Its name, picture and description aren’t encrypted, like your own name and picture. They are shown to the groups it is in.
The Privacy Policy says the same at more length.
Examples
The weather each morning (JavaScript)
Fetches a forecast and sends today’s high with a chart of the week. Needs Node 18 or later, and nothing installed.
// weather.mjs: the next five days in Reykjavik, each morning.
// Run it with: SKRAFA_KEY=skb_... SKRAFA_GROUP=... node weather.mjs
const forecast = await fetch(
"https://api.open-meteo.com/v1/forecast?latitude=64.15&longitude=-21.94" +
"&daily=temperature_2m_max&timezone=auto&forecast_days=5",
).then((response) => response.json());
const days = forecast.daily.time.map((day) =>
new Date(day).toLocaleDateString("en-GB", { weekday: "short" }),
);
const highs = forecast.daily.temperature_2m_max;
const sent = await fetch("https://strong-bulldog-554.eu-west-1.convex.site/api/v1/messages", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SKRAFA_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
conversation: process.env.SKRAFA_GROUP,
text: `${Math.round(highs[0])} degrees today`,
blocks: [
{ type: "text", text: `**${Math.round(highs[0])} degrees** today.` },
{ type: "chart", kind: "line", title: "Highs this week", unit: "°C",
labels: days, values: highs },
],
}),
});
if (!sent.ok) {
const { error } = await sent.json();
throw new Error(`${sent.status} ${error.code}: ${error.message}`);
}Running it on a schedule
Anything that runs a command at a time will do: cron, a scheduled function, a workflow. Keep the key in the scheduler’s secrets, not in the file.
# .github/workflows/weather.yml: every morning at 07:00 UTC.
on:
schedule:
- cron: "0 7 * * *"
jobs:
send:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: node weather.mjs
env:
SKRAFA_KEY: ${{ secrets.SKRAFA_KEY }}
SKRAFA_GROUP: ${{ vars.SKRAFA_GROUP }}A build that finished (Python)
Uses only the standard library.
# build_done.py: say in the group that a build finished.
import json, os, urllib.request
request = urllib.request.Request(
"https://strong-bulldog-554.eu-west-1.convex.site/api/v1/messages",
method="POST",
headers={
"Authorization": f"Bearer {os.environ['SKRAFA_KEY']}",
"Content-Type": "application/json",
},
data=json.dumps({
"conversation": os.environ["SKRAFA_GROUP"],
"blocks": [
{"type": "text", "text": "**Build 412** passed in 3 min 20 s."},
{"type": "table", "columns": ["Suite", "Result"],
"rows": [["Unit", "142 passed"], ["End to end", "18 passed"]]},
],
}).encode(),
)
with urllib.request.urlopen(request) as response:
print(json.load(response)["id"])Not there yet
- Mentions and webhooks. A bot can’t be told when someone mentions it, so it can’t answer. This is planned. When it comes, a bot will only ever be told about what a person wrote, never what another bot sent, so that bots can’t set each other off.
- Reading. A bot can’t read messages, poll results or who is coming to an event.
- Pictures. A bot can’t send one.
- Conversations between two people. A bot can only be added to a group.
The API is new and will grow. The version in its address (/api/v1) is there so that later changes needn’t break what you have built.