link

Export consultation to Link

Writes the consultation's structured clinical note (generated with a Link JSON template, see the resolve endpoint) into a Link journal entry.

  • First export: pass customerId and animalId. A new entry is created with the Link template, at locationId or the integration's default location. Response mode: created.
  • Later exports: the entry recorded on the consultation is updated in place and customerId/animalId are ignored. Response mode: updated.
  • Existing entry: pass targetEntryId (from the compatible-entries endpoint) plus customerId and animalId to write into an entry created in Link.
  • Reassign: reassign: true with a new customerId/animalId creates a fresh entry; the old entry is left untouched in Link.

When updating, text fields are append-only: only lines added since Vetnio's last successful export to that entry are appended after a blank line, so text the vet wrote in Link is kept and retries do not duplicate text. Select, checkbox and result fields are overwritten; fields missing from the note are not touched. Locked, deleted or cancelled entries cannot be updated (400). If Link rejects any field during an update, the request fails with 500; fields Link accepted may already be saved, but Vetnio does not record the export, so a retry does not duplicate text. When creating, rejected fields are only reported in fieldWrites.create.errors.

post/workspaces/{workspaceId}/consultations/{consultationId}/link/export

Request

  • Base URL
    https://vetnio.com/api/v2
  • URL
    https://vetnio.com/api/v2/workspaces/{workspaceId}/consultations/{consultationId}/link/export
  • Auth
    HTTP bearer

Path parameters

workspaceIdstring 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.

Example:furunculotic-loud-chihuahua
consultationIdstring required

Identifier of the Vetnio consultation (UUID) whose structured clinical note is exported to, or matched against, Link.

Example:a1b2c3d4-e5f6-7890-abcd-ef1234567890

Request body

customerIdinteger

Link customer who owns the animal. Required on the first export, with reassign: true, and with targetEntryId; ignored when the consultation's existing entry is updated in place.

animalIdinteger

Link animal whose journal receives the entry. Required in the same cases as customerId, and must belong to that customer.

locationIdinteger

Link location (clinic site) for a newly created entry. Defaults to the integration's defaultLocationId; the request fails with 400 when neither is set. Ignored for updates.

reassignboolean

Set to true to create a new entry for customerId/animalId even though the consultation was already exported. The previous entry is left as it is in Link and the consultation is re-pointed to the new one. Defaults to false.

targetEntryIdinteger

Id of an existing Link entry to write into instead of creating one, typically from the compatible-entries endpoint. Takes precedence over the entry already recorded on the consultation. The entry must belong to customerId and animalId, be editable, and use a compatible template.

Example request

{
  "customerId": 54967922,
  "animalId": 1234567,
  "locationId": 346,
  "targetEntryId": 8812345
}

Response

Link entry id, journal id, deep-link URL, mode, and per-field write results.

linkEntryIdinteger required

Id of the Link journal entry that was created or updated. Stored on the consultation so later exports update the same entry.

linkJournalIdinteger required

Id of the animal's Link journal (medical record) that holds the entry.

entryUrlstring required

Deep link that opens the entry in Link's web app.

mode'created' | 'updated' required

What the export did:

  • created — a new journal entry was created (first export, or reassign: true).
  • updated — an existing entry was updated in place (the consultation's previously exported entry, or targetEntryId).

Example response

{
  "linkEntryId": 8812345,
  "linkJournalId": 2167548,
  "entryUrl": "https://riverside.linkjournal.se/customers/54967922/animals/1234567?only_entry=8812345",
  "mode": "created",
  "fieldWrites": {
    "create": {
      "applied": [
        98765,
        98766
      ]
    },
    "internalSamples": {
      "applied": [
        98765,
        98766
      ]
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.