SDK reference
Mirage apps and bots
GET/
Your applications (the developer portal's Mirage Bots), oldest first: each with its bot, public key, interactions endpoint, events and install settings.
Parameters and answerscurl 'https://api.cactive.com.au/v1/messaging/applications' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Makes an application (name 2 to 32 characters, description, icon emoji; an image icon is uploaded after) with its bot user (bot_…), an Ed25519 key pair that signs what Mirage sends it, and a bot token (si_bot_…) returned this once.
curl -X POST 'https://api.cactive.com.au/v1/messaging/applications' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
One of your applications; with a bot token, @me is the bot's own.
curl 'https://api.cactive.com.au/v1/messaging/applications/{appId}' \
-H "Authorization: Bearer $CACTIVE_TOKEN"PATCH/
Changes an application: name, description, icon (an emoji, an uploaded image:<version>, or null); installTypes (guild for servers, user for people's own accounts); interactionsUrl (HTTPS, saved only once it answers a signed PING with {"type": 1} and refuses a badly signed one with 401; null removes it); events (message_mention, member_join); public (listed in the App Directory, and anyone who manages a server may add it); permissions its install link asks for.
curl -X PATCH 'https://api.cactive.com.au/v1/messaging/applications/{appId}' \
-H "Authorization: Bearer $CACTIVE_TOKEN"DELETE/
Deletes an application: its bot leaves every server and its roles go, with its commands and token.
Parameters and answerscurl -X DELETE 'https://api.cactive.com.au/v1/messaging/applications/{appId}' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Resets the bot token: the old one stops working at once; the new one is returned this once.
Parameters and answerscurl -X POST 'https://api.cactive.com.au/v1/messaging/applications/{appId}/token' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Where to PUT an image icon (mime: PNG, JPEG, WebP or GIF; size up to 1 MB); then set the answer's icon (image:<version>) with a PATCH. Its owner.
curl -X POST 'https://api.cactive.com.au/v1/messaging/applications/{appId}/icon/uploads' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
What Mirage sent the app's interactions endpoint lately (kept for days, as platform data sets): kind (command, component, modal, autocomplete, event:<type>, ping), a summary, the status, time taken and any error, newest first. kind filters, before pages. Its owner.
curl 'https://api.cactive.com.au/v1/messaging/applications/{appId}/deliveries' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
Apps you added to your account (user installs): their commands work in every server you're in.
Parameters and answerscurl 'https://api.cactive.com.au/v1/messaging/me/applications' \
-H "Authorization: Bearer $CACTIVE_TOKEN"PUT/
Adds an app that allows user installs to your account (up to a limit set as platform data). Where a server doesn't give outside apps USE_EXTERNAL_APPS, only you see its answers.
curl -X PUT 'https://api.cactive.com.au/v1/messaging/me/applications/{appId}' \
-H "Authorization: Bearer $CACTIVE_TOKEN"DELETE/
Removes an app from your account.
Parameters and answerscurl -X DELETE 'https://api.cactive.com.au/v1/messaging/me/applications/{appId}' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
The app's global slash commands. Its owner, or its bot with its token.
Parameters and answerscurl 'https://api.cactive.com.au/v1/messaging/applications/{appId}/commands' \
-H "Authorization: Bearer $CACTIVE_TOKEN"PUT/
Replaces the app's global commands with these (up to 100): name, description, and options (string, integer, number, boolean, user, channel or role; required ones first; choices, or autocomplete for the app to suggest values as they're typed). Its owner, or its bot.
curl -X PUT 'https://api.cactive.com.au/v1/messaging/applications/{appId}/commands' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Adds or replaces one global command (by name).
curl -X POST 'https://api.cactive.com.au/v1/messaging/applications/{appId}/commands' \
-H "Authorization: Bearer $CACTIVE_TOKEN"DELETE/
Deletes a global command.
Parameters and answerscurl -X DELETE 'https://api.cactive.com.au/v1/messaging/applications/{appId}/commands/{command}' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
The app's commands for one server its bot is in.
Parameters and answerscurl 'https://api.cactive.com.au/v1/messaging/applications/{appId}/servers/{serverId}/commands' \
-H "Authorization: Bearer $CACTIVE_TOKEN"PUT/
Replaces the app's commands for one server its bot is in; there they take the place of global commands of the same name.
Parameters and answerscurl -X PUT 'https://api.cactive.com.au/v1/messaging/applications/{appId}/servers/{serverId}/commands' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Adds or replaces one of the app's commands for a server.
Parameters and answerscurl -X POST 'https://api.cactive.com.au/v1/messaging/applications/{appId}/servers/{serverId}/commands' \
-H "Authorization: Bearer $CACTIVE_TOKEN"DELETE/
Deletes one of the app's commands for a server.
Parameters and answerscurl -X DELETE 'https://api.cactive.com.au/v1/messaging/applications/{appId}/servers/{serverId}/commands/{command}' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Adds the app's bot to a server you manage (serverId; permissions, only ones you have). It joins with a role named after it holding them, which can't be deleted, given or taken by hand; removing the bot removes the role. MANAGE_SERVER.
curl -X POST 'https://api.cactive.com.au/v1/messaging/applications/{appId}/install' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
The server's apps: Caity (built in) and the bots people added, with who added them, what they were given and their commands. MANAGE_SERVER.
curl 'https://api.cactive.com.au/v1/messaging/servers/{serverId}/integrations' \
-H "Authorization: Bearer $CACTIVE_TOKEN"DELETE/
Removes an app's bot and its role from the server. Caity can't be removed: keep it out of channels with channel permissions. MANAGE_SERVER.
curl -X DELETE 'https://api.cactive.com.au/v1/messaging/servers/{serverId}/integrations/{appId}' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
The App Directory: Caity, then public apps by how many servers use them; with serverId, which are already there.
curl 'https://api.cactive.com.au/v1/messaging/directory' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
Every slash command you can use in a server (the composer's "/" list): Caity's, then each app's.
Parameters and answerscurl 'https://api.cactive.com.au/v1/messaging/servers/{serverId}/commands' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Uses a slash command (appId, name, options as { name, value }) in a channel or thread where you can send messages; the app's bot must be able to post there too. The app's endpoint gets a signed interaction (type 2, with a token) and answers within 3 seconds with a message ({"type": 4, "data": {"content": …, "components": …}}; flags: 64 shows it only to you), a modal (type 9) or deferred ({"type": 5}), then follows up with the token. Apps on your account answer where their bot isn't a member (only to you without USE_EXTERNAL_APPS). Caity answers /caity from its worker (deferred).
curl -X POST 'https://api.cactive.com.au/v1/messaging/channels/{channelId}/interactions' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
What an option with autocomplete suggests while it's typed (appId, name, options with the one being typed focused): the app gets a signed interaction (type 4) and answers with up to 25 choices.
curl -X POST 'https://api.cactive.com.au/v1/messaging/channels/{channelId}/interactions/autocomplete' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Presses a button or chooses in a select menu on an app's message (customId, values for a menu): the app gets a signed interaction (type 3) and answers with a message (type 4, flags: 64 for only you), deferred (5 or 6), a change to the message (7) or a modal (9). Returns message, updated or modal. In a user, role or channel select (types 5, 6 and 8) every value must be a member, a role, or a channel you can see of the menu's channelTypes; the app gets them in resolved.
curl -X POST 'https://api.cactive.com.au/v1/messaging/channels/{channelId}/messages/{messageId}/components' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
What a user, role or channel select on an app's message offers you: the server's members, its roles, or the channels you can see (q narrows by name; up to 25), and its defaultValues among them (choices, defaults). Nothing goes to the app.
curl 'https://api.cactive.com.au/v1/messaging/channels/{channelId}/messages/{messageId}/components/{customId}/choices' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Submits a modal an app showed you (components as { customId, value }): the app gets a signed interaction (type 5) and answers as for a component.
curl -X POST 'https://api.cactive.com.au/v1/messaging/modals/{modalId}' \
-H "Authorization: Bearer $CACTIVE_TOKEN"