Schemas
Error
statusCodemessageA human-readable reason. Not stable, so branch on the status code.
errorfieldOn a schema 400, the first field at fault (dotted for nested fields).
InboundEvent
Decision Table
| Variant | Matching Criteria |
|---|---|
| type = object · type="command" · requires: id, channel, user +1 more | |
| type = object · type="action" · requires: id, channel, user +2 more | |
| type = object · type="message" · requires: id, channel, user +1 more |
typeidYour id for this request, unique per request. Send the same one when
you retry it. A request repeating an id seen in the last 24 hours
is answered 202 and ignored.
Where the event happened. id is your chat's id for the channel,
opaque to Hijinks. Outbound events address the channel by it. name
is its display name, when you have one.
Ids starting with dm: are reserved for the acting member's DM with
Hijinks: dm: followed by the event's own user.id, exactly. Only
action and message events may come from a DM. A dm: id on a
command, or one naming another member, is refused with 400
(field channel.id). These rules span two fields, so this schema
alone cannot express them.
The member who acted. id is your chat's id for them, opaque to
Hijinks and stable — scores and DMs follow it. name is shown in
results and leaderboards. Send it whenever you have it.
textWhat followed the command, e.g. start, start science, leaderboard. Empty is help.
RequestId
Your id for this request, unique per request. Send the same one when
you retry it. A request repeating an id seen in the last 24 hours
is answered 202 and ignored.
Channel
id^(?!dm:)[\s\S]{1,128… · requirednameUser
idnameCommandEvent
typeidYour id for this request, unique per request. Send the same one when
you retry it. A request repeating an id seen in the last 24 hours
is answered 202 and ignored.
Where the event happened. id is your chat's id for the channel,
opaque to Hijinks. Outbound events address the channel by it. name
is its display name, when you have one.
Ids starting with dm: are reserved for the acting member's DM with
Hijinks: dm: followed by the event's own user.id, exactly. Only
action and message events may come from a DM. A dm: id on a
command, or one naming another member, is refused with 400
(field channel.id). These rules span two fields, so this schema
alone cannot express them.
The member who acted. id is your chat's id for them, opaque to
Hijinks and stable — scores and DMs follow it. name is shown in
results and leaderboards. Send it whenever you have it.
textWhat followed the command, e.g. start, start science, leaderboard. Empty is help.
ActionEvent
typeidYour id for this request, unique per request. Send the same one when
you retry it. A request repeating an id seen in the last 24 hours
is answered 202 and ignored.
Where the event happened. id is your chat's id for the channel,
opaque to Hijinks. Outbound events address the channel by it. name
is its display name, when you have one.
Ids starting with dm: are reserved for the acting member's DM with
Hijinks: dm: followed by the event's own user.id, exactly. Only
action and message events may come from a DM. A dm: id on a
command, or one naming another member, is refused with 400
(field channel.id). These rules span two fields, so this schema
alone cannot express them.
The member who acted. id is your chat's id for them, opaque to
Hijinks and stable — scores and DMs follow it. name is shown in
results and leaderboards. Send it whenever you have it.
messageIdThe Hijinks message.id of the message the button was on.
actionThe button's action, echoed back untouched.
MessageEvent
typeidYour id for this request, unique per request. Send the same one when
you retry it. A request repeating an id seen in the last 24 hours
is answered 202 and ignored.
Where the event happened. id is your chat's id for the channel,
opaque to Hijinks. Outbound events address the channel by it. name
is its display name, when you have one.
Ids starting with dm: are reserved for the acting member's DM with
Hijinks: dm: followed by the event's own user.id, exactly. Only
action and message events may come from a DM. A dm: id on a
command, or one naming another member, is refused with 400
(field channel.id). These rules span two fields, so this schema
alone cannot express them.
The member who acted. id is your chat's id for them, opaque to
Hijinks and stable — scores and DMs follow it. name is shown in
results and leaderboards. Send it whenever you have it.
textreplyToThe Hijinks message.id this replies to, when your chat has replies.
EventId
^evt_[0-9A-HJKMNP-TV…Unique per event and unchanged across its retries. Dedupe on it.
MessageId
^msg_[0-9A-HJKMNP-TV…Minted by Hijinks. Keep a map from it to your chat's message id.
OutboundChannel
A channel id your bridge sent in an inbound event — or dm:<user id>
on a message.update of a message first sent by dm.create.
MessageKind
What the message is, so a bridge can special-case a few kinds and
print the rest. text is a plain message with no buttons. card
is a generic message (confirmations, errors,
celebrations, game announcements). New kinds may appear. Print
unknown ones like card.
Button
Decision Table
| Variant | Matching Criteria |
|---|---|
| type = object · requires: label, action | |
| type = object · requires: label, url |
labelactionOpaque. Echo it back untouched and never parse it.
ActionButton
labelactionOpaque. Echo it back untouched and never parse it.
Message
id^msg_[0-9A-HJKMNP-TV… · requiredMinted by Hijinks. Keep a map from it to your chat's message id.
kindWhat the message is, so a bridge can special-case a few kinds and
print the rest. text is a plain message with no buttons. card
is a generic message (confirmations, errors,
celebrations, game announcements). New kinds may appear. Print
unknown ones like card.
textChat-flavoured Markdown, ready to print: *italic*, **bold**,
`code`, [label](https://…), > quotes, fenced code blocks
and backslash escapes. A bare \n is a line break, as in most
chat tools. A strict CommonMark renderer needs hard line breaks
turned on (markdown-it breaks: true) or lines run together.
Member names and question text arrive escaped. Never empty for a
message worth showing.
Rows of buttons, top to bottom, each row left to right. Empty when there are none.
imageAn image or GIF to show with the message, or null.
awaitsReplyHijinks would like the member's next typed message to answer this
one. Offer a reply box or thread if your chat has one, and send the
answer as a message event with replyTo set. In a DM, replyTo
is optional: a message with channel: {"id": "dm:<user id>"}
answers the latest prompt waiting there.
MessageCreateEvent
id^evt_[0-9A-HJKMNP-TV… · requiredUnique per event and unchanged across its retries. Dedupe on it.
typeworkspaceThe Hijinks workspace, as shown in the dashboard.
createdAtWhen Hijinks created the event (ISO 8601, UTC).
channelA channel id your bridge sent in an inbound event — or dm:<user id>
on a message.update of a message first sent by dm.create.
MessageUpdateEvent
id^evt_[0-9A-HJKMNP-TV… · requiredUnique per event and unchanged across its retries. Dedupe on it.
typeworkspaceThe Hijinks workspace, as shown in the dashboard.
createdAtWhen Hijinks created the event (ISO 8601, UTC).
channelA channel id your bridge sent in an inbound event — or dm:<user id>
on a message.update of a message first sent by dm.create.
MessageEphemeralEvent
id^evt_[0-9A-HJKMNP-TV… · requiredUnique per event and unchanged across its retries. Dedupe on it.
typeworkspaceThe Hijinks workspace, as shown in the dashboard.
createdAtWhen Hijinks created the event (ISO 8601, UTC).
channelA channel id your bridge sent in an inbound event — or dm:<user id>
on a message.update of a message first sent by dm.create.
userA member's user.id, as your bridge sent it.
DmCreateEvent
id^evt_[0-9A-HJKMNP-TV… · requiredUnique per event and unchanged across its retries. Dedupe on it.
typeworkspaceThe Hijinks workspace, as shown in the dashboard.
createdAtWhen Hijinks created the event (ISO 8601, UTC).
userA member's user.id, as your bridge sent it.
PingEvent
id^evt_[0-9A-HJKMNP-TV… · requiredUnique per event and unchanged across its retries. Dedupe on it.
typeworkspaceThe Hijinks workspace, as shown in the dashboard.
createdAtWhen Hijinks created the event (ISO 8601, UTC).
Cursor
^\d{1,18}$A poll position. Opaque. Pass it back as after exactly as received.
OutboundEvent
Decision Table
| Variant | Matching Criteria |
|---|---|
| type = object · type="message.create" · requires: id, workspace, createdAt +2 more | |
| type = object · type="message.update" · requires: id, workspace, createdAt +2 more | |
| type = object · type="message.ephemeral" · requires: id, workspace, createdAt +3 more | |
| type = object · type="dm.create" · requires: id, workspace, createdAt +2 more | |
| type = object · type="ping" · requires: id, workspace, createdAt |
id^evt_[0-9A-HJKMNP-TV… · requiredUnique per event and unchanged across its retries. Dedupe on it.
typeworkspaceThe Hijinks workspace, as shown in the dashboard.
createdAtWhen Hijinks created the event (ISO 8601, UTC).
channelA channel id your bridge sent in an inbound event — or dm:<user id>
on a message.update of a message first sent by dm.create.
EventPage
Oldest first, each exactly the envelope a push would have carried.
next^\d{1,18}$ · requiredPass as after on the next poll. The after you sent when no
event was new. Without after, the newest cursor ("0" when
the workspace has never held an event).
hasMoreMore events wait past this page. Poll again at once.
gapEvents after your after expired (24 hours) before you fetched
them: the bridge missed something. Tell the channel if you like
("Hijinks was unreachable and some messages were missed") and carry
on from next. Always false without after.