Skip to main content
The Precipiq REST API is the foundation of the AI Consequences Ledger. Every endpoint lives under 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 an X-Precipiq-Key header. Keys come in two flavors:
  • pq_live_… — production keys that write to your live ledger
  • pq_test_… — sandbox keys for integration testing; data is isolated and never appears in production reports
Missing or invalid keys return 401 with this body — the message is identical whether the header is absent or wrong, so an attacker cannot enumerate valid keys by response shape:

Response envelope

All successful responses share the same outer shape. The data field contains the endpoint-specific payload; meta carries tracing information you can include in support tickets.
Every response also sets an X-Request-ID header that mirrors meta.request_id. Include it when opening a support ticket. Error responses use a separate envelope:
The optional 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 a Retry-After value in the response.
Use the batch endpoint (POST /decisions/batch) when ingesting bursts of decisions. You get 10 large calls per second instead of 100 individual ones, and the server preserves hash-chain order inside each batch.

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 key pq_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
The response’s 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
Returns 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
POST /api/v1/links
curl
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/exportsGET /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.