Update Template

Update a template. Owner only; starter templates are read-only.

definition is full-replace (matches WorkflowUpdate — the FE sends the entire graph back on save). Other fields are partial via exclude_unset.

Authentication

AuthorizationBearer
Clerk JWT token

Path parameters

template_idstringRequiredformat: "uuid"

Headers

X-Workspace-Idstring or nullOptional

Request

This endpoint expects an object.
namestring or nullOptional1-200 characters
descriptionstring or nullOptional<=2000 characters
categoryenum or nullOptional
definitionobject or nullOptional

Full-replace on PATCH. Omit to keep the stored value. Explicit null is rejected — there is no ‘empty graph’ use-case worth the ambiguity. The union with null here only makes omission easy for FE clients; see reject_null_definition for the runtime guard.

Response

Successful Response
dataobject

Response shape. workspace_id is intentionally omitted so the gallery endpoint (which returns rows from any workspace) does not leak tenant ownership IDs across tenants. created_by is retained as author provenance for public/starter rows.

definition is the serialized WorkflowDefinition JSONB (same shape as Workflow.definition) — a template is a reusable workflow snapshot.

metaobject

Errors

422
Unprocessable Entity Error