diff --git a/src/pages/docs/liveobjects/rest-api-usage.mdx b/src/pages/docs/liveobjects/rest-api-usage.mdx index cb098b250b..5e2e58d043 100644 --- a/src/pages/docs/liveobjects/rest-api-usage.mdx +++ b/src/pages/docs/liveobjects/rest-api-usage.mdx @@ -562,42 +562,6 @@ The newly created object's ID will be the first item in the list: ``` -### Creating standalone objects - -Create objects without immediately assigning them by omitting both `objectId` and `path` from the create operation. - - -```shell - curl -X POST "https://main.realtime.ably.net/channels/my-channel/object" \ - -u {{API_KEY}} \ - -H "Content-Type: application/json" \ - -d '{ - "mapCreate": { - "semantics": 0, - "entries": { - "name": {"data": {"string": "Alice"}} - } - } - }' -``` - - -The response includes the generated object ID: - - -```json -{ - "messageId": "TJPWHhMTrF:0", - "channel": "my-channel", - "objectIds": ["map:abc123def456...@1745835549101"] -} -``` - - - - ### Client-generated object IDs Generate [object IDs](/docs/liveobjects/concepts/objects#object-ids) when creating objects to enable atomic batch operations with cross-references between newly created objects. This is useful when creating multiple objects that reference each other in a single batch. @@ -660,31 +624,7 @@ There are additional operations for creating objects with client-generated IDs: The server validates that your `objectId` matches the hash of `initialValue + nonce`. -#### Publishing with client-generated IDs - -Publish an operation using either `mapCreateWithObjectId` or `counterCreateWithObjectId` to create -an object with a client-generated ID. - -For example: - - -```shell - curl -X POST "https://main.realtime.ably.net/channels/my-channel/object" \ - -u {{API_KEY}} \ - -H "Content-Type: application/json" \ - -d '{ - "objectId": "map:Qj2kkvprTybCY5mkNMcm31hhNKZCDWqcz45LjYvCABs@1769079911168", - "mapCreateWithObjectId": { - "initialValue": "{\"semantics\":0,\"entries\":{\"name\":{\"data\":{\"string\":\"Alice\"}},\"age\":{\"data\":{\"number\":30}}}}", - "nonce": "random-nonce-abc123" - } - }' -``` - - -#### Atomic batch with cross-references - -Create a map and immediately assign it to the channel object in a single atomic operation: +The following example creates a new `LiveMap` instance with a pre-computed object ID using the `mapCreateWithObjectId` operation, and immediately assigns it to the channel object in a single atomic batch: ```shell @@ -712,6 +652,10 @@ Create a map and immediately assign it to the channel object in a single atomic Both operations execute atomically. The second operation references the object created in the first because you pre-computed the ID. + +