Websocket API
The VRChat Websocket API is used receiving updates regarding the API, such as a friend has been added an invite received. The WebSocket is receive-only, meaning that you can only listen for messages. Sending messages is undefined behavior.
Connecting
Connecting to the VRChat webhook server is done via the URL:
wss://pipeline.vrchat.cloud/?authToken=authcookie_...
The auth-token query parameter is the authorization cookie you receive when logging into VRChat.
Message structure
Messages through VRChat’s Websocket API are delivered as strings. For example, the friend-offline event would be formated as:
"{content:\"{\"userId\": \"usr_...\"}\"}"
After parsing the message:
The value of content is also delivered as a string.
To get the full payload it is required to again parse the contents of content
:
Events
Friend Online Event
Friend Offline Event
Friend Active Event
Friend Add Event
Friend Delete Event
Friend Update Event
Friend Location Event
Notification Received Event
Notifications are used for e.g. Invites, Friend Requests, Invite Requests and Invite Responeses.
Notification Seen Event
Lets the listener know a notification has been marked as seen.
Notification Response
Similar to Notification Received Event
, except this carries an ID (responseId
) of the notificaiton (which is required to fetch seperately) that was sent in response to an earlier notification (notificationId
). This is used e.g., when responding to an Invite.