# AI Triage
Source: https://docs.pidgeon.health/api-reference/ai-triage
AI-powered failure analysis, pattern detection, and vendor upgrade checking via the Bridge API.
Four endpoints for AI-assisted analysis of message failures. AI Triage is a **Post Pro feature**. These Bridge routes are unauthenticated because the Bridge is a single-user loopback sidecar: it listens only on `localhost` for the signed-in user, so there is no network surface to authenticate against. The feature entitlement is enforced in the app, not on the loopback route.
## POST /api/loft/triage
Analyze a message failure and get plain-English root cause and fix suggestions.
```bash curl theme={null}
curl -X POST http://localhost:5101/api/loft/triage \
-H "Content-Type: application/json" \
-d '{
"messageContent": "MSH|^~\\&|...",
"validationErrors": ["PID.8 invalid value MALE"],
"interfaceContext": "Epic ER to downstream pharmacy"
}'
```
***
## POST /api/loft/patterns
Analyze recurring failure patterns across messages.
```bash curl theme={null}
curl -X POST http://localhost:5101/api/loft/patterns \
-H "Content-Type: application/json" \
-d '{
"interfaceId": "intf-001",
"sinceHours": 24
}'
```
***
## POST /api/loft/summary
Generate a plain-English summary of interface health issues.
```bash curl theme={null}
curl -X POST http://localhost:5101/api/loft/summary \
-H "Content-Type: application/json" \
-d '{
"interfaceId": "intf-001",
"sinceHours": 24
}'
```
***
## POST /api/loft/upgrade-check
Check whether failure patterns indicate a vendor system upgrade.
```bash curl theme={null}
curl -X POST http://localhost:5101/api/loft/upgrade-check \
-H "Content-Type: application/json" \
-d '{
"interfaceId": "intf-001",
"sinceHours": 48
}'
```
Returns an `UpgradeDetectionResult` with confidence score and detected changes.
# Analytics
Source: https://docs.pidgeon.health/api-reference/analytics
Time-series queries, dashboards, reports, and CSV exports for Loft interface analytics.
Seven endpoints for analytics and reporting.
Loft is a Pro product. These routes are served by the Loft desktop app's local Bridge on loopback (`localhost:5100`) for the signed-in user, which resolves the Professional tier locally, so a local call needs no API key. This is not a hosted API and is not reachable from another machine. A request below the Professional tier returns `402`, never a hard `403`.
## GET /api/loft/analytics/timeseries
Query time-series data for an interface.
| Query Param | Type | Default | Description |
| ------------- | -------- | ----------------- | ------------------------------------------------------- |
| `interfaceId` | string | all | Filter to a specific interface |
| `since` | ISO 8601 | 24h ago | Start time |
| `until` | ISO 8601 | Now | End time |
| `granularity` | string | `"oneHour"` | `oneMinute`, `oneHour`, `oneDay` |
| `metric` | string | `"messagesTotal"` | `messagesTotal`, `messagesFailed`, `messagesSuccessful` |
```bash curl theme={null}
curl "http://localhost:5100/api/loft/analytics/timeseries?interfaceId=intf-001&granularity=oneHour&since=2026-02-22T00:00:00Z"
```
***
## GET /api/loft/analytics/topn
Get top N interfaces ranked by a metric.
| Query Param | Type | Default | Description |
| ----------- | -------- | ----------------- | ----------------- |
| `metric` | string | `"messagesTotal"` | Metric to rank by |
| `n` | int | `10` | Number of results |
| `since` | ISO 8601 | 24h ago | Start time |
```bash curl theme={null}
curl "http://localhost:5100/api/loft/analytics/topn?metric=messagesFailed&n=5"
```
***
## POST /api/loft/analytics/query
Custom filter query with additional criteria.
```bash curl theme={null}
curl -X POST http://localhost:5100/api/loft/analytics/query \
-H "Content-Type: application/json" \
-d '{"filters": {"interfaceId": "intf-001", "severity": "critical"}, "since": "2026-02-20T00:00:00Z"}'
```
***
## GET /api/loft/analytics/dashboards/
Get pre-built dashboard data.
```bash curl theme={null}
curl "http://localhost:5100/api/loft/analytics/dashboards/overview?since=2026-02-15T00:00:00Z"
```
***
## POST /api/loft/analytics/reports/schedule
Schedule a recurring report.
```bash curl theme={null}
curl -X POST http://localhost:5100/api/loft/analytics/reports/schedule \
-H "Content-Type: application/json" \
-d '{"frequency": "daily", "format": "html", "recipients": ["team@hospital.org"]}'
```
***
## POST /api/loft/analytics/reports/generate
Generate a report immediately.
```bash curl theme={null}
curl -X POST http://localhost:5100/api/loft/analytics/reports/generate \
-H "Content-Type: application/json" \
-d '{"format": "html", "since": "2026-02-15T00:00:00Z"}'
```
***
## GET /api/loft/analytics/export/csv
Export analytics data as CSV.
| Query Param | Type | Default | Description |
| ------------- | -------- | ----------------- | ------------------- |
| `interfaceId` | string | all | Interface to export |
| `since` | ISO 8601 | 24h ago | Start time |
| `until` | ISO 8601 | Now | End time |
| `granularity` | string | `"oneHour"` | Data resolution |
| `metric` | string | `"messagesTotal"` | Metric to export |
```bash curl theme={null}
curl "http://localhost:5100/api/loft/analytics/export/csv?interfaceId=intf-001&granularity=oneDay" \
-o metrics.csv
```
# Compare Messages
Source: https://docs.pidgeon.health/api-reference/diff
Compare two healthcare messages field-by-field via the Bridge API.
## POST /api/diff
Compare two messages and return field-level differences. Diff is a **Post Pro feature**. The Bridge route is unauthenticated because the Bridge is a single-user loopback sidecar; the Pro entitlement is enforced in the app, not on the loopback route.
### Request Body
| Field | Type | Default | Description |
| --------------- | --------- | ----------- | ----------------------------------------------- |
| `leftMessage` | string | Required | Baseline message |
| `rightMessage` | string | Required | Comparison message |
| `standard` | string | Auto-detect | `hl7`, `fhir`, `ncpdp` |
| `ignoredFields` | string\[] | `[]` | Fields to exclude (e.g., `["PID.3", "MSH.10"]`) |
### Example
```bash curl theme={null}
curl -X POST http://localhost:5101/api/diff \
-H "Content-Type: application/json" \
-d '{
"leftMessage": "MSH|^~\\&|SENDER|FAC|RECV|DEST|20260222||ADT^A01|12345|P|2.3\rPID|1||MRN001^^^MRN||DOE^JOHN||19800101|M",
"rightMessage": "MSH|^~\\&|SENDER|FAC|RECV|DEST|20260222||ADT^A01|12345|P|2.3\rPID|1||MRN001^^^MRN||DOE^JANE||19800101|F",
"standard": "hl7",
"ignoredFields": ["MSH.10"]
}'
```
### Response
```json theme={null}
{
"success": true,
"data": {
"differences": [
{
"field": "PID.5.1",
"leftValue": "JOHN",
"rightValue": "JANE",
"changeType": "modified"
},
{
"field": "PID.8",
"leftValue": "M",
"rightValue": "F",
"changeType": "modified"
}
],
"totalDifferences": 2,
"ignoredFields": ["MSH.10"]
},
"error": null
}
```
# Flock API
Source: https://docs.pidgeon.health/api-reference/flock
Synthetic population generation endpoints on the local Flock Bridge: connect to a database, learn distributions, generate a population, and seed data.
These endpoints are served by the Flock Bridge sidecar on `localhost:5102`. The Bridge listens only on loopback for the signed-in user, so the routes are unauthenticated locally. Flock itself is a Pro feature and requires a Pidgeon account.
## POST /api/flock/connect
Connect to a database and analyze its schema.
| Field | Type | Description |
| ------------------ | ------ | -------------------------------- |
| `provider` | string | `postgres`, `sqlserver`, `mysql` |
| `connectionString` | string | Database connection string |
```bash curl theme={null}
curl -X POST http://localhost:5102/api/flock/connect \
-H "Content-Type: application/json" \
-d '{"provider": "postgres", "connectionString": "Host=localhost;Port=5432;Database=ehr;Username=dev;Password=${DB_PASSWORD}"}'
```
## GET /api/flock/schema
Get the analyzed schema from the last connection.
```bash curl theme={null}
curl http://localhost:5102/api/flock/schema
```
## POST /api/flock/learn
Learn statistical distributions from existing rows.
| Field | Type | Default | Description |
| ------------ | ---- | ------- | ------------------------ |
| `sampleSize` | int | `500` | Rows to sample per table |
```bash curl theme={null}
curl -X POST http://localhost:5102/api/flock/learn \
-H "Content-Type: application/json" \
-d '{"sampleSize": 500}'
```
## GET /api/flock/profiles
List learned profiles.
```bash curl theme={null}
curl http://localhost:5102/api/flock/profiles
```
## GET /api/flock/profiles/
Get a specific profile.
```bash curl theme={null}
curl http://localhost:5102/api/flock/profiles/ehr_production
```
## POST /api/flock/generate
Start a generation job. Returns a job ID for polling.
| Field | Type | Default | Description |
| ----------------- | ------ | ------- | --------------------------------------------------- |
| `count` | int | `1000` | Number of patients |
| `format` | string | `"sql"` | `sql`, `csv`, `hl7`, `fhir`, `pas-bundle` |
| `geographicFocus` | string | null | Geographic focus (for example a state abbreviation) |
| `seed` | int | null | Reproducible seed |
| `profile` | string | null | Learned data profile name |
```bash curl theme={null}
curl -X POST http://localhost:5102/api/flock/generate \
-H "Content-Type: application/json" \
-d '{"count": 1000, "format": "sql", "geographicFocus": "TX"}'
```
## GET /api/flock/generate/
Poll job status.
```bash curl theme={null}
curl http://localhost:5102/api/flock/generate/job-123
```
## GET /api/flock/generate//analytics
Get analytics for a completed job.
```bash curl theme={null}
curl http://localhost:5102/api/flock/generate/job-123/analytics
```
## POST /api/flock/seed
Seed the connected database with the generated population.
| Field | Type | Default | Description |
| ------------------ | ------ | ---------- | -------------------------- |
| `connectionString` | string | required | Target database connection |
| `provider` | string | `postgres` | Database provider |
```bash curl theme={null}
curl -X POST http://localhost:5102/api/flock/seed \
-H "Content-Type: application/json" \
-d '{"connectionString": "Host=localhost;Database=ehr;...", "provider": "postgres"}'
```
## POST /api/flock/seed/dry-run
Preview the seed plan without executing.
```bash curl theme={null}
curl -X POST http://localhost:5102/api/flock/seed/dry-run \
-H "Content-Type: application/json" \
-d '{"connectionString": "Host=localhost;Database=ehr;...", "provider": "postgres"}'
```
## DELETE /api/flock/seed/cleanup
Remove all synthetic data from the database.
| Query Param | Type | Description |
| ------------------ | ------ | ------------------- |
| `connectionString` | string | Database connection |
| `provider` | string | Database provider |
```bash curl theme={null}
curl -X DELETE "http://localhost:5102/api/flock/seed/cleanup?connectionString=Host%3Dlocalhost%3BDatabase%3Dehr&provider=postgres"
```
## GET /api/flock/compliance/
Get the no-PHI attestation for a generation job. It confirms the population is synthetic-only and reports whether any PHI was detected.
```bash curl theme={null}
curl http://localhost:5102/api/flock/compliance/job-123
```
# Generate Messages
Source: https://docs.pidgeon.health/api-reference/generate
Generate synthetic healthcare messages via the Bridge API.
## POST /api/generate
Generate synthetic healthcare messages. This is a free-tier route. The Post Bridge listens only on `localhost` for the signed-in user, so no network authentication applies.
### Request Body
| Field | Type | Default | Description |
| ------------- | ------ | ----------- | -------------------------------------------------- |
| `messageType` | string | `"ADT^A01"` | Message type (e.g., `ADT^A01`, `Patient`, `NewRx`) |
| `standard` | string | `"hl7"` | Standard: `hl7`, `fhir`, `ncpdp` |
| `count` | int | `1` | Number of messages (1-100) |
| `hl7Version` | string | `"2.3"` | HL7 version (2.3–2.8) |
| `seed` | int | null | Reproducible seed |
### Example
```bash curl theme={null}
curl -X POST http://localhost:5101/api/generate \
-H "Content-Type: application/json" \
-d '{
"messageType": "ADT^A01",
"standard": "hl7",
"count": 3
}'
```
### Response
```json theme={null}
{
"success": true,
"data": [
"MSH|^~\\&|PIDGEON|FACILITY|RECEIVING|DEST|20260222143021||ADT^A01|MSG00001|P|2.3\rEVN|A01|20260222143021\rPID|1||PAT98234^^^MRN||JOHNSON^MARIA^A||19870415|F\rPV1|1|I|ER^101^A",
"MSH|^~\\&|PIDGEON|FACILITY|RECEIVING|DEST|20260222143021||ADT^A01|MSG00002|P|2.3\rEVN|A01|20260222143021\rPID|1||PAT44521^^^MRN||SMITH^JAMES^R||19550923|M\rPV1|1|I|MED^204^B"
],
"error": null
}
```
# API Reference
Source: https://docs.pidgeon.health/api-reference/introduction
The Pidgeon Bridge API, a local sidecar each desktop app runs, not a hosted cloud API. Authentication, response format, and endpoint overview.
Each Pidgeon desktop app (Post, Flock, Loft, Migrate, Conform) starts a local **Bridge**, an ASP.NET Core sidecar, on a fixed loopback port while the app runs. The desktop apps use this same API. There is no public hosted API today: every request in this reference is local to the machine running the app, on a loopback port reachable only while that app is open.
**Base URL**: `http://localhost:`, where the port depends on which app's Bridge you're calling:
| App | Port |
| ------- | ------ |
| Loft | `5100` |
| Post | `5101` |
| Flock | `5102` |
| Migrate | `5103` |
| Conform | `5104` |
This reference documents the Post, Flock, and Loft routes. Migrate and Conform run Bridges too, but their routes aren't documented here yet; drive them from the [Migrate CLI](/cli/migrate-commands) and [Conform CLI](/cli/conform-commands). The Pidgeon launcher has no Bridge of its own.
This reference documents the local Bridge HTTP contract for automation against a running desktop app. It has not been exhaustively cross-checked against every current Bridge route. If an example here 404s, prefer the CLI equivalent and treat the mismatch as a docs bug.
## Authentication
The Bridge listens only on loopback, for the user signed into the app on that machine. Most routes need no token. Where a route is protected, include the app session's credential:
The free-versus-Pro boundary is enforced by the app and your Pidgeon account entitlements, not by an internet-facing permission model. A feature like AI Triage is a Post Pro feature even though its loopback route carries no separate auth.
## Response Format
## Usage limits
Because the Bridge runs locally, there's no network-abuse rate limit to enforce. Usage limits follow your account's plan and entitlements, for example Flock's population caps in the desktop app's **Population** panel. Where a response includes rate-limit headers, they reflect the entitlement-based cap for that endpoint.
## Endpoint groups
| Group | Description |
| ------------------------------------------------- | -------------------------------------- |
| [Generate](/api-reference/generate) | Synthetic message generation |
| [Validate](/api-reference/validate) | Message validation |
| [Diff](/api-reference/diff) | Message comparison |
| [AI Triage](/api-reference/ai-triage) | AI-powered failure analysis (Post Pro) |
| [Loft Interfaces](/api-reference/loft-interfaces) | Interface CRUD and metrics |
| [Loft Alerts](/api-reference/loft-alerts) | Alert management |
| [Loft Status](/api-reference/loft-status) | Status and reports |
| [Analytics](/api-reference/analytics) | Time-series and dashboards |
| [Traces](/api-reference/traces) | Patient tracing and gaps |
| [Flock](/api-reference/flock) | Population generation |
| [SignalR](/api-reference/signalr) | Live updates |
## Content type
All request and response bodies use JSON. Set `Content-Type: application/json` on all requests with a body.
# Loft Alerts
Source: https://docs.pidgeon.health/api-reference/loft-alerts
Query and acknowledge monitoring alerts via the Bridge API.
Loft is a Pro product. These routes are served by the Loft desktop app's local Bridge on loopback (`localhost:5100`) for the signed-in user, which resolves the Professional tier locally, so a local call needs no API key. This is not a hosted API and is not reachable from another machine. A request below the Professional tier returns `402`, never a hard `403`.
## GET /api/loft/alerts
List alerts with optional filters.
| Query Param | Type | Default | Description |
| ------------ | ------ | ------- | ------------------------------------- |
| `severity` | string | All | Filter: `critical`, `warning`, `info` |
| `sinceHours` | int | `24` | Time window |
```bash curl theme={null}
curl "http://localhost:5100/api/loft/alerts?severity=critical&sinceHours=6"
```
### Response
```json theme={null}
{
"success": true,
"data": [
{
"id": "7d9c1e46-3b0a-4c2e-9f1a-2b6d5e4f8a10",
"interfaceId": "intf-001",
"interfaceName": "ER Interface",
"severity": "critical",
"title": "Validation failure rate exceeded threshold",
"message": "12.3% failure rate in the last 15 minutes (threshold: 5%)",
"triggeredAt": "2026-02-22T14:15:00Z",
"acknowledgedAt": null
}
],
"error": null
}
```
***
## POST /api/loft/alerts//acknowledge
Acknowledge an alert. The `{id}` is the alert's GUID.
```bash curl theme={null}
curl -X POST http://localhost:5100/api/loft/alerts/7d9c1e46-3b0a-4c2e-9f1a-2b6d5e4f8a10/acknowledge
```
# Loft Interfaces
Source: https://docs.pidgeon.health/api-reference/loft-interfaces
CRUD operations and metrics for monitored healthcare integration interfaces.
Manage monitored interfaces.
Loft is a Pro product. These routes are served by the Loft desktop app's local Bridge on loopback (`localhost:5100`) for the signed-in user, which resolves the Professional tier locally, so a local call needs no API key. This is not a hosted API and is not reachable from another machine. A request below the Professional tier returns `402`, never a hard `403`.
## GET /api/loft/interfaces
List all interfaces.
```bash curl theme={null}
curl http://localhost:5100/api/loft/interfaces
```
## POST /api/loft/interfaces
Create a new interface.
| Field | Type | Default | Description |
| --------------- | ------ | --------- | ------------------------------ |
| `name` | string | Required | Display name |
| `directoryPath` | string | Required | Filesystem path to watch |
| `profileName` | string | none | Vendor profile for validation |
| `filePattern` | string | `"*.hl7"` | Glob pattern for message files |
```bash curl theme={null}
curl -X POST http://localhost:5100/api/loft/interfaces \
-H "Content-Type: application/json" \
-d '{
"name": "ER Interface",
"directoryPath": "/var/loft/er",
"profileName": "epic_er",
"filePattern": "*.hl7"
}'
```
## GET /api/loft/interfaces/
Get interface by ID.
```bash curl theme={null}
curl http://localhost:5100/api/loft/interfaces/intf-001
```
## PUT /api/loft/interfaces/
Update an interface. All fields optional.
| Field | Type | Description |
| ------------- | ------- | ------------------------- |
| `name` | string | Updated display name |
| `profileName` | string | Updated vendor profile |
| `filePattern` | string | Updated file pattern |
| `enabled` | boolean | Enable/disable monitoring |
```bash curl theme={null}
curl -X PUT http://localhost:5100/api/loft/interfaces/intf-001 \
-H "Content-Type: application/json" \
-d '{"enabled": false}'
```
## DELETE /api/loft/interfaces/
Delete an interface.
```bash curl theme={null}
curl -X DELETE http://localhost:5100/api/loft/interfaces/intf-001
```
## GET /api/loft/interfaces//metrics
Get interface metrics.
| Query Param | Type | Default | Description |
| ------------ | ---- | ------- | ---------------- |
| `sinceHours` | int | `24` | Hours of history |
```bash curl theme={null}
curl "http://localhost:5100/api/loft/interfaces/intf-001/metrics?sinceHours=12"
```
Response includes `totalMessagesProcessed`, `totalErrors`, `totalSuccesses`, `errorRate`, `lastMessageAt`, `startedAt`, `uptimeSeconds`, and an `hourlyBreakdown` array (each bucket has `hour`, `messagesProcessed`, `errors`, and `successes`).
# Loft Status & Reports
Source: https://docs.pidgeon.health/api-reference/loft-status
Get overall Loft monitoring status and generate reports via the Bridge API.
Loft is a Pro product. These routes are served by the Loft desktop app's local Bridge on loopback (`localhost:5100`) for the signed-in user, which resolves the Professional tier locally, so a local call needs no API key. This is not a hosted API and is not reachable from another machine. A request below the Professional tier returns `402`, never a hard `403`.
## GET /api/loft/status
Get overall monitoring status across all interfaces.
```bash curl theme={null}
curl http://localhost:5100/api/loft/status
```
## GET /api/loft/report
Generate a monitoring report.
| Query Param | Type | Default | Description |
| ------------ | ------ | -------- | ------------------------------------- |
| `format` | string | `"text"` | Report format: `text`, `html`, `json` |
| `sinceHours` | int | `24` | Time range |
```bash curl theme={null}
curl "http://localhost:5100/api/loft/report?format=html&sinceHours=168"
```
# Live Updates (SignalR)
Source: https://docs.pidgeon.health/api-reference/signalr
Subscribe to live interface updates via the Loft SignalR hub.
Loft pushes live updates over a SignalR hub for dashboard integration. The hub delivers events as Loft processes each watched source; it is the transport for already-computed results, not a claim about source-pickup latency.
**Hub URL**: `ws://localhost:5100/hubs/loft` (the Loft desktop app's local Bridge; no hosted hub exists)
Loft is a Pro product. The hub is served by the Loft desktop app's local Bridge on loopback for the signed-in user. It is not a hosted hub and is not reachable from another machine.
The connection authenticates as the signed-in user with a JWT Bearer token or API key.
## Client → Server Methods
| Method | Parameters | Description |
| -------------------------- | --------------------- | --------------------------------------------- |
| `SubscribeToInterface` | `interfaceId: string` | Subscribe to updates for a specific interface |
| `UnsubscribeFromInterface` | `interfaceId: string` | Unsubscribe from interface updates |
| `SubscribeToAll` | none | Subscribe to all interface updates |
| `UnsubscribeFromAll` | none | Unsubscribe from all updates |
## Server → Client Events
| Event | Description |
| ------------------------ | -------------------------------------------------- |
| `AlertReceived` | New alert triggered on a monitored interface |
| `MetricUpdate` | Interface metrics changed (throughput, error rate) |
| `InterfaceStatusChanged` | Interface status changed (healthy, degraded, down) |
## JavaScript Example
```javascript theme={null}
import { HubConnectionBuilder } from "@microsoft/signalr";
const connection = new HubConnectionBuilder()
.withUrl("http://localhost:5100/hubs/loft", {
accessTokenFactory: () => "YOUR_JWT_TOKEN"
})
.withAutomaticReconnect()
.build();
// Listen for alerts
connection.on("AlertReceived", (alert) => {
console.log("Alert:", alert.severity, alert.message);
});
// Listen for metric updates
connection.on("MetricUpdate", (metric) => {
console.log("Metrics:", metric.interfaceId, metric.messagesTotal);
});
// Listen for status changes
connection.on("InterfaceStatusChanged", (status) => {
console.log("Status:", status.interfaceId, status.newStatus);
});
// Connect and subscribe
await connection.start();
await connection.invoke("SubscribeToInterface", "intf-001");
// Or subscribe to all interfaces
await connection.invoke("SubscribeToAll");
```
## .NET Example
```csharp theme={null}
var connection = new HubConnectionBuilder()
.WithUrl("http://localhost:5100/hubs/loft", options =>
{
options.AccessTokenProvider = () => Task.FromResult("YOUR_JWT_TOKEN");
})
.WithAutomaticReconnect()
.Build();
connection.On("AlertReceived", alert =>
{
Console.WriteLine($"Alert: {alert.Severity} - {alert.Message}");
});
await connection.StartAsync();
await connection.InvokeAsync("SubscribeToAll");
```
# Traces & Gaps
Source: https://docs.pidgeon.health/api-reference/traces
Trace patient journeys across interfaces, detect message gaps, and measure interface latency.
Five endpoints for message tracing and gap detection.
Loft is a Pro product. These routes are served by the Loft desktop app's local Bridge on loopback (`localhost:5100`) for the signed-in user, which resolves the Professional tier locally, so a local call needs no API key. This is not a hosted API and is not reachable from another machine. A request below the Professional tier returns `402`, never a hard `403`.
## GET /api/loft/traces
Trace a patient's messages across all monitored interfaces.
| Query Param | Type | Description |
| ---------------- | -------- | -------------------- |
| `patient_id` | string | Patient MRN |
| `account_number` | string | Account/visit number |
| `control_id` | string | Message control ID |
| `since` | ISO 8601 | Start time |
| `limit` | int | Max results |
```bash curl theme={null}
curl "http://localhost:5100/api/loft/traces?patient_id=MRN12345&since=2026-02-01T00:00:00Z"
```
### Response
```json theme={null}
{
"success": true,
"data": {
"patientId": "MRN12345",
"totalSpanMs": 14400000,
"events": [
{"interfaceName": "ER ADT", "messageType": "ADT^A01", "timestamp": "2026-02-20T08:30:00Z", "validationStatus": "valid"},
{"interfaceName": "Lab", "messageType": "ORU^R01", "timestamp": "2026-02-20T09:15:00Z", "validationStatus": "valid"},
{"interfaceName": "ER ADT", "messageType": "ADT^A03", "timestamp": "2026-02-20T12:30:00Z", "validationStatus": "valid"}
],
"gaps": []
},
"error": null
}
```
***
## GET /api/loft/traces/
Get a specific trace by ID (treated as patient\_id lookup).
```bash curl theme={null}
curl http://localhost:5100/api/loft/traces/MRN12345
```
***
## GET /api/loft/gaps
Detect gaps in message sequences.
| Query Param | Type | Description |
| -------------- | -------- | ------------------ |
| `interface_id` | string | Interface to check |
| `sequence` | string | Expected sequence |
| `since` | ISO 8601 | Start time |
| `patient_id` | string | Filter by patient |
```bash curl theme={null}
curl "http://localhost:5100/api/loft/gaps?interface_id=intf-001&since=2026-02-20T00:00:00Z"
```
***
## GET /api/loft/latency
Measure message latency between interfaces.
| Query Param | Type | Description |
| ---------------- | -------- | ------------------------ |
| `from_interface` | string | Source interface ID |
| `to_interface` | string | Destination interface ID |
| `message_type` | string | Filter by message type |
| `since` | ISO 8601 | Start time |
```bash curl theme={null}
curl "http://localhost:5100/api/loft/latency?from_interface=intf-001&to_interface=intf-002"
```
***
## GET /api/loft/sequences
List all known message sequences.
```bash curl theme={null}
curl http://localhost:5100/api/loft/sequences
```
# Validate Messages
Source: https://docs.pidgeon.health/api-reference/validate
Validate healthcare messages against standard specifications via the Bridge API.
## POST /api/validate
Validate a healthcare message. This is a free-tier route. The Post Bridge listens only on `localhost` for the signed-in user, so no network authentication applies.
### Request Body
| Field | Type | Default | Description |
| ---------------- | ------ | ----------- | --------------------------- |
| `messageContent` | string | Required | Raw message content |
| `standard` | string | Auto-detect | `hl7`, `fhir`, `ncpdp` |
| `mode` | string | `"strict"` | `strict` or `compatibility` |
### Example
```bash curl theme={null}
curl -X POST http://localhost:5101/api/validate \
-H "Content-Type: application/json" \
-d '{
"messageContent": "MSH|^~\\&|SENDER|FAC|RECV|DEST|20260222||ADT^A01|12345|P|2.3\rPID|1||MRN001^^^MRN||DOE^JOHN||19800101|M\rPV1|1|I|ER^101^A",
"standard": "hl7",
"mode": "strict"
}'
```
### Valid Response
```json theme={null}
{
"success": true,
"data": {
"isValid": true,
"errors": [],
"warnings": [
{
"field": "PID.11",
"code": "RECOMMENDED_FIELD_EMPTY",
"message": "Patient address (PID.11) is recommended for ADT messages",
"severity": "warning"
}
]
},
"error": null
}
```
### Invalid Response
```json theme={null}
{
"success": true,
"data": {
"isValid": false,
"errors": [
{
"field": "PID.5",
"code": "REQUIRED_FIELD_MISSING",
"message": "Patient name (PID.5) is required but missing",
"severity": "error"
}
],
"warnings": []
},
"error": null
}
```
The outer `success` field indicates whether the API call succeeded. Check `data.isValid` for the validation outcome.
# AI Commands
Source: https://docs.pidgeon.health/cli/ai-commands
Manage on-device AI models, configure a BYOK provider, set the PHI-egress policy, and run message operations like triage, explain, and fix.
`pidgeon ai` is a Post Pro feature and is hardware dependent. It ships with the Post desktop app and the licensed CLI, not the free `dotnet tool install` build. Every AI operation runs on-device by default; nothing leaves the machine without an explicit opt-in.
The `ai` family manages the on-device model, configures an optional cloud provider (BYOK), sets the egress policy that governs where inference is allowed to run, and runs message operations (triage a failure, explain a message, apply field-level fixes).
## Model management
On-device inference needs a local model. Set one up in one step:
```bash theme={null}
# Pick the model that fits this machine, download it if needed, and make it active
pidgeon ai setup
```
Or manage models directly:
```bash theme={null}
pidgeon ai list --available # Downloadable model catalog
pidgeon ai list --installed # Models installed locally
pidgeon ai download qwen3-4b # Download and install a model
pidgeon ai download qwen3-4b --background # Large downloads run in the background
pidgeon ai info qwen3-4b # Model details (size, RAM, capabilities)
pidgeon ai remove qwen3-4b # Remove a locally installed model
```
### On-device models
Two bundled models are validated today:
| Model | Fit |
| -------------- | ------------------------------------------------------------------------ |
| `qwen3-4b` | The default on-device model on a typical laptop (16 GB RAM recommended). |
| `smollm2-1.7b` | The small-RAM fallback for 8 GB machines. |
Run `pidgeon ai list --available` for the full downloadable catalog on your machine.
Gemma 4 support (`gemma4-e4b`, `gemma4-12b`) is being validated and may appear in the catalog. Confirm availability with `pidgeon ai list --available` before relying on it.
## Provider configuration (BYOK)
Point the AI operations at a cloud provider instead of the on-device model. Bring your own key, so cost control stays with you.
```bash theme={null}
pidgeon ai configure --provider openai --model gpt-4o --api-key sk-...
pidgeon ai status # Show the configured provider and connection health
pidgeon ai test-connection # Send a synthetic canary request (provider billing may apply)
pidgeon ai remove-credential # Delete a provider credential from this device
```
Supported providers: `openai`, `anthropic`, `openrouter`, `ollama`, `azure`, `gemini`, or any OpenAI-compatible endpoint (`openai-compatible`). For an OpenAI-compatible server, pass `--endpoint` and `--model`; many in-tenant servers are keyless. Use `--locus in-network` for a server you run yourself and `--locus cloud` for a compatibility-API SaaS. The locus is declared, never inferred from the address.
## Message operations
Each verb takes a message file (HL7, FHIR JSON, or NCPDP XML):
| Command | What it does |
| --------------------------------------- | ------------------------------------------------------------------------------- |
| `pidgeon ai triage ` | Analyze validation failures and suggest fixes. Accepts `--mode` and `--vendor`. |
| `pidgeon ai explain ` | Explain a message in plain English. |
| `pidgeon ai fix ` | Recommend field-level fixes and apply the approved changes. |
| `pidgeon ai enrich ` | Fill sparse optional fields with realistic values. |
| `pidgeon ai suggest ` | Suggest a realistic value for a single field. |
| `pidgeon ai modify ` | Modify a message with an AI-assisted instruction. |
| `pidgeon ai template ` | Apply a predefined modification template. |
```bash theme={null}
# Triage a message that fails validation
pidgeon ai triage broken.hl7
# Explain what a message contains
pidgeon ai explain admit.hl7
```
## PHI-egress policy
`pidgeon ai egress` views or sets where inference is allowed to run. The default keeps all content on-device; nothing goes off-device without an explicit opt-in.
```bash theme={null}
pidgeon ai egress # Show the current policy
pidgeon ai egress --mode workstation-ollama # Use a local Ollama runtime
pidgeon ai egress --require-on-device true # Refuse any off-device inference
pidgeon ai egress --mode byok-cloud --baa-opt-in true # Allow real content to a cloud provider under a BAA
```
| Flag | Values | Meaning |
| --------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| `--mode` | `bundled-on-device` (default), `workstation-ollama`, `customer-controlled`, `byok-cloud` | Where inference runs. |
| `--baa-opt-in` | `true` / `false` | Permit real content to a `byok-cloud` provider. |
| `--require-on-device` | `true` / `false` | Refuse any off-device inference regardless of the synthetic attestation. |
| `--max-locus` | `on-device`, `in-network`, `cloud` | The highest locus any provider may occupy before content is refused. |
Every call that resolves to a non-local provider is audit-logged with the provider, deployment mode, and content length.
## Health and policy
```bash theme={null}
pidgeon ai health # Runtime daemon, active provider, capability verdict, egress ceiling, last error
pidgeon ai settings # Effective AI settings and their authority
pidgeon ai policy # The managed org policy that locks AI settings
```
## Next steps
* [AI Triage in Post](/post/ai-triage): the same on-device analysis in the desktop panel
* [Message Generation](/post/message-generation): the `model` and `api` generation modes
# Config Commands
Source: https://docs.pidgeon.health/cli/config-commands
Analyze real messages to detect vendor patterns, manage named profiles, and compare configurations.
Vendor-profile management (`pidgeon config`) ships with the Post desktop app and the licensed CLI, not the free `dotnet tool install` build. If you installed only the free CLI, these commands are delivered through Post.
## pidgeon config analyze
Analyze sample messages to detect vendor-specific patterns and save as a named profile.
```bash theme={null}
pidgeon config analyze --samples --save
```
| Flag | Type | Description |
| ----------------- | ------ | --------------------------------------- |
| `--samples ` | string | Directory of sample messages to analyze |
| `--save ` | string | Name to save the profile as |
```bash theme={null}
pidgeon config analyze --samples ./epic-er-messages --save epic_er
```
## pidgeon config list
List all saved vendor profiles.
```bash theme={null}
pidgeon config list
```
```text theme={null}
Profile Standard Message Types Samples
──────────────────────────────────────────────────────────
epic_er HL7 v2.3 ADT^A01, ADT^A08 47
cerner_lab HL7 v2.3 ORU^R01 23
meditech_pharm HL7 v2.3 RDE^O11 15
```
## pidgeon config show
Display details of a saved profile.
```bash theme={null}
pidgeon config show
```
```bash theme={null}
pidgeon config show epic_er
```
## pidgeon config use
Set a profile as the default for all commands.
```bash theme={null}
pidgeon config use
```
```bash theme={null}
pidgeon config use epic_er
```
## pidgeon config export
Export a profile as JSON for sharing with your team.
```bash theme={null}
pidgeon config export
```
```bash theme={null}
pidgeon config export epic_er > epic_er_profile.json
```
## pidgeon config diff
Compare two vendor profiles side by side.
```bash theme={null}
pidgeon config diff
```
```bash theme={null}
pidgeon config diff epic_er cerner_lab
```
## Workflow Example
```bash theme={null}
pidgeon config analyze --samples ./epic-messages --save epic_er
```
```bash theme={null}
pidgeon generate ADT^A01 --vendor epic_er --count 20
```
```bash theme={null}
pidgeon validate --folder ./test-data --profile epic_er
```
# Conform Commands
Source: https://docs.pidgeon.health/cli/conform-commands
Probe a live FHIR endpoint against a published Implementation Guide from CI, with a non-zero exit code and an HTML scorecard.
Conform is Pidgeon's FHIR conformance product. `pidgeon conform` probes a live FHIR endpoint against a published Implementation Guide (US Core, Da Vinci PAS 2.1) and returns pass/fail with a non-zero CI exit code plus a self-contained HTML scorecard. It's the CI gate for CMS-0057-F. For the concepts behind these flags, see the [Conform section](/conform/overview).
```bash theme={null}
pidgeon conform --endpoint [options]
```
## Options
| Flag | Type | Default | Description |
| ------------------------- | ------ | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--endpoint` | string | — | FHIR base URL (e.g. `https://payer.example.com/fhir`). Mutually exclusive with `--endpoint-set` |
| `--endpoint-set` | string | — | Name of an installed conform-endpoint set (`pidgeon recipe list`) to walk every endpoint in |
| `--resource` | string | — | Resource path `ResourceType/id` (e.g. `Patient/example`). Required unless `--walk` |
| `--profile` | string | — | IG profile short name (e.g. `us-core-patient`) or canonical URL. Required unless `--walk` |
| `--auth` | string | — | Authorization header value (`Bearer eyJ…`). Leave unset for unauthenticated endpoints. Mutually exclusive with `--auth-smart-backend` |
| `--auth-smart-backend` | flag | off | Authenticate via SMART Backend Services: discover the token endpoint, sign an RS384 client assertion, exchange it for an access token |
| `--client-id` | string | — | Registered backend-services client id. Requires `--auth-smart-backend` |
| `--key-file` | string | — | PEM-encoded RSA private key that signs the client assertion. Requires `--auth-smart-backend` |
| `--scope` | string | `system/*.read` | OAuth scopes for the `client_credentials` grant |
| `--token-endpoint` | string | — | Explicit OAuth token endpoint; skips `.well-known/smart-configuration` discovery |
| `--walk` | flag | off | Probe every resource × profile pair declared in the endpoint's CapabilityStatement |
| `--ci` | flag | off | CI mode: must-support warnings flip the exit to non-zero; a walk validating zero resources exits `2` |
| `--require-full-coverage` | flag | off | Exit `2` unless every declared resource type was actually probed (walk only) |
| `--probe-operations` | flag | off | Also POST a synthetic PAS request Bundle to `Claim/$submit` and grade the response |
| `--check-terminology` | flag | off | Validate coded fields against a live FHIR terminology service; an unresolved code flips the exit to `1` |
| `--terminology-endpoint` | string | `http://127.0.0.1:8080/fhir` | Cross-vocab terminology service for `--check-terminology` (ICD-10-CM / LOINC / RxNorm) |
| `--snomed-endpoint` | string | `http://127.0.0.1:8181/fhir` | SNOMED CT terminology service; `http://snomed.info/sct` codes route here |
| `--only-resources` | string | — | Comma-separated resource types to walk (e.g. `Patient,Encounter`). Walk only |
| `--ig` | string | — | Filter walk probes to profiles from this IG base URL. Walk only |
| `--readiness-pack` | string | — | Grade the walk against a compiled readiness pack and write an evidence envelope. Supported: `us-core-3.1.1` (requires the `fhir-us-core-3.1.1` package). Walk only |
| `--evidence-out` | string | `conform-evidence.json` | Path for the readiness evidence envelope JSON. Requires `--readiness-pack` |
| `--output-file` | string | stdout | Write the report to a file instead of stdout (particularly useful for the HTML scorecard) |
| `--badge` | string | — | Write dated pass/fail badge artifacts (SVG + shields.io endpoint JSON) whose verdict mirrors the exit code |
## Examples
```bash theme={null}
# Walk an endpoint against its CapabilityStatement, CI mode
pidgeon conform --endpoint https://api.payer.example/fhir --walk --ci
# Single resource against a named profile
pidgeon conform --endpoint https://api.payer.example/fhir --resource Patient/123 --profile us-core-patient
# Da Vinci PAS with the $submit operation probe, HTML scorecard + badge
pidgeon conform --endpoint https://api.payer.example/fhir --walk --ig http://hl7.org/fhir/us/davinci-pas/ \
--probe-operations --output html --output-file scorecard.html --badge conform-badge.svg
# Authenticated endpoint
pidgeon conform --endpoint https://api.payer.example/fhir --walk --auth "Bearer eyJ..."
# SMART Backend Services (system-to-system) auth
pidgeon conform --endpoint https://api.payer.example/fhir --walk \
--auth-smart-backend --client-id my-client --key-file ./key.pem
# Grade against the US Core 3.1.1 readiness pack and write an evidence envelope
pidgeon conform --endpoint https://api.payer.example/fhir --walk \
--readiness-pack us-core-3.1.1 --evidence-out conform-evidence.json
```
## Exit codes
Conform extends the CLI's `0`/`1` convention with a coverage code so a CI gate can tell "failed" from "tested nothing" apart:
| Code | Meaning |
| ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `0` | Report passed |
| `1` | Report failed; or (with `--ci`) passed but carries a must-support or stub-profile warning; or an endpoint/IG load error; or a failed `--probe-operations` / `--check-terminology` probe |
| `2` | No coverage: under `--ci`, a walk validated zero resources. `--require-full-coverage` widens this to "any declared type skipped". A real failure (`1`) always outranks the coverage gate |
A minimal CI gate:
```bash theme={null}
pidgeon conform --endpoint "$FHIR_URL" --walk --ci || exit 1
```
## Learn more
* [Conform overview](/conform/overview): the concepts behind these flags
* [CMS-0057-F](/conform/cms-0057-f): required vs recommended IGs
* [Evidence and CI](/conform/evidence-and-ci): exit codes, scorecards, readiness packs
* [Get started with Post](/getting-started/post): the Conformance panel in the desktop app
# Data Commands
Source: https://docs.pidgeon.health/cli/data-commands
Manage terminology datasets and FHIR Implementation Guide packages. Install, import, and update LOINC, SNOMED, ICD-10, NDC, US Core, Da Vinci, and more.
`pidgeon data` is a free CLI command. It manages two kinds of local package: **terminology datasets** (the code systems that make generated messages pass downstream validation) and **FHIR Implementation Guide packages** (the profiles that `pidgeon conform` and FHIR validation grade against). Run `pidgeon data list` for the live catalog on your machine.
## Terminology datasets
| Dataset | Codes | Size | Free | Pro |
| -------------- | --------------- | ------ | ------------ | --------------- |
| LOINC 2.81 | 108K | 25 MB | Basic subset | Full |
| SNOMED CT US | 350K+ | 1.5 GB | Basic subset | Full |
| ICD-10-CM 2026 | 74K | 15 MB | Full | Full |
| ICD-9-CM v32 | DX + SG | 8 MB | Full | Full |
| NDC | 110K products | 30 MB | Basic subset | Full |
| CVX | 288 entries | 1 MB | Full | Full |
| RxNorm | Large | 1.7 GB | — | Full |
| HCPCS | Full set | 5 MB | — | Full |
| CPT | Procedure codes | — | — | Licensed add-on |
Eight terminology datasets ship; CPT is a separate licensed add-on gated by AMA royalty terms. This table is the CLI companion to [Datasets & Data Packages](/post/datasets).
## FHIR Implementation Guide packages
`pidgeon data` is also the IG package manager. Install a guide, and FHIR validation and `pidgeon conform` grade against its profiles.
| Package | IG | Version |
| ---------------------- | ------------------------------------------ | ------- |
| `fhir-r4-core` | FHIR R4 base | 4.0.1 |
| `fhir-us-core-3.1.1` | US Core | 3.1.1 |
| `fhir-us-core-6.0` | US Core | 6.1.0 |
| `fhir-davinci-pas-2.1` | Da Vinci Prior Auth Support | 2.1.0 |
| `fhir-davinci-crd-2.1` | Da Vinci Coverage Requirements Discovery | 2.1.0 |
| `fhir-davinci-dtr-2.0` | Da Vinci Documentation Templates and Rules | 2.0.0 |
```bash theme={null}
pidgeon data install fhir-us-core-3.1.1
pidgeon data install fhir-davinci-pas-2.1
```
## License-gated standards packages
Some standards material is member-only and closed by default. It installs only with an explicit `--accept-license`:
```bash theme={null}
# NCPDP SCRIPT (member-only XSDs; NCPDP membership required)
pidgeon data install ncpdp-script --accept-license
# X12 5010 guides
pidgeon data install x12-5010 --accept-license
```
Until the `ncpdp-script` package is installed, NCPDP generation and validation report a license-required state rather than running. See [Message Generation](/post/message-generation#ncpdp-script-2017071).
## pidgeon data list
List every available and installed package: terminology datasets, FHIR IGs, and license-gated standards.
```bash theme={null}
pidgeon data list
```
```text theme={null}
Name DataType Status Version
────────────────────────────────────────────────────────────
loinc lab-tests installed 2.81
snomed snomed-concepts available Sep 2025
icd10 diagnoses installed 2026
ndc medications installed Current
fhir-r4-core fhir-ig installed 4.0.1
fhir-us-core-3.1.1 fhir-ig available 3.1.1
fhir-davinci-pas-2.1 fhir-ig installed 2.1.0
ncpdp-script ncpdp-schemas available (license)
```
## pidgeon data install
Download and install a package (terminology dataset, FHIR IG, or a license-gated standards package).
```bash theme={null}
pidgeon data install [--accept-license] [--all]
```
| Flag | Description |
| ------------------ | ------------------------------------------------------------------------------------------------------ |
| `--accept-license` | Accept required license terms (for example UMLS, NCPDP membership). Required for member-only packages. |
| `--all` | Install every available package. |
```bash theme={null}
pidgeon data install loinc
pidgeon data install rxnorm
pidgeon data install fhir-us-core-3.1.1
pidgeon data install ncpdp-script --accept-license
```
## pidgeon data import
Import a custom dataset from a CSV or JSON file.
```bash theme={null}
pidgeon data import
```
```bash theme={null}
pidgeon data import ./custom-codes.csv
```
## pidgeon data update
Update all installed datasets to the latest versions.
```bash theme={null}
pidgeon data update
```
# Flock Commands
Source: https://docs.pidgeon.health/cli/flock-commands
CLI commands for Flock synthetic population generation: connect to a database, learn distributions, generate a population, and seed the data.
`flock` is a Pro command delivered through the Flock desktop app, not the free community CLI. If you installed only `dotnet tool install --global Pidgeon.CLI`, the `flock` subcommand is not present. It requires a Pidgeon account sign-in.
## pidgeon flock connect
Connect to a database and introspect its schema.
```bash theme={null}
pidgeon flock connect --provider --connection
```
| Flag | Type | Default | Description |
| -------------------- | ------ | ---------- | --------------------------------------------------- |
| `--provider ` | string | `postgres` | Database provider: `postgres`, `sqlserver`, `mysql` |
| `--connection ` | string | required | Database connection string |
```bash theme={null}
pidgeon flock connect \
--provider postgres \
--connection "Host=localhost;Port=5432;Database=ehr;Username=dev;Password=${DB_PASSWORD}"
```
MariaDB connects through the `mysql` provider; `postgresql` and `mssql` are accepted as aliases.
***
## pidgeon flock schema
View and classify the introspected schema.
```bash theme={null}
pidgeon flock schema [--classify] [--visualize]
```
| Flag | Type | Default | Description |
| ------------- | ---- | ------- | --------------------------------------- |
| `--classify` | flag | `false` | Classify tables by healthcare domain |
| `--visualize` | flag | `false` | Emit the schema as a Mermaid ER diagram |
***
## pidgeon flock learn
Learn statistical distributions from existing rows.
```bash theme={null}
pidgeon flock learn [--sample ]
```
| Flag | Type | Default | Description |
| -------------- | ---- | ------- | ---------------------------------- |
| `--sample ` | int | `500` | Number of rows to sample per table |
```bash theme={null}
pidgeon flock learn --sample 500
```
***
## pidgeon flock generate
Generate a synthetic patient population.
```bash theme={null}
pidgeon flock generate [options]
```
| Flag | Type | Default | Description |
| ----------------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------ |
| `--count`, `-c ` | int | `100` | Number of patients to generate |
| `--format`, `-f ` | string | `sql` | Output format: `sql`, `csv`, `hl7`, `fhir`, `pas-bundle` |
| `--schema ` | string | optional | Path to a SQL DDL or JSON schema |
| `--state ` | string | optional | State abbreviation for geographic focus (for example `TX`, `CA`) |
| `--seed ` | int | random | Seed for reproducible output |
| `--profile ` | string | optional | Use a learned data profile |
| `--output`, `-o ` | string | stdout | Output directory for generated files |
| `--from-config ` | string | optional | Run a saved population config (supersedes `--count` / `--format` / `--state` / `--seed` / `--profile`) |
```bash theme={null}
# Generate 1000 patients as SQL
pidgeon flock generate --count 1000 --format sql --output ./seed-data/
# Generate as FHIR Bundles
pidgeon flock generate --count 500 --format fhir --output ./fhir-data/
# Reproducible output
pidgeon flock generate --count 1000 --format csv --seed 42
```
***
## pidgeon flock seed
Seed a target database with generated data.
```bash theme={null}
pidgeon flock seed --target --connection [options]
```
| Flag | Type | Default | Description |
| -------------------- | ------ | ---------- | ------------------------------------------------------------------------- |
| `--target ` | string | `postgres` | Database provider: `postgres`, `sqlserver`, `mysql` |
| `--connection ` | string | required | Target database connection string |
| `--dry-run` | flag | `false` | Generate SQL without executing |
| `--from ` | string | optional | Seed records written by `flock generate -o` instead of the in-process job |
```bash theme={null}
# Preview what would be inserted
pidgeon flock seed --target postgres --connection "Host=localhost;Database=ehr;..." --dry-run
# Seed from a directory that generate wrote
pidgeon flock seed --target postgres --connection "Host=localhost;Database=ehr;..." --from ./seed-data/
```
***
## pidgeon flock cleanup
Remove synthetic data from a target database.
```bash theme={null}
pidgeon flock cleanup --provider --connection
```
| Flag | Type | Default | Description |
| -------------------- | ------ | ---------- | --------------------------------- |
| `--connection ` | string | required | Target database connection string |
| `--provider ` | string | `postgres` | Database provider |
```bash theme={null}
pidgeon flock cleanup --provider postgres --connection "Host=localhost;Database=ehr;..."
```
Cleanup removes every record tagged as synthetic. This cannot be undone.
***
## pidgeon flock status
Show the installed Flock data packages.
```bash theme={null}
pidgeon flock status
```
# Global Options
Source: https://docs.pidgeon.health/cli/global-options
Flags and options available on all Pidgeon CLI commands.
These flags are available on every `pidgeon` command.
| Flag | Type | Default | Description |
| ---------------------- | ------ | ----------------- | ---------------------------------------------- |
| `-p, --project ` | string | Current directory | Project directory |
| `-s, --standard ` | string | Auto-detect | Force standard: `hl7`, `fhir`, or `ncpdp` |
| `-o, --output ` | string | stdout | Output file or directory path |
| `-f, --format ` | string | `auto` | Output format: `auto`, `hl7`, `json`, `ndjson` |
| `-v, --verbose` | flag | off | Enable verbose logging |
| `--quiet` | flag | off | Suppress all output except errors |
| `--color ` | string | `auto` | Color output: `auto`, `always`, `never` |
| `--config ` | string | — | Path to configuration file |
| `--profile ` | string | — | Named vendor profile to use |
## Smart Standard Detection
When `--standard` is omitted, Pidgeon auto-detects the standard from the message type:
| Pattern | Detected Standard | Examples |
| ---------------- | ----------------- | ---------------------------------- |
| `TYPE^TRIGGER` | HL7 v2 | `ADT^A01`, `ORU^R01`, `ORM^O01` |
| Resource name | FHIR R4 | `Patient`, `Observation`, `Bundle` |
| Transaction type | NCPDP SCRIPT | `NewRx`, `RxFill`, `CancelRx` |
## Output Formats
| Format | When to Use |
| -------- | ------------------------------------------------------- |
| `auto` | Default; picks the best format for the standard |
| `hl7` | Raw HL7 pipe-delimited format |
| `json` | Pretty-printed JSON (FHIR resources, structured output) |
| `ndjson` | Newline-delimited JSON for bulk/streaming |
## Examples
```bash theme={null}
# Verbose output for debugging
pidgeon generate ADT^A01 --verbose
# Quiet mode for CI/CD pipelines
pidgeon validate --folder ./messages --quiet
# Force JSON output
pidgeon generate Patient --format json
# Use a vendor profile
pidgeon generate ADT^A01 --profile epic_er
```
# Loft Commands
Source: https://docs.pidgeon.health/cli/loft-commands
CLI commands for Loft interface monitoring: watch directories, check status, view alerts, and generate reports.
Loft is a Pro product delivered with the Loft desktop app. The `pidgeon loft` commands and the local Bridge on `localhost:5100` ship with that app. The free `dotnet tool install --global Pidgeon.CLI` build does not include `loft`.
## pidgeon loft watch
Watch a directory for incoming `.hl7` files and validate each one as it lands.
```bash theme={null}
pidgeon loft watch --path [options]
```
| Flag | Type | Default | Description |
| ------------------ | ------ | --------------- | ------------------------------------------------------------------------- |
| `--path ` | string | Required | Directory to watch for `.hl7` files |
| `--profile ` | string | none | Vendor profile for validation |
| `--mode ` | string | `compatibility` | Validation mode: `strict` or `compatibility` |
| `--alert ` | string | `console` | Alert provider: `console`, `file:`, or `webhook:`. Repeatable. |
```bash theme={null}
# Watch a Mirth output directory against a vendor profile
pidgeon loft watch --path /var/mirth/outbound/er --profile epic_er
# Watch in strict mode and post failures to a webhook
pidgeon loft watch --path /var/loft/lab --mode strict --alert webhook:https://hooks.example.org/loft
```
The `watch` command validates `.hl7` files only, and its `--alert` flag covers the console, file, and webhook providers inline. To watch a custom file pattern, or to route to Slack, Microsoft Teams, email, or PagerDuty, create a persistent interface through the desktop app or its local Bridge. See [Interface Monitoring](/loft/interface-monitoring) and [Alerting](/loft/alerting).
***
## pidgeon loft status
Show current monitoring metrics across all watched interfaces.
```bash theme={null}
pidgeon loft status
```
***
## pidgeon loft alerts
List recent alerts from the Loft metrics store.
```bash theme={null}
pidgeon loft alerts [options]
```
| Flag | Type | Default | Description |
| --------------------- | ------ | ------- | ---------------------------------------------- |
| `--since ` | string | `1h` | Time window (e.g. `1h`, `12h`, `7d`) |
| `--severity ` | string | All | Filter: `critical`, `warning`, `info`, `error` |
| `--format ` | string | `table` | Output format: `table` or `json` |
| `-o, --output ` | string | stdout | File path for the JSON export |
```bash theme={null}
# Critical alerts from the last 6 hours
pidgeon loft alerts --severity critical --since 6h
# All recent alerts as JSON
pidgeon loft alerts --since 1h --format json
```
***
## pidgeon loft report
Generate a summary report of Loft monitoring activity.
```bash theme={null}
pidgeon loft report [options]
```
| Flag | Type | Default | Description |
| -------------------- | ------ | ------- | ----------------------------------------- |
| `--since ` | string | `24h` | Time range for the report |
| `--format ` | string | `text` | `text`, `json`, `pdf`, `excel`, or `html` |
Text and JSON print to stdout. For a PDF, Excel, or HTML file, use `pidgeon loft report generate`, which writes to a path with `-o`:
```bash theme={null}
# Text report for the last 24 hours
pidgeon loft report
# HTML report file for the last week
pidgeon loft report generate --format html --since 7d --output report.html
```
`report generate` also takes `--template` (`interface-health`, `partner-scorecard`, or `sla-compliance`). The `report schedule`, `report list`, `report run`, and `report history` subcommands manage recurring reports.
# Migrate Commands
Source: https://docs.pidgeon.health/cli/migrate-commands
Export healthcare data to FHIR R4 Bulk Data NDJSON, with de-identification, reconciliation, and resume.
Migrate moves healthcare data between systems via FHIR R4 Bulk Data Access (NDJSON per the HL7 IG). v1 ships the `run` export workflow reading from Centricity / athenaPractice 23.0 `FHIR_*` views. For the concepts behind these commands, see the [Migrate section](/migrate/overview).
Migrate requires a Pidgeon account sign-in. It is built for migration projects, not synthetic test data. For populations, see [Flock](/cli/flock-commands).
## pidgeon migrate run
Export from a source EHR to FHIR R4 Bulk Data NDJSON, one file per resource type plus a `manifest.json` conforming to the HL7 FHIR Bulk Data Access IG.
```bash theme={null}
pidgeon migrate run --source --output [options]
```
| Flag | Type | Default | Description |
| ---------------------- | ------ | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `--source` | string | **Required** | Source DB connection string (Postgres or SQL Server; auto-detected by shape) |
| `--output` | string | **Required** | Output directory. Created if missing; existing files overwritten unless `--resume` |
| `--mapping` | string | sane defaults | Mapping YAML for per-field retain/redact/date-shift policy (per-customer override) |
| `--source-adapter` | string | `centricity` | Source EHR adapter key |
| `--resources` | string | Patient,Encounter,Observation,Condition,MedicationRequest,Procedure | Comma-separated resource list |
| `--since` | string | — | Incremental cursor (ISO 8601). v1: recorded in the manifest, full export still runs |
| `--batch-size` | int | `1000` | NDJSON flush batch size |
| `--deidentify` | flag | off | Run emitted resources through de-identification before write; cross-resource references stay coherent |
| `--deident-salt` | string | random | Deterministic hashing salt for cross-run reference consistency |
| `--deident-date-shift` | string | — | Uniform date shift, `+Nd` or `-Nd` (e.g. `+30d`) |
| `--resume` | flag | off | Resume from `.checkpoint.json` in the output directory |
| `--dry-run` | flag | off | Read + transform + reconcile without writing NDJSON; manifest still emitted |
```bash theme={null}
# Full export with de-identification
pidgeon migrate run --source "Host=localhost;Database=centricity;..." --output ./export --deidentify --deident-date-shift +30d
# Validate the mapping before a real run
pidgeon migrate run --source "Host=localhost;Database=centricity;..." --output ./export --dry-run
# Resume an interrupted export
pidgeon migrate run --source "Host=localhost;Database=centricity;..." --output ./export --resume
```
## pidgeon migrate analyst
Deterministic migration analysis: assess a source, review the mapping and loss catalog, convert a bounded sample, cluster exceptions, analyze reconciliation, and assemble cutover-readiness evidence. Read/derive-only; results are local evidence artifacts.
```bash theme={null}
pidgeon migrate analyst [options]
```
Subcommands cover source assessment, mapping-plan review, bounded sample conversion, exception clustering, reconciliation analysis, and cutover-readiness evidence. Sample sizes are bounded (1–25 rows) so a run is fast and reproducible.
## pidgeon migrate to-xds
Read a FHIR R4 bundle, generate a C-CDA, and submit it to an IHE XDS.b registry via ITI-41 Provide and Register. With `--verify` (default), it confirms the round-trip by ITI-18 FindDocuments + ITI-43 Retrieve and asserts the document is byte-identical.
```bash theme={null}
pidgeon migrate to-xds --bundle [options]
```
| Flag | Type | Default | Description |
| ------------ | ------ | -------------------- | ------------------------------------------------------------- |
| `--bundle` | string | **Required** | Path to a FHIR R4 bundle JSON file |
| `--registry` | string | mock-network default | XDS toolkit base URL |
| `--verify` | flag | on | Assert a byte-identical ITI-18/ITI-43 round-trip after submit |
## Desktop app
The Migrate desktop app runs the same `run` workflow with a preflight checklist, a live migration log, and reconciliation. See [Get started with Migrate](/getting-started/migrate).
# Post Commands
Source: https://docs.pidgeon.health/cli/post-commands
CLI commands for message generation, validation, de-identification, diff, and workflow management with Post.
`generate`, `validate`, and `deident` are in the free CLI (`dotnet tool install --global Pidgeon.CLI`). `diff` and `workflow` ship with the Post desktop app and the licensed CLI, not the free `dotnet tool` build. Each Pro command below says so.
## pidgeon generate
Generate synthetic healthcare messages.
```bash theme={null}
pidgeon generate [options]
```
The standard is auto-detected from the message type: `ADT^A01` → HL7, `Patient` → FHIR, `NewRx` → NCPDP.
| Flag | Type | Default | Description |
| --------------------- | ---------- | ------------ | ----------------------------------------------------------------------- |
| `` | positional | Required | Message type (e.g., `ADT^A01`, `Patient`, `NewRx`) |
| `--count, -c ` | int | `1` | Number of messages to generate |
| `--seed, -s ` | int | Random | Reproducible seed value |
| `--vendor, -v ` | string | — | Vendor profile for realistic patterns |
| `--mode, -m ` | string | `procedural` | Generation mode: `procedural`, `model` (on-device AI), `api` (cloud AI) |
| `--hl7-version` | string | `2.3` | HL7 version: `2.3`, `2.3.1`, `2.4`, `2.5`, `2.5.1`, `2.6`, `2.7`, `2.8` |
| `--output, -o ` | string | stdout | Output file or directory |
| `--format, -f ` | string | `auto` | Output format: `auto`, `hl7`, `json`, `ndjson` |
Generation modes `model` (on-device) and `api` (cloud, BYOK) are Pro features requiring a Pidgeon account with Post Pro entitlement. The AI modes ship with the desktop app and the licensed CLI, not the free `dotnet tool` build.
```bash theme={null}
# Generate 10 HL7 admission messages
pidgeon generate ADT^A01 --count 10
# Generate FHIR patients
pidgeon generate Patient --count 5 --format json
# Reproducible output
pidgeon generate ORU^R01 --count 20 --seed 42
# Vendor-specific patterns
pidgeon generate ADT^A01 --vendor epic_er --count 10
```
***
## pidgeon validate
Validate messages against standard specifications.
```bash theme={null}
pidgeon validate [options]
pidgeon validate --file [options]
```
Files can be passed as positional arguments (with wildcard support) or via `--file`/`--folder`.
| Flag | Type | Default | Description |
| ----------------------- | ---------- | ----------- | ----------------------------------------------------------- |
| `` | positional | — | Files to validate (supports wildcards) |
| `--file, -f ` | string | — | Single file to validate |
| `--folder ` | string | — | Directory to validate |
| `--mode, -m ` | string | `strict` | `strict` or `compatibility` |
| `--standard, -s ` | string | auto-detect | Force a standard: `hl7`, `fhir`, `ncpdp` |
| `--ig ` | string | — | FHIR implementation guide |
| `--profile, -p ` | string | — | Vendor profile for validation |
| `--report ` | string | — | Write an HTML report, or JSON when the path ends in `.json` |
```bash theme={null}
# Strict validation
pidgeon validate --file message.hl7 --mode strict
# Vendor-tolerant validation
pidgeon validate --folder ./inbox --mode compatibility
# FHIR with US Core profile
pidgeon validate --file bundle.json --standard fhir --ig us-core
```
***
## pidgeon deident
De-identify real messages on-device. No data leaves your machine.
```bash theme={null}
pidgeon deident