Developer Documentation

API Reference v1.0

Integrate directly with Yukti's 6-layer predictive engine. Use our RESTful APIs to sync live POS data, extract AI-generated anomaly reports, and build custom business intelligence dashboards.

Authentication

Bearer token auth via Firebase. Tokens expire every 1h. Requests without valid tokens return 401 Unauthorized.

Rate Limiting

1,000 requests/minute per IP. Batch data endpoints are limited to 50 concurrent jobs per workspace.

Data Storage

All transactions are persisted to tenant-isolated PostgreSQL tables with strict schema enforcement and point-in-time recovery.

Encryption

Protected routes validate account credentials before handling data. Contact Yukti for current hosting and transport details.

Core Endpoints

Initialize Connection

Exchange public keys and validate platform connectivity using supplied OAuth or API credentials. Establishes a secure tunnel for subsequent requests.

POST/api/v1/integrations/auth
Request Parameters
platformIdstring

Unique identifier for the POS/ERP (e.g., 'shopify', 'tally_prime')

credentialsobject

Credential payload as required by the connected platform

Response Example (200 OK)
{
  "status": "success",
  "connection_id": "conn_8f72a91b",
  "expires_in": 3600,
  "scopes": ["read:transactions", "read:inventory"]
}

Batch Data Ingestion

Upload historical CSV/JSON data. Passes through Yukti's 6-layer pipeline: parsing, cleaning, schema inference, and anomaly detection.

POST/api/v1/data/ingest
Request Parameters
dataset_typeenum

'sales', 'inventory', or 'expenses'

recordsarray

Array of transaction objects (Max 10,000 per request)

strict_validationboolean

If true, rejects entire batch on single schema failure

Response Example (200 OK)
{
  "job_id": "job_batch_9921",
  "status": "processing",
  "records_accepted": 9850,
  "records_rejected": 150,
  "anomalies_detected": 12
}

Retrieve Predictions

Fetch polynomial regression forecasts generated by the Yukti AI engine. Includes confidence intervals and upper/lower uncertainty bands.

GET/api/v1/analytics/forecast
Request Parameters
metricstring

Target variable (e.g., 'daily_revenue', 'footfall')

horizon_daysinteger

Forecast horizon (1 to 90 days)

Response Example (200 OK)
{
  "forecast": [
    {"date": "2024-11-01", "predicted": 45200, "lower_bound": 42000, "upper_bound": 48500},
    {"date": "2024-11-02", "predicted": 47800, "lower_bound": 44100, "upper_bound": 51200}
  ],
  "model_used": "yukti-phi4-mini-qlora-v1"
}

Register Webhook

Set up a webhook endpoint to receive real-time anomaly alerts, sync completion events, or monthly diagnostic report generations.

POST/api/v1/webhooks/register
Request Parameters
target_urlstring

HTTPS URL to receive the POST payloads

eventsarray

List of event subscriptions (e.g., ['anomaly.critical', 'sync.completed'])

Response Example (200 OK)
{
  "webhook_id": "wh_55x819",
  "secret_key": "whsec_...",
  "status": "active"
}