VRChat server-client companion suite
vrcd API.md
78 kB · 1,281 lines
Markdown
at meow

Server-Client API Reference #

vrcd uses a JSON-L (newline-delimited JSON) protocol over TCP for server-client communication.

  • Default port: 9700
  • Default bind: 127.0.0.1
  • Encoding: UTF-8
  • Line terminator: \n
  • Receive buffer: 8192 bytes per read; lines are accumulated until a \n arrives
  • Max line length: 32 MiB (server-side inbound cap; exceeding it disconnects the client). Large payloads (image uploads/downloads) are base64-encoded inside a single line, so this bounds them to ~24 MiB of binary

Transport #

A single TCP connection carries both requests and live event streams. The protocol is full-duplex: either side can send a message at any time. JSON-L framing (one JSON object per \n-terminated line) makes messages self-delimiting regardless of direction.

There is no peeking or out-of-band signaling. Both sides use a blocking receive loop that accumulates bytes into a buffer and extracts complete lines as they arrive.

Server Threading Model #

The server spawns one thread per client. Each ClientHandler thread runs a blocking receive() loop to read client requests. Live events (from the VRChat WebSocket) are broadcast from the main event-processing path, writing directly to each client's socket. A per-client sendMutex serializes writes from the handler thread and the broadcast path so they don't interleave.

Client Threading Model #

The client has two receive modes:

  • Blocking (run): A single-threaded receive loop that processes messages inline via callbacks. Used for CLI mode.
  • Threaded (runThreaded): A dedicated network thread pushes received JSON lines into a thread-safe MessageQueue. The main SDL thread is woken via SDL_PushEvent to drain the queue. Ping/pong is handled directly in the network thread to avoid queuing delay.

In both modes the client sends requests (auth, catch_up, get_friends, etc.) by writing to the same socket. Client sends are serialized by a sendMutex and loop on partial sends: the main thread sends requests while the network thread sends pong, and large lines (base64 image uploads) can exceed what a single send() accepts.

Authentication #

Authentication uses a shared secret token. If the server's secret is empty, auth is disabled.

Client sends: #

{"type": "auth", "token": "<shared-secret>"}

Server responds: #

Success:

{"type": "auth_ok", "server_version": 11}

Protocol versions:

  • 1 = base protocol
  • 2 = adds the content API (files, prints, inventory, images, uploads)
  • 3 = adds the moderation API (moderations, moderate_user, unfriend)
  • 4 = adds the notification listing (get_notifications)
  • 5 = adds VRChat's v2 notifications (every type, each carrying its own responses)
  • 6 = adds the forced roster refresh (refresh_friends)
  • 7 = adds full user profiles (get_user) and badge art (get_badge_image).
  • 8 = adds profile editing (set_profile)
  • 9 = bounds catch-up (catch_up takes a limit, caught_up reports a gap)
  • 10 = server-side notification inbox (notifications re-broadcast on change, get_notifications answered from it)
  • 11 = filtered inventory listings (get_inventory takes types, not_types and not_flags; inventory echoes them)
  • 12 = events ordered by time (catch_up takes an epoch, caught_up carries it, events_reset when history was rewritten)
  • 13 = imports (import_begin, import_events, import_end, import_abort, get_imports, import_undo)
  • 14 = boop replies (notification_action takes boop)
  • 15 = notification promotion (get_promotions, set_promotions, promotions)
  • 16 = set_promotions takes a request_id, echoed to the requester only
  • 17 = status-change synthetic, promotion rules take statuses
  • 18 = groups (get_groups, get_group, group_action, groups)
  • 19 = group announcements (get_group_announcement)
  • 20 = friend requests (friend_request, friend_request_result)

Failure:

{"type": "auth_error", "message": "Invalid token"}

All other messages require authentication. Unauthenticated messages are rejected with an error.

Client-to-Server Messages #

auth #

Authenticate with the server. Must be sent first.

Field Type Description
type string "auth"
token string Shared secret token

status #

Request current server status.

{"type": "status"}

catch_up #

Request events stored since a given ID. Server sends the newest limit of them in ascending time order, followed by a caught_up message.

Events are ordered by received_at, not by ID: history stored after the fact (an import) gets higher IDs than the events that follow it. IDs stay the cursors: since_id means "stored after", and before_id names a position in time order. Timestamps are UTC with millisecond precision (YYYY-MM-DDTHH:MM:SS.sssZ), ties broken by ID; local time would interleave the hour repeated when daylight saving ends.

An ID only means something within one epoch of the server's history. A client that has been told one sends it back as epoch; when the server's differs (history was rewritten, or the database is not the one the ID came from), it answers events_reset instead of replaying. A client that sends no epoch adopts the one in caught_up.

The limit exists because the event log does not shrink: a server running for months holds tens of thousands of events, and replaying all of them takes long enough that the keepalive gives up on a client that is perfectly healthy. What was skipped is not lost — caught_up says so with gap, and the client back-fills a page at a time with fetch_older.

Field Type Description
type string "catch_up"
since_id long Last known event ID (0 for all)
limit int Max events to replay (default 1000, max 5000)
epoch long Epoch since_id came from. Optional

fetch_older #

Request a page of events older than the one named by before_id. Server sends matching events in descending order as event_older messages (capped at limit, max 500), followed by an older_fetched terminator. Intended for UI back-fill when a client has caught up and wants to scroll into history.

A before_id naming no row is still a position: past the newest ID it means "from the newest" (long.max seeds a feed), otherwise the nearest lower ID stands in for it, that event included.

Field Type Description
type string "fetch_older"
before_id long Return events older than this one
limit int Max events to return (default 100, max 500)

get_friends #

Request the current friends state snapshot. Cheap: the server answers from the tracker it already holds, topping up instance occupancy for the handful of locations whose cached counts have lapsed. It does not re-read the roster from VRChat -- see refresh_friends for that.

{"type": "get_friends"}

refresh_friends #

Ask the server to re-read the roster from VRChat, the full paginated pull it otherwise performs only on WebSocket reconnect and on its own timer (2 hours by default). This is the repair path: the tracker is built from a stream of changes, so a frame missed while the pipeline was down leaves a friend parked wherever they last were, and no later event corrects it.

{"type": "refresh_friends"}

