ScreenShared Developers Developer portal

ScreenShared API

Build bots and integrations for ScreenShared guilds. The platform follows Discord's concepts, numbers and names wherever it can, so porting a bot is mostly a matter of changing URLs.

Outgoing webhooks, gateway resume, attachments and voice bots are planned. See the changelog.

Quick start

  1. Open the developer portal and create an application. Creating applications requires an active account VIP; the bot only runs while its creator's VIP is active.
  2. Copy the bot token. It is shown once. Anyone holding it controls the bot.
  3. Pick the permissions the bot needs, copy the install link and open it to add the bot to a guild you manage.
  4. Call the REST API or connect to the gateway with the token.
curl -H "Authorization: Bot $TOKEN" https://apiscreen.screenshared.io/v1/users/@me

Authentication

Every REST request and the gateway IDENTIFY use the bot token:

Authorization: Bot ssb.<application id>.<secret>

Incoming webhooks

Create a webhook in a text channel: Channel settings → Integrations → New webhook (requires Manage webhooks). The URL looks like:

https://apiscreen.screenshared.io/webhooks/<id>/<token>

Treat the URL as a password: whoever has it can post in the channel. "Generate new URL" invalidates the old one at once. A webhook posts in its channel regardless of channel permissions; only a frozen guild blocks it.

Execute

POST /webhooks/{id}/{token}   Optional ?wait=true returns the created message (200); otherwise 204.

BodyHow it is read
application/jsonDiscord format: {content, username, embeds}. avatar_url, tts and thread_id are ignored. flags: 4 (SUPPRESS_EMBEDS, no link previews) and 32768 (Components V2). Slack's {text} also works.
text/plainThe whole body becomes the message.
# JSON (Discord format) with an embed
curl -H "Content-Type: application/json" \
  -d '{"username":"CI","content":"Deploy finished","embeds":[{"title":"main @ 3f2a1c","description":"**42** tests passed","color":4180863}]}' \
  "https://apiscreen.screenshared.io/webhooks/ID/TOKEN?wait=true"

# Plain text
curl -d "backup ok" https://apiscreen.screenshared.io/webhooks/ID/TOKEN
# PowerShell
Invoke-RestMethod -Method Post -ContentType "application/json" `
  -Uri "https://apiscreen.screenshared.io/webhooks/ID/TOKEN" `
  -Body (@{ content = "Hello from PowerShell" } | ConvertTo-Json)

Rules

