> ## 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 the lab results of their home kit are ready

Send the customer one email that tells them their lab results are ready. The email goes to the
`email` of the home kit order'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 kit. 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`.
* The order is one of the demo home kit orders. A demo order has no customer to email.

Requires the `results_view` scope plus the `home_kit_orders_view` or `home_kit_orders_manage` scope.

## Request

### Path parameters

**id** `string` *required*

Unique identifier (UUID) of the home kit order 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 scopes, or the home kit order is outside your access context. |
| `404` | `not_found` | Home kit order not found. |
| `409` | `demo_order` | The order is a demo home kit order. It has no customer to email. |
| `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/home-kit-orders/d1e2f3a4-5b6c-4d7e-8f9a-0b1c2d3e4f5a/results/email \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "with_reports": true
  }'
```

```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": "No lab report has arrived yet.",
  "reason": "no_reports"
}
```


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