Variable upsertPatientSchemaConst
upsertPatientSchema: ZodObject<
{
externalId: ZodString;
phone: ZodString;
email: ZodString;
givenName: ZodString;
familyName: ZodString;
birthdate: ZodString;
sex: ZodEnum<{ male: "male"; female: "female" }>;
lang: ZodOptional<
ZodEnum<
{
en_US: "en_US";
es_US: "es_US";
de_CH: "de_CH";
fr_CH: "fr_CH";
it_CH: "it_CH";
},
>,
>;
state: ZodOptional<ZodString>;
country: ZodOptional<ZodString>;
},
$strict,
> = ...
Body of
POST /v1/patients— idempotent upsert keyed onexternalId.Repeating the call with the same
externalIdupdates the mutable fields instead of creating a duplicate.phoneis identity-bearing: it must be E.164, unique across the platform, and cannot be changed after creation (a conflicting phone yields409 phone_unavailable).