Skip to main content

Vircadia World API

The World API Manager is the interface between clients and the PostgreSQL database, and any other services that might be utilized.

REST API

The REST API is accessible at the base path:

/world/rest

Available Endpoints

EndpointMethodPathDescription
AUTH_SESSION_VALIDATEPOST/world/rest/session/validateValidates a user session token from an authentication provider
Parameters
NameTypeRequiredDescription
tokenstringYesAuthentication token to validate
providerstringYesName of the authentication provider (e.g., 'oauth', 'local')
Returns

Type: object

Description: Response indicating whether the session is valid

Fields

NameTypeDescription
successbooleanIndicates if the validation was successful
timestampnumberUnix timestamp when the response was generated
errorstringError message (only present when success is false)

WebSocket API

WebSocket connections are established by upgrading a connection at:

/world/ws

Establish Connection

The WebSocket connection is established by creating a connection with search parameters:

TypeScript WS upgrade example
// Format for WebSocket connection URL
const url = new URL(`https://server-domain${Communication.WS_UPGRADE_PATH}`);
url.searchParams.set("token", authToken); // Authentication token
url.searchParams.set("provider", authProvider); // Authentication provider name
const ws = new WebSocket(url);

Required URL parameters:

  • token: Authentication token obtained from the authentication provider
  • provider: Name of the authentication provider (e.g., 'system', 'local')

Message Types

The following message types are available in the WebSocket API:

Message TypeDescription
GENERAL_ERROR_RESPONSEResponse sent when a general error occurs during processing
Message Format

Type: object

Description: Error response with details about the failure

Fields

NameTypeDescription
timestampnumberUnix timestamp when the error occurred
requestIdstringID of the request that generated the error
errorMessagestringDetailed error message describing what went wrong
typestringMessage type identifier (GENERAL_ERROR_RESPONSE)
QUERY_REQUESTRequest to execute a query on the server
Parameters
NameTypeRequiredDescription
querystringYesThe query string to execute
parametersarrayNoArray of parameters to pass to the query
requestIdstringYesUnique identifier for this request
Message Format

Type: object

Description: Query request object

Fields

NameTypeDescription
timestampnumberUnix timestamp when the request was created
requestIdstringUnique identifier for this request
errorMessagestring | nullError message if there was an issue with the request format
typestringMessage type identifier (QUERY_REQUEST)
querystringThe query string to execute
parametersarrayArray of parameters to pass to the query
QUERY_RESPONSEResponse to a query request with results or error information
Message Format

Type: object

Description: Query response containing results or error details

Fields

NameTypeDescription
timestampnumberUnix timestamp when the response was generated
requestIdstringID of the request this response is for
errorMessagestring | nullError message if the query failed, null if successful
typestringMessage type identifier (QUERY_RESPONSE)
resultT | []Query results, empty array if no results or error
SYNC_GROUP_UPDATES_RESPONSEResponse containing updates for a sync group
Message Format

Type: object

Description: Updates for entities in a specific sync group

Fields

NameTypeDescription
timestampnumberUnix timestamp when the updates were generated
requestIdstringID of the request that triggered these updates
errorMessagestring | nullError message if there was a problem, null if successful
typestringMessage type identifier (SYNC_GROUP_UPDATES_RESPONSE)
TICK_NOTIFICATIONNotification sent when a server tick occurs
Message Format

Type: object

Description: Information about the completed tick

Fields

NameTypeDescription
timestampnumberUnix timestamp when the tick notification was sent
requestIdstringID for this notification
errorMessagestring | nullError message if there was an issue, null if successful
typestringMessage type identifier (TICK_NOTIFICATION)
tickTick.I_TickDetailed information about the tick that completed