Create rpc

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.

POST /v1/team/collaborator/rpc/{documentId}

Addresshttps://api.hanzo.ai/v1/team/collaborator/rpc/{documentId}
MethodPOST
Operationpost_team_collaborator_rpc_by_documentid
AuthAuthorization: Bearer $HANZO_API_KEY

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 space token: the documentId's space must be the token's space when the token names one, and the caller must be a member of it. An unknown space, another tenant's space and a space 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).

FieldInTypeRequiredDescription
documentIdpathstringyesDocumentID addresses the document field, as "<spaceUuid>|<objectClass>|<objectId>|<objectAttr>" — the collaborator-client encodeDocumentId shape, from the path.
documentIdbodystring—DocumentID addresses the document field, as "<spaceUuid>|<objectClass>|<objectId>|<objectAttr>" — the collaborator-client encodeDocumentId shape, from the path.
methodbodystring—Method is the verb: createContent, updateContent or getContent.
payloadbodyteam.collabPayload—
payload.contentbodyobject—Content maps a document field to its ProseMirror markup JSON.
payload.content.*bodystring—
payload.sourcebodystring—Source is the blob ref a getContent reads the snapshot from.
payload.updatesbodyobject—Updates carries, per field, a base64 Y.js state update encoding the SAME markup — the front computes it (markupToYDoc → encodeStateAsUpdate) so a createContent seeds the live-editing lane's update log, not just the snapshot blob.
payload.updates.*bodystring—

Response

StatusBodyMeaning
200team.collabResultok
defaultproblem-detailsrefused

200 body — 3 fields.

FieldInTypeAlwaysDescription
contentbodyobject—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.*bodystring—
errorbodystring—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 instead.

Failure carries the platform error shape — see Errors.

Examples

hanzo team collaborator rpc add <documentId>
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 := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.TeamAPI.PostTeamCollaboratorRpcByDocumentid(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::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.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new TeamApi(client).postTeamCollaboratorRpcByDocumentid();
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>"
     }'

MCP reaches team through the team tool, which names its 33 operations with its own verbs — this one among them, under a name only MCP 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": "list_team_account_providers"
         }
       }
     }'

Team API · All Hanzo APIs · Interactive reference

Was this page useful?