# Upsert patient

URL: https://docs.clinia.com/api/rest/put-patients-patientId

> Creates the patient entry if it does not yet exist, or returns the existing record unchanged. Idempotent.

New ids are limited to `[A-Za-z0-9][A-Za-z0-9.~:-]{0,127}`, but you can keep referring to previous ids as they were defined.

## `PUT /v1/patients/{patientId}`

Parameters, request body and responses: operation `upsert-patient` in the [OpenAPI spec](https://docs.clinia.com/openapi.yaml).