---
title: "List of available workflow template versions"
method: GET
path: "/v1/workflow-templates/{id}/versions"
tags: ["Workflows"]
---

# List of available workflow template versions

`GET /v1/workflow-templates/{id}/versions`

## Request

- Base URL: `https://api.emma.ms/external`
- URL: `https://api.emma.ms/external/v1/workflow-templates/{id}/versions`
- Auth: HTTP bearer

Returns the full version history of the workflow template, sorted by `createdAt` descending by default. 

Each item includes `isActive` to identify the current active version, and `secretsChanged` to indicate versions where a secret parameter's value was rewritten.

## Path parameters

- `id` integer, required

## Response `200`

Successful operation

- object
  - `activeVersionId` integer, nullable: ID of the currently active version of the workflow template — the version used when creating instances from this workflow. A template that has any version has exactly one active version. `null` when the template has no versions at all, and `content` is then an empty array. This is the permanent state of built-in default templates (`isDefault = true`): they are excluded from versioning and cannot be edited, so a version is never created for them. It is also the state of templates created before versioning was enabled and not yet covered by the one-off backfill.
  - `content` WorkflowTemplateVersionListItem[], required: List of workflow template versions, sorted by `createdAt` descending.
    - `id` integer, required: ID of the version.
    - `name` string, required: Name of the version.
    - `createdAt` string, required: Date and time of the version creation.
    - `createdById` integer, required: ID of the user or service application that initiated creation of the version.
    - `createdByName` string, required: Name of the user or service application that initiated creation of the version.
    - `isActive` boolean, required: Indicates whether the version is active.
    - `secretsChanged` boolean, required: Indicates whether the secrets were changed in this version.
    - `sequenceNumber` integer, required: A sequential number assigned to each version in creation order.
    - `restoredFrom` integer, nullable: ID of the source version. Present only if this version was created by restoring another version; null otherwise.
    - `restoredFromName` string, nullable: Name of the source version. Present only if this version was created by restoring another version; null otherwise.

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden - Access is denied
- `404`: Not found
- `500`: Internal server error
- `503`: InternalError
- `504`: Timeout

---

[API](https://skmtc.dev/emma/apis/public-emma-api.md) - [All operations](https://skmtc.dev/emma/apis/public-emma-api/llms.txt) - [OpenAPI document](https://skmtc.dev/emma/apis/public-emma-api/revisions/9e55f0920078?raw)
