Outcome
Create a document and its first immutable locale version.
These examples were captured from the local Worker. Deployment, publication and retrieval are verified separately for each environment; local examples do not establish external provider delivery.
Before you start
-
Inspect the credential identity with topolo whoami and the exact action with topolo actions get before preparing input.
-
Discover an accessible Docs workspace with topolo resources topolo-docs and topolo workspaces list topolo-docs. Pass workspace resource type and identifier separately from action input.
-
The published required permission is docs:write; the active credential and resource binding must authorize the call.
-
Validate and plan the exact request. Execute only after the intended effect has been authorized; --confirm is the transport guard, not a grant of permission.
Discover the target
topolo actions get app_topolo_docs.spaces.documents.create --detail --json
topolo resources topolo-docs --json
topolo workspaces list topolo-docs --json
Discover spaceId with app_topolo_docs.spaces.list in the selected workspace.
Input fields
| Field | Required | Meaning |
|---|---|---|
spaceId | Yes | Stable documentation space identifier discovered with spaces.list in the selected workspace. It is separate from the Auth workspace resource identifier. |
parentId | No | Parent document identifier for hierarchy, or null to remove the parent. Discover the parent in the same workspace; omission preserves the parent when updating metadata. Owned-document upsert requires the same owner and audience, and refuses missing parents, self-parenting and cycles. |
title | No | Human-readable title. Native creation uses an Untitled space, Untitled document or Untitled section title when omitted. Updates preserve an omitted title; document versions snapshot their title. |
slug | No | URL or navigation slug. Creation normalizes the supplied value or derives it from title and resolves collisions. Updates preserve it when omitted; changing a public space or document slug changes its address. |
summary | No | Short document summary, stored up to 2,000 characters. A new version snapshots it; public reads retain the explicitly published version summary. |
bodyMarkdown | No | Complete Markdown body for the new immutable version. This replaces the version body, not a patch. The repository stores up to one million characters. |
locale | No | Locale of the version to create; omitted creation locale defaults to en. Public machine reads accept only the locale of the explicitly published version. |
sourceKind | No | Document provenance. Native is the default. platform_repo requires platform access and prevents editing through native document metadata/version routes. |
sourceRevision | No | Provenance revision for the immutable version. Owned-document upsert requires an exact lowercase 40-character commit SHA when supplied; ordinary version creation stores the supplied provenance string. |
sourcePath | No | Repository path or other provenance path associated with the immutable version. It is recorded as evidence metadata rather than used to fetch content. |
Interpret the response
document is the new current record and version is its first immutable body. Use document.id for later document operations and version.id for exact publication. No public publication has occurred yet.
Worked examples
The following inputs and responses were captured from the local Docs worker fixture. Auth and Nexus dependencies are simulated. Identifiers, URLs and timestamps are illustrative fixture values. Discover your own identifiers and choose an appropriate test resource; copying a fixture identifier does not make it valid in your environment. For workspace-bound calls, set DOCS_WORKSPACE_ID to the identifier returned by resource discovery. Run validation and planning first; the final call requires the intended effect to be authorized.
Minimal example
Save the input as payload.json:
{
"spaceId": "docspace_a09c96df-e507-4751-89c8-e6a99e496d0d",
"title": "Rotate an integration token",
"slug": "rotate-token",
"bodyMarkdown": "# Rotate a token\n\nOpen credential settings, replace the token and verify a read."
}
CLI:
topolo actions validate app_topolo_docs.spaces.documents.create --data @payload.json --json
topolo actions plan app_topolo_docs.spaces.documents.create --resource-type workspace --resource-id "$DOCS_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_docs.spaces.documents.create --resource-type workspace --resource-id "$DOCS_WORKSPACE_ID" --data @payload.json --confirm --json
MCP tool and arguments:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_docs.spaces.documents.create",
"input": {
"spaceId": "docspace_a09c96df-e507-4751-89c8-e6a99e496d0d",
"title": "Rotate an integration token",
"slug": "rotate-token",
"bodyMarkdown": "# Rotate a token\n\nOpen credential settings, replace the token and verify a read."
},
"resourceType": "workspace",
"resourceId": "<identifier returned by resource discovery>",
"confirm": true
}
}
Captured local response · HTTP 201:
{
"document": {
"id": "doc_de0efe08-781e-4e60-9d7a-2a48b6dd4dd4",
"organizationId": "org_fixture",
"workspaceId": "ws_fixture",
"spaceId": "docspace_a09c96df-e507-4751-89c8-e6a99e496d0d",
"sectionId": null,
"sectionPosition": 0,
"parentId": null,
"slug": "rotate-token",
"title": "Rotate an integration token",
"summary": "",
"status": "draft",
"sourceKind": "native",
"ownerAppId": null,
"currentVersionId": "docver_cef00930-d087-4485-98bc-0f335d96fd80",
"publishedVersionId": null,
"createdByUserId": "usr_fixture",
"createdAt": "2026-10-03T08:07:30.565Z",
"updatedAt": "2026-10-03T08:07:30.595Z",
"publishedAt": null
},
"version": {
"id": "docver_cef00930-d087-4485-98bc-0f335d96fd80",
"organizationId": "org_fixture",
"workspaceId": "ws_fixture",
"documentId": "doc_de0efe08-781e-4e60-9d7a-2a48b6dd4dd4",
"locale": "en",
"title": "Rotate an integration token",
"summary": "",
"bodyMarkdown": "# Rotate a token\n\nOpen credential settings, replace the token and verify a read.",
"agentGuidance": null,
"contentHash": "1499e80576ef14317aee62135063b901e7a9cb64c02082bac0fcd159886348ba",
"sourceRevision": null,
"sourcePath": null,
"createdByUserId": "usr_fixture",
"createdAt": "2026-10-03T08:07:30.595Z"
}
}
document is the new current record and version is its first immutable body. Use document.id for later document operations and version.id for exact publication. No public publication has occurred yet.
Workflow example
Save the input as payload.json:
{
"spaceId": "docspace_a0013653-dabf-4831-8c11-6405b39664ca",
"title": "Rotate an integration token",
"slug": "rotate-token",
"bodyMarkdown": "# Rotate a token\n\nOpen credential settings, replace the token and verify a read."
}
CLI:
topolo actions validate app_topolo_docs.spaces.documents.create --data @payload.json --json
topolo actions plan app_topolo_docs.spaces.documents.create --resource-type workspace --resource-id "$DOCS_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_docs.spaces.documents.create --resource-type workspace --resource-id "$DOCS_WORKSPACE_ID" --data @payload.json --confirm --json
MCP tool and arguments:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_docs.spaces.documents.create",
"input": {
"spaceId": "docspace_a0013653-dabf-4831-8c11-6405b39664ca",
"title": "Rotate an integration token",
"slug": "rotate-token",
"bodyMarkdown": "# Rotate a token\n\nOpen credential settings, replace the token and verify a read."
},
"resourceType": "workspace",
"resourceId": "<identifier returned by resource discovery>",
"confirm": true
}
}
Captured local response · HTTP 201:
{
"document": {
"id": "doc_453b15f4-06fc-4366-ae42-adf1f10d9d38",
"organizationId": "org_fixture",
"workspaceId": "ws_fixture",
"spaceId": "docspace_a0013653-dabf-4831-8c11-6405b39664ca",
"sectionId": null,
"sectionPosition": 0,
"parentId": null,
"slug": "rotate-token",
"title": "Rotate an integration token",
"summary": "",
"status": "draft",
"sourceKind": "native",
"ownerAppId": null,
"currentVersionId": "docver_de2b1e18-55d5-4793-b71f-51bc27b78c84",
"publishedVersionId": null,
"createdByUserId": "usr_fixture",
"createdAt": "2026-10-03T08:07:34.003Z",
"updatedAt": "2026-10-03T08:07:34.032Z",
"publishedAt": null
},
"version": {
"id": "docver_de2b1e18-55d5-4793-b71f-51bc27b78c84",
"organizationId": "org_fixture",
"workspaceId": "ws_fixture",
"documentId": "doc_453b15f4-06fc-4366-ae42-adf1f10d9d38",
"locale": "en",
"title": "Rotate an integration token",
"summary": "",
"bodyMarkdown": "# Rotate a token\n\nOpen credential settings, replace the token and verify a read.",
"agentGuidance": null,
"contentHash": "1499e80576ef14317aee62135063b901e7a9cb64c02082bac0fcd159886348ba",
"sourceRevision": null,
"sourcePath": null,
"createdByUserId": "usr_fixture",
"createdAt": "2026-10-03T08:07:34.032Z"
}
}
document is the new current record and version is its first immutable body. Use document.id for later document operations and version.id for exact publication. No public publication has occurred yet.
Verify the result
-
Read $.document.id and confirm a first version exists with documents.versions.list.
-
Nothing is public yet — publish deliberately with documents.publish.
Errors and recovery
-
HTTP 403 ·
organization_required: The token carries no organization scope. Re-authenticate against the organization that owns the Docs workspace and retry. -
HTTP 400 ·
workspace_required: No Docs workspace resolved for the caller. Call workspace.get to see which workspace is bound, then retry in that context. -
HTTP 403 ·
permission_denied: The credential needs docs:write on the selected Docs workspace. -
HTTP 400 ·
invalid_json_object: The body was missing, malformed, or carried a key the action does not accept. Send a JSON object matching inputSchema exactly — these routes reject unknown keys. -
HTTP 404 ·
not_found: No record in this workspace carries that id. List the resource first and use an id from the response.
Archive a document created in error. Its versions are immutable and are retained either way; archiving removes it from listings and public lookup.
Evidence boundary
These examples establish local handler behavior and schema validity. They do not establish runtime permission parity, a deployed development/staging result or production completion. Preserve the actual request identifier and perform the verification reads after an authorized live call.