Reports, aggregations and the compliance score
Three endpoints for the compliance team rather than the integrator: aggregations are the counts behind a dashboard, reports are dated files you can hand an auditor or have mailed every Monday, and the compliance score says how well the roster is covered. Every number agrees with the list endpoints: a report's row count equals the matching list or aggregation total under the same filters. The dashboard page is Reports.
Aggregations
| Resource | groupBy | Filters |
|---|---|---|
GET /v1/aggregations/subjects | status (default) · type · practiceState · language · raceEthnicity · gender | status, type, since |
GET /v1/aggregations/licenses | statusMapped (default) · state · profession · cadence · status · verdict — plus expiring buckets expired / 30 / 60 / 90 / later / unknown | status (active by default), state, profession, cadence, expiringWithin, since |
GET /v1/aggregations/monitors | status (default) · cadence · verdict · claimType · state · profession | status, claimType, state, profession, cadence, subjectId, verdict, since |
GET /v1/aggregations/alerts | type (default) · severity · status · state · profession | status (open by default; all lifts it), type, severity, subjectId, monitorId, state, profession, since |
GET /v1/aggregations/matches | status (default) · severity · kind · sourceCode · claimType | status, severity, kind, since |
Every filter takes a comma-separated list. total is the number of rows matching the filters (a subject with three practice states counts once in total, once per state in data). Each call is one indexed SQL group-by, so an account with 100,000 monitors answers in the time of one query.
GET /v1/aggregations/licenses?state=PA&expiringWithin=90
{ "object": "aggregation", "resource": "licenses", "groupBy": "statusMapped", "filters": { "state": "PA", "expiringWithin": 90 },
"total": 4, "today": "2026-11-08",
"expiring": { "expired": 1, "30": 1, "60": 1, "90": 1, "later": 0, "unknown": 0 },
"data": [ { "key": "active", "count": 3 }, { "key": "expired", "count": 1 } ] }Reports
| Method | Path | Purpose |
|---|---|---|
| POST | /v1/reports | { type, format, filters, schedule? } → a report (rep_…, status: queued). type: roster · monitors · expirables · exclusions · alerts · source_health; format: csv | pdf. |
| GET | /v1/reports | Newest first; type, status, scheduleId; cursor pagination. |
| GET | /v1/reports/{id} | Row count, sha256, bytes, fileName and — once complete — a signed downloadUrl valid 15 minutes (call again for a fresh one). |
| GET | /v1/reports/{id}/download | The bytes: through the signed link (?exp=&sig=, no key) or with your credential. Content-Disposition: attachment, X-Content-SHA256. |
| GET / PATCH / DELETE | /v1/reports/schedules[/{id}] | Schedules: pause / resume (status), change cadence, dayOfWeek, hourEt, recipients, filters. |
| type | One row is | Filters (the matching list's) | Count equals |
|---|---|---|---|
roster | a subject | status, type, since | GET /v1/subjects |
monitors | a monitor with its verdict, mapped status and expiry | status, claimType, state, profession, cadence, subjectId, verdict, since | GET /v1/monitors |
expirables | a licence monitor expiring within expiringWithin days (default 90; lapsed ones included), soonest first, with its bucket | status, state, profession, cadence, expiringWithin, since | /v1/aggregations/licenses?expiringWithin= |
exclusions | an exclusion / healthcare screen monitor with its verdict, the lists hit and the hit count; verdict=discrepancy → hits only | status, verdict, state, profession, subjectId, since | /v1/aggregations/monitors?claimType=exclusion_screen,healthcare_screen |
alerts | an alert (open by default) | status, type, severity, subjectId, monitorId, state, profession, since | GET /v1/alerts |
source_health | a source with status, canary result, 24 h error rate and dataset freshness | status | GET /v1/sources |
directory | a person subject compared with its NPPES record: name match, practice states vs NPPES practice / licence states, deactivation, last update, verified licences, a verdict and issues | status, state, since | — |
delegation | a credentialing request decided in the period (default last 6 months): attestation age at decision, PSV within 180 days, days to decision, checklist completeness, flags, overdue — the semiannual delegation report | since, until, type, status, decision | — |
Building is asynchronous: status goes queued → running → complete (or failed with error), then the report.completed webhook carries the report object. Files are stored with their SHA-256 so an auditor can check what was handed over. CSV files are UTF-8 with a header row; PDFs are tabular, US-Letter landscape, with the filters and the row count on page one.
POST /v1/reports
{ "type": "expirables", "format": "pdf", "filters": { "expiringWithin": 60, "state": "PA" },
"schedule": { "cadence": "weekly", "dayOfWeek": 0, "hourEt": 9, "recipients": ["compliance@example.com"] } }
→ 201 { "id": "rep_…", "object": "report", "type": "expirables", "format": "pdf", "status": "queued",
"filters": { "expiringWithin": 60, "state": "PA" }, "scheduleId": "rsc_…",
"schedule": { "id": "rsc_…", "cadence": "weekly", "dayOfWeek": 0, "hourEt": 9, "status": "active", "nextRunOn": "2026-11-09", … } }
GET /v1/reports/rep_…
→ { "status": "complete", "rowCount": 3, "sha256": "…", "bytes": 18211, "fileName": "expirables-2026-11-08-1a2b3c4d.pdf",
"downloadUrl": "https://api.primarycheck.com/v1/reports/rep_…/download?exp=…&sig=…", "downloadExpiresAt": "…" }Schedules
cadence is daily, weekly (with dayOfWeek, 0 = Monday … 6 = Sunday) or monthly (the 1st). The file is built overnight (03:40 US Eastern); recipients are mailed a link to the dashboard at hourEt (9–20, US Eastern — people-facing mail never goes out at night), where a fresh signed download link is minted on click. recipients defaults to your notification recipients. A schedule carries lastRunOn, lastReportId and nextRunOn; paused schedules build nothing.
Compliance score
GET /v1/compliance/score returns one number per account, 0–100, with a letter grade (A ≥ 90, B ≥ 75, C ≥ 60, D ≥ 40) — the analogue of ProviderTrust's Impact Compliance score:
score = 100 × coverage × breadth × cadence × hygiene
| Driver | Definition |
|---|---|
coverage | Active subjects with at least one active monitor ÷ active subjects. |
breadth | Required sources actually monitored ÷ applicable sources. Applicable = federal exclusion screening (always) + one licence board per state the active roster practises in (practiceStates; the states of your licence monitors when the roster lists none). Monitored = an active exclusion / healthcare screen monitor exists + the states with an active licence monitor. |
cadence | Active monitors re-checked at least monthly (daily, weekly, monthly, or custom ≤ 31 days) ÷ active monitors. |
hygiene | 1 − ½ × (open alerts older than 14 days ÷ open alerts): a queue nobody works costs up to half the score. |
Each driver comes with its value, percent, the counts behind it (detail) and an explanation; recommendations name what to change (uncovered_subjects, no_exclusion_monitoring, boards_not_monitored, slow_cadence, stale_alerts, unlinked_monitors, or healthy), ordered by impact. The dashboard home shows the card with driver bars.
SDKs
pc.aggregations.licenses("state", expiring_within=90) # Python
rep = pc.reports.create("expirables", "pdf", {"expiring_within": 60, "state": "PA"})
rep = pc.reports.wait_for_completion(rep["id"]); pdf = pc.reports.download(rep["id"])
pc.reports.schedule("alerts", "weekly", day_of_week=0, hour_et=9, recipients=["compliance@example.com"])
pc.compliance.score()["score"]
await pc.aggregations.subjects("practiceState", { status: "active" }); // Node
const rep = await pc.reports.create({ type: "roster", format: "csv" });
const done = await pc.reports.waitForCompletion(rep.id); const csv = await pc.reports.download(done.id);
await pc.reports.schedule({ type: "expirables", filters: { expiringWithin: 60 } }, { cadence: "monthly", hourEt: 10 });
(await pc.compliance.score()).drivers;