POST
GET
PUT
/cloud/partner/v5/patients
Patients
Créer un patient dans un espace de confiance, le retrouver par NIR + rang bénéficiaire ou externalId, et mettre à jour ses données administratives.
POST /patients
Créer ou retrouver un patient
Cet endpoint est idempotent : si le patient existe déjà (NIR+rang ou externalId), il retourne le patient existant avec
created: false.
Paramètres du corps
| Champ | Type | Requis | Description |
|---|---|---|---|
trustSpaceUuid | string | Oui | UUID de l'espace de confiance auquel rattacher le patient |
firstName | string | Oui | |
lastName | string | Oui | |
birthDate | date | Oui | YYYY-MM-DD |
gender | enum | Oui | M / F / U |
email | string | Non | Requis pour envoi par email |
phone | string | Non | E.164 — requis pour envoi par SMS |
externalId | string | Non | Identifiant dans votre système. Unique par espace de confiance. |
identificationKey | object | Non | Clé NIR SESAM-Vitale. Voir ci-dessous. |
identificationKey.nir | string | Non | 13 chiffres INSEE (sans clé de contrôle) ou 15 avec |
identificationKey.rang | string | Non | Rang bénéficiaire : 01 = assuré, 02–99 = ayants droit |
Priorité de déduplication : 1) NIR + rang → 2) externalId → 3) nom + prénom + DOB (fallback avec warning)
curl
Créer un patient (NIR)
curl -X POST https://secure.medicapp.ids.host/cloud/partner/v5/patients \ -H "Authorization: Bearer sk_test_VOTRE_CLE" \ -H "Content-Type: application/json" \ -d '{ "trustSpaceUuid": "ts_xxxxxxxxxxxx", "firstName": "Sophie", "lastName": "Bernard", "birthDate": "1988-11-03", "gender": "F", "phone": "+33612345678", "externalId": "EMP-4821", "identificationKey": { "nir": "1881103750016", "rang": "01" } }'
json
201 Created
{
"patientUuid": "pat_xxxxxxxxxxx",
"created": true,
"externalId": "EMP-4821",
"identificationKey": { "nir": "1881103750016", "rang": "01" },
"warning": null
}
PUT /patients/{patientUuid}
Mettre à jour un patient
Seuls
email, phone, externalId et identificationKey sont modifiables. Les données d'identité civile sont verrouillées.
curl
curl -X PUT https://secure.medicapp.ids.host/cloud/partner/v5/patients/{patientUuid} \ -H "Authorization: Bearer sk_test_VOTRE_CLE" \ -H "Content-Type: application/json" \ -d '{ "phone": "+33698765432", "email": "new@email.fr" }'
Try it
Tester en live