---
title: "VetManager visit context for a consultation"
method: GET
path: "/workspaces/{workspaceId}/consultations/{consultationId}/vetmanager/visit-context"
tags: ["vetmanager"]
---

# VetManager visit context for a consultation

`GET /workspaces/{workspaceId}/consultations/{consultationId}/vetmanager/visit-context`

## Request

- Base URL: `https://vetnio.com/api/v2`
- URL: `https://vetnio.com/api/v2/workspaces/{workspaceId}/consultations/{consultationId}/vetmanager/visit-context`
- Auth: HTTP bearer

Returns what the vet needs before exporting: whether the consultation is already linked to a VetManager visit, an unfinished visit creation to resume, earlier visits the animal can be added to, and the VetManager animal of the consultation's patient. Errors: `401` when the caller must sign in to VetManager again; `403` when the practice is not linked to this workspace; `404` when the consultation does not exist.

## 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.
- `consultationId` string, required: Identifier of the consultation (UUID), as returned when it was created or by `GET /workspaces/{workspaceId}/consultations`. It must belong to the clinic in `workspaceId`.

## Response `200`

The visit context.

- object: Everything needed to choose or create the VetManager visit for a consultation.
  - `identityKey` string, required: Opaque key from the visit context. A request is rejected with `409` when the signed-in VetManager account or practice changed since it was issued.
  - `practice` object, required: The VetManager practice of the signed-in account.
    - `id` integer, required: VetManager practice id, as returned in `practice.id` by the visit context.
    - `name` string, required: Practice name.
  - `linked` boolean, required: `true` when the consultation is already linked to a visit; export directly.
  - `linkedVisit` object, nullable, required: The linked visit when it was created through Vetnio, else `null`.
    - `resonId` integer, required: VetManager visit reason ("reson") id: the record the note is written to.
    - `assignmentId` integer, nullable, required: VetManager visit (assignment) id; `null` for a recovered visit, which cannot take more animals.
    - `practiceId` integer, required: VetManager practice id, as returned in `practice.id` by the visit context.
    - `contactId` integer, required: VetManager client (owner) id.
    - `animalId` integer, required: VetManager animal id.
    - `clientBlocked` boolean, required: `true` when VetManager flags the owner as blocked; show a warning.
  - `returnUrl` string, nullable, required: Link back to the linked visit in VetManager, when known.
  - `pending` object, nullable, required: An earlier visit creation that did not finish, or `null`.
    - `key` string, required: Key of the unfinished creation; pass it as `pendingKey` to recovery.
    - `selection` object, required: The owner and animal the visit is for.
      - `contactId` integer, required: VetManager client (owner) id.
      - `animalId` integer, required: VetManager animal id.
      - `assignmentId` integer: Add the animal to this earlier visit (assignment) created through Vetnio for the same owner, without another basic fee. Omit to create a new visit, which charges the practice's basic fee.
      - `name` string, required: Optional visit reason shown in VetManager.
    - `canRetry` boolean, required: `true`: resend this selection to the create-visit endpoint to finish safely. `false`: the retry window passed or another vet started it; use recovery instead.
  - `visits` object[], required: Earlier visits another animal of the same owner can be added to. Filter by `contactId`.
    - `assignmentId` integer, required: Pass as `selection.assignmentId`.
    - `contactId` integer, required: VetManager client (owner) id.
    - `name` string, nullable, required: Name of the Vetnio consultation that created it.
  - `patientChoice` object, nullable, required: Owner and animal of the consultation's patient when it was picked from VetManager; preselect it.
    - `contactId` integer, required: VetManager client (owner) id.
    - `animalId` integer, required: VetManager animal id.
    - `animalName` string, nullable, required: Animal name.
    - `ownerName` string, nullable, required: Owner name as it was when the animal was picked.

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