Skip to navigation

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 name the workflow after the template itself — an inherited template name that uses characters workflow names disallow is stripped down to them, or replaced by a placeholder name if nothing usable remains. Workflow names are not unique within a workspace, so cloning the same template twice succeeds and yields two workflows with the same name.

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: "^[A-Za-z0-9]{8}$"=8 characters

Case-sensitive 8-character base62 template identifier.

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