Accessing Snapshot via API
Overview
AI Outputs are delivered in Particle's FLAT format as part of the patient dataset. When you query patient data, AI-generated summaries are included in the AI_Outputs table.
FLAT Schema: AI_Outputs
| Field Name | Type | Description |
|---|---|---|
patient_id | String | Unique identifier for the patient |
ai_output_id | String | Unique identifier for this AI output record |
type | String | Type of summary: PATIENT_HISTORY or DISCHARGE_SUMMARY |
text | String | The AI-generated clinical summary in plain text |
resource_reference_ids | String | Source resource reference (e.g., transition/123, encounter/456). Null if based on entire patient record |
created | String | Timestamp when this record was created (UTC ISO-8601). Not a clinical date |
FLAT Schema: AI_Citations
AI Citations provide source attribution for AI-generated summaries. Each citation links specific statements in the AI output to the underlying clinical data, enabling source verification and transparency.
| Field Name | Type | Description |
|---|---|---|
ai_output_id | String | Links to the corresponding ai_output_id in the AI_Outputs table |
citation_id | String | Unique identifier for this citation |
particle_patient_id | String | Unique identifier for the patient |
resource_reference_id | String | Identifier of the source record. Matches the primary key of the table named in resource_type |
resource_type | String | Name of the FLAT table the citation points to (e.g., Problems, Encounters, Labs, Medications, Procedures) |
preferred_document_reference_id | String | The document that best supports this citation. Joins to DocumentReferences.document_reference_id. May be empty |
text_snippet | String | Excerpt from the source document that supports the AI-generated statement |
Retrieving AI Outputs
API Endpoint
GET /api/v2/patients/{particle_patient_id}/flat
You can filter to retrieve only AI Outputs:
GET /api/v2/patients/{particle_patient_id}/flat?AI_OUTPUTS
Or retrieve both AI Outputs and Citations:
GET /api/v2/patients/{particle_patient_id}/flat?AI_OUTPUTS&AI_CITATIONS
Example Request
curl -X GET "https://api.particlehealth.com/api/v2/patients/d939196d-0c80-4e82-b0e1-19f9ee271085/flat?AI_OUTPUTS&AI_CITATIONS" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"Example Response
{
"aIOutputs": [
{
"patient_id": "d939196d-0c80-4e82-b0e1-19f9ee271085",
"ai_output_id": "ai_output_12345",
"type": "PATIENT_HISTORY",
"text": "Patient has a history of type 2 diabetes mellitus diagnosed in 2018, currently managed with metformin. Recent lab work shows HbA1c of 7.2%. No diabetic complications noted...",
"resource_reference_ids": null,
"created": "2025-11-25T22:35:12Z"
}
],
"aICitations": [
{
"ai_output_id": "ai_output_12345",
"citation_id": "citation_001",
"particle_patient_id": "d939196d-0c80-4e82-b0e1-19f9ee271085",
"resource_reference_id": "hash_abc123def456",
"resource_type": "Problems",
"text_snippet": "Type 2 diabetes mellitus without complications, diagnosed 03/2018."
},
{
"ai_output_id": "ai_output_12345",
"citation_id": "citation_002",
"particle_patient_id": "d939196d-0c80-4e82-b0e1-19f9ee271085",
"resource_reference_id": "hash_def456ghi789",
"resource_type": "Medications",
"text_snippet": "Metformin 1000mg tablet, take 1 tablet by mouth twice daily."
},
{
"ai_output_id": "ai_output_12345",
"citation_id": "citation_003",
"particle_patient_id": "d939196d-0c80-4e82-b0e1-19f9ee271085",
"resource_reference_id": "hash_ghi789jkl012",
"resource_type": "Labs",
"text_snippet": "Hemoglobin A1c: 7.2% (Reference range: <5.7%)"
}
]
}AI Output Types
PATIENT_HISTORY
Comprehensive overview of the patient's entire clinical history including demographics, chronic conditions, procedures, medications, lab trends, and key health events.
Use cases: New patient onboarding, annual wellness visits, chronic care management, comprehensive care planning
DISCHARGE_SUMMARY
Focused summary of a specific hospitalization including admission details, hospital course, procedures, discharge diagnoses, medications, and follow-up recommendations.
Use cases: Post-discharge care coordination, readmission prevention, care transitions, PCP notifications
Note: Discharge summaries are only available to Particle Signal customers. Signal monitors patients for new encounters and clinical events, automatically generating a discharge summary each time a discharge transition event is detected.
More AI Output Types Coming SoonParticle is expanding our library of AI-generated clinical summaries. Contact your Particle Solutions team to learn more about upcoming output types and discuss custom use cases for your organization.
Using AI Outputs and Citations Together
The AI_Outputs and AI_Citations tables work together to provide AI-generated summaries with full source transparency. Here's how to use them effectively:
Relationship Between Tables
The two tables are linked via the ai_output_id field:
- AI_Outputs table: Contains the AI-generated summary text
- AI_Citations table: Contains source attributions for statements in the summary
Each AI Output can have multiple citations, enabling you to trace any statement back to its source clinical documents.
Joining the Tables
To associate citations with their AI output:
-- Get an AI output with all its citations
SELECT
ao.ai_output_id,
ao.type,
ao.text,
COUNT(ac.citation_id) AS citation_count
FROM AI_Outputs ao
LEFT JOIN AI_Citations ac ON ao.ai_output_id = ac.ai_output_id
WHERE ao.ai_output_id = 'ai_output_12345'
GROUP BY ao.ai_output_id, ao.type, ao.text;Retrieving Source Documents
Each citation includes a resource_reference_id and resource_type that point to the underlying FLAT resource. resource_reference_id matches the primary key of the table named in resource_type (for example Problems.condition_id, Medications.medication_id, or Labs.lab_observation_id). For Patients citations there is no row to join to. To retrieve the full source data, join to the corresponding FLAT table:
-- Example: Join citations to the Problems table
SELECT
ac.citation_id,
ac.text_snippet,
p.*
FROM AI_Citations ac
JOIN Problems p ON ac.resource_reference_id = p.condition_id
WHERE ac.ai_output_id = 'ai_output_12345'
AND ac.resource_type = 'Problems';
-- Example: Get source data for an AI output's Problems, Medications, and Labs citations
SELECT
ac.citation_id,
ac.resource_type,
ac.text_snippet,
CASE
WHEN ac.resource_type = 'Problems' THEN p.condition_name
WHEN ac.resource_type = 'Medications' THEN m.medication_name
WHEN ac.resource_type = 'Labs' THEN l.lab_name
END AS source_description
FROM AI_Citations ac
LEFT JOIN Problems p ON ac.resource_type = 'Problems' AND ac.resource_reference_id = p.condition_id
LEFT JOIN Medications m ON ac.resource_type = 'Medications' AND ac.resource_reference_id = m.medication_id
LEFT JOIN Labs l ON ac.resource_type = 'Labs' AND ac.resource_reference_id = l.lab_observation_id
WHERE ac.ai_output_id = 'ai_output_12345'
AND ac.resource_type IN ('Problems', 'Medications', 'Labs');Analyzing Citation Distribution
View which resource types support an AI output:
-- Count citations by resource type
SELECT
resource_type,
COUNT(*) AS citation_count
FROM AI_Citations
WHERE ai_output_id = 'ai_output_12345'
GROUP BY resource_type
ORDER BY citation_count DESC;Use Cases
1. Source Verification
Enable clinicians to click on statements in the AI summary and view the original clinical documents that support those statements.
2. Citation Display
Show inline citations in your UI (e.g., superscript numbers) that link to detailed source information.
3. Resource Type Filtering
Filter citations by resource_type to show which types of clinical data (Labs, Medications, Problems, etc.) support specific AI-generated statements.
4. Audit Trail
Maintain a complete audit trail showing which source documents contributed to each AI-generated summary.
Webhook Notifications
Overview
Particle sends webhook notifications when AI Outputs are ready for a patient. Instead of polling the API to check if summaries have been generated, you'll receive a proactive notification when new AI Outputs are available.
Registering for Webhooks
To receive AI Output notifications, contact your Particle Health representative to configure your webhook endpoint. Particle will register your callback URL and provide a signature key for verifying webhook authenticity.
For complete webhook setup instructions and signature verification details, see Webhook Event Notifications.
Webhook Payload
When AI Outputs are generated, Particle sends a webhook notification with the following structure:
Example Webhook Payload
{
"specversion": "1.0",
"id": "baa927f8-fc4e-498c-80ba-0592b712ee8a",
"source": "api/notifications",
"type": "com.particlehealth.api.v2.aioutput",
"subject": "AI Outputs completed (2 completed, 0 failed)",
"datacontenttype": "application/json",
"time": "2025-11-25T22:35:12.745001633Z",
"data": {
"outputs": [
{
"ai_output_id": "451681f3-4fa6-4530-8fd8-ed69455be7c5",
"output_type": "PATIENT_HISTORY",
"status": "completed"
},
{
"ai_output_id": "8d2c5e1a-3b7f-4c9e-a6d4-2f1e0b9c7a35",
"output_type": "DISCHARGE_SUMMARY",
"status": "completed"
}
],
"particle_patient_id": "626a50b5-ec72-4839-8277-a0161e0a3129",
"query_id": "26f68b3b-6694-4f48-ab93-295ea9c18932"
}
}Webhook Payload Fields
| Field | Description |
|---|---|
type | Event type: com.particlehealth.api.v2.aioutput for AI Output notifications |
subject | Summary of the outputs in this notification: AI Outputs completed (<n> completed, <n> failed) |
time | ISO 8601 timestamp when the notification was created |
data.outputs | One entry per AI output generated |
data.outputs[].ai_output_id | Unique identifier of the AI output |
data.outputs[].output_type | AI output type (e.g., PATIENT_HISTORY, DISCHARGE_SUMMARY) |
data.outputs[].status | completed or failed |
data.particle_patient_id | Particle patient identifier |
data.query_id | Query identifier that generated the AI outputs |
Output Type Values
PATIENT_HISTORY- Longitudinal patient summaryDISCHARGE_SUMMARY- Discharge summary
Handling Webhook Notifications
When you receive a webhook notification:
-
Verify the signature using the
x-ph-signature-256header (see Webhook Event Notifications) -
Extract the patient ID from
data.particle_patient_id -
Retrieve AI Outputs using the FLAT API endpoint:
GET /api/v2/patients/{particle_patient_id}/flat?AI_OUTPUTS
Testing
Test AI Outputs in Particle's Sandbox environment with synthetic patient data. AI Outputs are available for every Sandbox query when Snapshot is enabled for your organization. See Test Patient Sandbox for example patients.
Updated 5 days ago

