Manage a room and its storage using the Liveblocks REST API endpoints. They’ll help you manage your data and extend Liveblocks’ functionality. You’ll find the API base URL below.
This is the API v1 reference, learn more about the latest version on the API v2 reference.
To use the API, you need to add a JWT token to the request’s authorization header:
You can get a JWT token by calling our authorization endpoint, using your secret key (accessible from the dashboard). The token will be valid for one hour.
Get the room storage data as a JSON using the endpoint below.
GET
"liveblocksType"
: "LiveObject"
| "LiveList"
| "LiveMap"
"data"
=> contains the nested data structures (children) and data.LiveObject
.Initialize a room storage using the following endpoint. The storage of the room you’re initializing must be empty. The new storage data can be passed as a JSON in the request body.
POST
The format of the request body is the same as what's returned by the get storage endpoint.
For each Liveblocks data structure that you want to create, you need a JSON element having two properties:
"liveblocksType"
: "LiveObject"
| "LiveList"
| "LiveMap"
"data"
=> contains the nested data structures (children) and data.The root's type can only be LiveObject
.
Delete all elements of the room storage using the following endpoint.
DELETE
Get the current list of users connected to a room.
GET
id
and info
can be set during the authentication
to the room, see authorize
.Gets a list of rooms. Pagination is cursor-based, the response contains the url for the next page.
GET
limit
: Optional, default is 20, accepted value between 1 and 100.starting_after
: Optional, automatically built and part of the response for
you to request the next page.