https://api.precipiq.dev/api/v1/ and returns a consistent JSON envelope so you can handle success and error paths the same way across your codebase.
Authentication
Every request requires anX-Precipiq-Key header. Keys come in two flavors:
pq_live_…— production keys that write to your live ledgerpq_test_…— sandbox keys for integration testing; data is isolated and never appears in production reports
Response envelope
All successful responses share the same outer shape. Thedata field contains the endpoint-specific payload; meta carries tracing information you can include in support tickets.
X-Request-ID header that mirrors meta.request_id. Include it when opening a support ticket.
Error responses use a separate envelope:
details object contains field-level validation errors when code is validation_error.
Rate limits
Limits are applied per organization. Exceeding a limit returns 429 with aRetry-After value in the response.
| Bucket | Limit | Endpoints |
|---|---|---|
| Single ingestion | 100 req / s | POST /decisions, POST /financial-events, POST /links, DELETE /links/{id} |
| Batch ingestion | 10 req / s | POST /decisions/batch |
| Reads | 1,000 req / s | GET /decisions, GET /links, GET /analytics/*, GET /decisions/chain/verify |
| WebSocket handshake | 30 req / min / IP | /ws/v1/stream |
Endpoints at a glance
Browse all endpoints by tag in the interactive reference below, or jump straight to a group:- decisions —
/api/v1/decisions,/decisions/batch,/decisions/{id},/decisions/chain/verify - financial-events —
/api/v1/financial-events,/financial-events/webhook/stripe - consequence-links —
/api/v1/links,/links/{id},/links/{id}/confirm,/links/{id}/reject - analytics —
/api/v1/analytics/ai-pnl,/analytics/timeline,/analytics/liability - exports —
/api/v1/exports,/exports/{id},/exports/{id}/download - websocket —
/ws/v1/stream
Common calls
Every example below uses the placeholder keypq_test_demo_key_REPLACE_ME — substitute your own key from the dashboard before running.
Ingest a single decision
POST /api/v1/decisions
Ingest a batch of decisions
POST /api/v1/decisions/batch — send up to 100 decisions in a single call.
List decisions with cursor pagination
GET /api/v1/decisions?agent_id=&action_type=&start=&end=&cursor=
curl
data.next_cursor is an opaque string. Pass it back verbatim as ?cursor=… to fetch the next page. Results are ordered newest first (timestamp DESC, id DESC), and the cursor guarantees no rows are skipped or duplicated across pages.
Verify the hash chain
GET /api/v1/decisions/chain/verify?start_date=&end_date=
curl
is_valid, records_checked, first_broken_link, and verification_timestamp. See Hash Chain for the semantics.
Ingest a financial event
POST /api/v1/financial-events
curl
Link a decision to a financial event
POST /api/v1/links
curl
Confirm or reject a suggested link
POST /api/v1/links/{id}/confirm and POST /api/v1/links/{id}/reject
These endpoints are used when a human reviews a link with status ML_SUGGESTED. Confirming flips it to ML_INFERRED and nudges the Bayesian priors; rejecting soft-deletes it and nudges them the other way.
curl
Fetch the AI P&L
GET /api/v1/analytics/ai-pnl?start=&end=&agent_id=
curl
Aggregate liability exposure
GET /api/v1/analytics/liability
curl
Create and download a forensic export
POST /api/v1/exports → GET /api/v1/exports/{id} → GET /api/v1/exports/{id}/download
Forensic exports are generated asynchronously. Start the job, poll until it completes, then download the signed bundle.
curl
The download URL in the response is a pre-signed link with a limited TTL. Download the file promptly after the export reaches
complete status.