CollabRPC is the collaborative-markup snapshot plane the Team front's editor…
CollabRPC is the collaborative-markup snapshot plane the Team front's editor speaks: createContent stores a document field's markup at a fresh, immutable…
POST /v1/team/collaborator/rpc/{documentId}
| Address | https://api.hanzo.ai/v1/team/collaborator/rpc/{documentId} |
| Method | POST |
| Operation | post_team_collaborator_rpc_by_documentid |
| Auth | Authorization: Bearer $HANZO_API_KEY |
CollabRPC is the collaborative-markup snapshot plane the Team front's editor speaks: createContent stores a document field's markup at a fresh, immutable blob ref and returns it, updateContent stores a new snapshot and answers nothing, and getContent reads back the exact snapshot a ref names.
createContent ALSO seeds the live-editing update log from the front-supplied Y.js update, so a dialog-authored description is visible in the collaborative editor — which replays that log — and not only in snapshot reads. updateContent never touches that log: peers may be live-editing the document, and their edits are not this call's to overwrite.
Every call is scoped to the caller's VERIFIED session or workspace token: the documentId's workspace must be the token's workspace when the token names one, and the caller must be a member of it. An unknown workspace, another tenant's workspace and a workspace the caller is not in all answer the same 404, so a probe learns nothing about what exists.
Request
9 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
documentId | path | string | yes | DocumentID addresses the document field, as "<workspaceUuid>|<objectClass>|<objectId>|<objectAttr>" — the collaborator-client encodeDocumentId shape, from the… |
documentId | body | string | — | DocumentID addresses the document field, as "<workspaceUuid>|<objectClass>|<objectId>|<objectAttr>" — the collaborator-client encodeDocumentId shape, from the… |
method | body | string | — | Method is the verb: createContent, updateContent or getContent. |
payload | body | collabPayload | — | |
payload.content | body | object | — | Content maps a document field to its ProseMirror markup JSON. |
payload.content.* | body | string | — | |
payload.source | body | string | — | Source is the blob ref a getContent reads the snapshot from. |
payload.updates | body | object | — | Updates carries, per field, a base64 Y.js state update encoding the SAME markup — the front computes it (markupToYDoc → encodeStateAsUpdate) so a createContent… |
payload.updates.* | body | string | — |
Response
| Status | Body | Meaning |
|---|---|---|
200 | collabResult | ok |
200 body — 3 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
content | body | object | — | Content maps each document field to its value for the verb: the new blob ref after a createContent, the stored markup after a getContent. |
content.* | body | string | — | |
error | body | string | — | Error carries a SEMANTIC refusal, which this RPC reports under 200 because the client throws on result.error — auth and tenancy failures are HTTP statuses… |
Failure carries the platform error shape — see Errors.
Examples
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { Configuration, TeamApi } from 'hanzoai';
const api = new TeamApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postTeamCollaboratorRpcByDocumentid({ documentId: 'documentId', documentId: "<documentId>", method: "<method>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import TeamApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = TeamApi(client).post_team_collaborator_rpc_by_documentid(document_id='documentId', document_id="<documentId>", method="<method>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.TeamAPI.PostTeamCollaboratorRpcByDocumentid(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, team_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = team_api::post_team_collaborator_rpc_by_documentid(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.TeamApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new TeamApi(client).postTeamCollaboratorRpcByDocumentid();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl -X POST https://api.hanzo.ai/v1/team/collaborator/rpc/<documentId> \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"documentId": "<documentId>",
"method": "<method>"
}'The door reaches team through the team tool, which names its 18 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "get_collaborator"
}
}
}'How is this guide?