Promote Template Api V1 Workstreams Templates Template Id Promote Post
post
/api/v1/workstreams/templates/{template_id}/promotePromote a recipe to workspace library
Promote a private draft recipe to the shared workspace library.
Path parameters
template_idrequiredpath | The template's UUID. |
Responses
200Recipe promoted
| Field | Type | Description |
|---|---|---|
idrequired | string (uuid) | Template UUID |
slug | string | null | Human-readable URL key (e.g. 'asc-606-review'). Stable + globally unique; resolvable by GET /templates/{id}. Link the FE here, not the UUID. |
permakey | string | null | Stable opaque short id (7-char); the cross-entity permalink, also resolvable. |
namerequired | string | Template name |
description | string | null | Template description |
source_description | string | null | The definition's own text, verbatim (the audit-true record of what was authored). Disclosed behind 'The definition, as written', in mono β never the firm-facing head. NULL when the definition has no prose distinct from the interpreted description. |
source_name | string | null | The definition's own name, verbatim. Disclosed alongside source_description when it differs from the firm-facing name. |
category | "compliance" | "advisory" | "audit" | "bookkeeping" | "tax" | "internal" | null | Template category (closed taxonomy: compliance/advisory/audit/bookkeeping/tax/internal). NULL = genuinely uncategorised (no category set); 'internal' = an off-taxonomy value mapped to the catch-all bucket β the two are distinct (NULL is NOT coerced to 'internal'). |
steps | object[] | WDL step definitionsitem shapeEmpty object. |
default_config | object | Default configurationshow nestedEmpty object. |
goal_spec | GoalSpecPayload-Output | object | null | The versioned deterministic goal contract. This is definition state, not cycle output, and must round-trip through every authoring surface. |
accounting_ledger | "off" | "optional" | "required" | The WorkStream's explicit Cycle Accounting Ledger capability.offoptionalrequired |
tags | string[] | Template tags |
input_schema | object[] | Declared workstream inputs (array of InputDef: name/type/required/...).item shapeEmpty object. |
families | object[] | βitem shapeEmpty object. |
data_files | object | null | The WorkStream's data files; null on the list route. |
broker_option_names | object | Maps each family_id@version choice of a select input in input_schema to its broker family's stored display name. A family with no stored name is omitted; the choice values themselves are unchanged. Filled by the single-template route only; empty elsewhere.show nestedEmpty object. |
output_schema | object[] | Declared workstream outputs for the Outputs tab (array of OutputDef: name/label/type/format/...). Empty β no Outputs tab.item shapeEmpty object. |
inputs_required | any[] | null | Declared inputs the WorkStream needs before it can run (part of the hashed definition). |
runner_config | object | null | Runner settings for the WorkStream (part of the hashed definition). {} when none. |
execution_mode | "inline" | "containerized" | null | How the WorkStream runs (part of the hashed definition). |
jurisdictions | string[] | null | Applicable jurisdictions (part of the hashed definition). |
forked_from | object | null | Provenance: parent recipe {name, version} this was forked from. NULL when not a fork. |
upstream_update | object | null | {version, note} when the fork's parent has advanced past the fork point. NULL when none/uncomputable. |
is_template | boolean | Always true for templates |
domain | string | null | DomainAgent knowledge-key backing this recipe (e.g. 'ita_2007_eis'), resolved from the linked job_definition.domain via its most-recent cycle and surfaced ONLY when it maps to a real DomainAgent persona. NULL for fixed-step recipes and generic agentic containers (the 'workstream'/'general' placeholder domains) β which are NOT WorkPlan-able. The WorkPlan-create picker filters to `domain != null`. |
statusrequired | "draft" | "active" | "paused" | "archived" | Status for workstream entities.draftactivepausedarchived |
version | integer | Template version, incremented on each update |
active_blueprint_count | integer | Number of active linked workplans for this template |
total_runs | integer | Count of cycles ever launched from this template (run count). |
total_instances | integer | Aggregate instance count across all cycles. Each backend cycle is one instance run, so this equals total_runs today; kept distinct so the FE contract is stable if job-level fan-out grouping lands later. |
last_run_at | string (date-time) | null | Start (or creation) timestamp of the most recent cycle. NULL if never run. |
last_run_state | "created" | "planning" | "queued" | "running" | "paused" | "blocked" | "completed" | "failed" | "cancelled" | "skipped" | "pending" | "needs_guidance" | "abandoned" | "debug_paused" | null | Status of the most recent cycle, for the 'last run' badge. NULL if never run. |
avg_instance_cost | number | Average customer-facing cost (GBP) across runs: mean of Β£19/hr x elapsed per cycle. Mirrors CycleResponse.customer_cost_gbp. |
cycle_ids | string (uuid)[] | Cycle ids that have run this template, most recent first (capped). |
needs_you_count | integer | Instances of this WorkStream parked at an approval gate, waiting on a person. APPROVALS ONLY β blocked (waiting on the client) and errored (needs a retry) are different asks and are counted elsewhere, so the orange attention number means the same thing on the list card, the WorkStream page and a cycle's triage. |
needs_you_job_id | string (uuid) | null | The batch holding the most of those approvals β the DOOR the attention chip opens, so the count is never a claim the user then has to hunt for. NULL when needs_you_count is 0, and ALSO null when the gated instances belong to no batch (a standalone run has no fan-out to open). A non-zero count with a null door is therefore expected: fall back to the WorkStream's own Cycles tab, which is always reachable β never render the count as unclickable. |
source_managed | boolean | The WorkStream is saved to git (every save is a commit). |
working_branch_head | string | null | The head of the working branch (40 lower-case hex) of a managed WorkStream: send it back as `expected_head` with the next save. |
published | boolean | null | Always false on a managed save answer: saved, not yet published. |
unpublished_saves | integer | null | Commits on the working branch that main does not yet hold; null when it could not be read. |
latest_version | integer | null | The WorkStream's own version; a save never changes it. |
head | string | null | The head after this save (a managed save only). |
save_message | string | null | "Saved. Not published: N change(s) since version V." (a managed save only). |
created_byrequired | string (uuid) | Creator user ID |
created_by_name | string | null | Creator display name |
owner_user_id | string | null | The user who owns (and alone grants edit rights on) this definition. |
shared_with_user_ids | string[] | Users the owner granted edit rights on this definition. |
created_atrequired | string (date-time) | Creation timestamp |
updated_atrequired | string (date-time) | Last update timestamp |
scope | string | Distribution scope: gallery|firm|team|user|plan (provenance pill). |
is_catalog | boolean | True for curated public library recipes (the seeded catalog). |
owning_team_id | string (uuid) | null | The team a `scope='team'` workstream belongs to β lets the FE group the My WorkStreams list under the team name (#170). NULL for firm/user-scoped rows. |
workspace_id | string (uuid) | null | Workspace ID owning this template, or NULL for catalog/curated recipes |
lint | string[] | ADVISORY structural findings for the saved step set β duplicate ids, dangling depends_on, dependency cycles, unresolvable references. Entries prefixed `warn:` are advisory by the linter's own tiering. This NEVER blocks a save and an empty list is not a guarantee: see the note on the update handler for why a hard gate would be wrong against today's stored data. |
400Invalid scope promotion
401Unauthorized
404Recipe not found
422Validation Error
| Field | Type | Description |
|---|---|---|
detail | ValidationError[] | βitem shape |
curl https://api.dev.arch.ie/api/v1/workstreams/templates/<template_id>/promote \
-X POST \
-H "Authorization: Bearer sk_..."