Investigation Review Hub
Produce structured JSON dashboards by querying a read-only Investigation Review
Hub REST API. The hub exposes matter metadata, subpoena categories, production
stats, custodian sources, review documents, privilege-log entries, QC findings,
retention events, and remediation actions — all scoped by matter_id or
queryable through a SQL endpoint.
When to use this skill
Use this skill when all of these conditions hold:
- The task references an "Investigation Review Hub" and provides a base URL.
- The deliverable is a structured JSON object that synthesizes evidence from
multiple hub endpoints.
- An answer template (JSON schema file) is provided in the task payloads.
If any condition is absent, handle the task with your general tools instead.
Workflow
Phase 1 — Discover and validate the environment
- GET / from the base URL. Confirm the service is up and note the
response service field to confirm it is the Investigation Review Hub.
- GET /api/schema to learn the available table structures. This endpoint
lists every table, its columns and column types. Use it to understand what
fields are available before writing SQL queries.
- If the task payload refers to a query_api_key_header (typically
X-API-Key), save that header name and value. All POST /api/query calls
must include it.
Phase 2 — Scope and gather
Identify the matter_id from the task prompt or payload. Every hub endpoint
that supports a ?matter_id= filter should be called with that value.
Call these GET endpoints, each filtered by matter_id when supported:
| Endpoint |
What it provides |
| /api/matters |
Matter metadata (agency, hold date, lead partner, status) |
| /api/subpoena-categories |
Request categories with codes, date ranges, descriptions |
| /api/productions |
Per-category production batches with produced/withheld/responsive counts and status |
| /api/custodian-sources |
Custodian device/source records with collection status, post-hold flag, and category impacts |
| /api/documents/search |
Individual review documents with responsiveness coding, privilege status, issue tags |
| /api/privilege-log |
Privilege entries with withheld/logged counts, issue types, third-party flags |
| /api/qc-findings |
QC findings with issue types, affected categories, severity, doc counts |
| /api/retention-events |
Retention events with status, policy sections, volume counts, affected categories |
| /api/remediation-actions |
Pre-existing remediation action records with owners, priorities, target refs |
Some of these endpoints may require matter_id as a query parameter. The hub
returns {"count": N, "rows": [...]} for each. Process every row.
For queries that need filtering beyond what the GET endpoints support, use:
POST /api/query
Headers: Content-Type: application/json, X-API-Key: <key>
Body: {"sql": "<SQL query using tables from /api/schema>"}
Always scope SQL queries to the task matter_id in the WHERE clause. Use
column names exactly as they appear in /api/schema.
Phase 3 — Cross-reference evidence
The hub record IDs form a web of relationships. When you assemble findings:
- A doc_id from /api/documents/search may be referenced in
/api/qc-findings via source_ref.
- A source_id from /api/custodian-sources may be referenced in
/api/retention-events via source_ref.
- A privilege entry_id from /api/privilege-log is the canonical reference
for privilege-linked metrics.
- A batch_id from /api/productions may appear as the batch_id in
/api/qc-findings.
- A retention event_id may be cross-referenced in
/api/remediation-actions via target_ref.
When the answer template asks for source_refs, record_refs, issue_refs,
blocking_refs, or target_refs, use the stable hub IDs you observed — not
invented values. Sort them ascending.
When category codes are listed in the answer, use the exact codes from
/api/subpoena-categories (or from the task-provided payloads if they override
labels). Sort category codes ascending.
Phase 4 — Fill the template
Read the answer template JSON file from the task payloads. It defines:
- required_top_level_keys — every top-level key must appear in your answer.
- fields — the type, sub-keys, and constraints for each section.
- enums — the allowed values for each enum field. Pick values only from
these lists.
- ordering_rules — how to sort lists within the answer.
Rules for filling the template:
- Match key names exactly. If the template expects category_code, do not
call it code or category.
- Use enum values verbatim. If the template defines severity as
["critical", "high", "medium", "low"], use those strings, not variants
like "Critical" or "CRITICAL".
- Sort lists per ordering rules. If the template says sort by
priority_rank ascending, do that.
- Use integers for counts. All document_count, withheld_count,
volume_count, and similar fields are whole integers. Use 0 when not
applicable, never null.
- Use null for optional fields only when the template allows it. String
fields like third_party or missing_component may be null when no value
exists; numeric fields default to 0.
- Only include list items that have a material status. The template
description often says "one object per category with a material non-complete
status" or similar. Do not include categories or items that have no
findings.
- Return exactly one JSON object and no prose outside the JSON. The
answer must be parseable as JSON without any surrounding text.
Phase 5 — Verify
Before finishing:
- Confirm every required top-level key is present.
- Confirm every nested object has all required keys.
- Confirm all enum values match the template allowed lists.
- Confirm sorting follows the template ordering rules.
- Confirm all record IDs are actual hub IDs, not invented.
- Confirm numeric counts are whole integers.
- Run a quick JSON parse to catch syntax errors.
Using the SQL endpoint
When the GET endpoints do not provide the needed aggregation or filtering, use
POST /api/query. The schema from /api/schema defines available tables and
columns. Build queries that:
- Scope to the task matter_id.
- Use standard SQL compatible with SQLite (the hub backend).
- Keep queries simple — SELECT with WHERE, GROUP BY, ORDER BY. Avoid CTEs or
window functions unless you have confirmed they work.
If a query returns truncated: true, refine the WHERE clause or add LIMIT.
Reference: API guide
For detailed endpoint descriptions, response shapes, and cross-referencing
patterns read references/api-guide.md.
Common pitfalls
- Not filtering by matter_id. The hub contains records for many matters.
Always scope your requests.
- Inventing record IDs. Every ID must come from the hub. If you cannot find
a stable ID for a finding, use the most specific hub record that anchors it.
- Using the wrong enum values. Enum lists in the answer template are
authoritative. Do not use synonyms or variants.
- Including non-material items. If a category has no gaps, do not include
it in the category_statuses list unless the template explicitly requires all
categories.
- Skipping cross-references. A template field like source_refs often
needs IDs from multiple endpoints — cross-reference before writing.
- Returning prose with the JSON. The final answer must be a single JSON
object with no markdown fences, no commentary, no trailing text.
1---2name: investigation-review-hub-33description: Query an Investigation Review Hub REST API to produce structured JSON review dashboards for e-discovery, legal-hold gap analysis, privilege review, production readiness, and cross-system remediation. Use this skill whenever the task mentions an Investigation Review Hub, a matter-based subpoena or regulatory review, legal-hold gap analysis, production readiness review, privilege-log QC, retention-event tracking, or remediation dashboards tied to REST endpoints at a provided base URL. Trigger even when the user describes ediscovery workstreams, grand jury or SEC subpoena reviews, or asks for a structured JSON deliverable from review-hub endpoints.4metadata:5 source: https://skillmd.com/skills/prism-shadow/investigation-review-hub-36---78# Investigation Review Hub910Produce structured JSON dashboards by querying a read-only Investigation Review11Hub REST API. The hub exposes matter metadata, subpoena categories, production12stats, custodian sources, review documents, privilege-log entries, QC findings,13retention events, and remediation actions — all scoped by matter_id or14queryable through a SQL endpoint.1516## When to use this skill1718Use this skill when all of these conditions hold:19201. The task references an "Investigation Review Hub" and provides a base URL.212. The deliverable is a structured JSON object that synthesizes evidence from22 multiple hub endpoints.233. An answer template (JSON schema file) is provided in the task payloads.2425If any condition is absent, handle the task with your general tools instead.2627## Workflow2829### Phase 1 — Discover and validate the environment30311. **GET /** from the base URL. Confirm the service is up and note the32 response service field to confirm it is the Investigation Review Hub.332. **GET /api/schema** to learn the available table structures. This endpoint34 lists every table, its columns and column types. Use it to understand what35 fields are available before writing SQL queries.363. If the task payload refers to a query_api_key_header (typically37 X-API-Key), save that header name and value. All POST /api/query calls38 must include it.3940### Phase 2 — Scope and gather4142Identify the matter_id from the task prompt or payload. Every hub endpoint43that supports a ?matter_id= filter should be called with that value.4445Call these GET endpoints, each filtered by matter_id when supported:4647| Endpoint | What it provides |48|---|---|49| /api/matters | Matter metadata (agency, hold date, lead partner, status) |50| /api/subpoena-categories | Request categories with codes, date ranges, descriptions |51| /api/productions | Per-category production batches with produced/withheld/responsive counts and status |52| /api/custodian-sources | Custodian device/source records with collection status, post-hold flag, and category impacts |53| /api/documents/search | Individual review documents with responsiveness coding, privilege status, issue tags |54| /api/privilege-log | Privilege entries with withheld/logged counts, issue types, third-party flags |55| /api/qc-findings | QC findings with issue types, affected categories, severity, doc counts |56| /api/retention-events | Retention events with status, policy sections, volume counts, affected categories |57| /api/remediation-actions | Pre-existing remediation action records with owners, priorities, target refs |5859Some of these endpoints may require matter_id as a query parameter. The hub60returns {"count": N, "rows": [...]} for each. Process every row.6162For queries that need filtering beyond what the GET endpoints support, use:6364 POST /api/query65 Headers: Content-Type: application/json, X-API-Key: <key>66 Body: {"sql": "<SQL query using tables from /api/schema>"}6768Always scope SQL queries to the task matter_id in the WHERE clause. Use69column names exactly as they appear in /api/schema.7071### Phase 3 — Cross-reference evidence7273The hub record IDs form a web of relationships. When you assemble findings:7475- A doc_id from /api/documents/search may be referenced in76 /api/qc-findings via source_ref.77- A source_id from /api/custodian-sources may be referenced in78 /api/retention-events via source_ref.79- A privilege entry_id from /api/privilege-log is the canonical reference80 for privilege-linked metrics.81- A batch_id from /api/productions may appear as the batch_id in82 /api/qc-findings.83- A retention event_id may be cross-referenced in84 /api/remediation-actions via target_ref.8586When the answer template asks for source_refs, record_refs, issue_refs,87blocking_refs, or target_refs, use the stable hub IDs you observed — not88invented values. Sort them ascending.8990When category codes are listed in the answer, use the exact codes from91/api/subpoena-categories (or from the task-provided payloads if they override92labels). Sort category codes ascending.9394### Phase 4 — Fill the template9596Read the answer template JSON file from the task payloads. It defines:9798- required_top_level_keys — every top-level key must appear in your answer.99- fields — the type, sub-keys, and constraints for each section.100- enums — the allowed values for each enum field. Pick values only from101 these lists.102- ordering_rules — how to sort lists within the answer.103104Rules for filling the template:1051061. **Match key names exactly.** If the template expects category_code, do not107 call it code or category.1082. **Use enum values verbatim.** If the template defines severity as109 ["critical", "high", "medium", "low"], use those strings, not variants110 like "Critical" or "CRITICAL".1113. **Sort lists per ordering rules.** If the template says sort by112 priority_rank ascending, do that.1134. **Use integers for counts.** All document_count, withheld_count,114 volume_count, and similar fields are whole integers. Use 0 when not115 applicable, never null.1165. **Use null for optional fields only when the template allows it.** String117 fields like third_party or missing_component may be null when no value118 exists; numeric fields default to 0.1196. **Only include list items that have a material status.** The template120 description often says "one object per category with a material non-complete121 status" or similar. Do not include categories or items that have no122 findings.1237. **Return exactly one JSON object and no prose outside the JSON.** The124 answer must be parseable as JSON without any surrounding text.125126### Phase 5 — Verify127128Before finishing:129130- Confirm every required top-level key is present.131- Confirm every nested object has all required keys.132- Confirm all enum values match the template allowed lists.133- Confirm sorting follows the template ordering rules.134- Confirm all record IDs are actual hub IDs, not invented.135- Confirm numeric counts are whole integers.136- Run a quick JSON parse to catch syntax errors.137138## Using the SQL endpoint139140When the GET endpoints do not provide the needed aggregation or filtering, use141POST /api/query. The schema from /api/schema defines available tables and142columns. Build queries that:143144- Scope to the task matter_id.145- Use standard SQL compatible with SQLite (the hub backend).146- Keep queries simple — SELECT with WHERE, GROUP BY, ORDER BY. Avoid CTEs or147 window functions unless you have confirmed they work.148149If a query returns truncated: true, refine the WHERE clause or add LIMIT.150151## Reference: API guide152153For detailed endpoint descriptions, response shapes, and cross-referencing154patterns read [references/api-guide.md](references/api-guide.md).155156## Common pitfalls157158- **Not filtering by matter_id.** The hub contains records for many matters.159 Always scope your requests.160- **Inventing record IDs.** Every ID must come from the hub. If you cannot find161 a stable ID for a finding, use the most specific hub record that anchors it.162- **Using the wrong enum values.** Enum lists in the answer template are163 authoritative. Do not use synonyms or variants.164- **Including non-material items.** If a category has no gaps, do not include165 it in the category_statuses list unless the template explicitly requires all166 categories.167- **Skipping cross-references.** A template field like source_refs often168 needs IDs from multiple endpoints — cross-reference before writing.169- **Returning prose with the JSON.** The final answer must be a single JSON170 object with no markdown fences, no commentary, no trailing text.