---
title: "Set VetsGPT patient context"
method: PUT
path: "/workspaces/{workspaceId}/vetsgpt/chats/{chatId}/attachments/patient"
tags: ["vetsgpt"]
---

# Set VetsGPT patient context

`PUT /workspaces/{workspaceId}/vetsgpt/chats/{chatId}/attachments/patient`

## Request

- Base URL: `https://vetnio.com/api/v2`
- URL: `https://vetnio.com/api/v2/workspaces/{workspaceId}/vetsgpt/chats/{chatId}/attachments/patient`
- Auth: HTTP bearer

Owner only: attaches one patient to the chat as context, replacing any previous patient. For new questions VetsGPT uses the patient's details, up to five recent clinical notes and up to five analysed patient files, but only while no consultations are attached (attached consultations bring their own patient). Existing questions retain their captured context on retry. Returns `404` when the chat does not exist or the caller is not its owner.

## Path parameters

- `workspaceId` string, required: Identifier of the workspace (clinic). The caller must be a member, and VetsGPT must be enabled for them in this workspace.
- `chatId` string, required: Identifier of a VetsGPT chat owned by or explicitly shared with the caller. Unshared chats behave as if they did not exist.

## Request body

- object
  - `patientId` string, required: Patient to attach. Replaces any patient already attached. Not validated; an unknown id is stored but gives no context.

## Response `200`

The patient context was attached.

- object: Acknowledgement returned by VetsGPT mutations that have no resource body.
  - `success` boolean, required: Always `true` on success; failures are returned as errors.

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