Skip to main content

Messages, friends and calls

Paths are relative to https://api.vrchatlegends.com/api. Messages are in beta. Requests use a signed-in session, or an API key with the scopes listed below. Friends are two accounts that follow each other's Legend pages; only friends can start a one to one chat.

How messages are protected​

  • Message text, photo captions, group names and stored photos are encrypted at rest (AES-256-GCM). A copy of the data files alone does not reveal chats.
  • Photos and chat backgrounds are served through signed links that expire after a few hours; a link cannot be changed to open another photo.
  • Voice and video calls are end-to-end encrypted. Audio and video go directly between the people in the call (WebRTC, DTLS-SRTP). The server only passes connection messages and never has the keys. Each pair of people sees a matching safety code to rule out anyone in the middle.
  • Deleted messages leave a "message deleted" note. The original is kept for 90 days in a log only staff can read, so reports can still be checked.

Friends and conversations​

Method and pathBehavior / API-key scope
GET /friendsYour friends. friends:read
GET /messagesYour one to one and group chats, newest first, with unread counts. messages:read
GET /messages/unreadTotal unread count. messages:read

:target in the paths below is a friend's account id (one to one chat) or a group id starting with g_.

Method and pathBehavior / API-key scope
GET /messages/:targetMessages (?before=ISO pages back), read times, members, bots, background. messages:read
POST /messages/:targetSend { "body": "text" }, up to 2000 characters. messages:write
POST /messages/:target/imageSend a photo: multipart image (up to 10 MB) and optional body. Photos are checked for unsafe content. messages:write
POST /messages/:target/readMark the chat read. messages:read
POST /messages/:target/typingShow "is typing" for a few seconds. messages:write
DELETE /messages/:target/:messageIdDelete your own message (group owners can delete any in their group). messages:write
PUT /messages/:target/background{ "kind": "preset", "id": "aurora" } or { "kind": null }. messages:write
POST /messages/:target/background/imagePhoto background (multipart image, optional dim 0-80). messages:write
PUT /messages/:target/bubbleYour bubble colour in this chat (Bronze Legend and up) or null. messages:write

Sending is limited to 30 messages a minute.

Group chats​

Method and pathBehavior / API-key scope
POST /messages/groupsNew group { "name", "members": [accountId] }. Members must be your friends. Up to 25 people. messages:write
PATCH /messages/:groupIdRename { "name" } (owner). messages:write
POST /messages/:groupId/membersAdd friends { "accountIds": [] } (owner). messages:write
DELETE /messages/:groupId/members/:accountIdRemove someone (owner), or leave with your own id. messages:write
POST /messages/:groupId/iconGroup icon, multipart image (owner). DELETE removes it. messages:write
POST /messages/:groupId/botsAdd a bot { "botId" } (owner). See Chat bots. messages:write

Calls​

Calls work in one to one chats and groups (up to 8 people). Browsers connect to each other with WebRTC; these routes only pass connection messages along over the live connection.

Method and pathBehavior
GET /messages/calls/configSTUN and TURN servers for the browser
GET /messages/calls/activeCalls you can join now
POST /messages/:target/callStart a call, or join the one running
POST /messages/:target/call/signal{ "to", "signal" } where signal.type is offer, answer, ice or media
POST /messages/:target/call/pingStay in the call (every 15 seconds)
POST /messages/:target/call/leaveHang up
POST /messages/:target/call/declineTurn down a ringing call

Live events​

Signed-in browsers receive message.new, message.sent, message.read, message.deleted, message.typing, message.conversation and message.call on the live connection (/api/live/ws, topic notify:<accountId>).