SDK reference

Mirage apps and bots

Each route's function in the SDK, its call beside the same request in cURL.
messagingApplications

GET/v1/messaging/applications

Your applications (the developer portal's Mirage Bots), oldest first: each with its bot, public key, interactions endpoint, events and install settings.

Parameters and answers
curl 'https://api.cactive.com.au/v1/messaging/applications' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMessagingApplications

POST/v1/messaging/applications

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.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/messaging/applications' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
messagingApplicationsByAppId

GET/v1/messaging/applications/:appId

One of your applications; with a bot token, @me is the bot's own.

Parameters and answers
curl 'https://api.cactive.com.au/v1/messaging/applications/{appId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
patchMessagingApplicationsByAppId

PATCH/v1/messaging/applications/:appId

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.

Parameters and answers
curl -X PATCH 'https://api.cactive.com.au/v1/messaging/applications/{appId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
deleteMessagingApplicationsByAppId

DELETE/v1/messaging/applications/:appId

Deletes an application: its bot leaves every server and its roles go, with its commands and token.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/messaging/applications/{appId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMessagingApplicationsToken

POST/v1/messaging/applications/:appId/token

Resets the bot token: the old one stops working at once; the new one is returned this once.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/messaging/applications/{appId}/token' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMessagingApplicationsIconUploads

POST/v1/messaging/applications/:appId/icon/uploads

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.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/messaging/applications/{appId}/icon/uploads' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
messagingApplicationsDeliveries

GET/v1/messaging/applications/:appId/deliveries

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.

Parameters and answers
curl 'https://api.cactive.com.au/v1/messaging/applications/{appId}/deliveries' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
messagingMeApplications

GET/v1/messaging/me/applications

Apps you added to your account (user installs): their commands work in every server you're in.

Parameters and answers
curl 'https://api.cactive.com.au/v1/messaging/me/applications' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
putMessagingMeApplicationsByAppId

PUT/v1/messaging/me/applications/:appId

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.

Parameters and answers
curl -X PUT 'https://api.cactive.com.au/v1/messaging/me/applications/{appId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
deleteMessagingMeApplicationsByAppId

DELETE/v1/messaging/me/applications/:appId

Removes an app from your account.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/messaging/me/applications/{appId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
messagingApplicationsCommands

GET/v1/messaging/applications/:appId/commands

The app's global slash commands. Its owner, or its bot with its token.

Parameters and answers
curl 'https://api.cactive.com.au/v1/messaging/applications/{appId}/commands' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
putMessagingApplicationsCommands

PUT/v1/messaging/applications/:appId/commands

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.

Parameters and answers
curl -X PUT 'https://api.cactive.com.au/v1/messaging/applications/{appId}/commands' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMessagingApplicationsCommands

POST/v1/messaging/applications/:appId/commands

Adds or replaces one global command (by name).

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/messaging/applications/{appId}/commands' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
deleteMessagingApplicationsCommandsByCommand

DELETE/v1/messaging/applications/:appId/commands/:command

Deletes a global command.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/messaging/applications/{appId}/commands/{command}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
messagingApplicationsServersCommands

GET/v1/messaging/applications/:appId/servers/:serverId/commands

The app's commands for one server its bot is in.

Parameters and answers
curl 'https://api.cactive.com.au/v1/messaging/applications/{appId}/servers/{serverId}/commands' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
putMessagingApplicationsServersCommands

PUT/v1/messaging/applications/:appId/servers/:serverId/commands

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 answers
curl -X PUT 'https://api.cactive.com.au/v1/messaging/applications/{appId}/servers/{serverId}/commands' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMessagingApplicationsServersCommands

POST/v1/messaging/applications/:appId/servers/:serverId/commands

Adds or replaces one of the app's commands for a server.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/messaging/applications/{appId}/servers/{serverId}/commands' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
deleteMessagingApplicationsServersCommandsByCommand

DELETE/v1/messaging/applications/:appId/servers/:serverId/commands/:command

Deletes one of the app's commands for a server.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/messaging/applications/{appId}/servers/{serverId}/commands/{command}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
messagingApplicationsAuthorize

GET/v1/messaging/applications/:appId/authorize

What an install link shows (permissions from the link, else the app's): the app, the permissions it asks for, and the servers you manage (installed where its bot already is). A private app shows only to its owner.

Parameters and answers
curl 'https://api.cactive.com.au/v1/messaging/applications/{appId}/authorize' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMessagingApplicationsInstall

POST/v1/messaging/applications/:appId/install

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.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/messaging/applications/{appId}/install' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
messagingServersIntegrations

GET/v1/messaging/servers/:serverId/integrations

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.

Parameters and answers
curl 'https://api.cactive.com.au/v1/messaging/servers/{serverId}/integrations' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
deleteMessagingServersIntegrationsByAppId

DELETE/v1/messaging/servers/:serverId/integrations/:appId

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.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/messaging/servers/{serverId}/integrations/{appId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
messagingDirectory

GET/v1/messaging/directory

The App Directory: Caity, then public apps by how many servers use them; with serverId, which are already there.

Parameters and answers
curl 'https://api.cactive.com.au/v1/messaging/directory' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
messagingServersCommands

GET/v1/messaging/servers/:serverId/commands

Every slash command you can use in a server (the composer's "/" list): Caity's, then each app's.

Parameters and answers
curl 'https://api.cactive.com.au/v1/messaging/servers/{serverId}/commands' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMessagingChannelsInteractions

POST/v1/messaging/channels/:channelId/interactions

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

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/messaging/channels/{channelId}/interactions' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMessagingChannelsInteractionsAutocomplete

POST/v1/messaging/channels/:channelId/interactions/autocomplete

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.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/messaging/channels/{channelId}/interactions/autocomplete' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMessagingChannelsMessagesComponents

POST/v1/messaging/channels/:channelId/messages/:messageId/components

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.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/messaging/channels/{channelId}/messages/{messageId}/components' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
messagingChannelsMessagesComponentsChoices

GET/v1/messaging/channels/:channelId/messages/:messageId/components/:customId/choices

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.

Parameters and answers
curl 'https://api.cactive.com.au/v1/messaging/channels/{channelId}/messages/{messageId}/components/{customId}/choices' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
postMessagingModalsByModalId

POST/v1/messaging/modals/:modalId

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.

Parameters and answers
curl -X POST 'https://api.cactive.com.au/v1/messaging/modals/{modalId}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"