# Leave a note on a notification

Canonical page: https://docs.ovok.com/api/slim/notifications/leave-a-note-on-a-notification

`POST /v1/slim/notifications/notes`

Leaves a note on a notification. A note is a practitioner's comment on a notification, stored as a FHIR `Communication` whose `basedOn` points at the alert. The alert itself is never changed.

**Auth:** Bearer token. The caller must be a practitioner, an admin, a super admin, or hold the "System Owner" access policy. The access policy must grant `Patient:read` (an admin or super admin who holds no access policy skips this check). Only a practitioner can write notes.
**Scope:** The caller's project (from the token). An alert or note from another project, of another kind, or that does not exist answers the same 404.

## Behaviour

- `kind` names the feed the notification comes from: `oob` or `alarm` with the row's `commId` as `id`, `medical` with the row's `episode.id`, or `alert` with a raw Signals alert's `id`.
- A note on a raw alert is also listed and counted on that alert's episode. Which episode is decided once, when the note is written.
- `text` is trimmed and must be 1 to 2000 characters.
- The author is the calling practitioner, never a body field.
- Notes can be left on acknowledged notifications too.
- `medical` and `alert` notes are read from Signals first, so they answer 503 `signals_unavailable` while Signals is down. Retry once Signals is back.
- Answers 201 with the note as stored.

## Example

```bash
curl -X POST 'https://api.sandbox.ovok.com/v1/slim/notifications/notes' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \
  -H 'Content-Type: application/json' \
  -d '{ "kind": "oob", "id": "c3499c27-2973-0a7f-807e-fb8676a92dcb", "text": "Resident was in the bathroom." }'
```
