# Notes

Subscribe to `notes` to receive notes written about a member.

| `event_type` | Sent when |
| --- | --- |
| `notes.created` | A note is created. |
| `notes.updated` | A note is edited. |
| `notes.deleted` | A note is deleted. |

## notes.created and notes.updated

Both events send the full note.

```json
{
  "event_type": "notes.created",
  "data": {
    "note_id": "665f1c2ab7e4d90012a3f4c4",
    "medical_record_number": "3f2b8c1e-7a4d-4e9b-9c55-0d6a1f2e8b47",
    "plan_name": "Standard Plan",
    "note_content": "Weekly session. Member reports steady progress.",
    "created_at": "2026-01-01T14:30:00.000Z",
    "updated_at": "2026-01-01T14:31:10.000Z",
    "created_by": "Jordan Rivera",
    "session_details": {
      "start_time": "2026-01-01T14:00:00.000Z",
      "stop_time": "2026-01-01T14:30:00.000Z",
      "duration_minutes": 30
    },
    "coaching_session": {
      "session_id": "665f1c2ab7e4d90012a3f4c5",
      "scheduled_date": "2026-01-01T14:00:00.000Z",
      "end_time": "2026-01-01T14:30:00.000Z",
      "duration_minutes": 30,
      "status": "completed",
      "recurrence_group_id": null
    },
    "flags": {
      "essential_info": false,
      "recovery_capital_summary": false,
      "compliance": false,
      "tox_review": false,
      "onboarding_complete": false,
      "notify_care_team": true,
      "call": false,
      "email": false,
      "checkin": true,
      "family_contact": false,
      "clinical_contact": false,
      "justice_contact": false,
      "no_show": false
    },
    "tox_id": null,
    "file": null
  }
}
```

| Field | Type | Description |
| --- | --- | --- |
| `note_id` | string | The note's ID. |
| `medical_record_number` | string (UUID) | The member's medical record number. |
| `plan_name` | string | The member's plan. Optional. |
| `note_content` | string | The text of the note. |
| `created_at` | string (date-time) | The date on the note. |
| `updated_at` | string (date-time) | When the note was last changed. |
| `created_by` | string or null | First and last name of the person who wrote the note. |
| `session_details` | object or null | The times the coach logged. See [Session details and coaching session](#session-details-and-coaching-session). |
| `coaching_session` | object or null | The scheduled session this note was matched to. |
| `flags` | object | What kind of note this is. See [Flags](#flags). |
| `tox_id` | string or null | The related test result, if there is one. Matches `test_id` on toxicology and breathalyzer events. |
| `file` | null | Reserved. Always `null`. |

### Flags

| Flag | `true` when |
| --- | --- |
| `essential_info` | The note holds important information about the member. |
| `recovery_capital_summary` | The note came from a recovery capital assessment. |
| `compliance` | The note is a compliance note. |
| `tox_review` | The note came from a review of a recorded test. |
| `onboarding_complete` | The note marks the end of onboarding. |
| `notify_care_team` | The care team was notified about the note. |
| `call` | A call was made. |
| `email` | An email was sent. |
| `checkin` | The note documents a session with the member. |
| `family_contact` | The note documents contact with family. |
| `clinical_contact` | The note documents contact with a clinician. |
| `justice_contact` | The note documents contact with probation, court or other justice staff. |
| `no_show` | The member missed a scheduled session. |

### Session details and coaching session

These two objects describe different things and will not always agree.

- `session_details` holds the **actual** times the coach logged: when the session started, when it stopped and how long it ran. Use it for actual time.
- `coaching_session` holds the **scheduled** appointment the note was matched to. Use it to tie the note to a booking. See [Coaching session](https://developers.youareaccountable.com/webhooks/events/coaching-session.md).

`session_details`

| Field | Type | Description |
| --- | --- | --- |
| `start_time` | string (date-time) or null | When the session started. |
| `stop_time` | string (date-time) or null | When the session ended. |
| `duration_minutes` | number or null | How long the session ran. |

On a no-show note, `start_time` and `duration_minutes` are `null` because no session took place. Some older no-show notes have a `stop_time` with no `start_time`. Ignore `stop_time` whenever `start_time` is `null`.

`coaching_session`

| Field | Type | Description |
| --- | --- | --- |
| `session_id` | string | The scheduled session's ID. |
| `scheduled_date` | string (date-time) | The scheduled start time. |
| `end_time` | string (date-time) or null | The scheduled end time. |
| `duration_minutes` | number or null | The scheduled length. |
| `status` | string | `scheduled`, `completed`, `canceled` or `no-show`. |
| `recurrence_group_id` | string or null | Set when the session belongs to a recurring series. |

- `coaching_session` is set only on attendance notes (`checkin` or `no_show`) that match a scheduled session within 4 hours of the note's session time. It is `null` on every other note.
- `status` is `completed` for a check-in and `no-show` for a no-show.
- `end_time` and `duration_minutes` are `null` for most sessions a member booked themselves before April 2026. If you need a length, use your program's standard session length.

## notes.deleted

```json
{
  "event_type": "notes.deleted",
  "data": {
    "note_id": "665f1c2ab7e4d90012a3f4c4"
  }
}
```

| Field | Type | Description |
| --- | --- | --- |
| `note_id` | string | The ID of the deleted note. |

## JSON Schemas

- [`notes.created`](https://developers.youareaccountable.com/schemas/notes.created.json)
- [`notes.updated`](https://developers.youareaccountable.com/schemas/notes.updated.json)
- [`notes.deleted`](https://developers.youareaccountable.com/schemas/notes.deleted.json)
