Docs
Contact

Events

What YOU(th) tells your system, and what each delivery carries.

When something happens in your organization, to one of its members or to one of its access codes, YOU(th) tells your system with an event: a signed POST to the HTTPS address you registered, for each event you subscribed to. A delivery says what happened and where to read it.

Events

event_typeSent whenResource
AccessCode.redeemedA person redeemed one of your access codesThe access code
Access.endedThe access a code started has endedThe access code
Checkup.completedPreview: a member of yours completed a checkupBundle (FHIR)
Patient.registeredPreview: a person registered as a member of yoursPatient (FHIR)

Preview: Checkup.completed and Patient.registered are not available yet. What this page says of them, and of reading a checkup or a member from a resource_url, is proposed and may change. AccessCode.redeemed and Access.ended are final, and are sent to the endpoints that take them.

Each event type documents its own resource. New event types can appear: answer 2xx to one you do not handle.

A webhook endpoint is one address of yours that takes deliveries: its HTTPS address, and the events it receives. Your backend creates it with the API: see Manage your endpoints. Each endpoint has its own signing secret, shown once when it is created. An organization can have several endpoints, and your sandbox has its own.

The body

Every event shares one envelope. A checkup's, a preview, looks like this:

{  "event_id": "evt_e560fc965cf89b3d5a8c3ed27406806f",  "event_type": "Checkup.completed",  "occurred_at": "2026-10-01T09:30:00.375000Z",  "patient_id": "cfefb422-ac79-4cb9-a849-e80f8a6f21cd",  "checkup_id": "64d866f3-0c88-485c-bfe6-3339df1d224a",  "resource_url": "https://api.youth-platform.io/v1/checkups/64d866f3-0c88-485c-bfe6-3339df1d224a/fhir"}
FieldMeans
event_idThe event, evt_ and 32 hex digits. The same on every retry: deduplicate on it
event_typeFrom the table above
occurred_atWhen what the event reports happened, ISO 8601 in UTC: see below
patient_idThe member; in Checkup.completed and Patient.registered
checkup_idThe checkup; only in Checkup.completed
access_code_idThe access code's id; in AccessCode.redeemed and Access.ended
batch_idThe code's batch; in AccessCode.redeemed and Access.ended
reasonWhy the access ended; only in Access.ended
resource_urlWhere to read the resource: the checkup's bundle, the member's Patient or the access code, in the read-API version your integration is set to, today /v1. You can also build it from the ids: see Versions
  • occurred_at is when what the event reports happened, not when it was sent:
    • Checkup.completed: the checkup's completion, which is the issued of its bundle's DiagnosticReport and what the catch-up list's completed_from filters on;
    • Patient.registered: the member's registration;
    • AccessCode.redeemed: the redemption, which is the code's redeemed_at;
    • Access.ended: the end you set with PUT …/access, or the end of the code's term.
  • Most events are sent within seconds, but one can come later than its occurred_at: an Access.ended comes once the app has ended the access, within about 10 minutes of its end, later when YOU(th) can't reach the app; and, rarely, an AccessCode.redeemed comes up to a day after the redemption.
  • AccessCode.redeemed and Access.ended name a code and never a person: they have no patient_id. See their examples.
  • Patient.registered has no checkup_id; its resource_url points at the Patient.
  • Ids are opaque strings. Store them as they are; do not rely on their length or format.
  • New fields and new event types can appear. Ignore fields you do not know; answer 2xx to an event you do not handle. A change that could break your receiver comes as a new event type, never as a change to one you receive: see Versions.

What a delivery carries

Ids, never the resource: your backend reads it from resource_url with an access token. A delivery sent to a wrong address, or kept in a gateway's or a queue's logs, then holds no personal or health data, and every read is checked against your integration's scopes when it happens.

  • An access event names a code and its batch, never a person.
  • A checkup's or a member's event is sent only for a member who consented to share their data with your organization, and reading its resource_url takes the scope checkups:read or patients:read: see Health data.
  • A checkup's bundle is built once, when the event happens: reading resource_url answers the same bundle every time.
  • Reading a member's resource_url answers the Patient as it is now.

