---
title: "List retained versions of a workspace JSON template"
method: GET
path: "/workspaces/{workspaceId}/data-export/json-templates/versions"
tags: ["data-export", "customer-content"]
---

# List retained versions of a workspace JSON template

`GET /workspaces/{workspaceId}/data-export/json-templates/versions`

## Request

- Base URL: `https://vetnio.com/api/v2`
- URL: `https://vetnio.com/api/v2/workspaces/{workspaceId}/data-export/json-templates/versions`
- Auth: HTTP bearer

Lists the retained stored versions of one template's body (`part=content`, the default) or of its imported instructions (`part=instructions`, document and meeting templates only), newest first, up to 50 per page. Pass `nextCursor` back as `cursor` until it is `null`. The template must belong to this scope, otherwise 404. Deleted templates and Vetnio's default catalog templates are not available. `currentVersionId` can change while you page if someone edits the template. JSON templates have no instructions part: `part=instructions` returns 400. Requires admin rights in the workspace (workspace admin or superadmin, or an admin of an organization the clinic belongs to). Accepts a browser session or a personal API key; organization and workspace API keys (`sk_org_…`, `sk_ws_…`) get 403.

## Path parameters

- `workspaceId` string, required: Identifier of the workspace (clinic) to export. The caller must be an admin of it, directly or as an admin of its organization.

## Query parameters

- `part` 'content' | 'instructions': Which stored object of the template to read: - `content` — the template body itself. - `instructions` — the separate instructions object of an imported template (original wording and per-section instructions). Only workspace note and meeting templates have one; other kinds return 400.
- `templateId` string, required: ID of the template, as returned in `items[].id` by the matching template export. It must belong to the workspace or organization in the path, otherwise 404.
- `cursor` string: Opaque pagination cursor: the `nextCursor` value from the previous page of this template's versions. Omit for the first page. URL-encode it.

## Response `200`

Successful response

- TemplateVersionHistory: One page of a template's retained stored versions.
  - `currentVersionId` string, nullable, required: Version ID of the template's current body at the time of the request, or null when there is no current body. Unlike `artifact.currentVersionId`, a legacy unversioned body is reported here as the literal string `"null"`.
  - `versions` object[], required: Retained versions on this page, newest first. A page can hold fewer than 50 versions even when more follow.
    - `versionId` string, required: Opaque stored version ID. A literal null version belongs to unversioned or suspended storage and can be overwritten.
    - `isLatest` boolean, required: `true` when this version is the template's current body.
    - `lastModified` string, date-time, nullable, required: When this version was stored (ISO-8601 UTC), or null if unknown.
    - `size` number, nullable, required: Size of this version's body in bytes, or null if unknown.
    - `audit` object, nullable, required: Audit details of the edit that saved this version. Only available for workspace note templates and `part=content`; `null` otherwise, or when no matching audit entry exists. Not a clinical approval or accuracy classification.
      - `id` string, required: ID of the audit-log entry (UUID).
      - `occurredAt` string, date-time, required: When the change was made (ISO-8601 UTC).
      - `actorName` string, nullable, required: Display name of the person who made the change, or null when unknown or for system changes. For changes made by Vetnio support on a customer's behalf, this is the support staff member.
      - `actorType` 'user' | 'vetnio_staff' | 'system', required: Who made the change: - `user` — a member of the customer's team. - `vetnio_staff` — Vetnio staff, for example while providing support. - `system` — an automated process.
      - `action` string, required: Audit action that saved this version, for example `template.created`, `template.content_updated` or `template.restored`.
      - `s3VersionId` string, required: The stored version ID the audit entry refers to; equals the version's `versionId`.
  - `nextCursor` string, nullable, required: Pass this value as `cursor` to fetch older versions. `null` when the history is complete.

## Other responses

- `400`: Invalid input data
- `401`: Authorization not provided
- `403`: Insufficient access
- `404`: Not found
- `500`: Internal server error

---

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