Skip to main content

Chat bots

Chat bots (beta) work a bit like Discord bots. You make them at Developers → Chat bots; group owners add them to their group chats, and people can mention them in comments.

Getting started​

  1. Create a bot. Save its token and signing secret; they are shown once.
  2. Give it an avatar, a tag (shown next to its name, like BOT or MUSIC) and slash commands.
  3. Turn on the intents it needs (below).
  4. A group owner adds it in Group settings → Bots: your own bots are listed there, and public bots can be added by ID.
  5. Read events from the event feed (no server needed) or a webhook, and reply with the Bot API.
  6. Optionally fill in its listing page and list it in the bot directory so anyone can add it.

Bots only join group chats, never one to one chats. They only see messages sent after they were added, and everyone in the group sees that a bot is there.

Authentication​

Send the token with every request:

Authorization: Bot vrclbot_<botId>.<secret>

Rotate token gives a new token and keeps the old one working for 24 hours, so a running bot can switch over without going offline. Reset now ends every old token at once; use it if a token leaks.

Intents​

IntentWhat it allows
Message content (privileged)Read the text of every message in its chats. Without it, a bot only gets messages that mention it (@Name or @bot_id) or start with one of its commands; other messages arrive with an empty body.
MembersSee the names of the people in its chats, and who joined or left. Without it, only their ids and the member count.
CommentsAnswer when mentioned in comments on Legend pages and posts.

Endpoints​

Base URL https://api.vrchatlegends.com/api/bots.

Method and pathBehavior
GET /v1/meThe bot's profile
GET /v1/events?after=<cursor>&wait=25The event feed: events after a cursor, waiting up to 25 seconds for one
GET /v1/chatsGroup chats the bot is in, and DMs ("kind": "dm", id dm_<account id>)
GET /v1/chats/:chatIdOne chat: name, member count, members (members intent, or in a DM), the bots in it, and any running call
GET /v1/chats/:chatId/messages?after=ISOMessages since the bot joined, oldest first (up to 100)
GET /v1/chats/:chatId/messages?before=ISOPage back: the newest messages older than that time (up to 100)
GET /v1/chats/:chatId/messages/:messageIdOne message
POST /v1/chats/:chatId/messagesSend { "body", "embeds"?, "components"?, "replyTo"? }
PATCH /v1/chats/:chatId/messages/:messageIdEdit one of the bot's own messages (any of body, embeds, components)
POST /v1/chats/:chatId/messages/:messageId/reactionsReact { "emoji": "👍", "on": true } (on: false takes it back)
DELETE /v1/chats/:chatId/messages/:messageIdDelete one of the bot's own messages
POST /v1/chats/:chatId/typingShow "is typing" for a few seconds
POST /v1/chats/:chatId/leaveLeave a chat
PUT /v1/commandsSet slash commands { "commands": [{ "name", "description", "options"? }] } (up to 25). See Command options
PUT /v1/statusThe line under the bot's name { "text": "Playing lofi", "minutes"?: 30 }. minutes clears it on its own; { "text": "" } clears it now
POST /v1/chats/:chatId/scheduledSend later { "sendAt": "2026-12-05T18:00:00Z", "body", "embeds"?, "components"?, "replyTo"? }
GET /v1/scheduled?chatId=Scheduled messages still waiting
DELETE /v1/scheduled/:idCancel a scheduled message
GET /v1/storage?prefix=The bot's stored keys, with sizes
GET /v1/storage/:keyOne stored value
PUT /v1/storage/:keyStore { "value": <any JSON> }
DELETE /v1/storage/:keyDelete a stored value
POST /v1/comments/replyReply to a comment that mentioned the bot { "pageId", "postId"?, "commentId", "body" }
GET /v1/calls/configSTUN and TURN servers for calls
POST /v1/chats/:chatId/call/joinJoin the group's voice call (starts one if none is running)
POST /v1/chats/:chatId/call/signalSend { "to", "signal" }: a WebRTC offer, answer, ice or media message
POST /v1/chats/:chatId/call/pingStay in the call (every 15 seconds)
POST /v1/chats/:chatId/call/leaveHang up
GET /avatars/:botId.webpA bot's avatar (public)
GET /directoryListed bots (public)
GET /profiles/:botIdA public bot's listing page data (public)

Command options​

Commands can take options, like Discord. People see them as a hint while they type, and your bot gets them already parsed.

{ "commands": [
{ "name": "roll", "description": "Roll dice", "options": [
{ "name": "sides", "description": "Sides on each die", "type": "integer", "required": true, "min": 2, "max": 100 },
{ "name": "count", "description": "How many dice", "type": "integer" }
] },
{ "name": "flavor", "description": "Pick a milk", "options": [
{ "name": "kind", "type": "string", "required": true, "choices": [{ "name": "Chocolate", "value": "choc" }, { "name": "Strawberry", "value": "straw" }] }
] }
] }
  • type is string, integer, number, boolean or user. Up to 10 options, required ones first, up to 25 choices each.
  • People type options in order (/roll 20 2) or by name (/roll count:2 sides:20). "Quotes" keep words together, and the last text option takes the rest of the line.
  • The message.created event for a command carries message.command:
{ "name": "roll", "args": "20 2", "options": { "sides": 20, "count": 2 }, "errors": [] }

errors lists anything missing or wrong ("sides is required.") so the bot can answer with how to use the command.

Storage​

Each bot gets a small key-value store, so it can remember things (scores, settings, who it welcomed) without running a database. Keys are 1 to 64 letters, numbers or . _ : -. A value is any JSON up to 16 KB, with up to 200 keys and 1 MB per bot. Storage is private to the bot and is deleted with it. Use prefixes like score:dm_123 and list them with ?prefix=score:.