The server replies friends_refresh immediately with whether a pass started; it does not wait for the pass, which runs on the re-seed worker and holds the VRChat API mutex for its duration. The roster follows as a broadcast friends snapshot carrying "reseeded": true, sent to every connected client.

Passes are debounced 60 seconds apart. A request inside that window is refused (started: false) and answered with a friends snapshot, as if get_friends had been sent, so a caller always has something to draw.

Requires protocol version 6.

get_world #

Request world name resolution.

Field Type Description
type string "get_world"
world_id string World ID (e.g. "wrld_...")

get_user #

Request one user's full profile: bio, links, badges, trust rank, languages, the day they joined. Server replies with user. Requires server_version >= 7.

None of this is in the friends snapshot. It changes on a different timescale than where somebody is standing, so carrying it in a broadcast sent on every friend movement would pay for it hundreds of times over; it is asked for when a profile is opened instead.

It is also the only way to see somebody who is not a friend, which is the case it exists for: a friend request arrives as a name and an ID, and there is nothing else to decide on.

Field Type Description
type string "get_user"
user_id string Target user ID (usr_...)
{"type": "get_user", "user_id": "usr_8b5e4d3c-..."}

The server answers from a 5-minute cache when it can, and a failure is remembered for a minute, so several front-ends looking at the same person cost one GET /users/{id}. Anything that is not a user ID (a grp_... from a group notification, most of all) is refused without a call. Unfriending someone drops their cached profile, since it carries isFriend.

get_moderations #

Request the mute/block moderations snapshot. Server replies with moderations. Always refetches GET auth/user/playermoderations from VRChat: there are no WebSocket events for player moderations, so the cache goes stale whenever the user moderates in-game. Clients send this automatically after connect (when server_version >= 3) and from the Refresh button on the moderation list pages.

{"type": "get_moderations"}

moderate_user #

Add or remove a player moderation. The server calls POST auth/user/playermoderations (mute/block) or PUT auth/user/unplayermoderate (unmute/unblock), updates its cache, replies with moderate_result, and on success broadcasts a fresh moderations snapshot to all authenticated clients.

Field Type Description
type string "moderate_user"
user_id string Target user ID (usr_...)
action string One of "mute", "unmute", "block", "unblock"

unfriend #

Remove a friend. The server calls DELETE auth/user/friends/{userId}, replies with unfriend_result, and on success eagerly removes the friend from the tracker and broadcasts a fresh friends snapshot (rather than waiting for the friend-delete WebSocket event). HTTP 404 is treated as success: the friendship is already gone, which is the desired end state.

Field Type Description
type string "unfriend"
user_id string Target user ID (usr_...)

friend_request #

Send or cancel a friend request. The server calls POST user/{userId}/friendRequest (send) or DELETE user/{userId}/friendRequest (cancel, outgoing requests only) and replies with friend_request_result. Sending to somebody who already sent you one accepts theirs, and the roster moves on the friend-add event that follows. Either way the cached profile is dropped, since its friendRequestStatus is now stale.

Field Type Description
type string "friend_request"
user_id string Target user ID (usr_...)
action string "send" or "cancel"

get_groups #

Request the logged-in user's groups. Server refetches GET users/{selfId}/groups and replies with groups. Clients send this after connect (when server_version >= 18) and from REFRESH. The list is then kept current from group-joined, group-left and group-member-updated, re-broadcast on change.

{"type": "get_groups"}

get_group #

Request one group's details (GET groups/{groupId}?includeRoles=true, cached 5 minutes). Server replies with group. Works for groups the user is not in.

Field Type Description
type string "get_group"
group_id string Group ID (grp_...)

get_group_announcement #

Request a group's current announcement (GET groups/{groupId}/announcement, cached 5 minutes, dropped when a group.announcement notification for the group arrives). Server replies with group_announcement. Only the current one: VRChat keeps no history here, so an older notification opens whatever replaced it.

Field Type Description
type string "get_group_announcement"
group_id string Group ID (grp_...)

group_action #

Member-side group action. Replies with group_action_result and, on success, broadcasts groups.

Field Type Description
type string "group_action"
group_id string Group ID (grp_...)
action string represent, unrepresent (PUT groups/{id}/representation), subscribe, unsubscribe, visibility (PUT groups/{id}/members/{selfId}), join (POST groups/{id}/join), cancel_request (DELETE groups/{id}/requests), leave (POST groups/{id}/leave)
value string For visibility: visible, friends or hidden

get_notifications #

Request the pending notification list. Server replies with notifications. Requires server_version >= 4.

Always refetches from VRChat. The WebSocket only reports changes, so anything that arrived while a front-end was down has no event to replay and the inbox cannot be rebuilt from the event log; this is the authoritative list. Front-ends send it once per connect and then keep the list current from the notification events.

VRChat has two notification systems and neither endpoint returns the other's, so the server fetches both: GET auth/user/notifications (v1: friend requests, invites, boops, votes to kick) and GET notifications (v2: group invites, join requests, transfers, announcements, queue-ready, instance closures, moderation). Every type is returned, not just the ones with an accept button - a front-end draws a dismiss for the rest. The v2 half is allowed to fail on its own: the failure is logged server-side and the v1 list is sent anyway, since a partial inbox beats an error that leaves the front-end with a stale one.

VRChat no longer includes sender names, so the server fills them in from the friend roster, then falls back to GET /users/{id} for the ones the roster cannot answer - a friend request is precisely the case where the sender is not a friend yet. Those lookups are capped per request; past the cap the user ID stands in as the name. Group IDs (grp_..., which is what a v2 group notification puts in the sender field) are never looked up.

{"type": "get_notifications"}

notification_action #

Answer one notification. The server replies with notification_action_result.

The two notification systems share no endpoints, so api_version decides which call is made:

Action v1 v2
accept PUT auth/user/notifications/{id}/accept rejected: use respond
hide PUT auth/user/notifications/{id}/hide DELETE notifications/{id}
respond rejected: v1 notifications have no responses POST notifications/{id}/respond
boop POST users/{user_id}/boop, then hide same, then hide

A promoted entry (user_notification_...) is vrcd's own: hide removes it without calling VRChat, and every other action fails.

For hide, HTTP 404 is treated as success: the notification is already gone, which is the desired end state.

