---
title: "Create a patient"
method: POST
path: "/workspaces/{workspaceId}/patients"
tags: ["patients"]
---

# Create a patient

`POST /workspaces/{workspaceId}/patients`

## Request

- Base URL: `https://vetnio.com/api/v2`
- URL: `https://vetnio.com/api/v2/workspaces/{workspaceId}/patients`
- Auth: HTTP bearer

Creates a patient and, always, a new owner (client) for it: the `client` object fills in the owner's details, and omitting it creates an empty placeholder owner. An existing client cannot be reused through this endpoint. All fields are optional and stored as given. Returns the patient with the new owner embedded.

Not idempotent and not deduplicated: Vetnio does not check for an existing patient with the same name or identifier, so repeating the call creates another patient and owner. Search the patient list by `identifier` first if duplicates matter. An invalid `dateOfBirth` fails with `500` and may leave the new owner behind without a patient.

## Path parameters

- `workspaceId` string, required: Identifier of the workspace (clinic) that owns the patients and clients. The caller must be a member of it; patients and clients are shared by all members of the workspace.

## Request body

- object
  - `name` string: The animal's name. Free text; Vetnio does not enforce uniqueness.
  - `species` string: Species, free text. The Vetnio web app stores the English species name, followed by ` - <breed>` when a breed is chosen (for example `Dog` or `Dog - Labrador Retriever`); patients synced from a practice-management system may use that system's values.
  - `breed` string: Breed, free text.
  - `dateOfBirth` string: Date of birth as an ISO-8601 calendar date (`YYYY-MM-DD`). Stored as a date, so other formats are rejected by the database.
  - `gender` string: Sex and neuter status, free text. The Vetnio web app uses `Male`, `Female`, `Male Neutered` and `Female Neutered`; use the same values so the patient list's gender filter and the UI stay consistent.
  - `weight` string: Body weight as free text including the unit, as the web app writes it (for example `24.5 kg`). Not parsed or converted.
  - `identifier` string: The animal's identifier, typically a microchip (transponder) number, but it can be a tattoo, registration number or practice-management-system id. Free text, not unique; matched by the patient list search.
  - `insurance` string: Name of the animal's insurance company, free text.
  - `client` object: Details for the new owner created with the patient. When omitted, an owner with no details is created.
    - `name` string: The owner's full name, free text.
    - `email` string: The owner's email address. Stored as given; the format is not validated.
    - `address` string: The owner's street address, free text.
    - `zipCode` string: The owner's postal code, free text.
    - `phoneNumbers` string[]: The owner's phone numbers, stored as given (no normalisation). E.164 format such as `+46701234567` is recommended. Defaults to an empty list.

## Response `200`

The newly created patient with its embedded client.

- PatientWithClient: A patient with its owner (client) embedded. Returned by the endpoints that read or create a single patient.
  - `id` string, required: Patient id (UUID), generated by Vetnio.
  - `name` string, nullable, required: The animal's name. Free text; Vetnio does not enforce uniqueness. `null` when not recorded.
  - `species` string, nullable, required: Species, free text. The Vetnio web app stores the English species name, followed by ` - <breed>` when a breed is chosen (for example `Dog` or `Dog - Labrador Retriever`); patients synced from a practice-management system may use that system's values. `null` when not recorded.
  - `breed` string, nullable, required: Breed, free text. `null` when not recorded.
  - `dateOfBirth` string, nullable, required: Date of birth (`YYYY-MM-DD`), or `null` when not recorded.
  - `gender` string, nullable, required: Sex and neuter status, free text. The Vetnio web app uses `Male`, `Female`, `Male Neutered` and `Female Neutered`; use the same values so the patient list's gender filter and the UI stay consistent. `null` when not recorded.
  - `weight` string, nullable, required: Body weight as free text including the unit, as the web app writes it (for example `24.5 kg`). Not parsed or converted. `null` when not recorded.
  - `identifier` string, nullable, required: The animal's identifier, typically a microchip (transponder) number, but it can be a tattoo, registration number or practice-management-system id. Free text, not unique; matched by the patient list search. `null` when not recorded.
  - `insurance` string, nullable, required: Name of the animal's insurance company, free text. `null` when the animal is uninsured or it is not recorded.
  - `clientId` string, nullable, required: Id of the owner (client). Patients created through the API always have one (an empty placeholder owner when no owner details were given); `null` only for patients created without an owner by other flows.
  - `createdAt` string, nullable, required: When the patient was created (ISO-8601). May be `null` for very old records.
  - `updatedAt` string, nullable, required: When the patient was last changed (ISO-8601). Set on every update, even one that changes nothing, and by practice-management-system syncs.
  - `client` ClientOutput, required: An animal owner registered in the workspace. A client can own any number of patients. Clients are shared by every member of the workspace and are also created automatically when patients are synced from a connected practice-management system.
    - `id` string, required: Client id (UUID), generated by Vetnio.
    - `name` string, nullable, required: The owner's full name, free text. `null` when not recorded, for example for the placeholder owner created with a patient that had no owner details.
    - `address` string, nullable, required: The owner's street address, free text. `null` when not recorded.
    - `zipCode` string, nullable, required: The owner's postal code, free text. `null` when not recorded.
    - `phoneNumbers` string[], required: The owner's phone numbers, stored as given (no normalisation). E.164 format such as `+46701234567` is recommended. Empty array when none are recorded.
    - `email` string, nullable, required: The owner's email address. Stored as given; the format is not validated. `null` when not recorded.

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