Private beta: this contract may change before launch. Join the waitlist
Hijinks
Hijinks Webhook API

WorkspaceId

string · uuid

The Hijinks workspace, as shown in the dashboard.

Error

statusCode
​integer · required
message
​string | array · required

A human-readable reason. Not stable, so branch on the status code.

error
​string
field
​string

On a schema 400, the first field at fault (dotted for nested fields).

InboundEvent

oneOf
Exactly one variant must match.

Decision Table

VariantMatching 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
Properties for Variant 1:
A member ran `/hijinks <text>` (or however your chat spells the command).
type
​const · required
Const value: command
id
​RequestId · minLength: 1 · maxLength: 128 · required

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 · required

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.

​User · required

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.

text
​string · maxLength: 2000 · required

What followed the command, e.g. start, start science, leaderboard. Empty is help.

RequestId

string · minLength: 1 · maxLength: 128

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

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.
id
​string · pattern: ^(?!dm:)[\s\S]{1,128… · required
name
​string | null · maxLength: 128

User

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.
id
​string · minLength: 1 · maxLength: 128 · required
name
​string | null · maxLength: 128

CommandEvent

A member ran `/hijinks <text>` (or however your chat spells the command).
type
​const · required
Const value: command
id
​RequestId · minLength: 1 · maxLength: 128 · required

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 · required

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.

​User · required

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.

text
​string · maxLength: 2000 · required

What followed the command, e.g. start, start science, leaderboard. Empty is help.

ActionEvent

A member pressed a button, in a channel or in their DM.
type
​const · required
Const value: action
id
​RequestId · minLength: 1 · maxLength: 128 · required

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 · required

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.

​User · required

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.

messageId
​string · minLength: 1 · maxLength: 128 · required

The Hijinks message.id of the message the button was on.

action
​string · minLength: 1 · maxLength: 512 · required

The button's action, echoed back untouched.

MessageEvent

A member typed something: word-game guesses, rebus and charades answers, replies to a message with `awaitsReply`. A message that answers nothing in play is dropped, so forwarding every message is fine. Typed in the member's DM, it carries `channel: {"id": "dm:<user.id>"}` and answers the latest awaiting-reply prompt Hijinks sent there. `replyTo`, when present, picks the prompt instead.
type
​const · required
Const value: message
id
​RequestId · minLength: 1 · maxLength: 128 · required

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 · required

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.

​User · required

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.

text
​string · minLength: 1 · maxLength: 4000 · required
replyTo
​string | null · maxLength: 128

The Hijinks message.id this replies to, when your chat has replies.

EventId

string · pattern: ^evt_[0-9A-HJKMNP-TV…

Unique per event and unchanged across its retries. Dedupe on it.

MessageId

string · pattern: ^msg_[0-9A-HJKMNP-TV…

Minted by Hijinks. Keep a map from it to your chat's message id.

CreatedAt

string · date-time

When Hijinks created the event (ISO 8601, UTC).

OutboundChannel

string · minLength: 1

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.

MemberId

string · minLength: 1

A member's user.id, as your bridge sent it.

MessageKind

string · enum
Enum values:
text
card
game_start
question
time_up
answer_update
gotcha_bait
gotcha_reveal

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

oneOf
Exactly one variant must match.

Decision Table

VariantMatching Criteria
type = object · requires: label, action
type = object · requires: label, url
Properties for Variant 1:
label
​string · required
action
​string · maxLength: 512 · required

Opaque. Echo it back untouched and never parse it.

ActionButton

label
​string · required
action
​string · maxLength: 512 · required

Opaque. Echo it back untouched and never parse it.

LinkButton

label
​string · required
url
​string · uri · required

Message

id
​MessageId · pattern: ^msg_[0-9A-HJKMNP-TV… · required

Minted by Hijinks. Keep a map from it to your chat's message id.

kind
​MessageKind · enum · required

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.

Enum values:
text
card
game_start
question
time_up
answer_update
gotcha_bait
gotcha_reveal
text
​string · required

Chat-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.

​array[] · required

Rows of buttons, top to bottom, each row left to right. Empty when there are none.

image
​string | null · uri · required

An image or GIF to show with the message, or null.

awaitsReply
​boolean · required

Hijinks 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
​EventId · pattern: ^evt_[0-9A-HJKMNP-TV… · required

Unique per event and unchanged across its retries. Dedupe on it.

type
​const · required
Const value: message.create
workspace
​WorkspaceId · uuid · required

The Hijinks workspace, as shown in the dashboard.

createdAt
​CreatedAt · date-time · required

When Hijinks created the event (ISO 8601, UTC).

channel
​OutboundChannel · minLength: 1 · required

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.

​Message · required

MessageUpdateEvent

id
​EventId · pattern: ^evt_[0-9A-HJKMNP-TV… · required

Unique per event and unchanged across its retries. Dedupe on it.

type
​const · required
Const value: message.update
workspace
​WorkspaceId · uuid · required

The Hijinks workspace, as shown in the dashboard.

createdAt
​CreatedAt · date-time · required

When Hijinks created the event (ISO 8601, UTC).

channel
​OutboundChannel · minLength: 1 · required

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.

​Message · required

MessageEphemeralEvent

id
​EventId · pattern: ^evt_[0-9A-HJKMNP-TV… · required

Unique per event and unchanged across its retries. Dedupe on it.

type
​const · required
Const value: message.ephemeral
workspace
​WorkspaceId · uuid · required

The Hijinks workspace, as shown in the dashboard.

createdAt
​CreatedAt · date-time · required

When Hijinks created the event (ISO 8601, UTC).

channel
​OutboundChannel · minLength: 1 · required

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.

user
​MemberId · minLength: 1 · required

A member's user.id, as your bridge sent it.

​Message · required

DmCreateEvent

id
​EventId · pattern: ^evt_[0-9A-HJKMNP-TV… · required

Unique per event and unchanged across its retries. Dedupe on it.

type
​const · required
Const value: dm.create
workspace
​WorkspaceId · uuid · required

The Hijinks workspace, as shown in the dashboard.

createdAt
​CreatedAt · date-time · required

When Hijinks created the event (ISO 8601, UTC).

user
​MemberId · minLength: 1 · required

A member's user.id, as your bridge sent it.

​Message · required

PingEvent

id
​EventId · pattern: ^evt_[0-9A-HJKMNP-TV… · required

Unique per event and unchanged across its retries. Dedupe on it.

type
​const · required
Const value: ping
workspace
​WorkspaceId · uuid · required

The Hijinks workspace, as shown in the dashboard.

createdAt
​CreatedAt · date-time · required

When Hijinks created the event (ISO 8601, UTC).

Cursor

string · pattern: ^\d{1,18}$

A poll position. Opaque. Pass it back as after exactly as received.

OutboundEvent

oneOf
Exactly one variant must match.

Decision Table

VariantMatching 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
Properties for Variant 1:
id
​EventId · pattern: ^evt_[0-9A-HJKMNP-TV… · required

Unique per event and unchanged across its retries. Dedupe on it.

type
​const · required
Const value: message.create
workspace
​WorkspaceId · uuid · required

The Hijinks workspace, as shown in the dashboard.

createdAt
​CreatedAt · date-time · required

When Hijinks created the event (ISO 8601, UTC).

channel
​OutboundChannel · minLength: 1 · required

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.

​Message · required

EventPage

​OutboundEvent[] · maxItems: 100 · required

Oldest first, each exactly the envelope a push would have carried.

next
​Cursor · pattern: ^\d{1,18}$ · required

Pass 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).

hasMore
​boolean · required

More events wait past this page. Poll again at once.

gap
​boolean · required

Events 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.