Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

InstantDB Realtime Sync API

The realtime sync transport - a persistent WebSocket at wss://api.instantdb.com/runtime/session over which the client Reactor sends init, add-query, transact, and presence ops and the server streams query novelty (refresh-ok), presence, and broadcasts back to subscribers.

InstantDB Realtime Sync API is one of 6 APIs that InstantDB publishes on the APIs.io network, described by an AsyncAPI event-driven specification.

Tagged areas include Realtime, WebSocket, Sync, and Presence. The published artifact set on APIs.io includes API documentation, an API reference, and an AsyncAPI specification.

This event API exposes 2 operations across 1 channel, and defines 17 schemas. It is described by AsyncAPI 2.6.0, at version 1.0.0.

The API connects through a single server, api.instantdb.com/runtime/session (wss).

2 operations 1 channels 17 schemas

Metadata

The identity and technical contract details declared by the specification.

Specification
AsyncAPI 2.6.0
API Version
1.0.0
Base URL
wss://api.instantdb.com/runtime/session
Resource Areas
1

Channels & Operations 2

Across 1 channel, the API surfaces 2 operations. Each is listed below with its action, channel, parameters, and response codes.

Channels 2
SUB
/runtime/session
Operations the sync server pushes to the client.
receiveServerOps body
PUB
/runtime/session
Operations the client Reactor sends to the sync server.
sendClientOps body

Messages & Schemas 17

The contract defines 17 schemas that model the data carried by its messages. Each schema is shown below with its type and property counts.

Init
message
Authenticate and open the session.
AddQuery
message
Register an InstaQL query for live updates.
RemoveQuery
message
Transact
message
Send InstaML transaction steps over the socket.
JoinRoom
message
LeaveRoom
message
SetPresence
message
Publish this client's ephemeral presence into a room.
ClientBroadcast
message
Send an ephemeral topic event to others in a room.
InitOk
message
AddQueryOk
message
Acknowledges a query subscription and returns initial results.
RefreshOk
message
Server-pushed updated results when underlying data changes.
TransactOk
message
JoinRoomOk
message
PatchPresence
message
Incremental presence change for peers in a room.
RefreshPresence
message
Full presence snapshot for a room.
ServerBroadcast
message
A topic event broadcast by another client in the room.
ErrorMessage
message
An error tied to a prior client op (by client-event-id).

Specification

The full machine-readable AsyncAPI contract behind this narrative.

Source

instantdb-asyncapi.yml Raw ↑

Other APIs InstantDB publishes across the network.

InstantDB Auth API
InstantDB Presence API
InstantDB Query API
InstantDB Storage API
InstantDB Transactions API