StatuserrorWhen
204 / 200Posted (200 with ?wait=true)
400invalid_bodyBad JSON, nothing to post, embed limits exceeded
403guild_frozenThe guild's plan expired
404unknown_webhookWrong id or token (we don't say which)
413too_largeBody over 64 KB
429rate_limitedMore than 30 messages per minute per webhook (120 per channel)
503webhooks_pausedPaused by the platform administrators

Outgoing webhooks

A guild can notify your own system (n8n, Zapier, a server) when something happens. Set it up in Guild settings → Integrations → Outgoing webhooks (requires Manage guild): an https:// URL and the events you want.

POST https://your-server.example/webhook
Content-Type: application/json
User-Agent: ScreenShared-Hooks/1.0
X-SS-Hook-Id: h3…
X-SS-Delivery: dlv_8f…
X-SS-Event: msg.create
X-SS-Timestamp: 1764090000
X-SS-Signature: v1=<hex HMAC-SHA256(secret, timestamp + "." + body)>

{ "id": "dlv_8f…", "type": "msg.create", "guild_id": "g1…", "at": 1764090000000,
  "data": { "channel_id": "c8…", "user": { "id": "u3…", "name": "Bruna" }, "message": { …Message object… } } }

Events: msg.create, msg.edit, msg.delete, react.add, react.remove, member.join, member.leave, member.kick, member.ban, member.update, voice.join, voice.leave, voice.move, channel.create/update/delete, role.create/update/delete, ticket.open, ticket.close, and ping (the "Test" button).

// Node.js: verify the signature
import crypto from 'node:crypto';
function verify(req, rawBody, secret) {
  const ts = req.headers['x-ss-timestamp'];
  if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
  const mac = crypto.createHmac('sha256', secret).update(ts + '.' + rawBody).digest('hex');
  const got = String(req.headers['x-ss-signature'] || '').replace('v1=', '');
  return got.length === mac.length && crypto.timingSafeEqual(Buffer.from(got), Buffer.from(mac));
}

REST conventions

Errors

{ "error": "missing_permission", "message": "Falta a permissão \"Mandar mensagens\" neste canal.", "need": ["send"] }

error is a stable machine code; message is a human-readable text (Portuguese).

HTTPerrorMeaning
400invalid_body, invalid_channelMalformed request or wrong channel type
400invalid_referencemessage_reference points to a message that doesn't exist, can't be replied to, or is in another channel
401invalid_tokenMissing, malformed or rotated token
403missing_permissionThe bot lacks a permission in that channel or guild
400cannot_editForwarded messages and polls can't be edited
400invalid_poll, poll_expiredA poll that breaks the rules below (message says which one); ending a poll that already ended
400cannot_forwardThat message can't be forwarded there (system message, AutoMod, file limits…); message says why
400unknown_emoji, too_many_reactionsEmoji the bot can't use; 20 different emojis already on the message
403missing_contentForwarding needs to be able to read the original (MESSAGE_CONTENT)
413too_largeFile over the size limit
403not_authorEditing a message the bot didn't send
403guild_frozenThe guild's plan expired
403app_disabledThe application was disabled by the administrators
403owner_not_vipThe creator's account VIP is not active; the bot is paused until it is
404unknown_guild, unknown_channel, unknown_message, unknown_memberDoesn't exist or the bot can't see it
429rate_limitedSee rate limits
503bots_pausedThe bot platform is paused by the administrators

Rate limits

Buckets are per application (not per IP). Every response carries:

X-RateLimit-Bucket: msg:c8xYz
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 7
X-RateLimit-Reset-After: 3.250
Retry-After: 4            (only on 429, whole seconds)
BucketLimit
global50 requests / second
msg:<channel>10 messages / 10 s
msg-guild:<guild>30 messages / 10 s
edit-del:<channel>20 / 10 s
read300 GET / minute
invalid tokens20 / minute per IP

A 429 body: {"error":"rate_limited","retry_after":3.25,"bucket":"msg:c8xYz","global":false}

Endpoints

MethodRouteNeeds
GET/users/@meThe bot user + application
GET/users/@me/guildsGuilds the bot is in
DELETE/users/@me/guilds/{guild}Leave a guild (uninstall)
GET/guilds/{guild}Bot in the guild
GET/guilds/{guild}/channelsOnly channels the bot can view
GET/guilds/{guild}/members?after=&limit=Sorted by user id, limit 1–1000 (default 100)
GET/guilds/{guild}/members/{user}
GET/channels/{channel}View channel
GET/channels/{channel}/messages?before=&after=&limit=View + Read history; ascending ids, limit 1–100 (default 50)
GET/channels/{channel}/messages/{id}View + Read history
POST/channels/{channel}/messagesView + Send messages
PATCH/channels/{channel}/messages/{id}Author must be the bot
DELETE/channels/{channel}/messages/{id}Own message, or Manage messages
GET/channels/{channel}/pinsView + Read history; pinned messages, most recently pinned first (/channels/{channel}/messages/pins answers {items: [{pinned_at, message}], has_more})
PUT/channels/{channel}/pins/{id}Manage messages; 204. Up to 250 per channel; posts the "pinned a message" notice (type 6)
DELETE/channels/{channel}/pins/{id}Manage messages; 204 (also /messages/pins/{id})
GET/channels/{channel}/messages/{id}/reactions/{emoji}View + Read history; the accounts that reacted
PUT DELETE/channels/{channel}/messages/{id}/reactions/{emoji}/@meAdd (Add reactions) or remove the bot's reaction; 204
DELETE/channels/{channel}/messages/{id}/reactions/{emoji}/{user}Manage messages; 204
GET/channels/{channel}/polls/{id}/answers/{answer_id}?after=&limit=View + Read history; {"users": [User]}, the accounts that voted for that answer (25 by default, up to 100)
POST/channels/{channel}/polls/{id}/expireEnds the bot's own poll now; returns the message
GET/guilds/{guild}/emojis, /guilds/{guild}/emojis/{emoji}Bot in the guild
POST/guilds/{guild}/emojis {"name", "image": "data:image/png;base64,…"}Manage emojis; 201. Up to 50 static + 50 animated
PATCH DELETE/guilds/{guild}/emojis/{emoji} {"name"}Manage emojis
GET/gatewayNo auth: the gateway URL

{emoji} is URL-encoded: a Unicode emoji (%F0%9F%91%8D) or name:id for a guild emoji.

Send a message

POST /v1/channels/{channel}/messages
{
  "content": "Hello <@USER_ID>!",
  "embeds": [{ "title": "Status", "description": "All systems **operational**", "color": 3066993,
               "fields": [{ "name": "Uptime", "value": "99.98%", "inline": true }] }],
  "allowed_mentions": { "parse": ["users"] },
  "nonce": "my-correlation-id"
}

Reply to a message

Same shape as Discord. Add message_reference with the id of a message in the same channel:

POST /v1/channels/{channel}/messages
{
  "content": "pong 🏓",
  "message_reference": { "message_id": 1532, "fail_if_not_exists": true },
  "allowed_mentions": { "parse": ["users"], "replied_user": false }
}

Guild emojis

Same text format as Discord: <:name:id>, or <a:name:id> when animated. A bot can use the emojis of every guild it is in; any other one becomes :name: as plain text. Image: https://screenshared.io/ge/{id} (logged-in people only).

Send a file

multipart/form-data with payload_json (the JSON above) and files[0]. One file per message for now. Needs Attach files. Give it a description with "attachments": [{ "id": 0, "description": "…" }] in payload_json, and mark it as a spoiler by starting the file name with SPOILER_. Webhooks can't send files.

Send a poll

POST /v1/channels/{channel}/messages
{ "poll": {
    "question": { "text": "Which track on Saturday?" },
    "answers": [ { "poll_media": { "text": "Mountain", "emoji": { "name": "🏔️" } } },
                 { "poll_media": { "text": "Harbour at night", "emoji": { "id": "1234567890123456789", "name": "anchor" } } } ],
    "duration": 48, "allow_multiselect": false, "layout_type": 1 } }

Same shape as Discord. Needs Send messages and Create polls. Question up to 300 characters, 2 to 10 different answers of up to 55, duration in hours (24 by default, up to 768). A poll goes alone: no content, embeds, components or file in the same message. Up to 10 answers can have an emoji: Unicode, or one of a guild the bot is in. Polls can't be edited or forwarded, and bots can't vote.

The message comes with content: "" and a poll object (gated by MESSAGE_CONTENT, like the text):

"poll": {
  "question": { "text" }, "answers": [ { "answer_id": 1, "poll_media": { "text", "emoji": { "id", "name" } } } ],
  "expiry": 1764262800000,        // ms, like every other date in this API
  "allow_multiselect": false, "layout_type": 1,
  "results": { "is_finalized": false, "answer_counts": [ { "id": 1, "count": 3, "me_voted": false } ] } }

When it ends (by itself, with /expire or by a moderator) the message arrives again as MESSAGE_UPDATE with is_finalized: true, and a type 46 message (POLL_RESULT) is posted with message_reference to the poll and one embed of type: "poll_result", with the fields poll_question_text, victor_answer_votes, total_votes, and, unless it was a tie or nobody voted, victor_answer_id, victor_answer_text and victor_answer_emoji_name.

Forward a message

POST /v1/channels/{destination}/messages
{ "message_reference": { "type": 1, "channel_id": "c8…", "message_id": 1532 } }

Message content

Without the privileged Message Content setting (enabled in the portal and shown on the authorization screen), a bot receives content, embeds and attachments empty, except for messages that mention the bot (a reply to the bot with ping counts as a mention) or that the bot itself sent. This applies to the REST API and the gateway, and to each referenced_message on its own.

Moderation

Same rules as people on the website: the bot's managed role needs the permission, and the target (member or role) must be below the bot's highest role. The guild owner can never be targeted. Add an optional reason with the X-Audit-Log-Reason header (or reason in the body); it shows up in the guild's audit log.

MethodRouteNeeds
DELETE/guilds/{guild}/members/{user}Kick members
PUT/guilds/{guild}/bans/{user} {"reason"}Ban members
DELETE/guilds/{guild}/bans/{user}Ban members
PUT DELETE/guilds/{guild}/members/{user}/roles/{role}Manage roles; the role below the bot's highest role
PATCH/guilds/{guild}/members/{user} {"nick", "communication_disabled_until"}Nick: Manage guild · Timeout: Moderate members (ISO 8601 up to 28 days; null removes it)

All return 204. Errors: missing_permission, role_hierarchy, unknown_member, unknown_role. Bucket mod:<guild>: 30 per minute.

Objects

// Message
{
  "id": 1532, "type": 0, "channel_id": "c8…", "guild_id": "g1…",
  "author": { "id": "u3…", "name": "Bruna", "bot": false, "avatar": "/av/…" },
  "webhook_id": "w9…",                 // only on webhook messages
  "content": "hi <@u9…>", "embeds": [ … ], "attachments": [ { "id", "name", "size", "type", "url", "expires_at", "spoiler", "description" } ],   // spoiler: the name comes with SPOILER_
  "flags": 0,                          // 4 = someone removed the link previews (or they were suppressed)
  "gif": { "provider": "klipy", "slug", "title", "url", "fallback_url", "preview_url", "width", "height" },   // only on messages sent from the GIF picker
  "mentions": ["u9…"], "mention_roles": [], "mention_everyone": false,   // a reply with ping lists the replied author here too
  "reactions": [ { "emoji": "👍", "count": 2, "users": ["u3…", "u7…"] } ],   // a guild emoji is an object: { "id", "name", "animated" }
  "created_at": 1764090000000, "edited_at": null, "pinned": false
}
// Reply: "type": 19 plus
//   "message_reference": { "message_id": 1530, "channel_id": "c8…", "guild_id": "g1…" },
//   "referenced_message": { …Message object, as it is now… } | null   // null = the original was deleted
// Forward: "message_reference": { "type": 1, … }, "message_snapshots": [ { "message": { type, content, embeds, attachments, created_at, mentions, flags } } ]
// Poll: "content": "" and "poll": { … } (see "Send a poll"). Poll result notice: "type": 46 plus "message_reference": { "message_id": , … }
// "Pinned a message" notice: "type": 6 plus "message_reference": { "message_id": , … }
// Guild   { id, name, description, icon, owner_id, active, member_count, roles: [Role], channels: [Channel], me: { permissions } }
// Channel { id, guild_id, type: "text" | "voice" | "category" | "app", name, topic, parent_id, position, permissions }
// Role    { id, name, color, permissions, position, hoist, managed }   // managed = application id of a bot role
// Member  { user: { id, name, bot, avatar }, nick, roles: [ids], joined_at }

Image paths such as /av/… are relative to https://screenshared.io.

Link previews are built after the message is delivered. When they arrive (or are removed) the message comes again as MESSAGE_UPDATE with them at the end of embeds, like on Discord: type link, image or video, url, title, description, provider.name, author.name, thumbnail: { url, proxy_url, width, height }. edited_at does not change. Send flags: 4 (or write the link as <https://…>) to skip them.

GIFs from the picker (KLIPY) have no text: content is the media URL, gif has the details, and embeds gets one type: "gifv" entry. Do not download or re-host that media: link to it. A favourite GIF that was an uploaded file arrives as a normal attachment.

Gateway

Get the URL from GET /v1/gateway (no auth) or use wss://apiscreen.screenshared.io/v1/gateway/ws. Authentication happens in IDENTIFY, not in the upgrade, so the built-in WebSocket of Node.js 22+ and browsers works.

Every frame uses Discord's envelope: {"op": 0, "t": "MESSAGE_CREATE", "s": 42, "d": {…}}

opNameDirectionPayload
0DISPATCHserver → botevent t, sequence s
1HEARTBEATbot → serverd = last s received
2IDENTIFYbot → server{"token": "...", "intents": 33281, "presence": {…}} (presence optional, see Presence)
3PRESENCE_UPDATEbot → server{"since": null, "activities": [{"name": "/help", "type": 0}], "status": "online", "afk": false}
10HELLOserver → bot{"heartbeat_interval": 30000}
11HEARTBEAT_ACKserver → bot
  1. Connect. The server sends HELLO. You have 10 s to send IDENTIFY.
  2. You get READY {session_id, user, guilds: [{id}]}, then one GUILD_CREATE per guild (members included with the GUILD_MEMBERS intent).
  3. Send HEARTBEAT every heartbeat_interval; after 75 s of silence the session closes with 4009.
  4. If the connection drops, connect and identify again, then fetch what you missed with the REST API (resume arrives in a later release).

Up to 2 sessions per application (a third closes the oldest) and 10 IDENTIFY per 5 minutes.

Presence (status and activity)

Same shape as Discord: send it inside IDENTIFY as presence, or any time later with op 3 PRESENCE_UPDATE. Members see it like a person's: the bot's row in the member list shows the custom status, or "Jogando name", and the profile card shows the activity.

{"op": 3, "d": {
  "since": null, "afk": false,
  "status": "dnd",                        // online | idle | dnd | invisible ("offline" = invisible)
  "activities": [
    {"name": "Custom Status", "type": 4, "state": "Watching the server", "emoji": {"name": "🛡️"}},
    {"name": "/help", "type": 0}
  ]
}}
typeShown asFields used
0Jogando name (Playing)name, state, details
1Transmitindo name (Streaming), with a "watch" buttonname, url (https)
2Ouvindo name (Listening)name, state, details
3Assistindo name (Watching)name, state, details
4Custom status: the state is the textstate, emoji.name (Unicode emoji only)
5Competindo em name (Competing)name, state, details

Intents

BitNameEvents
1 << 0 = 1GUILDSGUILD_UPDATE, CHANNEL_CREATE/UPDATE/DELETE, CHANNEL_PINS_UPDATE
1 << 1 = 2GUILD_MEMBERSGUILD_MEMBER_ADD/UPDATE/REMOVE, members in GUILD_CREATE
1 << 2 = 4GUILD_MODERATIONGUILD_BAN_ADD/REMOVE
1 << 3 = 8GUILD_EMOJIS_AND_STICKERSGUILD_EMOJIS_UPDATE
1 << 7 = 128GUILD_VOICE_STATESVOICE_STATE_UPDATE
1 << 9 = 512GUILD_MESSAGESMESSAGE_CREATE/UPDATE/DELETE, MESSAGE_DELETE_BULK
1 << 10 = 1024GUILD_MESSAGE_REACTIONSMESSAGE_REACTION_ADD/REMOVE
1 << 15 = 32768MESSAGE_CONTENT (privileged)Message text in events; must be enabled in the portal first (otherwise close 4014)
1 << 24 = 16777216GUILD_MESSAGE_POLLSMESSAGE_POLL_VOTE_ADD/REMOVE (bots have no direct messages here, so 1 << 25 is refused)

GUILD_CREATE and GUILD_DELETE for the bot's own guilds always arrive.

Events

Eventd
READY{v, session_id, user, guilds: [{id}], application: {id}}
GUILD_CREATEGuild object (when connecting or when added to a guild)
GUILD_DELETE{id} (removed from the guild)
GUILD_UPDATE{id, name, roles}
GUILD_EMOJIS_UPDATE{guild_id, emojis: [Emoji]} (the whole list, after any change)
CHANNEL_CREATE/UPDATE/DELETEChannel object
CHANNEL_PINS_UPDATE{guild_id, channel_id, last_pin_timestamp} (ms of the most recent pin, or null)
MESSAGE_CREATE/UPDATEMessage object (content gated by MESSAGE_CONTENT)
MESSAGE_DELETE{id, channel_id, guild_id}
MESSAGE_DELETE_BULK{channel_id, guild_id, count} (a moderator used /limpar)
MESSAGE_REACTION_ADD/REMOVE{message_id, channel_id, guild_id, user_id, emoji}
MESSAGE_POLL_VOTE_ADD/REMOVE{user_id, channel_id, message_id, guild_id, answer_id}, one per answer (changing a vote sends a REMOVE and an ADD)
GUILD_MEMBER_ADD/UPDATEMember object + guild_id
GUILD_MEMBER_REMOVE{guild_id, user, reason: "leave" | "kick" | "ban"}
GUILD_BAN_ADD/REMOVE{guild_id, user}
VOICE_STATE_UPDATE{guild_id, user_id, channel_id | null}

Close codes

CodeMeaningReconnect?
4000Unknown error, or replaced by a newer sessionyes
4001Unknown opcodeyes
4002Invalid JSONyes
4003Not identified in timeyes
4004Invalid tokenno
4005Already identifiedyes
4008Too many IDENTIFYyes, after waiting
4009Session timed out (no heartbeat)yes
4013Invalid intentsno
4014Privileged intent not enabledno
4020Application disabled, platform paused or creator's VIP inactiveno
4021Token rotatedno

Components and Components V2

Send components with a message (REST, interaction responses and webhooks). Two modes, exactly as in Discord:

typeComponentNotes
1Action RowUp to 5 buttons, or 1 select menu
2Buttonstyle 1 primary · 2 secondary · 3 success · 4 danger · 5 link (url, no custom_id); label ≤ 80, emoji: {name}, disabled
3String Selectoptions (≤ 25: label, value, description, emoji), placeholder, min_values, max_values
5 · 6 · 7 · 8User · Role · Mentionable · Channel SelectFilled from the guild by the client
9Section1–3 Text Displays + an accessory (Button or Thumbnail)
10Text Displaycontent: markdown, mentions
11Thumbnailmedia: {url}, description, spoiler
12Media Galleryitems (≤ 10): {media: {url}, description, spoiler}
13Filefile: {url}: a file already uploaded to ScreenShared (/f/…)
14Separatordivider (default true), spacing 1 small · 2 large
17Containeraccent_color, spoiler, children of any type except another container

Limits: 40 components per message, 4000 characters of text across Text Displays, custom_id 1–100 characters and unique in the message. Images from outside ScreenShared go through its proxy (media.proxy_url in the stored message) when they come from a well-known image host, otherwise they are shown as a link. Webhook messages can use every layout component and link buttons, but not interactive buttons or menus (they need a bot to answer).

POST /v1/channels/{channel}/messages
{
  "flags": 32768,
  "components": [
    { "type": 17, "accent_color": 5793266, "components": [
      { "type": 10, "content": "## Server status\nAll systems **operational**" },
      { "type": 14 },
      { "type": 9, "components": [ { "type": 10, "content": "Region **São Paulo**\nLatency 12 ms" } ],
        "accessory": { "type": 2, "style": 2, "label": "Refresh", "custom_id": "refresh" } },
      { "type": 1, "components": [
        { "type": 3, "custom_id": "region", "placeholder": "Pick a region",
          "options": [ { "label": "São Paulo", "value": "gru" }, { "label": "Miami", "value": "mia" } ] } ] }
    ] }
  ]
}

Slash commands

Register commands and they show up in the / menu of every guild where the bot is installed (for members with Use applications in the channel).

MethodRoute
GET PUT/applications/{app}/commandsGlobal commands (PUT replaces the whole list, max 50)
GET PUT/applications/{app}/guilds/{guild}/commandsCommands for one guild only
PUT /v1/applications/{app}/commands
[
  { "name": "dice", "description": "Roll a die",
    "options": [ { "type": 4, "name": "sides", "description": "How many sides", "required": false } ] },
  { "name": "hug", "description": "Hug someone",
    "options": [ { "type": 6, "name": "who", "description": "The person", "required": true } ] }
]

Option types: 3 string · 4 integer · 5 boolean · 6 user · 7 channel · 8 role · 10 number; choices (≤ 25) restrict the value. Names: 1–32 lowercase letters, numbers, _ or -. In the chat, users type /dice 20 or /hug @Bruna; name:value also works.

Interactions

When someone uses a command, clicks a button, picks from a menu or submits a modal, the bot receives INTERACTION_CREATE on the gateway (sent to the newest session; no intent needed):

{ "id": "…", "application_id": "…", "token": "…", "type": 2, "guild_id": "…", "channel_id": "…",
  "member": { "user": { "id", "name" }, "nick", "roles", "permissions" },
  "data": { "id": "…", "name": "dice", "options": [ { "name": "sides", "type": 4, "value": 20 } ] } }
typeWhendata
2Slash command{id, name, options, resolved: {users}}
3Button or select{custom_id, component_type, values?} + message
5Modal submitted{custom_id, components: [{type: 1, components: [{type: 4, custom_id, value}]}]}

Answer within 30 seconds (the user sees "the application didn't respond" after 5 s) with:

POST /v1/interactions/{id}/{token}/callback      (no Authorization header needed: the token is enough)
{ "type": 4, "data": { "content": "🎲 You rolled **17**", "flags": 64 } }
typeResponse
4Reply with a message (content, embeds, components, flags). flags: 64 = ephemeral (only the user sees it)
5Deferred: shows "thinking…"; edit it later with PATCH …/messages/@original
6Deferred update (components): just acknowledge the click
7Update the message the button belongs to
9Open a modal

Follow-ups (the interaction token lives 15 minutes):

PATCH/v1/interactions/{id}/{token}/messages/@original (alias: /v1/webhooks/{app}/{token}/messages/@original)
DELETE/v1/interactions/{id}/{token}/messages/@original
POST/v1/interactions/{id}/{token}/followup (alias: /v1/webhooks/{app}/{token}) — a new message

A second callback returns 409 already_responded. Components on ephemeral messages are shown but not clickable yet.

Modals (forms)

Respond with type 9 to open a form for the user (from a command or a component; not from another modal):

{ "type": 9, "data": { "custom_id": "feedback", "title": "Feedback",
  "components": [ { "type": 1, "components": [
    { "type": 4, "custom_id": "text", "label": "What do you think?", "style": 2, "max_length": 1000, "required": true } ] } ] } }

Up to 5 text inputs (type 4, style 1 short · 2 paragraph). On submit you get an INTERACTION_CREATE of type 5 with the values, and you answer it like any other interaction.

Embeds

Discord's embed format, rendered natively in the chat:

{ "title": "…", "description": "markdown", "url": "https://…", "color": 3066993,
  "timestamp": "2026-11-25T20:00:00Z", "author": { "name": "…", "icon_url": "https://…" }, "footer": { "text": "…", "icon_url": "https://…" },
  "image": { "url": "https://…" }, "thumbnail": { "url": "https://…" },
  "fields": [ { "name": "…", "value": "markdown", "inline": true } ] }
FieldLimit
embeds per message10, with 6000 characters across all of them
title / author.name256
description4096
fields25 (name 256, value 1024)
footer.text2048
urlhttp/https only, 2048
image / thumbnailhttps (http is upgraded), up to 10 MB; PNG, JPEG, GIF or WebP; shown up to 1280 px
author.icon_url / footer.icon_urlsame rules, shown as a small icon; dropped if not accepted

Embed images

Images are fetched by ScreenShared, decoded, re-encoded and served from /lp/…. Accepted hosts include i.imgur.com, cdn.discordapp.com, media.discordapp.net, raw.githubusercontent.com, avatars.githubusercontent.com, opengraph.githubassets.com, i.ytimg.com, static-cdn.jtvnw.net, *.steamstatic.com, i.scdn.co, pbs.twimg.com, i.redd.it and upload.wikimedia.org. An image or thumbnail from another host becomes a link in the description. Animated GIFs keep moving when they are small enough; animated WebP shows its first frame. Reading the message back returns your url plus proxy_url. attachment:// is not supported.

Permissions

When a bot is added, it gets a managed role with the permissions granted by the installer (who can only grant what they have; only the guild owner grants Administrator). Guild admins can edit that role's permissions and position like any role, but can't give it to anyone else or delete it (remove the bot instead).

BitValueName
1 << 01View channels
1 << 12Manage channels
1 << 24Manage roles
1 << 38Manage guild
1 << 416Create invites
1 << 532Kick members
1 << 664Ban members
1 << 7128Send messages
1 << 8256Attach files
1 << 9512Manage messages
1 << 101024Read message history
1 << 112048Connect (voice)
1 << 124096Speak
1 << 138192Video
1 << 1416384Stream (screen share)
1 << 1532768Mute members (voice)
1 << 1665536Move members (voice)
1 << 17131072Administrator
1 << 18262144Moderate members (timeout, warnings)
1 << 19524288Handle tickets
1 << 201048576Manage webhooks
1 << 212097152Use applications
1 << 224194304Manage emojis
1 << 238388608Create polls

Note: the values differ from Discord's; the names and the model are the same.

Example bot (Node.js 22+)

Replies pong to !ping and answers a /dice command with a button. No dependencies: Node 22+ ships fetch and WebSocket. !ping requires the Message Content setting (or mention the bot); slash commands don't.

const TOKEN = process.env.SS_TOKEN;
const API = 'https://apiscreen.screenshared.io/v1';
const INTENTS = 1 | 512 | 32768;   // GUILDS | GUILD_MESSAGES | MESSAGE_CONTENT

async function rest(method, path, body) {
  const r = await fetch(API + path, {
    method, headers: { Authorization: 'Bot ' + TOKEN, 'Content-Type': 'application/json' },
    body: body ? JSON.stringify(body) : undefined,
  });
  if (r.status === 429) { const e = await r.json(); await new Promise((ok) => setTimeout(ok, e.retry_after * 1000)); return rest(method, path, body); }
  return r.status === 204 ? null : r.json();
}

function connect() {
  const ws = new WebSocket(API.replace('https', 'wss') + '/gateway/ws');
  let seq = null, beat;
  ws.onmessage = async (ev) => {
    const { op, t, s, d } = JSON.parse(ev.data);
    if (s) seq = s;
    if (op === 10) {
      beat = setInterval(() => ws.send(JSON.stringify({ op: 1, d: seq })), d.heartbeat_interval);
      ws.send(JSON.stringify({ op: 2, d: { token: TOKEN, intents: INTENTS } }));
    }
    if (t === 'READY') {
      console.log('online as', d.user.name);
      await rest('PUT', `/applications/${d.application.id}/commands`, [{ name: 'dice', description: 'Roll a die' }]);
    }
    if (t === 'INTERACTION_CREATE') {
      const roll = 1 + Math.floor(Math.random() * 6);
      const reply = { content: `🎲 **${roll}**`, components: [{ type: 1, components: [{ type: 2, style: 1, label: 'Again', custom_id: 'again' }] }] };
      await fetch(`${API}/interactions/${d.id}/${d.token}/callback`, { method: 'POST', headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ type: d.type === 3 ? 7 : 4, data: reply }) });
    }
    if (t === 'MESSAGE_CREATE' && d.content === '!ping' && !d.author.bot) {
      await rest('POST', `/channels/${d.channel_id}/messages`, { content: 'pong 🏓' });
    }
  };
  ws.onclose = (ev) => {
    clearInterval(beat);
    if ([4004, 4013, 4014, 4020, 4021].includes(ev.code)) { console.error('closed:', ev.code, ev.reason); return; }
    setTimeout(connect, 3000);
  };
}
connect();

Limits

ItemLimit
Applications per account5 (account VIP required)
Bots per guild10
Webhooks10 per channel, 50 per guild
Gateway sessions2 per application; 10 IDENTIFY per 5 minutes
Gateway frame (bot → server)16 KB
Request body64 KB

Changelog