The request

MethodPOST, to your HTTPS address, on port 443
BodyJSON, compact, keys sorted, UTF-8. Verify the raw bytes; never re-serialize
SuccessAny 2xx within ten seconds
RedirectsNot followed. A 3xx counts as a failure that is not retried
OrderNone. Deliveries can arrive in any order and more than once

Headers, as Standard Webhooks names them (their names are case-insensitive):

HeaderHolds
Content-Typeapplication/json
webhook-idThe event_id. The same on every retry: deduplicate on it
webhook-timestampWhen this attempt was signed, in Unix seconds
webhook-signaturev1,<signature>, or several separated by spaces: see Verify a delivery

YOU(th) adds two headers of its own, to route and log a delivery before you read its body:

HeaderHolds
youth-event-typeThe event_type, such as Checkup.completed
youth-delivery-attemptWhich attempt this is: 1 for the first, up to 8

They are not signed. Act on the verified body, and trust it over them if they ever differ.

Verify every delivery before you act on it, and answer fast: see Retries and duplicates.

Examples

The bodies below are pretty-printed for reading. On the wire a body is compact, with its keys sorted, as in the first example; verify the bytes as you received them.

A whole request

This request is really signed: the fixture secret on Verify a delivery verifies it.

POST /youth-webhook HTTP/1.1Host: partner.example.comContent-Type: application/jsonwebhook-id: evt_e560fc965cf89b3d5a8c3ed27406806fwebhook-timestamp: 1790847002webhook-signature: v1,f/69pGXkwyZXFdzr/vJ44kTIC3ThgR+du6f4olitEV0=youth-event-type: Checkup.completedyouth-delivery-attempt: 1{"checkup_id":"64d866f3-0c88-485c-bfe6-3339df1d224a","event_id":"evt_e560fc965cf89b3d5a8c3ed27406806f","event_type":"Checkup.completed","occurred_at":"2026-10-01T09:30:00.375000Z","patient_id":"cfefb422-ac79-4cb9-a849-e80f8a6f21cd","resource_url":"https://api.youth-platform.io/v1/checkups/64d866f3-0c88-485c-bfe6-3339df1d224a/fhir"}

Patient.registered

{  "event_id": "evt_3b9e0f6a1c2d4e5f8a7b6c5d4e3f2a1b",  "event_type": "Patient.registered",  "occurred_at": "2026-10-01T08:12:40.120000Z",  "patient_id": "cfefb422-ac79-4cb9-a849-e80f8a6f21cd",  "resource_url": "https://api.youth-platform.io/v1/patients/cfefb422-ac79-4cb9-a849-e80f8a6f21cd/fhir"}

AccessCode.redeemed

{  "event_id": "evt_3b9f2c1a7d4e4f6a8c5b0e1d2f3a4b5c",  "event_type": "AccessCode.redeemed",  "occurred_at": "2026-12-12T09:30:00.375000Z",  "access_code_id": "0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34",  "batch_id": "0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21",  "resource_url": "https://api.youth-platform.io/v1/access-codes/0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34"}

occurred_at is the redemption: the time to bill from. access_code_id is the id you got with the code when you read the batch.

Access.ended

{  "event_id": "evt_7c1e5a9b3d2f4a6c8e0b1d3f5a7c9e2b",  "event_type": "Access.ended",  "occurred_at": "2027-01-12T00:00:00.000000Z",  "access_code_id": "0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34",  "batch_id": "0193b1c0-11aa-7e02-8c55-9d3f0a7b6c21",  "reason": "ended_by_partner",  "resource_url": "https://api.youth-platform.io/v1/access-codes/0193b1c2-7a4e-7c1d-9f0a-2b6d5e8f1a34"}

reason is ended_by_partner or term_over: see What happens then. New reasons can appear.

Last updated