Sendungen
Termine mit Sendung verknüpfen
Einen oder mehrere Termine mit einer Sendung verknüpfen
POST
/
api
/
v1
/
shipments
/
{id}
/
appointments
curl --request POST \
--url https://anivahealth.com/api/v1/shipments/P2611194821/appointments \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"appointment_ids": [
"c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a"
]
}'
[
{
"id": "c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a",
"profile_id": "a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d",
"location_id": "b7e2d1f5-3c4a-4e8b-a2f1-9d0c1e2f3a4b",
"scheduled_at": "2026-04-15T08:30:00Z",
"status": "blood_drawn",
"created_at": "2026-04-01T09:45:00Z",
"updated_at": "2026-04-15T08:30:00Z",
"profile": {
"id": "a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d",
"first_name": "Maria",
"last_name": "Schmidt",
"email": "maria.schmidt@example.com",
"date_of_birth": "1985-03-22",
"sex": 2
},
"panels": [],
"individual_biomarkers": [],
"shipments": [
{
"id": "P2611194821",
"added_at": "2026-04-15T08:30:00Z"
}
]
}
]
{
"error": "Cannot attach appointments outside the allowed window — each appointment must be past blood-draw or the shipment must be less than 24 hours old. Blocked: c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a"
}
Verknüpfe einen oder mehrere Termine mit dieser Sendung. Idempotent – bereits verknüpfte Termine
werden stillschweigend übersprungen.
Die Änderungsregel (pro Termin) lautet: Die Verknüpfung kann erstellt werden, wenn ENTWEDER
- der Termin nach der Blutabnahme liegt (
blood_drawn) oder - die Sendung vor weniger als 24 Stunden erstellt wurde.
409 Conflict abgelehnt, damit historische Einträge stabil bleiben.
Dieselbe Regel gilt für Termine von Sendung
trennen. Diese beiden Endpunkte sind die einzige
Möglichkeit, Verknüpfungen zu ändern. Die Termin-API hat keinen gespiegelten Endpunkt.
Anfrage
Pfadparameter
Body-Parameter
Array mit Termin-UUIDs, die verknüpft werden sollen. Muss mindestens einen Eintrag enthalten.
Antwort
Bei Erfolg gibt die API200 OK mit den verknüpften Terminen in deinem Zugriffskontext zurück,
die älteste Verknüpfung zuerst. Jeder Eintrag hat dieselbe Struktur wie Termin abrufen.
Fehlerantworten
| Status | Beschreibung |
|---|---|
400 | Validierungsfehler – z. B. leeres appointment_ids oder ungültige UUID. |
403 | Zugriff verweigert – fehlender Scope, Sendung oder Termin außerhalb des Zugriffskontexts oder eine verknüpfte Home-Kit-Bestellung liegt außerhalb deines Zugriffskontexts. |
404 | Sendung nicht gefunden oder ein oder mehrere Termine nicht gefunden. |
409 | Änderungsregel nicht erfüllt – mindestens ein Termin liegt noch nicht nach der Blutabnahme und die Sendung ist älter als 24 Stunden. Die Antwort listet die IDs auf. |
500 | Interner Serverfehler. |
curl --request POST \
--url https://anivahealth.com/api/v1/shipments/P2611194821/appointments \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"appointment_ids": [
"c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a"
]
}'
[
{
"id": "c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a",
"profile_id": "a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d",
"location_id": "b7e2d1f5-3c4a-4e8b-a2f1-9d0c1e2f3a4b",
"scheduled_at": "2026-04-15T08:30:00Z",
"status": "blood_drawn",
"created_at": "2026-04-01T09:45:00Z",
"updated_at": "2026-04-15T08:30:00Z",
"profile": {
"id": "a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d",
"first_name": "Maria",
"last_name": "Schmidt",
"email": "maria.schmidt@example.com",
"date_of_birth": "1985-03-22",
"sex": 2
},
"panels": [],
"individual_biomarkers": [],
"shipments": [
{
"id": "P2611194821",
"added_at": "2026-04-15T08:30:00Z"
}
]
}
]
{
"error": "Cannot attach appointments outside the allowed window — each appointment must be past blood-draw or the shipment must be less than 24 hours old. Blocked: c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a"
}
⌘I
curl --request POST \
--url https://anivahealth.com/api/v1/shipments/P2611194821/appointments \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"appointment_ids": [
"c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a"
]
}'
[
{
"id": "c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a",
"profile_id": "a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d",
"location_id": "b7e2d1f5-3c4a-4e8b-a2f1-9d0c1e2f3a4b",
"scheduled_at": "2026-04-15T08:30:00Z",
"status": "blood_drawn",
"created_at": "2026-04-01T09:45:00Z",
"updated_at": "2026-04-15T08:30:00Z",
"profile": {
"id": "a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d",
"first_name": "Maria",
"last_name": "Schmidt",
"email": "maria.schmidt@example.com",
"date_of_birth": "1985-03-22",
"sex": 2
},
"panels": [],
"individual_biomarkers": [],
"shipments": [
{
"id": "P2611194821",
"added_at": "2026-04-15T08:30:00Z"
}
]
}
]
{
"error": "Cannot attach appointments outside the allowed window — each appointment must be past blood-draw or the shipment must be less than 24 hours old. Blocked: c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a"
}