Scheduled messages​

POST /v1/chats/:chatId/scheduled sends a message at sendAt, 10 seconds to 30 days ahead, even if the bot is offline then. Good for reminders and event announcements. Up to 100 can wait per bot. The message is checked when you schedule it; if it still cannot be sent when the time comes (the bot was removed from the chat, say), the bot gets a schedule.failed event with the error.

DMs​

Anyone can message a public bot one to one from its card or listing page; a private bot only talks to its owner. A DM's chat id is dm_<account id>. In a DM the bot reads every message, with no intent needed. Bots can only reply in DMs people started, and someone who blocks the bot (or its owner) stops getting its messages. DMs have no voice calls and cannot be left.

Embeds and buttons​

Messages can carry up to 4 embeds and up to 3 rows of 5 buttons, like Discord. A message needs a body or at least one embed.

{
"body": "",
"embeds": [{
"title": "Server status",
"url": "https://example.com/status",
"description": "Everything is **running**.",
"color": "#22c55e",
"author": { "name": "Status bot" },
"fields": [{ "name": "Players", "value": "12", "inline": true }, { "name": "Region", "value": "EU", "inline": true }],
"image": { "url": "https://example.com/graph.png" },
"thumbnail": { "url": "https://example.com/logo.png" },
"footer": { "text": "Updated every minute" }
}],
"components": [[
{ "label": "Refresh", "style": "primary", "customId": "refresh", "emoji": "🔄" },
{ "label": "Website", "style": "link", "url": "https://example.com" }
]]
}

Button styles: primary, secondary, success, danger, and link (opens url). Pressing any other button sends the bot an interaction.button event with customId, the chat, the message and the person who pressed it. Answer by sending a message, or by editing the one with the button (for example to turn it off with "disabled": true). Embed pictures are fetched and checked by our server and shown from there, so viewers never load them from your site.

Other events: message.edited when someone edits a message the bot could read, and message.reaction.added / message.reaction.removed for reactions to the bot's own messages. Messages the bot reads include replyTo, forwarded and hasVoice.

Event feed​

The simplest way to run a bot: ask for new events and wait for the next one (long polling). No server or public address is needed.

let cursor = (await api('/v1/events?from=now')).cursor
for (;;) {
const { events, cursor: next } = await api(`/v1/events?after=${cursor}&wait=25`)
cursor = next
for (const e of events) handle(e)
}

?from=now skips events from before the bot started. The feed keeps the last 500 events per bot. It gets every event a webhook would, plus call connection messages.

Voice calls​

Bots can join group voice calls to play audio and share a camera or screen. Calls are end-to-end encrypted, so a bot connects straight to each person with WebRTC, like a browser (in Node, the @roamhq/wrtc package works).

  1. POST /v1/chats/:chatId/call/join. The reply lists the people already in the call (others) and the ICE servers.
  2. Make one RTCPeerConnection per person, add your audio (and video) tracks, and send each of them an offer with call/signal. People who join later send you an offer.
  3. Their answers and ICE candidates arrive as call.signal events. Use "perfect negotiation": if both sides offer at once, the side with the smaller id (compared as text) gives way.
  4. Send { "type": "media", "camera": "<stream id>", "screen": "<stream id>", "muted": false } so people see which video is your camera and which is your screen.
  5. Ping every 15 seconds and call/leave when done. call.left and call.ended events tell you when people go.

Listing page​

Fill in the Listing page tab in the portal: a longer description (Markdown), features, website and support links, tags and a banner colour. Public bots get a page at /chat-bots/<botId> with an Add to group button, and you can list them in the directory.

Comments​

When someone mentions a bot in a comment, the bot gets a comment.mention event and can post up to 3 replies under that comment within 15 minutes. It cannot post anywhere it was not mentioned. Private bots only work on their owner's own page.

Page owners can block single bots or all bots from their page and posts in Account settings → Bots. Anyone who blocks a person also stops that person's bots from answering them and from showing them messages.

Webhooks​

Set an HTTPS webhook URL to receive events. Each request carries:

  • X-VRCL-Event: the event type
  • X-VRCL-Timestamp: Unix seconds
  • X-VRCL-Signature: v1= + HMAC-SHA256 of <timestamp>.<raw body> using your signing secret

Answer with a 2xx status within 6 seconds. After 20 failed deliveries in a row the webhook is turned off; turn it back on in the portal.

EventSent when
message.createdSomeone writes in a group the bot is in (filtered by the message content intent)
schedule.failedA scheduled message could not be sent when its time came (error says why)
bot.added / bot.removedThe bot joins or leaves a group
comment.mentionSomeone mentions the bot in a comment (comments intent)
member.joined / member.leftPeople are added to or leave a group the bot is in (names with the members intent)
call.startedSomeone starts a voice call in a group the bot is in
call.signal, call.joined, call.left, call.endedWhile the bot is in a call (event feed only, except call.ended)
pingYou press "Send test event"
{
"id": "…",
"type": "message.created",
"createdAt": "2026-11-13T12:00:00.000Z",
"botId": "bot_…",
"data": {
"chat": { "id": "g_…", "name": "Game night" },
"author": { "id": "…", "name": "Sketch494", "bot": false },
"message": { "id": "…", "body": "/roll", "createdAt": "…", "hasImage": false }
}
}

Limits​

LimitValue
Requests60 every 10 seconds (the event feed and calls: 400 every 10 seconds)
Messages per chat10 every 10 seconds
Messages in total30 a minute
Comment replies6 a minute, 3 per mention
Repeated textThe same text at most 3 times a minute
Bots per account5

Going over a limit answers HTTP 429.