Profili
Atjaunināt profilu
Atjaunināt esošu pacienta profilu
PATCH
/
api
/
v1
/
profiles
/
{id}
curl --request PATCH \
--url https://anivahealth.com/api/v1/profiles/a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"phone": "+4917612345678",
"language": "en"
}'
{
"id": "a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d",
"handle": null,
"first_name": "Maria",
"last_name": "Schmidt",
"email": "maria.schmidt@example.com",
"phone": "+4917612345678",
"sex": 2,
"date_of_birth": "1985-03-22",
"height": 168,
"weight": 65,
"language": "en",
"transactional_emails_enabled": true,
"created_at": "2026-04-01T09:14:32Z",
"updated_at": "2026-04-01T14:22:11Z"
}
{
"error": "phone: Phone must be in E.164 format (e.g., +14155552671)"
}
{
"error": "Profile not found"
}
Atjaunini vienu vai vairākus laukus esošā pacienta profilā. Tev jāiekļauj tikai tie lauki, kurus vēlies mainīt — visi pamatteksta parametri ir neobligāti.
Nepieciešams
create_user tvērums.
Pieprasījums
Ceļa parametri
Pieprasījuma satura parametri
Jaunā bioloģiskā dzimuma vērtība saskaņā ar ISO/IEC 5218 (
1 = vīrietis, 2 = sieviete). 0 (nezināms) atgriež 400.Jaunais dzimšanas datums
YYYY-MM-DD formātā. Jābūt pagātnē un ne agrākam par 1900. gadu. Aprēķinātajam
vecumam jābūt no 16 līdz 100 gadiem.Jaunā vēlamā valoda:
en, bg, ca, cs, da, de, el, es, et, fi, fr, ga, hr, hu, is, it, lb, lt, lv, mt, nl, no, pl, pt, ro, ru, sk, sl, sr, sv, tr vai uk.Vai šim profilam jāsaņem transakciju (automātiskie) e-pasti — pierakstu
apstiprinājumi, paziņojumi par gataviem rezultātiem u. c. Atšķiras no piekrišanas mārketingam. Izlaid, lai saglabātu
pašreizējo vērtību.
Atbilde
Ja pieprasījums izdodas, API atgriež200 OK ar pilnu atjaunināto profilu.
Bioloģiskais dzimums pēc ISO/IEC 5218 (
0 = nezināms, 1 = vīrietis, 2 = sieviete). Var būt null.Kļūdu atbildes
| Statuss | Apraksts |
|---|---|
400 | Validācijas kļūda — viens vai vairāki lauki neizturēja validāciju. |
403 | Piekļuve liegta — tavai API atslēgai nav piekļuves šai darbībai vai profils atrodas ārpus tava piekļuves konteksta. |
404 | Profils nav atrasts. |
500 | Iekšēja servera kļūda. |
curl --request PATCH \
--url https://anivahealth.com/api/v1/profiles/a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"phone": "+4917612345678",
"language": "en"
}'
{
"id": "a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d",
"handle": null,
"first_name": "Maria",
"last_name": "Schmidt",
"email": "maria.schmidt@example.com",
"phone": "+4917612345678",
"sex": 2,
"date_of_birth": "1985-03-22",
"height": 168,
"weight": 65,
"language": "en",
"transactional_emails_enabled": true,
"created_at": "2026-04-01T09:14:32Z",
"updated_at": "2026-04-01T14:22:11Z"
}
{
"error": "phone: Phone must be in E.164 format (e.g., +14155552671)"
}
{
"error": "Profile not found"
}
⌘I
curl --request PATCH \
--url https://anivahealth.com/api/v1/profiles/a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"phone": "+4917612345678",
"language": "en"
}'
{
"id": "a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d",
"handle": null,
"first_name": "Maria",
"last_name": "Schmidt",
"email": "maria.schmidt@example.com",
"phone": "+4917612345678",
"sex": 2,
"date_of_birth": "1985-03-22",
"height": 168,
"weight": 65,
"language": "en",
"transactional_emails_enabled": true,
"created_at": "2026-04-01T09:14:32Z",
"updated_at": "2026-04-01T14:22:11Z"
}
{
"error": "phone: Phone must be in E.164 format (e.g., +14155552671)"
}
{
"error": "Profile not found"
}