A boop answers a boop with one of your own rather than posting the notification's boop response back, since what VRChat does with that response is undocumented. The notification is dismissed afterwards, because VRChat leaves an answered boop in the inbox; success reports the boop, and a failed dismiss only leaves the row behind. Requires server_version >= 14.

Field Type Description
type string "notification_action"
notification_id string Notification ID (not_...)
action string One of "accept", "hide", "respond", "boop"
api_version int Which system it belongs to, 1 or 2. Absent means 1
response_type string On respond: which of the entry's responses was pressed
response_data string On respond: that response's data, sent back verbatim
user_id string On boop: who to boop, the notification's sender_user_id
emoji_id string On boop: default_<name> for a built-in emoji, or a file_... ID. Absent is a plain boop
emoji_version int On boop: the file's version, for a file_... emoji

get_promotions #

Request the promotion rules. Server replies with promotions. Requires server_version >= 15.

{"type": "get_promotions"}

set_promotions #

Replace the whole rule set. On success the server stores it and broadcasts promotions to every client; on failure only the requester gets promotions with error and the rules as they were. Requires server_version >= 15.

An optional request_id string (server_version >= 16) comes back in the promotions sent to the requester, on success and on failure. The other clients get the same broadcast without it, which is how a front-end tells its own save from another's. Saves are applied one at a time, in the order they arrive.

A rule turns a matching event into an inbox entry (see notifications) and an ephemeral notification-promoted event. Rules see only events that survived noise suppression, and synthetics (avatar-change, profile-change, status-change). Events about yourself never match. The first matching enabled rule wins, so one event makes at most one entry.

Field Type Description
id string Unique within the set, chosen by the front-end
name string Entry title. Empty uses the event's feed label
enabled bool Absent means true
events array Event types, e.g. "friend-delete". Notification events are rejected
users array usr_... IDs the event must be about. Empty or absent matches anyone
statuses array Status the friend must be in after the event, one of "join me", "active", "ask me", "busy". Read from a status-change's currentStatus, else user.status. Empty or absent matches any. server_version >= 17
cooldown int Seconds the rule stays quiet for the same user after firing. 0 is none
{"type": "set_promotions", "rules": [
  {"id": "r1", "name": "Unfriended", "events": ["friend-delete"]},
  {"id": "r2", "events": ["friend-online"], "users": ["usr_..."], "cooldown": 300}
], "request_id": "save-1"}

What VRChat already notifies #

A rule is for events VRChat does not turn into a notification of its own. These already arrive as notification or notification-v2 and land in the inbox without one:

  • v1: friendRequest, invite, requestInvite, inviteResponse, requestInviteResponse, votetokick, boop, message
  • v2: group.* (announcement, invite, join request, transfer, post, event created/starting), event.announcement, badge.earned, boop, moderation.*, gifts (economy.received.gift, vrcplus.gift), avatarreview.*, instance.closed

VRChat has no notification for a friend request being accepted (friend-add), an unfriend (friend-delete), a status change (status-change), or a friend going online, offline or elsewhere, so those are what rules are for. user-badge-assigned is deliberately not in the editors' catalogue (promotableEvents in common/source/vrcd/promotions.d), since it most likely duplicates badge.earned. Check new catalogue entries against this list.

The rule with id "watch-online" is the one a friend's "Notify When Online" toggle adds to and removes from, so every front-end edits the same rule. Nothing on the server treats it specially.

set_status #

Set the logged-in user's status and/or custom status message. The server issues a PUT users/{selfUserId} to VRChat, updates its self entry from the response, broadcasts a fresh self snapshot to all authenticated clients, and replies to the requester with set_status_result.

Either field may be omitted to leave it unchanged; at least one must be present.

Field Type Description
type string "set_status"
status string Optional. One of "active", "join me", "ask me", "busy"
status_description string Optional. Custom status message text

set_profile #

Edit the parts of the logged-in user's profile that they write themselves. The server replies with set_profile_result, preceded on success by a fresh self broadcast. Requires server_version >= 8.

Every field is optional and an omitted one is left alone; at least one must be present. An empty value is how a field is cleared, which is why "absent" and "empty" are not the same thing.

Bio, links and pronouns go out as one PUT users/{selfUserId}. Languages do not: VRChat keeps them as language_* entries in the user's tag list, alongside trust rank and moderation marks, so they are changed with POST users/{selfUserId}/removeTags and /addTags against the difference. That difference needs the current tags, which come from the PUT response when there was one and cost a GET users/{selfUserId} when there was not.

Limits are checked before any call is made: bio 512 code points, pronouns 32, at most 3 links (http/https only -- both front-ends put these in an anchor), at most 3 languages. Anything VRChat itself refuses comes back in error in VRChat's own words.

Field Type Description
type string "set_profile"
bio string Optional. Profile bio
pronouns string Optional. Pronouns
bio_links array Optional. Links pinned under the bio, in order
languages array Optional. ISO 639-3 codes without the language_ prefix

get_files #

Request a page of the logged-in user's files for one content tag. The server proxies GET /files on VRChat and replies with files.

Field Type Description
type string "get_files"
tag string One of "gallery", "icon", "sticker", "emoji"
n int Optional. Page size (default 60)
offset int Optional. Page offset (default 0)

get_prints #

Request the logged-in user's prints. Server replies with prints (single page, up to 100 entries; VRChat caps prints at 64 per user).

{"type": "get_prints"}

get_inventory #

Request the logged-in user's inventory items (props, bundles, drone/portal skins, warp effects). The server pages through VRChat's inventory API (up to 500 items) and replies with inventory.

Field Type Description
type string "get_inventory"
types string Optional. Comma-separated item types to include (v11)
not_types string Optional. Comma-separated item types to exclude (v11)
not_flags string Optional. Comma-separated capability flags to exclude (v11)
archived bool Optional. Return archived items instead

Item types are bundle, droneskin, emoji, portalskin, prop, sticker and warpeffect; flags are archivable, cloneable, consumable, equippable, instantiatable, trashable, ugc and unique. Anything else is refused as an error. Each filter is passed to VRChat and applied again to the reply, since a filter the endpoint ignores would widen the listing rather than fail.

A request with none of the three filters means the Items view and defaults to not_types=emoji,sticker: emoji and stickers have their own sections, sourced from the files endpoint. That default is what a front-end older than these fields gets.

