Reference
Keys marked ? may be left out; a key left out is its default (no value, false, an empty list,
an empty text, 0). Ids are lowercase GUIDs; times are microseconds since 1970, UTC.
Frames Woosh sends
Section titled “Frames Woosh sends”| Frame | Shape | |
|---|---|---|
| ready | {"t":"ready","v":2,"id","s","g?","e?","replay","silence","retry","media","gateway?","slices","budget"} |
The line |
| numbered event | {"c":<group>,"n":<number>,"t":<name>,"d":{…}} |
Frames |
| unnumbered event | {"t":<name>,"d":{…}} |
|
| answer | {"r":<i>} or {"r":<i>,"v":…} |
Calls and answers |
| refused | {"r":<i>,"e":"refused","why":<why>,"w":<words>} |
Error codes |
| a form’s value refused | {"r":<i>,"e":"refused","why":"field","field":<name>,"rule":<rule>,"limit?","w":<words>} |
to a person’s app (The rules) |
| limited | {"r":<i>,"e":"limited","budget":<budget>,"w":<words>,"wait":<ms>} |
|
| failed | {"r":<i>,"e":"failed","w":<words>} |
|
| ping | {"t":"ping"} |
after 15 seconds of nothing else |
| move | {"t":"move"} |
Moving |
Frames a wisp sends
Section titled “Frames a wisp sends”| Frame | Shape | |
|---|---|---|
| hello | {"t":"hello","v":2,"r?","e?","a","f":1,"slice?"} |
The line |
| call | {"i":<number>,"t":<name>,"d":{…}} |
i from 1 to 2,147,483,647; one frame a message, at most 64 KB |
| moved | {"t":"moved"} |
Moving |
Events a wisp hears
Section titled “Events a wisp hears”All numbered, on the wisp’s own group.
| Event | Grant | d |
|
|---|---|---|---|
command |
always | server, channel, id, user, name?, avatar?, command, options?, expires |
Commands |
act |
always | server, channel, message, id, user, name?, avatar?, kind (press, menu, tally or form), action, value?, values? (a form’s answers), on? (a tally’s: always there, true or false), expires |
Presses, Forms |
server |
always with new; shape for other changes |
id, name, icon?, owner, unread?, new?: the server alone |
Always |
grants |
always | server, hears?, does?, everywhere? or channels? (one of the two always there; channels empty once every channel it named was deleted), permissions? (by name): whole, after server with new and each time it changes |
Always |
server.gone |
always | id, why (removed, kicked, banned, deleted), name? |
Always |
channel |
shape |
id, server, name, type?, new? |
shape |
channel.gone |
shape |
id, server |
|
layout |
shape |
server, nodes? |
|
roles |
shape |
server, roles |
|
emoji |
shape |
id, server, name, url, serverName |
|
emoji.gone |
shape |
id, server |
|
member |
members |
server, user, name?, avatar?, avatarColor?, banner?, bannerColor?, status?, flags?, joined, roleIds? |
members |
member.roles |
members |
server, user, roleIds? |
|
member.gone |
members |
server, user |
|
message |
messages |
server, id, channel, parent?, author, name?, avatar?, text?, at, edited?, reply?, files?, imported?, card?, run? |
messages |
message.edit |
messages |
server, id, channel, parent?, text?, files?, edited?, card?, run? |
|
message.gone |
messages |
server, id, channel, parent? |
|
reaction |
messages |
server, message, channel, parent?, emoji, user, name?, on? |
A line’s parts: reply is id, author?, name?, text?, files? (id alone: that line is
gone); each of files (1 to 10) is id,
url, name?, type?, mb?, w?, h?, expires?; run is id, user, name?,
command? (left out on an answer to a press); imported is the name the line’s author had in
the app it was brought over from.
Calls a wisp makes
Section titled “Calls a wisp makes”| Call | d |
Answer | |
|---|---|---|---|
commands |
commands: the whole list, up to 50 |
ack. Sent each time your wisp starts; the same list again changes nothing, and a new one at most once every 15 seconds | Sending them |
respond |
to (a run or a press), as (line, aside or update), text? (up to 4,000), and one of card?, patch? (update of a line’s card) or form? (aside or update) |
v: the line’s id, the aside’s, or the id of what changed |
Commands, Presses, Forms |
send |
channel, text?, card?, replyTo?, parent?, sendId |
v: the line’s id |
send |
edit |
message, and at least one of text?, card? or patch?: only what it names changes |
ack | edit |
card.live |
message (its own line with a card) and card or patch; or aside (one of its private cards, while Woosh keeps it) and a whole card |
ack | Live frames |
delete |
message |
ack | delete |
react |
message, emoji, parent?, on? |
ack | react |
roles |
server, user, add?, remove? |
ack | roles |
kick |
server, user |
ack | kick and ban |
ban |
server, user |
ack | kick and ban |
activity |
activity? (your wisp’s words, up to 1,024 characters; left out clears them) |
ack; one call every 15 seconds, and the words last two minutes | Your wisp’s words |
history |
channel (where it hears messages), before? or after? (a time) for the first page, cursor? for the next (without before or after; limit still goes with it), limit? (1 to 100) |
v: items and next?: the lines, each as it hears message, newest first going back, oldest first with after; thread replies not included |
Catching up |
members |
server (where it hears members), cursor?, limit? (1 to 1,000) |
v: items and next?: the members by user id, each as it hears member |
|
member |
server (where it hears members), user |
v: the member, as it hears member |
|
tally |
message (its own line), action, cursor?, limit? (1 to 1,000; 1,000 when left out) |
v: items and next?: each counted person’s user and at, by user id |
Tallies |
draw |
message (its own line), action, count (1 to 100) |
v: up to count people’s ids, picked at random |
A read’s next is there while more is left: pass it back as cursor for the next page. A wisp
does not send presence (Woosh keeps it for you), nor typing, read, view or follow,
which are a person’s.
Error codes
Section titled “Error codes”e |
Means | |
|---|---|---|
refused |
Woosh said no; why says why. Do not retry |
also any code you do not know |
limited |
past a budget; nothing done. Again after wait ms; budget names the one |
Budgets and limits |
failed |
it may or may not have run. Retry what is safe to repeat |
Branch on e, and on why for a refusal: a why you do not know is invalid. The words in w
are for your log and may change; write your own from why.
why |
Met by | |
|---|---|---|
invalid |
a call or a part of it breaks a rule (a card, a form, a command list, an argument): w says which |
your wisp, people’s apps |
not_found |
no such channel, line, member, wisp or command | your wisp, people’s apps |
not_granted |
outside your wisp’s grant, a channel it was not given among it | your wisp, people’s apps |
permission |
the roles of your wisp or of the person do not allow it, or the line is not theirs | your wisp, people’s apps |
unknown_call |
a call this line does not make | your wisp |
too_late |
an answer past the run’s or press’s expires |
your wisp |
answered |
a second way of answering one run or press | your wisp |
no_run |
a run or press that is not your wisp’s, or more than a minute old | your wisp |
offline |
your wisp is offline | people’s apps |
switched_off |
the action is disabled as the card shows now |
people’s apps |
gone |
a private card or a form Woosh no longer keeps, or someone else’s | people’s apps, and your wisp framing a private card Woosh no longer keeps |
sent |
the form’s sending waits for your wisp’s answer | people’s apps |
field |
a form’s value: with field (its name), rule and limit? (The rules) |
people’s apps |
What people’s apps meet never reaches your wisp: a run or press refused stops there. A check a
person would meet answers your wisp as it would them, permission or not_found, with a
person’s words in w, such as “Missing permission: KickMembers.”.
budget |
Past |
|---|---|
calls |
your line’s calls a second |
serverCalls |
the calls about one server a second |
channelLines |
the lines into one channel a second |
edits |
the edits and frames of one line or private card a second |
commands |
a new list of commands, one every 15 seconds |
activity |
your wisp’s words, one call every 15 seconds |
person |
a person’s own 3 runs and presses a second: their app, never your wisp |
Close codes
Section titled “Close codes”| Code | What to do | |
|---|---|---|
| 4426 | version |
stop |
| 4401 | unauthorized |
a new token, then again at once; if a second 4401 follows, back off |
| 4403 | revoked |
stop |
| 4429 | retry=<s> |
wait the seconds named |
| 1013 | retry=<s> |
wait the seconds named |
| 1012 | restart |
come back at once |
| 1011 | connect failed |
back off; check the slice |
| 1000 | moved |
nothing |
The details are on The line.
What people’s apps hear
Section titled “What people’s apps hear”Not on your line, but what your calls become:
| Frame | To | |
|---|---|---|
message with card and run |
the people looking at the channel | your line, with who ran which command above it |
aside |
the person alone, unnumbered | id, channel, author (your wisp), name?, avatar?, to?, text (yours, or the words Woosh writes), card? or form? (without its value), at: a private answer, kept nowhere; the same id again replaces it |
card.live |
the people looking, unnumbered | id, channel, parent?, card or patch: a frame of your card |
card.counts |
the people looking, unnumbered | id, channel, parent?, counts: every tally on the card by its name, 0 for one nobody pressed, at most once a second while people press, merged onto the card on screen |
form.gone |
the person alone, unnumbered | id: the form was answered away, or turned into a card or words, so it can no longer be sent: its sheet closes and its row goes |
commands |
the server | server, at: its commands changed. Your wisp does not hear it |
When a person loads a channel’s lines, each line with a card carries tallied: the names of its
tallies that count them, so their app shows what they pressed.
https://api.woosh.no, with Authorization: Bearer <token>. JSON keys in camelCase.
| Route | Who | |
|---|---|---|
POST /api/auth/login |
you | username (or your email) and password: answers your own token |
POST /api/oauth/token |
the wisp, with its id and secret | an hour’s token, and the line to open. At most 120 requests a minute from one address. Refusals: 400 unsupported_grant_type, 401 invalid_client (with error_description when Woosh suspended the wisp), 429 |
POST /api/wisps |
its owner | make one: answers the wisp and its secret, shown once |
GET /api/wisps |
its owner | your wisps |
PATCH /api/wisps/{id} |
its owner | change its name, description, asks, slices or listed (on the marketplace, wisp.woosh.no) |
POST /api/wisps/{id}/avatar |
its owner | its picture: one file, a PNG, JPEG, WebP or GIF; answers the wisp |
POST /api/wisps/{id}/secret |
its owner | a new secret; the old one’s lines close with 4403 |
DELETE /api/wisps/{id} |
its owner | delete it: it leaves every server it is in, its lines close with 4403, and its name is free again; answers 204 |
GET /api/wisps/{id}/commands |
its owner | the commands the wisp last sent on its line, which alone sets them |
GET /api/wisps/{id} |
anyone signed in | what the approval shows: who made it, its reach, all it asks for |
POST /api/servers/{id}/wisps |
an Administrator | add a wisp with what is approved: answers the wisp as the server holds it, with asksMore |
GET /api/servers/{id}/wisps |
an Administrator | the server’s wisps, each with what it was given, extra (from role settings), everywhere, all it asks for, and asksMore: what it newly asks for that the admins have not seen |
PATCH /api/servers/{id}/wisps/{wisp} |
an Administrator | change a grant; "seen": true marks what it newly asks for as seen |
DELETE /api/servers/{id}/wisps/{wisp} |
an Administrator | take a wisp out: answers 204 |
GET /api/servers/{id}/commands |
any member | the server’s commands, for the picker: each wisp’s wisp, name, avatarUrl, channels (null: every channel) and commands |
POST /api/wisps/files |
the wisp, with its own token | a picture for its cards: answers its url (Pictures) |
A wisp’s token reaches only POST /api/oauth/token and POST /api/wisps/files. Everything else
it does and reads is a call on its line. A REST refusal answers 403, 404 or 409 with
{"error": "<words>", "traceId": "…"}. A body Woosh cannot read answers 400 (or 415 for the
token route sent as something other than a form), a wrong sign-in 401, and too many requests
429. The token route answers {"error": "invalid_client"} or {"error": "unsupported_grant_type"}, and a picture past two a second answers 429 with Retry-After.
A wisp’s install link is https://web.woosh.no/wisp/<id>: it opens Woosh’s approval, where an
admin adds it to a server (Quick start).
Card blocks
Section titled “Card blocks”A card is color? (#rrggbb) and blocks: at most 40 parts, 4,000 characters and 8 KB.
| Block | Holds |
|---|---|
text |
text (with marks), size?, tone? |
fields |
fields: 1 to 10 of name (1 to 256 characters) and value (1 to 1,024) |
grid |
rows: 1 to 5 rows of 1 to 5 cells, each one of text, emoji, or url and alt; tone?; action? with value? and disabled? |
media |
url, alt, size? (small, normal or large) |
gallery |
items: 2 to 10 of url, alt |
section |
text, and media or action beside it (not both), tone? |
progress |
value, max, label?, tone? |
actions |
actions: 1 to 5, each action, label, kind (press, menu with its choices, tally or link), tone?, disabled? |
pages |
pages: 2 to 10 of label, blocks |
divider |
nothing |
Any block or cell may carry a key for patches. The whole model is on Cards.
A form is action, title, text?, fields (1 to 10), submit?, notice?, value? (kept by
Woosh, never shown) and errors?: at most 4,000 characters and 8 KB.
Field kind |
Holds, beside name, label, description?, required?, prefill? |
Its answer |
|---|---|---|
text |
lines? (1 to 10), min?, max? (characters, up to 4,000) |
text |
number |
min?, max?, whole? (and then whole min and max) |
a number |
member |
the member’s id | |
channel |
the channel’s id | |
role |
the role’s id | |
choice |
choices (1 to 25 of value, label), pick? |
its value, or a list of values where pick is above 1 |
toggle |
true or false, always there; with required, true |
|
time |
min?, max? (times, on a whole minute) |
a time on a whole minute, in microseconds |
The person’s app sends it with act: message (the form’s id), action, values, wisp and
channel. The whole model is on Forms, and every rule as cases in
/forms/rules.json.