Grist Octri Preview
POST/docs/{docId}/copy

Copy a document to a workspace

Creates a copy of a document in a target workspace. Supply workspaceId and documentName in the request body; set asTemplate to keep the structure while removing data and history.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 3 body fields
docIdstringrequired
The UUID of the document to copy.

Options for the document copy. If you provide a body, include workspaceId and documentName.

asTemplatebooleanoptional
Remove all data and history but keep the structure to use the document as a template
documentNamestringrequired
The name to give the copied document.
workspaceIdintegerrequired
The integer identifier of the workspace to copy the document into.

1 status code
200Returns the unique identifier of the copied document.

Error handling

docId must be a document UUID. If you provide a request body, include workspaceId and documentName; workspaceId must be an integer.