The exclusive stickers and emoji — the ones VRChat handed out rather than ones this account uploaded — are types=sticker or types=emoji with not_flags=ugc, since an uploaded sticker or emoji also has an inventory entry, flagged ugc, alongside the file the files listing carries.

get_inventory_drops #

Request the currently active inventory drop campaigns. Server replies with inventory_drops.

{"type": "get_inventory_drops"}

get_image #

Request image bytes through the server proxy. The server serves from its disk cache when possible, otherwise downloads from VRChat (rate-limit aware, 250 ms minimum spacing) and caches the result. Replies with image.

Field Type Description
type string "get_image"
file_id string File ID (file_...)
version int Optional. File version (default 1)
size int Optional. 0 = original file (default); 128, 256, 512, or 1024 = thumbnail edge

get_badge_image #

Request badge art through the server proxy. Replies with badge_image. Requires server_version >= 7.

Badges are the one picture in a profile that is not a VRChat file: they sit on a public asset CDN, so there is no file ID for get_image to be handed and the request names a URL. A front-end could load that URL itself in six lines; none of them do, because they make no external requests on purpose -- one that phoned out would break behind a tunnel, and would tell VRChat's CDN who is looking at whom.

Field Type Description
type string "get_badge_image"
url string imageUrl from a badge in a user reply
{"type": "get_badge_image", "url": "https://assets.vrchat.com/badges/fa/bdgai_....png"}

Which makes this the one request where a client names what to fetch rather than which object, so the URL is pinned hard: HTTPS, host exactly assets.vrchat.com, path under /badges/, and what is left checked character by character -- no .., no userinfo, no query, no fragment, nothing that is not a path character. Anything else is refused without a fetch. The rule lives in common/source/vrcd/badgeurl.d because both sides check it; if they disagreed, the looser one would be the real rule.

The CDN is not the VRChat API, so this touches neither the VRChat session, its cookies, its rate limiter, nor the API mutex: a badge fetch and a friend-list refresh have nothing to contend over. Results are cached in memory (8 MB, oldest evicted) and failures for 5 minutes; downloads are spaced 100 ms apart.

delete_file #

Delete a file (gallery image, icon, sticker, or emoji). Server replies with delete_file_result.

Field Type Description
type string "delete_file"
file_id string File ID (file_...)

delete_print #

Delete a print. Server replies with delete_print_result.

Field Type Description
type string "delete_print"
print_id string Print ID (prnt_...)

set_user_icon #

Set or clear the logged-in user's profile icon. Requires VRC+ (VRChat returns 403 otherwise). Server replies with set_user_icon_result.

Field Type Description
type string "set_user_icon"
file_id string Icon file ID; empty string clears the icon

inventory_action #

Equip, unequip, or consume an inventory item. Server replies with inventory_action_result.

Field Type Description
type string "inventory_action"
action string "equip", "unequip", or "consume"
inventory_id string Inventory item ID (inv_...); not used for unequip
slot string Equip slot name; required for equip and unequip

upload_image #

Upload a PNG to the files API under a content tag. The server validates the payload (PNG only, max 10 MB, max 2000x2000, square for stickers/emoji) before forwarding it as a multipart POST. Replies with upload_image_result.

Field Type Description
type string "upload_image"
tag string One of "gallery", "icon", "sticker", "emoji"
data_base64 string PNG bytes, base64-encoded
animationStyle string Optional (animated emoji)
loopStyle string Optional (animated emoji)
frames int Optional (animated emoji)
framesOverTime int Optional (animated emoji)

upload_print #

Upload a PNG as a print. Same size limits as upload_image; additionally throttled server-side to one upload per 2.5 seconds. Replies with upload_print_result.

Field Type Description
type string "upload_print"
data_base64 string PNG bytes, base64-encoded
note string Optional. Print caption
world_id string Optional. World the picture was taken in
world_name string Optional. World name
timestamp string Optional. ISO 8601; defaults to the current time (UTC)

auth_response #

Answer to an auth_request. The first answer to arrive wins; the server does not acknowledge it, it either signs in to VRChat or sends a new auth_request carrying the error. A cancel makes the server give up on that sign-in attempt, which for a headless server means it stops waiting and exits. Letting the prompt expire is not the same thing: see auth_cancelled.

Field Type Description
type string "auth_response"
kind string One of "credentials", "two_factor"
username string Credentials only. VRChat username or email
password string Credentials only
code string Two-factor only. The 2FA code
cancelled bool Optional. true refuses the prompt; other fields ignored

Imports: import_begin, import_events, import_end, import_abort, get_imports, import_undo #

History from another tool (only VRCX so far) stored into the event log. The client reads the other tool's data and converts it; the server decides what fits. What fits is the time vrcd was not recording itself: its own log is authoritative where it exists, so an import only fills the periods before vrcd ran and the gaps while it was disconnected (per the connection log, widened by a minute at each edge), minus what earlier imports covered, back to where prune_retain would cut history off. One import runs at a time, server-wide.

  1. import_begin names the source and the VRChat account the data belongs to, and is refused unless that is the account the server is signed in as. The reply is import_plan: the spans the import may fill, and what was left out and why, so a client can say so before sending anything.
  2. import_events carries one batch; import_ack answers it. Send the next batch after the ack. Events outside the accepted spans, of an unknown or ephemeral type, or malformed, are counted as rejected rather than stored.
  3. import_end finishes it: what each span covered (its first to its last event, not the whole span, so a newer copy of the same data can fill in past where this one ended) is recorded, and if anything was stored the epoch moves and every client gets events_reset. import_abort deletes what the import stored instead. So does the client disconnecting, and so does the server restarting in the middle of one.
Field Type Description
type string "import_begin"
source string "vrcx"
account string VRChat user ID the data belongs to
Field Type Description
type string "import_events"
import_id long From import_plan
events array Up to 5000 of {received_at, event_type, content}: an ISO 8601 time (normalised to the stored format), a type from VRChat Event Types, and the content object as an event would carry it

import_end and import_abort carry only type and import_id.

Finished imports are listed by get_imports (no fields) and undone by import_undo with an import_id. Undoing deletes the import's events and its coverage, so those spans are offered to the next import again, and moves the epoch like finishing one does. The space is handed back to the disk afterwards, not only to SQLite. An import that stored nothing is not listed: it left nothing to undo.

Replies:

