---
title: "Resolve Link template to JSON template id"
method: POST
path: "/workspaces/{workspaceId}/link/templates/{linkTemplateId}/resolve"
tags: ["link"]
---

# Resolve Link template to JSON template id

`POST /workspaces/{workspaceId}/link/templates/{linkTemplateId}/resolve`

## Request

- Base URL: `https://vetnio.com/api/v2`
- URL: `https://vetnio.com/api/v2/workspaces/{workspaceId}/link/templates/{linkTemplateId}/resolve`
- Auth: HTTP bearer

Maps a Link form template to a Vetnio JSON template so the clinical note is generated with one value per Link field. Vetnio reads the template's writable fields, derives a signature from their ordered titles, and returns the workspace's JSON template with that signature, creating it on first use (creation runs an AI step that writes per-field instructions, so the first call is slower). When `consultationId` is given, the JSON template is also set as that consultation's clinical-note template. Idempotent: repeated calls return the same id with `created: false`. Returns `400 BAD_REQUEST` when the template has no writable fields.

## Path parameters

- `workspaceId` string, required: Identifier of the clinic (workspace), as returned by `GET /workspaces`. The key's user must be a member of the clinic, or an admin of the organization it belongs to.
- `linkTemplateId` integer, required: Link journal form template id, as returned in `id` by the template list endpoint.

## Request body

- object
  - `consultationId` string: Optional consultation to bind the resolved JSON template to as its clinical-note template. Only the template is set; no note is generated.

## Response `200`

Resolved jsonTemplateId, a `created` flag, and the deterministic ordered keys.

- object: The Vetnio JSON template matching a Link template, created on first use.
  - `jsonTemplateId` string, required: Id of the Vetnio JSON template that mirrors the Link template's writable fields. Use it as the consultation's clinical-note JSON template so the generated note has one value per Link field.
  - `created` boolean, required: `true` when this call created the JSON template; `false` when a matching one already existed in the workspace.
  - `keys` string[], required: Keys of the JSON template, one per Link field and in the same order as the template detail's `fieldMetadata`. Derived from the field titles (lower-cased, `å`→`a`, `ä`→`ae`, `ö`→`oe`, other characters removed; duplicates get a hash suffix). The structured clinical note uses these keys.

## Other responses

- `400`: Invalid input data
- `401`: Authorization not provided
- `403`: Insufficient access
- `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)
