# Webhooks ## Unwrap **** `` ## Unsafe Unwrap **** `` ## Domain Types ### Report Delivered Event - `ReportDeliveredEvent = object { id, data, type }` Webhook event sent when a report is completed. This is an asynchronous notification - respond with a simple acknowledgment. - `id: string` Unique webhook event ID. Format: whe_{32-hex-chars} - `data: object { presignedUrl, reportId, studyId, plainText }` Event payload containing report and study information - `presignedUrl: string` Presigned URL for PDF download. Time-limited, typically valid for 1 hour. - `reportId: string` Avara report ID. Format: rep_{32-hex-chars} - `studyId: string` Avara study ID. Format: stu_{32-hex-chars} - `plainText: optional string` Report plain text content (optional). Contains the full report text. - `type: "report.delivered"` Event type identifier - `"report.delivered"` ### Report Delivered Response - `ReportDeliveredResponse = object { success }` Response expected by Avara for report delivery webhook. Simple acknowledgment. - `success: boolean` Acknowledgment of receipt. Return true to confirm delivery. ### Study Access Requested Event - `StudyAccessRequestedEvent = object { id, data, type }` Webhook event sent when Avara needs presigned URLs for DICOM images. This is a synchronous webhook - you must respond with the URLs within the request timeout. - `id: string` Unique webhook event ID. Format: whe_{32-hex-chars} - `data: object { studyId, studyInstanceUid }` Event payload containing study information - `studyId: string` Avara study ID. Format: stu_{32-hex-chars} - `studyInstanceUid: string` DICOM Study Instance UID. Must be a valid DICOM UID format (e.g., '1.2.840.10008.5.1.4.1.1.2') - `type: "study.access_requested"` Event type identifier - `"study.access_requested"` ### Study Access Requested Response - `StudyAccessRequestedResponse = object { authorized, urls, error }` Response expected by Avara for study access webhook. Provide presigned URLs for DICOM images. - `authorized: boolean` Whether access is authorized for this study - `urls: array of string` Flat list of presigned URLs for DICOM images. Include all image URLs for the study. - `error: optional string` Error message if authorization failed or URLs cannot be provided ### Webhook Event - `WebhookEvent = StudyAccessRequestedEvent or ReportDeliveredEvent` Union of all Avara webhook event types. Use the 'type' field to discriminate between event types. Events: study.access_requested (synchronous), report.delivered (asynchronous). - `StudyAccessRequestedEvent = object { id, data, type }` Webhook event sent when Avara needs presigned URLs for DICOM images. This is a synchronous webhook - you must respond with the URLs within the request timeout. - `id: string` Unique webhook event ID. Format: whe_{32-hex-chars} - `data: object { studyId, studyInstanceUid }` Event payload containing study information - `studyId: string` Avara study ID. Format: stu_{32-hex-chars} - `studyInstanceUid: string` DICOM Study Instance UID. Must be a valid DICOM UID format (e.g., '1.2.840.10008.5.1.4.1.1.2') - `type: "study.access_requested"` Event type identifier - `"study.access_requested"` - `ReportDeliveredEvent = object { id, data, type }` Webhook event sent when a report is completed. This is an asynchronous notification - respond with a simple acknowledgment. - `id: string` Unique webhook event ID. Format: whe_{32-hex-chars} - `data: object { presignedUrl, reportId, studyId, plainText }` Event payload containing report and study information - `presignedUrl: string` Presigned URL for PDF download. Time-limited, typically valid for 1 hour. - `reportId: string` Avara report ID. Format: rep_{32-hex-chars} - `studyId: string` Avara study ID. Format: stu_{32-hex-chars} - `plainText: optional string` Report plain text content (optional). Contains the full report text. - `type: "report.delivered"` Event type identifier - `"report.delivered"` ### Unsafe Unwrap Webhook Event - `UnsafeUnwrapWebhookEvent = StudyAccessRequestedEvent or ReportDeliveredEvent` Webhook event sent when Avara needs presigned URLs for DICOM images. This is a synchronous webhook - you must respond with the URLs within the request timeout. - `StudyAccessRequestedEvent = object { id, data, type }` Webhook event sent when Avara needs presigned URLs for DICOM images. This is a synchronous webhook - you must respond with the URLs within the request timeout. - `id: string` Unique webhook event ID. Format: whe_{32-hex-chars} - `data: object { studyId, studyInstanceUid }` Event payload containing study information - `studyId: string` Avara study ID. Format: stu_{32-hex-chars} - `studyInstanceUid: string` DICOM Study Instance UID. Must be a valid DICOM UID format (e.g., '1.2.840.10008.5.1.4.1.1.2') - `type: "study.access_requested"` Event type identifier - `"study.access_requested"` - `ReportDeliveredEvent = object { id, data, type }` Webhook event sent when a report is completed. This is an asynchronous notification - respond with a simple acknowledgment. - `id: string` Unique webhook event ID. Format: whe_{32-hex-chars} - `data: object { presignedUrl, reportId, studyId, plainText }` Event payload containing report and study information - `presignedUrl: string` Presigned URL for PDF download. Time-limited, typically valid for 1 hour. - `reportId: string` Avara report ID. Format: rep_{32-hex-chars} - `studyId: string` Avara study ID. Format: stu_{32-hex-chars} - `plainText: optional string` Report plain text content (optional). Contains the full report text. - `type: "report.delivered"` Event type identifier - `"report.delivered"` ### Unwrap Webhook Event - `UnwrapWebhookEvent = StudyAccessRequestedEvent or ReportDeliveredEvent` Webhook event sent when Avara needs presigned URLs for DICOM images. This is a synchronous webhook - you must respond with the URLs within the request timeout. - `StudyAccessRequestedEvent = object { id, data, type }` Webhook event sent when Avara needs presigned URLs for DICOM images. This is a synchronous webhook - you must respond with the URLs within the request timeout. - `id: string` Unique webhook event ID. Format: whe_{32-hex-chars} - `data: object { studyId, studyInstanceUid }` Event payload containing study information - `studyId: string` Avara study ID. Format: stu_{32-hex-chars} - `studyInstanceUid: string` DICOM Study Instance UID. Must be a valid DICOM UID format (e.g., '1.2.840.10008.5.1.4.1.1.2') - `type: "study.access_requested"` Event type identifier - `"study.access_requested"` - `ReportDeliveredEvent = object { id, data, type }` Webhook event sent when a report is completed. This is an asynchronous notification - respond with a simple acknowledgment. - `id: string` Unique webhook event ID. Format: whe_{32-hex-chars} - `data: object { presignedUrl, reportId, studyId, plainText }` Event payload containing report and study information - `presignedUrl: string` Presigned URL for PDF download. Time-limited, typically valid for 1 hour. - `reportId: string` Avara report ID. Format: rep_{32-hex-chars} - `studyId: string` Avara study ID. Format: stu_{32-hex-chars} - `plainText: optional string` Report plain text content (optional). Contains the full report text. - `type: "report.delivered"` Event type identifier - `"report.delivered"`