Skip to main content

Base URL

https://api.lexq.io/v1
All API endpoints are served over HTTPS. HTTP requests are rejected.

Authentication

LexQ uses API Key authentication. Include your key in every request:
x-api-key: YOUR_API_KEY
API keys are created and managed in the Console under Management → API Keys.
API keys grant full access to your organization’s policy engine. Never expose them in client-side code or public repositories.

Request Format

All request and response bodies use JSON. Set the Content-Type header:
Content-Type: application/json

Response Format

Every response follows a consistent envelope:
{
  "success": true,
  "data": { ... },
  "errorCode": null,
  "message": null
}

Error Codes

Error codes follow a prefix convention:
PrefixDomain
C-xxxCommon (input validation, not found, rate limit)
A-xxxAuth (credentials, API key, permissions)
P-xxxPolicy Engine (groups, versions, rules, deployment)
B-xxxBilling (subscription, payment, quota)
S-xxxSimulation & Analytics
ACT-xxxAction validation (discount, point, notification)
FD-xxxFact Definition
INT-xxxIntegration
FL-xxxFailure Log
See the full error reference for details.

Rate Limits

Rate limits depend on your plan’s Max TPS setting:
PlanMax TPS
Free5
Growth50
Pro200
Requests exceeding the TPS limit receive HTTP 429 Too Many Requests.

Idempotency

For execution endpoints, you can include an Idempotency-Key header to prevent duplicate processing:
Idempotency-Key: unique-request-id-123
Duplicate requests with the same key return the original response without re-executing the policy.

Next Steps