Clone Template

Create a runnable workflow in the caller's workspace from a template. This is the primary way to use a template: it produces a new `Workflow` owned by the caller's workspace, ready to accept scripts and run jobs. Use `body.name` to set the workflow name; omit it (or send blank/whitespace) to get the default `"{template name} (Copy)"`. Cross-workspace clones (gallery/starter templates) copy the published snapshot so unpublished draft edits made by the template owner never leak to other workspaces. Same-workspace clones copy the live draft definition. Use `GET /templates/{id}/estimate` first to preview credit costs before committing to a clone and run. Use `POST /workflows/{id}/duplicate` to copy an existing workflow rather than starting from a template. Requires workspace `editor` role or higher. Dual-auth: Bearer JWT or API key (scope `workflows:write`).

Authentication

AuthorizationBearer
Clerk JWT token
OR
AuthorizationBearer

Onepin live API key (op_live_...). Test and public keys are reserved in Phase 1.

Path parameters

template_idstringRequiredformat: "uuid"

Headers

X-Workspace-Idstring or nullOptional

Request

This endpoint expects an object.
namestring or nullOptional<=200 characters

Response

Successful Response
dataobject
metaobject

Errors

422
Unprocessable Entity Error