Appointments
Email Results
Email the customer that their lab results are ready
POST
/
api
/
v1
/
appointments
/
{id}
/
results
/
email
curl --request POST \
--url https://anivahealth.com/api/v1/appointments/c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a/results/email \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"with_reports": true,
"note": "Your vitamin D is low. We will talk about it at your next visit."
}'
{
"recipient_email": "maria.schmidt@example.com",
"attachment_count": 1,
"sent_at": "2026-10-15T09:12:44.512Z"
}
{
"error": "This customer has turned off emails. Turn emails on for them first.",
"reason": "unsubscribed"
}
Send the customer one email that tells them their lab results are ready. The email goes to the
email of the appointment’s profile.
The email uses generic partner branding: the name and the logo of the profile’s primary profile
group. It is in German when the profile language is de, and in English for all other languages.
Set with_reports to true to attach the lab reports of the appointment. The email
attaches every report that the customer can see in the app. Set it to false
to send only the notice. Add note to show a personal note in the email, at most 1000 characters.
Every attached report is a PDF encrypted with AES-256. The password is the date_of_birth of the
profile as 8 digits, DDMMYYYY, without dots: a customer born on 1 February 1985 types
01021985. The email tells the customer this format, but never the birthdate itself.
Each call sends one email. Calls are not deduplicated: if you call the endpoint twice, the customer
gets two emails.
The email is not sent when:
- No lab report has arrived yet.
- The profile has no email address, or only a placeholder
@aniva.emailaddress. - The profile has turned off transactional emails. To turn them on again, set
transactional_emails_enabledtotruewith Update Profile. with_reportsistrueand the profile has nodate_of_birth. Set it with Update Profile, or send withwith_reports: false.
results_view scope.
Request
Path parameters
string
required
Unique identifier (UUID) of the appointment whose results to email.
Body parameters
boolean
required
true attaches the lab reports as password-protected PDF files. false sends only the notice that the results are
ready.string
A personal note that the email shows below the notice. At most 1000 characters.
Response
On success, the API returns200 OK.
string
required
The address the email went to: the
email of the profile.integer
required
The number of lab reports attached.
0 when with_reports is false.string
required
When the email was sent, as a UTC instant (ISO 8601 with
Z suffix).Error responses
An error body haserror, a human-readable message, and reason, a stable code. Validation errors
and a missing results_view scope have no reason.
| Status | Reason | Description |
|---|---|---|
400 | — | Validation error — invalid ID, missing with_reports, or note longer than 1000 characters. |
403 | access_denied | Forbidden — your API key does not have the scope, or the appointment is outside your access context. |
404 | not_found | Appointment not found. |
409 | no_reports | No lab report has arrived yet. |
409 | no_email | The profile has no email address. |
409 | placeholder_email | The profile has only a placeholder @aniva.email address. Update the profile with a real email. |
409 | unsubscribed | The profile has turned off transactional emails. Set transactional_emails_enabled to true first. |
409 | no_birthdate | with_reports is true and the profile has no date_of_birth, the PDF password. |
413 | reports_too_large | The reports are too large for one email. Send the email with with_reports: false. |
422 | report_unprotectable | A report is not a PDF, or it could not be password-protected. Send with with_reports: false. |
500 | — | Internal server error. |
502 | report_unavailable | A lab report could not be loaded. No email was sent. |
502 | send_failed | The email provider refused the email. No email was sent. |
curl --request POST \
--url https://anivahealth.com/api/v1/appointments/c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a/results/email \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"with_reports": true,
"note": "Your vitamin D is low. We will talk about it at your next visit."
}'
{
"recipient_email": "maria.schmidt@example.com",
"attachment_count": 1,
"sent_at": "2026-10-15T09:12:44.512Z"
}
{
"error": "This customer has turned off emails. Turn emails on for them first.",
"reason": "unsubscribed"
}
⌘I
curl --request POST \
--url https://anivahealth.com/api/v1/appointments/c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a/results/email \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"with_reports": true,
"note": "Your vitamin D is low. We will talk about it at your next visit."
}'
{
"recipient_email": "maria.schmidt@example.com",
"attachment_count": 1,
"sent_at": "2026-10-15T09:12:44.512Z"
}
{
"error": "This customer has turned off emails. Turn emails on for them first.",
"reason": "unsubscribed"
}