API Reference
Complete REST API for inferonIQ. All endpoints require authentication via session cookie or API key unless noted.
Base URL: https://app.inferoniq.com (SaaS) or your BYOC deployment URL
Auth: Session cookie (browser) or Authorization: Bearer <api-key>
Content-Type: application/json (except file uploads: multipart/form-data)
NL2SQL Query
Execute natural language questions against connected databases.
/api/queryExecute natural language query
Translates natural language to SQL, executes safely, returns structured results with business insights.
Request Body:
querystringrequired— Natural language questionconnectionIdstring (UUID)— Target connectionstreamboolean— Enable SSE streamingResponse Example:
{
"sql": "SELECT vendor_name, SUM(amount) ...",
"data": [
{
"vendor_name": "Acme",
"total": 142500
}
],
"confidence": 0.94
}Documents
Upload, classify, and extract data from invoices, contracts, and receipts.
/api/documents/upload-urlGet presigned upload URL (large files)
For files > 4MB. Returns a signed URL to upload directly to storage. After uploading, call POST /api/documents with the storagePath.
Request Body:
fileNamestringrequired— Original file namefileSizenumberrequired— File size in bytesmimeTypestring— MIME type (optional)Response Example:
{
"uploadUrl": "https://storage...",
"storagePath": "customer_id/file.pdf",
"expiresIn": 600
}/api/documentsUpload & process document
Two modes: (1) multipart/form-data with file for direct upload (≤ 4MB), (2) application/json with storagePath for presigned uploads (up to 50MB). Returns classification + extraction preview.
Request Body:
fileFile (multipart)— Direct upload modestoragePathstring— Presigned upload mode — path from upload-url responseResponse Example:
{
"id": "doc-uuid",
"type": "invoice",
"extractedFields": {
"vendor": "Acme",
"total": 14805
}
}/api/documentsList documents
Paginated list of uploaded documents with metadata and extraction status.
Query Params:
typestring — Filter by document typelimitnumber — Page size (default 50)Connections
Manage database and storage connections.
/api/connectionsList connections
Returns all configured database and storage connections for your tenant.
/api/connectionsCreate connection
Add a new database or storage connection with encrypted credentials.
Request Body:
namestringrequired— Display nametypestringrequired— "postgres" | "snowflake" | "bigquery" | "oracle" | "mysql" | "sqlserver"hoststringrequired— Database hostportnumber— Port (auto-detected by type)databasestringrequired— Database nameusernamestringrequired— Auth usernamepasswordstringrequired— Auth password (encrypted at rest)/api/connections/testTest connection
Validates connectivity and credentials without saving.
3-Way Matching
Invoice ↔ Purchase Order ↔ Goods Receipt reconciliation.
/api/invoices/matchRun 3-Way Match
Executes the 7-phase matching pipeline on an uploaded invoice.
Request Body:
documentIdstring (UUID)required— Invoice document IDResponse Example:
{
"matchResult": "3-way",
"confidence": 0.97,
"exceptions": [],
"autoApproved": true
}/api/invoices/matchesList match results
Paginated list of all match results with exception details.
Contracts
Contract intelligence — clause extraction and compliance monitoring.
/api/contracts/analyzeAnalyze contract
AI extracts clauses, pricing terms, SLA targets, renewal dates, and obligations.
Request Body:
documentIdstring (UUID)required— Contract document ID/api/contractsList contracts
All analyzed contracts with metadata, risk scores, and expiry dates.
License
License validation and usage information.
/api/licenseGet license status
Returns current license plan, limits, usage counters, and expiry.
Response Example:
{
"plan": "business",
"status": "active",
"expiresAt": "2027-01-01",
"usage": {
"queries": 1250,
"limit": 25000
}
}/api/license/activateActivate license key
Activate a new Ed25519-signed license key (BYOC deployments).
Request Body:
keystringrequired— License key stringHealth
Platform health and connectivity checks.
/api/healthHealth check
Returns platform status, database connectivity, and version info. No auth required.
Response Example:
{
"status": "healthy",
"version": "3.7.0",
"database": "connected"
}Rate Limits & Usage
Rate limits are per-customer, enforced at the license level:
| Plan | Queries/mo | Documents/mo | Connections |
|---|---|---|---|
| Trial | 100 | 50 | 1 |
| Team | 5,000 | 2,000 | 5 |
| Business | 25,000 | 10,000 | 20 |
| Enterprise | Unlimited | Unlimited | Unlimited |
Exceeding limits returns 429 Too Many Requests with a Retry-After header.