# Preview who an alert event would reach

Canonical page: https://docs.ovok.com/api/omni-channel-alerts/preview-who-an-alert-event-would-reach

`POST /v1/omnichannel-alerts/preview`

Shows who a rule would tell about one alert event for one patient, and over which channels. Nothing is sent and nothing is stored.

**Scope:** the caller's project (from the token).

## Behaviour

- `patientId` is the FHIR Patient whose people are resolved. `event` is the Signals event to try, `alert.triggered` by default. `alert` is a sample alert: `reason`, and optionally `code`, `message` and `value`.
- `notifications` tries a rule before you save it; without it, the project's own rule applies.
- Each `notify` entry lists its `recipients`, each with `email` telling whether they have an address on file, and the `unknownChannels` and `unknownRoles` Ovok would skip.
- `withheld` lists the people the entry names but Ovok would not tell, because their own access does not cover the alert. Each has a `reason`:
  - `no_account`: no active membership in the project.
  - `no_patient_access`: their access policy does not let them read the patient.
  - `no_alert_access`: it grants neither `signals_alerts:read` nor the alert's `DetectedIssue`.

## Example

```bash
curl -X POST 'https://api.sandbox.ovok.com/v1/omnichannel-alerts/preview' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \
  -H 'Content-Type: application/json' \
  -d '{"patientId":"PATIENT_ID","event":"alert.triggered","alert":{"code":"8867-4","value":132}}'
```

**Who can call it:** a project admin. See [roles](/access-policies#who-can-call-a-route).