Expéditions
Associer des rendez-vous à une expédition
Lier un ou plusieurs rendez-vous à une expédition
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"
}
Associe un ou plusieurs rendez-vous à cet envoi. Idempotent — les rendez-vous déjà liés sont
ignorés silencieusement.
La règle de modification (par rendez-vous) est : le lien peut être créé SOIT quand
- le rendez-vous a dépassé la prise de sang (
blood_drawn), soit quand - l’envoi a été créé il y a moins de 24 heures.
409 Conflict afin que les enregistrements historiques restent stables.
La même règle s’applique à Détacher des rendez-vous d’un
envoi. Ces deux endpoints sont le seul moyen
de modifier les liens. L’API des rendez-vous n’a pas d’endpoint miroir.
Requête
Paramètres de chemin
Paramètres du corps
Réponse
En cas de succès, l’API renvoie200 OK avec les rendez-vous liés dans ton contexte d’accès,
du lien le plus ancien au plus récent. Chaque entrée a la même structure que Obtenir un rendez-vous.
Réponses d’erreur
| Statut | Description |
|---|---|
400 | Erreur de validation — par ex. appointment_ids vide ou UUID invalide. |
403 | Interdit — scope manquant, envoi ou rendez-vous hors du contexte d’accès, ou une commande de kit à domicile liée est en dehors de ton contexte d’accès. |
404 | Envoi introuvable, ou un ou plusieurs rendez-vous introuvables. |
409 | Règle de modification non respectée — au moins un rendez-vous n’a pas dépassé la prise de sang et l’envoi date de plus de 24 heures. La réponse liste les identifiants. |
500 | Erreur interne du serveur. |
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"
}