All systems operational--:--:-- UTC

API overview

Base URLs, versioning, pagination, idempotency, rate limits and errors shared by every endpoint.

On this page

The ConsciousLab API is organised around REST. It accepts JSON request bodies, returns JSON, and uses standard HTTP verbs and status codes. Real-time streams use WebSocket and server-sent events. Institutional trading uses FIX 4.4.

Base URLs

RegionBase URL
EU (Frankfurt)https://eu.api.consciouslab.xyz/v1
US (Oregon)https://us.api.consciouslab.xyz/v1
Automatichttps://api.consciouslab.xyz/v1

The automatic base URL routes to your workspace's region. Use the regional URL if you need guarantees about where requests terminate.

Versioning

The major version is in the path. Within v1 we add fields and endpoints but never remove or rename them. Breaking changes ship in a new major version with at least 12 months of overlap. Subscribe to the changelog to hear about additions.

Pagination

List endpoints use cursor pagination:

curl "https://api.consciouslab.xyz/v1/payments/invoices?limit=50&status=open" \
  -H "Authorization: Bearer $CL_API_KEY"
{
  "data": [{ "id": "inv_2049", "number": "INV-2049", "status": "open" }],
  "next_cursor": "c_eyJpZCI6Imludl8yMDAxIn0",
  "has_more": true
}

Pass cursor=<next_cursor> to fetch the next page. limit defaults to 25 and accepts up to 200.

Idempotency

Every POST accepts an Idempotency-Key header. If you retry a request with the same key within 24 hours, you get the original response instead of a second side effect. The TypeScript SDK sets this header for you.

curl https://api.consciouslab.xyz/v1/payments/refunds \
  -H "Authorization: Bearer $CL_API_KEY" \
  -H "Idempotency-Key: 9c2b0d4e-rfd-0193" \
  -d invoice=inv_2049 -d amount=182.40

Rate limits

PlanRequests per secondBurst
Starter2550
Pro250500
EnterpriseCustomCustom

Event ingest has its own limits; see Events. Every response includes RateLimit-Remaining and RateLimit-Reset headers. Exceeding the limit returns 429 with a Retry-After header in seconds.

Errors

Errors use conventional status codes and a consistent body:

{
  "error": {
    "code": "validation_failed",
    "message": "amount must be greater than 0",
    "field": "amount",
    "request_id": "req_01J9ZRB2K7"
  }
}
StatusMeaning
400Malformed request
401Missing or invalid credentials
403Authenticated, but missing a scope or denied by policy
404Not found in this workspace
409Conflicts with current state, such as cancelling a filled order
422Validation failed
429Rate limited
5xxOur fault. Safe to retry with the same idempotency key

Include the request_id when you contact support.