> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anivahealth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Email Results

> Email the customer that their lab results are ready

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.email` address.
* The profile has turned off transactional emails. To turn them on again, set
  `transactional_emails_enabled` to `true` with [Update Profile](/api/profiles/update-profile).
* `with_reports` is `true` and the profile has no `date_of_birth`. Set it with
  [Update Profile](/api/profiles/update-profile), or send with `with_reports: false`.

Requires the `results_view` scope.

## Request

### Path parameters

**id** `string` *required*

Unique identifier (UUID) of the appointment whose results to email.

### Body parameters

**with\_reports** `boolean` *required*

`true` attaches the lab reports as password-protected PDF files. `false` sends only the notice that the results are
ready.

**note** `string`

A personal note that the email shows below the notice. At most 1000 characters.

## Response

On success, the API returns `200 OK`.

**recipient\_email** `string` *required*

The address the email went to: the `email` of the profile.

**attachment\_count** `integer` *required*

The number of lab reports attached. `0` when `with_reports` is `false`.

**sent\_at** `string` *required*

When the email was sent, as a UTC instant (ISO 8601 with `Z` suffix).

## Error responses

An error body has `error`, 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. |

```bash cURL theme={null}
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."
  }'
```

```json 200 theme={null}
{
  "recipient_email": "maria.schmidt@example.com",
  "attachment_count": 1,
  "sent_at": "2026-10-15T09:12:44.512Z"
}
```

```json 409 theme={null}
{
  "error": "This customer has turned off emails. Turn emails on for them first.",
  "reason": "unsubscribed"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.