Clone Template

Clone a template into a workflow in the caller's workspace. Dual-auth: Clerk JWT or `op_live_*` API key (scope `workflows:write`). Same-workspace clones use the live `definition` (owner authoring). Cross-workspace clones use the `published_definition` snapshot to avoid leaking unpublished draft edits. Resolved name: explicit `body.name` (stripped) OR fallback to `"{source_name} (Copy)"`.

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