> ## 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.

# Sonuçları e-postayla gönder

> Müşteriye laboratuvar sonuçlarının hazır olduğunu e-postayla bildir

Müşteriye laboratuvar sonuçlarının hazır olduğunu bildiren bir e-posta gönder. E-posta, randevunun
profilindeki `email` adresine gider.

E-posta genel iş ortağı markalamasını kullanır: profilin birincil profil grubunun adı ve
logosu. Profilin `language` dilindedir, varsayılan olarak İngilizcedir.

Randevunun laboratuvar raporlarını eklemek için `with_reports` değerini `true` olarak ayarla. E-posta,
müşterinin uygulamada görebildiği her raporu ekler. Yalnızca bildirimi göndermek için `false` olarak
ayarla. E-postada kişisel bir not göstermek için en fazla 1.000 karakterlik `note` ekle.

Eklenen her rapor, AES-256 ile şifrelenmiş bir PDF'dir. Şifre, profilin `date_of_birth` değerinin
noktasız 8 haneli `DDMMYYYY` biçimidir: 1 Şubat 1985 doğumlu bir müşteri
`01021985` yazar. E-posta müşteriye bu biçimi söyler ama doğum tarihinin kendisini asla yazmaz.

Her çağrı bir e-posta gönderir. Çağrılar tekilleştirilmez: uç noktayı iki kez çağırırsan müşteri
iki e-posta alır.

E-posta şu durumlarda gönderilmez:

* Henüz laboratuvar raporu gelmedi.
* Profilde e-posta adresi yok veya yalnızca yer tutucu bir `@aniva.email` adresi var.
* Profil işlemsel e-postaları kapattı. Bunları yeniden açmak için [Profili güncelle](https://docs.anivahealth.com/tr/api/profiles/update-profile.md) ile
  `transactional_emails_enabled` değerini `true` olarak ayarla.
* `with_reports` değeri `true` ve profilde `date_of_birth` yok. Bunu
  [Profili güncelle](https://docs.anivahealth.com/tr/api/profiles/update-profile.md) ile ayarla veya `with_reports: false` ile gönder.

`results_view` kapsamını gerektirir.

## İstek

### Yol parametreleri

**id** `string` *required*

Sonuçları e-postayla gönderilecek randevunun benzersiz tanımlayıcısı (UUID).

### Gövde parametreleri

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

`true` laboratuvar raporlarını şifre korumalı PDF dosyaları olarak ekler. `false` yalnızca sonuçların hazır olduğuna dair
bildirimi gönderir.

**note** `string`

E-postanın bildirimin altında gösterdiği kişisel not. En fazla 1.000 karakter.

## Yanıt

Başarılı olduğunda API `200 OK` döndürür.

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

E-postanın gönderildiği adres: profilin `email` değeri.

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

Eklenen laboratuvar raporu sayısı. `with_reports` değeri `false` olduğunda `0`.

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

E-postanın gönderildiği zaman, UTC anı olarak (`Z` son ekli ISO 8601).

## Hata yanıtları

Hata gövdesinde okunabilir bir mesaj olan `error` ve sabit bir kod olan `reason` bulunur. Doğrulama hataları
ve eksik `results_view` kapsamı için `reason` bulunmaz.

| Durum | Neden | Açıklama |
| - | - | - |
| `400` | — | Doğrulama hatası — geçersiz kimlik, eksik `with_reports` veya 1.000 karakterden uzun `note`. |
| `403` | `access_denied` | Yasak — API anahtarının bu kapsamı yok veya randevu erişim bağlamının dışında. |
| `404` | `not_found` | Randevu bulunamadı. |
| `409` | `no_reports` | Henüz laboratuvar raporu gelmedi. |
| `409` | `no_email` | Profilde e-posta adresi yok. |
| `409` | `placeholder_email` | Profilde yalnızca yer tutucu bir `@aniva.email` adresi var. Profili gerçek bir e-postayla güncelle. |
| `409` | `unsubscribed` | Profil işlemsel e-postaları kapattı. Önce `transactional_emails_enabled` değerini `true` olarak ayarla. |
| `409` | `no_birthdate` | `with_reports` değeri `true` ve profilde PDF şifresi olan `date_of_birth` yok. |
| `413` | `reports_too_large` | Raporlar tek bir e-posta için çok büyük. E-postayı `with_reports: false` ile gönder. |
| `422` | `report_unprotectable` | Bir rapor PDF değil veya şifreyle korunamadı. `with_reports: false` ile gönder. |
| `500` | — | İç sunucu hatası. |
| `502` | `report_unavailable` | Bir laboratuvar raporu yüklenemedi. E-posta gönderilmedi. |
| `502` | `send_failed` | E-posta sağlayıcısı e-postayı reddetti. E-posta gönderilmedi. |

```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.