Message Fields
import_plan import_id; accept, recorded, imported: lists of [from, to) pairs in the stored timestamp format, from null for the beginning of time. accept is what may be sent; recorded is where vrcd was recording (with its margin); imported is what earlier imports covered
import_ack import_id, accepted, rejected
import_done import_id, rows: events stored over the whole import
import_aborted import_id
imports imports: list of {import_id, source, account, from, to, rows, imported_at}, oldest first. from/to are its earliest event and just past its latest
import_undone import_id, rows: events deleted
import_error message, and import_id when there is one. Nothing changed

pong #

Keepalive response to server's ping.

{"type": "pong"}

Server-to-Client Messages #

auth_ok #

Authentication succeeded.

Field Type Description
type string "auth_ok"
server_version int Protocol version (currently 11)

auth_error #

Authentication failed.

Field Type Description
type string "auth_error"
message string Error description

auth_request #

The server needs to sign in to VRChat and has no TTY to ask on, so it delegates the prompt to its clients. Broadcast when the sign-in reaches that point, and replayed to a client that authenticates while one is still pending. Answered with auth_response; after 30 minutes the server gives up on that prompt and sends auth_cancelled. Both front-ends handle these, so either can sign a headless server in.

Note this is VRChat's sign-in, not this API's: the auth handshake above is a separate shared secret.

Field Type Description
type string "auth_request"
kind string One of "credentials", "two_factor"
method string Two-factor only. One of "totp", "otp", "emailOtp"
error string Optional. Why the previous attempt failed (e.g. "Invalid code")

auth_cancelled #

Nobody answered an auth_request in time, so the server dropped it, restarted the sign-in and will send a fresh one. Front-ends should take the prompt down: an answer to a request nobody is waiting on is discarded.

Field Type Description
type string "auth_cancelled"
reason string Currently always "timeout"

status #

Server status. Sent after auth and on VRChat connection changes, or when requested.

Field Type Description
type string "status"
vrchat_connected bool Whether VRChat WebSocket is connected
vrchat_last_error string Last connection error (optional)

event #

A VRChat event, either live or during catch-up.

Field Type Description
type string "event"
id long Auto-incrementing event ID (1-based). 0 for ephemeral broadcasts (not persisted; see below)
received_at string ISO 8601 timestamp (UTC)
event_type string VRChat event type (see below)
content object Parsed event content (enriched by server)

Ephemeral events (id == 0) are live-only signals that the server never writes to ws_events. They will not appear in catch-up or fetch_older results, and clients must not advance their stored high-water mark (last_event_id) when they arrive. Currently emitted for friend-traveling.

caught_up #

Sent after all catch-up events have been delivered.

Field Type Description
type string "caught_up"
last_id long Highest ID stored when the replay started, or since_id when none were. The next since_id
epoch long The server's current epoch (APIv12)
first_id long ID of the first event sent. Absent when none were
gap bool True when older events after since_id were skipped to stay under the limit. Absent when no events were sent

A client that gets gap: true is missing the events between since_id and first_id; fetch_older from first_id is what pulls them in.

events_reset #

The event history was rewritten, so every ID a client holds is from a history that no longer exists. Sent instead of a replay when catch_up names another epoch, and broadcast when the server rewrites its history. A client drops its feed and cursor and sends catch_up from 0 with the new epoch.

Field Type Description
type string "events_reset"
epoch long The new epoch

event_older #

A back-filled VRChat event from a fetch_older request. Same fields as event but the type is "event_older" so the client can append it to the tail of the feed without advancing its live-cursor high-water mark.

older_fetched #

Terminator for a fetch_older response. Sent after all event_older messages in the batch.

Field Type Description
type string "older_fetched"
before_id long The before_id the client requested
oldest_id long ID of the oldest event in this batch (equals before_id when count == 0)
count long Number of events returned in this batch

friends #

Friends state snapshot. Sent after get_friends and when friends state changes.

Field Type Description
type string "friends"
instances array Online friends grouped by instance
offline array Offline friends
reseeded bool Present and true only on the snapshot a re-seed produced

reseeded marks a roster that came from a full pull rather than from accumulated WebSocket changes. Snapshots are broadcast on every friend movement, so a front-end waiting on a refresh_friends it asked for needs this to tell its answer from the ordinary traffic.

Each instance entry:

Field Type Description
instance_id string VRChat instance ID
world_name string Resolved world name
friends array Friends in this instance

Each friend entry (in both instances[].friends and offline):

Field Type Description
id string User ID (usr_...)
displayName string Display name
status string "active", "join me", "ask me", "busy", "offline"
statusDescription string Custom status text
platform string "standalonewindows", "android", etc.
location string Instance ID, "private", or "offline"
bio string Long-form profile blurb (distinct from statusDescription)
pronouns string User-set pronouns
bioLinks array Profile URLs the user pinned
imageFileId string Profile picture file (file_...), empty when there is none to fetch
imageVersion int Version of that file, for get_image

The picture is a file rather than a URL because only the server holds the VRChat session: pass imageFileId and imageVersion to get_image with the size you want. VRChat describes the same picture with up to five fields (profilePicOverrideThumbnail, profilePicOverride, userIcon, currentAvatarThumbnailImageUrl, currentAvatarImageUrl) and the server picks between them in that order, so every front-end shows the same face. It is empty for a friend whose only picture is a legacy CloudFront thumbnail, which is not a file, and while VRChat is still serving its robot placeholder.

friends_refresh #

Acknowledgement of refresh_friends, sent immediately. Says only whether a re-seed pass was signaled, not how it went.

Field Type Description
type string "friends_refresh"
started bool True when a pass was signaled
retry_after long Seconds until another may be requested; 0 when started is true

When started is true, the roster arrives later as a broadcast friends snapshot with "reseeded": true -- there is no completion message, and a pass that fails broadcasts nothing at all, so a caller showing progress needs its own ceiling on the wait.

When started is false the pass was debounced, and a friends snapshot follows on this connection only.

self #

Snapshot of the logged-in user's own status. Sent after auth (immediately following status) and whenever the self status changes (e.g. after a successful set_status). Omitted if the server does not yet know the logged-in user.

