Apply JSON Patch to Storage
Changed onApplies a sequence of JSON Patch operations to the room's Storage document, useful for modifying Storage. Operations are applied in order; if any operation fails, the document is not changed and a 422 response with a helpful message is returned.
Paths and data types: Be as specific as possible with your target path. Every parent in the chain of path segments must be a LiveObject, LiveList, or LiveMap. Complex nested objects passed in add or replace operations are automatically converted to LiveObjects and LiveLists. LiveText is a leaf node: only the LiveText node itself is addressable, not fields under its serialized data. Use replace with a string or a LiveTextData array to replace the whole node, for example /text with [["Hello"]]; use remove on /text to remove the node. LiveText versioning is internal and is not part of this API.
Performance: For large Storage documents, applying a patch can be expensive because the full state is reconstructed on the server to apply the operations. Very large documents may not be suitable for this endpoint.
For a full guide with examples, see Modifying storage via REST API with JSON Patch.
Request
- Base URL: https://api.liveblocks.io/v2
- URL: https://api.liveblocks.io/v2/rooms/{roomId}/storage/json-patch
- Auth: none declared
Path parameters
ID of the room
Request body
Example request
[
{
"op": "add",
"path": "/score",
"value": 42
},
{
"op": "remove",
"path": "/oldKey"
}
]Response
Success. All operations were applied; the Storage document was updated.
Changes
- breaking
the
request property type changed fromobjectto no type - warning
removed the request property
/ - warning
removed the request property
/ - warning
removed the request property
/ - warning
removed the request property
/ - info
api operation id
patch-rooms-roomId-storage-json-patchremoved and replaced withpatch-storage-document - info
added
subschema #1: AddJsonPatchOperationsubschema #2: RemoveJsonPatchOperationsubschema #3: ReplaceJsonPatchOperationsubschema #4: CopyJsonPatchOperationsubschema #5: MoveJsonPatchOperationsubschema #6: TestJsonPatchOperationto therequest propertyoneOflist
- breaking
- info
endpoint added
- info