Get Template

Fetch a single template by ID. Returns the template if it is visible to the caller: templates owned by the caller's workspace are returned with the live draft definition; public/starter templates from other workspaces are returned with the published snapshot. Returns 404 for templates that exist but are not visible to the caller (not owned, not public, not a starter) — same response as for a missing ID. Dual-auth: Bearer JWT or API key (scope `templates:read`).

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

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