Field Type Description
type string "self"
id string User ID (usr_...)
displayName string Display name
status string "active", "join me", "ask me", "busy"
statusDescription string Custom status text
bio string Long-form profile blurb
pronouns string User-set pronouns
bioLinks array Profile URLs the user pinned
imageFileId string Own profile picture file, same rules as a friend entry
imageVersion int Version of that file
lastLocation string Last instance VRChat put you in (full location), kept after leaving it and across restarts. Empty until one is seen
lastWorldName string Its world name, empty when unknown

The server takes lastLocation from your own user-location events. Front-ends offer a self-invite back to it (join_instance), which is how to return to an invite-only instance after VRChat closes or crashes.

set_status_result #

Reply to a set_status request, sent only to the requesting client. On success, a self broadcast precedes this for all clients.

Field Type Description
type string "set_status_result"
success bool Whether the VRChat update succeeded
error string Error description (present only on failure)

set_profile_result #

Reply to a set_profile request, sent only to the requesting client. On success, a self broadcast precedes it for all clients.

A refused field is reported here too, rather than as an error message: the requester is waiting on this reply specifically, and a bare error would leave its editor saving forever.

A failure does not mean nothing changed. Bio, links and pronouns are one call and the languages are one or two more, so a tag call that fails after the PUT succeeded reports the failure while the fields it did write stay written; the self broadcast still goes out.

Field Type Description
type string "set_profile_result"
success bool Whether the whole edit succeeded
error string Error description (present only on failure)

moderations #

Mute/block snapshot. Sent as the reply to get_moderations and broadcast to all authenticated clients after any successful moderate_user. Moderation types other than mute/block (e.g. interactOff) are not included.

Field Type Description
type string "moderations"
muted array Muted users: {user_id, display_name}
blocked array Blocked users: {user_id, display_name}
error string On failure, sent instead of the lists (rate limit, VRChat error)

promotions #

The promotion rules, in the shape set_promotions takes. Sent as the reply to get_promotions, broadcast after a successful set_promotions, and sent to the requester alone with error when one was rejected.

Field Type Description
type string "promotions"
rules array The rules the server is running
error string Why a set_promotions was rejected
request_id string The requester's request_id, to the requester only

groups #

The user's groups, sorted by name. Reply to get_groups, and broadcast after a successful group_action or a group event that changed the list.

Field Type Description
type string "groups"
groups array {id, name, shortCode, discriminator, iconFileId, iconVersion, bannerFileId, bannerVersion, memberCount, isRepresenting, visibility, privacy, ownerId}
error string On failure, sent instead of the list

group #

Reply to get_group.

Field Type Description
type string "group"
group_id string Echoed group ID
success bool Whether the fetch succeeded
group object {id, name, shortCode, discriminator, description, rules, links, languages, iconFileId, iconVersion, bannerFileId, bannerVersion, memberCount, onlineMemberCount, privacy, joinState, isVerified, ownerId, createdAt, membershipStatus}, plus myMember: {isRepresenting, isSubscribedToAnnouncements, visibility, joinedAt, membershipStatus, roles} when the user has a membership. roles are names.
error string Present only on failure

group_announcement #

Reply to get_group_announcement.

Field Type Description
type string "group_announcement"
group_id string Echoed group ID
success bool Whether the fetch succeeded
announcement object {id, title, text, authorId, createdAt, updatedAt, imageFileId, imageVersion}, or {} when the group has none
error string Present only on failure

group_action_result #

Reply to group_action, sent only to the requester.

Field Type Description
type string "group_action_result"
success bool Whether the VRChat call succeeded
action string Echoed action
group_id string Echoed group ID
name string Group name, best known
value string Echoed visibility, when sent
membership_status string For join: member, or requested for groups that ask first
error string Present only on failure

moderate_result #

Reply to a moderate_user request, sent only to the requesting client. On success, a moderations broadcast for all clients follows.

Field Type Description
type string "moderate_result"
success bool Whether the VRChat call succeeded
action string Echoed action
user_id string Echoed target user ID
display_name string Target display name (best known; may be empty)
error string Error description (present only on failure)

unfriend_result #

Reply to an unfriend request, sent only to the requesting client. On success, a friends broadcast for all clients follows. Same fields as moderate_result, without action.

friend_request_result #

Reply to a friend_request, sent only to the requesting client. Same fields as moderate_result, with action echoed. On failure error carries VRChat's own message when it gave one ("This user has already been sent a friend request").

notifications #

Pending notification snapshot. Sent only as the reply to get_notifications; there is no broadcast, since the notification events already tell every client what changed.

Field Type Description
type string "notifications"
notifications array Entries, oldest first (see below)
error string On failure, sent alongside an empty list (rate limit, VRChat error)

Entries promoted by a rule (see set_promotions) are merged in by time. They carry an id of user_notification_..., notification_type "vrcd.promoted", api_version 1 and no responses, so a front-end that knows nothing of them draws a row with a dismiss. They are kept in memory only, at most 50, and a re-seed from VRChat does not remove them.

Each entry:

