Create a template from a workspace item
Exports the item at `sourceItemId` and its subtree into a reusable template manifest, tokenizing it against any declared `inputs` so they become fill-in holes at instantiation. Requires `resources:write` in the workspace and a plan that includes custom templates. Names must be 1 to 160 characters and descriptions at most 4,000. Send an `Idempotency-Key` header to make retries safe; a replay within the window returns the original response.
Authorization
apiKey Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/v1/workspaces/string/templates" \ -H "Content-Type: application/json" \ -d '{ "sourceItemId": "string", "name": "string" }'{ "data": { "id": "string", "workspaceId": "string", "name": "string", "description": "string", "cover": "string", "icon": "string", "kind": "folder", "sourceItemId": "string", "scope": "builtin", "visibility": "private", "reviewStatus": "draft", "installCount": 0, "author": { "workspaceId": "string", "name": "string", "icon": "string" }, "category": "string", "tags": [ "string" ], "inputs": [ { "id": "string", "kind": "database", "label": "string", "description": "string", "placeholder": "string", "required": true, "dependsOn": "string", "choices": [ { "value": "string", "label": "string" } ], "default": "string" } ], "version": 0, "manifest": { "version": 2, "inputs": [ { "id": "string", "kind": "database", "label": "string", "description": "string", "placeholder": "string", "required": true, "dependsOn": "string", "choices": [ { "value": "string", "label": "string" } ], "default": "string" } ], "rootSourceItemId": "string", "rootKind": "folder", "operations": [ { "type": "item.create", "sourceItemId": "string", "parentSourceItemId": "string", "title": "string", "icon": "string", "color": "string", "order": 0, "accessMode": "open", "locked": true, "archived": true, "metadata": {}, "kind": "folder", "sourceTargetId": "string" } ] }, "publishedAt": "string", "curatedAt": "string", "submittedAt": "string", "reviewNote": "string", "createdBy": "string", "createdAt": "string", "updatedAt": "string" }}{ "_tag": "ApiNotFound", "error": "not_found", "message": "That item does not exist, or this key cannot see it.", "status": 404}{ "_tag": "ApiNotFound", "error": "not_found", "message": "That item does not exist, or this key cannot see it.", "status": 404}List the templates owned by a workspace
Returns the workspace's own templates newest first, including their metadata, declared inputs, review status, and publication state. Requires `resources:read` in the workspace.
Update a template's metadata
Changes name, description, cover, icon, category, tags, or declared inputs. The manifest is write-once, so re-exporting a subtree creates a new template instead; setting `visibility` to `public` is refused because publication is its own permissioned verb. Requires `resources:write` in the workspace, and an unknown template returns not-found. Send an `Idempotency-Key` header to make retries safe; a replay within the window returns the original response.