> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update workflow template

> The updated template version.

### Path parameters

<ParamField path="template_key" type="string (string)" required />

<ParamField path="version" type="string (string)" required />

### Request body

`object`

<ParamField body="template_key" type="string" />

<ParamField body="version" type="integer" />

<ParamField body="workflow_type" type="string" />

<ParamField body="runtime_target" type="string" />

<ParamField body="status" type="string" />

<ParamField body="schema" type="object" />

<ParamField body="determinism_contract" type="object" />

### Response

`object`

<ResponseField name="id" type="string (uuid)" required />

<ResponseField name="template_key" type="string" required />

<ResponseField name="version" type="integer" required />

<ResponseField name="workflow_type" type="string" required />

<ResponseField name="runtime_target" type="string" required />

<ResponseField name="status" type="string" required />

<ResponseField name="schema" type="object" required />

<ResponseField name="determinism_contract" type="object" required />

<ResponseField name="created_at" type="string (date-time)" required />

<ResponseField name="updated_at" type="string (date-time)" required />

### Status codes

| Code  | Meaning                       |
| ----- | ----------------------------- |
| `200` | The updated template version. |
| `400` | Validation error              |
| `401` | Unauthorized                  |
| `404` | Not found                     |
| `429` | Rate limited                  |
| `500` | Internal error                |

<RequestExample>
  ```bash cURL theme={null}
  curl --request PATCH \
    --url 'https://api.workstream.stateset.com/v1/workflow-templates/{template_key}/{version}' \
    --header "x-api-key: $STATESET_TEMPORAL_API_KEY" \
    --header 'Content-Type: application/json' \
    --data '{
    "template_key": "string",
    "version": 1,
    "workflow_type": "string",
    "runtime_target": "string",
    "status": "active",
    "schema": {},
    "determinism_contract": {}
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "template_key": "string",
    "version": 1,
    "workflow_type": "string",
    "runtime_target": "string",
    "status": "pending",
    "schema": {},
    "determinism_contract": {},
    "created_at": "2026-08-31T14:22:05Z",
    "updated_at": "2026-08-31T14:22:05Z"
  }
  ```
</ResponseExample>
