consent.collected
consent.collected fires when a patient authorizes one of your projects to use their data. It also fires when a patient re-consents to a project, for example after a previous authorization expired or was about to expire.
When It Fires
All of the following must hold:
- The patient opted in. A patient who declines never generates this event.
- The consent is scoped to a project. A patient's consent to use HealthEx is not project-scoped and does not emit this event.
- The consent is a data consent:
consentTypeisDATA_AUTHORIZATIONorPATIENT_DIRECTED_DATA_EXCHANGE.FUTURE_DATA_USEdoes not emit this event.
The event is delivered to every active webhook whose project scope covers the project and whose subscribed events include consent.collected.
Example Payload
{
"type": "consent.collected",
"timestamp": "2026-08-19T14:32:07.421Z",
"apiVersion": 1,
"deliveryAttempt": 1,
"organizationId": "56696fdb-2e0d",
"projectId": "694d61c2-3f1b-4dc8",
"data": {
"patientId": "17d4513f-73e8-4b2a-9c1d-5e6f7a8b9c0d",
"externalId": "member-48213",
"consentType": "PATIENT_DIRECTED_DATA_EXCHANGE",
"consentedAt": "2026-08-19T14:32:05.891Z",
"fullRecordWithoutRestrictedData": true,
"consentDataResourceScopes": null,
"consentDataSensitivityScopes": null,
"consentSource": "PATIENT"
}
}
The envelope fields are documented in the Webhooks overview.
Key Fields
| Field | Description |
|---|---|
patientId | The HealthEx identifier for the patient who consented. |
externalId | Your own identifier for the patient in this project, as supplied when you identified them. null if none has been set. |
consentType | Either DATA_AUTHORIZATION or PATIENT_DIRECTED_DATA_EXCHANGE. |
consentedAt | ISO 8601 timestamp of the patient's consent action. Distinct from the envelope's timestamp, which is when the event was emitted. |
fullRecordWithoutRestrictedData | true when the consent covers the patient's full record. When true, both scope arrays below are null. |
consentDataResourceScopes | The categories of data the consent covers, or null when fullRecordWithoutRestrictedData is true. |
consentDataSensitivityScopes | The sensitivity classifications the consent covers, or null when fullRecordWithoutRestrictedData is true. |
consentSource | Where the consent originated. Currently always PATIENT. Treat it as an open enumeration. |
The scope values are the same as those listed for consent.withdrawn.
Next Steps
- Idempotency and Ordering: Handle repeat and out-of-order deliveries