Field Type Description
id string Notification ID (not_...)
notification_type string VRChat's type string: "friendRequest", "invite", "group.announcement", "group.queueReady", ...
sender_user_id string Sender's user ID, empty when VRChat gave none. A v2 group notification carries a grp_... ID here
sender_name string Resolved display name; falls back to the user ID
title string v2 headline ("Group Invite", an announcement's subject), empty on v1
message string Message body, or the invite's world name when it carries no text
location string Instance an invite points at, empty for every other type
received_at_unix int Creation time, 0 when unknown
responses array Buttons this notification offers, empty on v1 (see below)
can_delete bool Whether it can be dismissed at all. VRChat clears some of its own and refuses to be told to
api_version int Which system it came from, 1 or 2. Echo it back in notification_action

Each response:

Field Type Description
type string Posted back as responseType; also the identity of the button
text string Button label, written by VRChat ("Accept", "Decline", "Block")
icon string Icon hint: "check", "cancel", "ban", "bell-slash", "reply". Advisory, often absent
data string Opaque payload, posted back as responseData alongside the type

Carrying the buttons rather than a per-type table is what makes a notification type nobody wrote code for work: a group invite, a join request and a transfer all answer the same way. Responses of type link are dropped by the server - they point at a screen in VRChat's own client that neither front-end has.

Order is part of the contract, not a detail. Front-ends draw the inbox with accept/dismiss buttons in each row and append new arrivals to the end, so the list never reflows under a thumb that is already reaching for a button - and on a friend request, the button that moves under it is an accept. Entries with no timestamp sort first.

notification_action_result #

Reply to a notification_action request, sent only to the requesting client.

Field Type Description
type string "notification_action_result"
notification_id string Echoed notification ID
action string Echoed action
success bool Whether the VRChat call succeeded
error string Error description (present only on failure)

VRChat also emits a hide-notification or response-notification event for the same change, but it arrives whenever it arrives; a front-end that drops the row on this result stops offering a button that has already been pressed.

world #

Response to get_world.

Field Type Description
type string "world"
world_id string World ID
world_name string Resolved world name

user #

Response to get_user. A failure is reported here rather than as an error, so a front-end's loading state resolves either way and it can tell which request failed.

Field Type Description
type string "user"
user_id string The user that was asked for
success bool Whether the profile was fetched
user object The profile, on success
error string Why not, on failure

The profile flattens VRChat's user object: last_platform becomes platform, date_joined becomes dateJoined, and the tag soup is split into a trust rank, a language list and the moderator/flagged marks, so no front-end has to know the tag vocabulary. Every field is optional on the way in -- VRChat trims a stranger's record thinner than a friend's -- and a missing one arrives empty rather than absent.

{
  "type": "user", "user_id": "usr_...", "success": true,
  "user": {
    "id": "usr_...", "displayName": "Somebody",
    "status": "join me", "statusDescription": "come say hi",
    "bio": "line one\nline two", "bioLinks": ["https://..."],
    "pronouns": "they/them", "note": "", "state": "online",
    "location": "wrld_...:12345", "platform": "standalonewindows",
    "dateJoined": "2019-04-01", "lastActivity": "2026-08-02T12:00:00.000Z",
    "lastLogin": "2026-08-02T09:00:00.000Z",
    "isFriend": false, "friendRequestStatus": "incoming",
    "ageVerified": true, "trustRank": "Known User",
    "languages": ["eng", "jpn"], "moderator": false, "troll": false,
    "badges": [{
      "id": "bdg_...", "name": "Supporter", "description": "Thanks",
      "imageUrl": "https://assets.vrchat.com/badges/...png", "showcased": true
    }],
    "imageFileId": "file_...", "imageVersion": 3
  }
}

trustRank is one of "Visitor", "New User", "User", "Known User", "Trusted User" -- the names the game shows, which are off by one from the tags they come from (system_trust_trusted is "Known User"). imageFileId/imageVersion are picked the same way the roster picks a friend's face, so a profile does not change whose picture it shows.

Badge art is the one picture here that is not a VRChat file: imageUrl points at a public CDN, so there is no file ID for get_image to be handed. It is fetched with get_badge_image instead.

files #

Reply to get_files: one page of trimmed file entries.

Field Type Description
type string "files"
tag string The requested tag
offset int The requested offset
count long Number of entries in this page
files array File entries (empty on failure)
error string Error description (present only on failure)

Each file entry:

Field Type Description
id string File ID (file_...)
name string File name
version long Highest complete, non-deleted version (0 = none usable)
mimeType string MIME type
extension string File extension
tags array VRChat tags

Animated emoji entries may also carry animationStyle, loopStyle, frames, and framesOverTime.

prints #

Reply to get_prints.

Field Type Description
type string "prints"
prints array Print entries (empty on failure)
error string Error description (present only on failure)

Each print entry:

Field Type Description
id string Print ID (prnt_...)
file_id string Image file ID, for get_image
file_version long Image file version
note string Caption
worldId string World the picture was taken in
worldName string World name
authorName string Author display name
timestamp string Picture timestamp (ISO 8601)
createdAt string Print creation time (ISO 8601)

inventory #

Reply to get_inventory.

Field Type Description
type string "inventory"
archived bool Whether archived items were requested
types string Filter asked for, echoed (v11)
not_types string Filter asked for, echoed (v11)
not_flags string Filter asked for, echoed (v11)
total_count long Total items VRChat reports for this filter
items array Inventory entries (empty on failure)
error string Error description (present only on failure)

The filter is echoed because a front-end draws three listings out of this one endpoint (its items, its exclusive stickers and its exclusive emoji), and nothing else in the reply says which of them it answers.

Each inventory entry:

Field Type Description
id string Inventory item ID (inv_...)
name string Item name
description string Item description
itemType string VRChat item type (e.g. "prop", "emoji")
itemTypeLabel string Human-readable type label
equipSlot string Equip slot, when applicable
flags array Capability flags ("equippable", "consumable", ...)
collections array Collections the item belongs to
isArchived bool Whether the item is archived
expiryDate string Expiry, when applicable
image_file_id string Image file ID, for get_image (when resolvable)
image_version long Image file version

inventory_drops #

Reply to get_inventory_drops. Same envelope as inventory (items array + optional error), carrying VRChat's drop campaign objects.

image #

Reply to get_image. Echoes the request identity so the client can key its cache.

Field Type Description
type string "image"
file_id string Requested file ID
version long Requested version
size int Requested size
success bool Whether the bytes are included
mime_type string Sniffed MIME type (success only)
data_base64 string Image bytes, base64-encoded (success only)
error string Error description (present only on failure)

badge_image #

Reply to get_badge_image. Echoes the URL so the client can key its cache; a badge URL names one picture forever, the way a file and version do.

Field Type Description
type string "badge_image"
url string Requested URL
success bool Whether the bytes are included
mime_type string Sniffed MIME type (success only)
data_base64 string Image bytes, base64-encoded (success only)
error string Error description (present only on failure)

A response the server cannot sniff as an image is a failure ("Not an image"), since a CDN answering with anything else is an error page, not a badge.

Action results #

delete_file_result, delete_print_result, set_user_icon_result, and inventory_action_result share the same envelope: the request's identifying fields echoed back (file_id, print_id, or action + inventory_id) plus:

Field Type Description
success bool Whether the VRChat call succeeded
error string Error description (present only on failure)

set_user_icon_result reports "HTTP 403 (VRC+ required)" when the account lacks VRC+. Each action result is followed by a status broadcast, since the action consumed VRChat API budget.

upload_image_result / upload_print_result #

Reply to upload_image / upload_print. Same success/error envelope as action results; on success also carries the created object:

Field Type Description
file object Trimmed file entry (see files) - upload_image_result only
print object Trimmed print entry (see prints) - upload_print_result only

After a successful upload, VRChat emits a content-refresh event on the WebSocket, which the server stores and broadcasts as a normal event.

ping #

Server keepalive, sent every 30 seconds. Client must respond with pong within 15 seconds or the server closes the connection.

{"type": "ping"}

A send that moved bytes in that window counts in place of the pong. Pongs are read on the connection's own thread, and that thread is not reading while it is answering a request — a long reply would otherwise be killed by its own keepalive, with the client's pong sitting unread in the receive buffer. A client that has stopped reading stops the sends too, and the 10-second send timeout ends the connection there.

error #

Error response for invalid messages.

Field Type Description
type string "error"
message string Error description

VRChat Event Types #

Events forwarded from VRChat's WebSocket, stored and broadcast as event messages.

Friend Events #

  • friend-online - Friend came online
  • friend-offline - Friend went offline
  • friend-active - Friend became active
  • friend-update - Friend profile updated
  • friend-location - Friend changed location
  • friend-add - New friend added
  • friend-delete - Friend removed

User Events #

  • user-update - Current user updated
  • user-location - Current user changed location
  • user-badge-assigned - Badge assigned
  • user-badge-unassigned - Badge unassigned

Notification Events #

  • notification - Legacy notification
  • notification-v2 - Notification received
  • notification-v2-delete - Notification deleted
  • notification-v2-update - Notification updated
  • see-notification - Notification marked seen
  • hide-notification - Notification hidden
  • response-notification - Notification response

Group Events #

  • group-joined - Joined a group
  • group-left - Left a group
  • group-role-updated - Group role changed
  • group-member-updated - Group member updated

Instance Events #

  • instance-queue-joined - Joined instance queue
  • instance-queue-position - Queue position updated
  • instance-queue-ready - Queue ready to enter
  • instance-queue-left - Left instance queue
  • instance-closed - Instance closed

Content Events #

  • content-refresh - The user's content changed (upload, delete, in-game print, inventory drop). content.contentType names what changed: "gallery", "icon", "emoji", "sticker", "print", "prints", "inventory", "avatar", "world". Clients use it to mark the matching STUFF section stale and re-list on next view

Synthesized Events #

Derived on the server, not produced by VRChat's WebSocket.

  • avatar-change (persisted) - A tracked entry's currentAvatar changed between updates. Content: { userId, displayName, previousAvatar, currentAvatar, isSelf }.
  • profile-change (persisted) - A tracked entry's bio, pronouns, or bioLinks changed between two non-empty values. First sighting of a subfield and clears (non-empty -> empty) seed silently and do not emit. A single edit covering multiple subfields produces one combined event. Content: { userId, displayName, isSelf, previousBio?, currentBio?, previousPronouns?, currentPronouns?, previousBioLinks?, currentBioLinks? } - only the previous*/current* pairs for subfields that actually changed are included.
  • status-change (persisted) - A friend's status or statusDescription changed. Gated like VRCX's Status feed: a move to or from offline is left to friend-online and friend-offline, and a first sighting seeds silently. Never emitted for yourself. The raw friend-update behind it is dropped unless it also moved something else. Content: { userId, displayName, previousStatus, currentStatus, previousStatusDescription, currentStatusDescription }.
  • friend-traveling (ephemeral, id == 0) - A friend's client is loading the next world (raw friend-location with location == "traveling"). Broadcast live for "Joining X" UI; never stored. The concrete arrival arrives shortly after as a normal friend-location. Content: { userId, displayName, travelingToLocation, world?, worldName? }.

Connection Flow #

A typical client session:

Client                          Server
  |                                |
  |-------- TCP connect ---------> |
  |                                |
  |-- {"type":"auth","token":..} ->|
  |                                |
  |<- {"type":"auth_ok",...} ------|
  |<- {"type":"status",...} -------|
  |<- {"type":"self",...} ---------|
  |<- {"type":"friends",...} ------|
  |                                |
  |-- {"type":"catch_up",          |
  |    "since_id": 0,              |
  |    "limit": 1000} ------------>|
  |                                |
  |<- {"type":"event",...} --------|  (newest 1000 events)
  |<- {"type":"event",...} --------|
  |<- {"type":"caught_up",...} ----|
  |                                |
  |    ... live events ...         |
  |<- {"type":"event",...} --------|
  |<- {"type":"friends",...} ------|
  |                                |
  |<- {"type":"ping"} -------------|
  |-- {"type":"pong"} ------------>|
  |                                |

Event Content Enrichment #

Before forwarding events to clients, the server enriches event content:

  1. Display names and platform - Looked up from the friends tracker cache
  2. World names - Resolved via the world name cache (fetched from VRChat REST API, cached for 1 day; failures cached for 1 hour)

Database Schema #

Events are stored in SQLite with WAL mode and incremental auto-vacuum: an import can be most of the file, and undoing one should give that back without a full VACUUM rewriting everything else. An older database is switched over with one VACUUM at startup.

CREATE TABLE ws_events (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  received_at TEXT NOT NULL,   -- YYYY-MM-DDTHH:MM:SS.sssZ
  event_type TEXT NOT NULL,
  source TEXT,                 -- "raw", "synthetic", or "<import source>:<import id>"
  data TEXT
);

CREATE INDEX idx_ws_events_type ON ws_events (event_type);
CREATE INDEX idx_ws_events_time ON ws_events (received_at, id);
CREATE INDEX idx_ws_events_source ON ws_events (source);

-- One row per span an import covered.
CREATE TABLE import_log (
  import_id INTEGER NOT NULL,
  source TEXT NOT NULL,
  account TEXT,
  range_from TEXT NOT NULL,
  range_to TEXT NOT NULL,
  rows INTEGER NOT NULL,
  imported_at TEXT NOT NULL
);

Configuration #

Setting Default Description
Listen address 127.0.0.1 TCP bind address
Listen port 9700 TCP port
API secret (empty) Shared auth token; empty = no auth
Config directory ~/.config/vrcd/ (Linux), %APPDATA%\vrcd\ (Windows)
Data directory ~/.local/share/vrcd/ (Linux), %APPDATA%\vrcd\ (Windows)
image_cache <data dir>/imagecache/ Server-side image disk cache directory
image_cache_max_mb 256 Image cache size cap (mtime-LRU eviction)