---
title: "Get a retained version of a workspace note template"
method: GET
path: "/workspaces/{workspaceId}/data-export/templates/version"
tags: ["data-export", "customer-content"]
---

# Get a retained version of a workspace note template

`GET /workspaces/{workspaceId}/data-export/templates/version`

## Request

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

Returns the exact saved body of one retained template version as UTF-8 text, after checking that the template belongs to this scope. Take `versionId` from the versions list and URL-encode it. Read-only: it does not restore or modify the template. Returns 404 when the template, or that version of it, is not available. 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.
- `versionId` string, required: Opaque version ID from the versions list (`versions[].versionId`) or from `artifact.currentVersionId`. URL-encode it; it can contain characters such as `+`, `/` and `=`.

## Response `200`

Successful response

- TemplateVersionSnapshot: The exact saved body of one retained template version, with its metadata.
  - `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"`.
  - `version` object, required: Metadata of the requested version.
    - `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.
    - `contentType` string, nullable, required: Media type of this version's body as recorded by storage, for example `text/html` or `application/json`, or null.
    - `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`.
  - `content` string, required: The exact retained body as UTF-8 text, including HTML instructions or the original JSON schema.

## 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)
