Write bots just like for Telegram: three HTTP methods, a familiar response format, long-poll. Except here the bot is a full E2E participant in a free federation.
http://your-domain:8840 (or your own nice subdomain, like api.prizrak.im).In the Prizrak app, open a chat with prizrakfather:prizrak.im (on your own server — prizrakfather:your-domain) and send /newbot. It asks for a name and a login — and issues a token.
One request — and the bot replies:
curl https://api.prizrak.im/bot<TOKEN>/getMe
# {"ok":true,"result":{"id":7,"is_bot":true,"username":"my_bot",…}}The bot can message people, post to groups and channels and receive incoming messages. Keep the token like a password; to reissue it — the /revoke command in PrizrakFather.
All methods: https://api.prizrak.im/bot<TOKEN>/MethodName (GET or POST, parameters as a query string or a JSON body). The response is always a JSON envelope:
{"ok": true, "result": …}
{"ok": false, "error_code": 401, "description": "invalid bot token"}
Information about the bot. No parameters. Handy for checking the token.
Send text — to a person, a group or a channel.
| Parameter | Description |
|---|---|
chat_id | nick:domain — a private message; !room-id… — a group or channel (the bot must be added as a member). |
text | Message text. |
curl -X POST https://api.prizrak.im/bot<TOKEN>/sendMessage \
-d '{"chat_id":"!f752e422c5088e96:prizrak.im","text":"News of the day! 🚀"}'
This is how any site, script or CRON job publishes posts to a Prizrak channel over HTTP. Add the bot to a room (PrizrakFather gave you its ID) — and post from anywhere.
Receiving incoming messages (long-poll).
| Parameter | Description |
|---|---|
offset | Acknowledgement: updates with an update_id lower than offset are removed from the server. |
limit | 1–100 (default 100). |
timeout | Long-poll in seconds, 0–30. With 0 — an immediate response. |
curl "https://api.prizrak.im/bot<TOKEN>/getUpdates?timeout=25&offset=0"
# {"ok":true,"result":[{"update_id":1,"message":{
# "message_id":"…","text":"hi, bot",
# "from":{"id":"fox:prizrak.im","username":"fox","is_bot":false},
# "chat":{"id":"fox:prizrak.im","type":"private"},"date":1766400000}}]}// Node.js ≥ 18, no dependencies
const API = 'https://api.prizrak.im/bot' + process.env.TOKEN;
let offset = 0;
while (true) {
const { result } = await (await fetch(`${API}/getUpdates?timeout=25&offset=${offset}`)).json();
for (const u of result) {
offset = u.update_id + 1;
if (u.message?.text) await fetch(`${API}/sendMessage`, { method: 'POST',
body: JSON.stringify({ chat_id: u.message.chat.id, text: 'Echo: ' + u.message.text }) });
}
}
The service bot prizrakfather:prizrak.im lives on every federation server and is created automatically.
Create a bot: it asks for a name and a login, issues a token (shown once).
A list of your bots.
Reissue the token — the old one is revoked instantly.
Delete the bot and its message queue.
A bot is an ordinary Prizrak account: your chat with it is end-to-end encrypted, over the same transport.
So the bot can work with a simple HTTP token, its keys are kept by its homeserver (as with Telegram bots). For ultra-private scenarios, use a regular account.
/revoke with PrizrakFather — the old token stops working the same second.The Bot API is included in every Prizrak homeserver and starts automatically. Bring up a server — and your PrizrakFather is already waiting for the /newbot command.
Planned: webhooks, file sending, keyboard buttons. Existing methods won't change.