Back to Documentation
API Reference

API Reference

Comprehensive reference for all REST API endpoints with request and response examples.

Authentication

All requests require authentication

Authentication is passed via HTTP headers on every request. Include the following headers:

HeaderRequiredDescription
X-Api-Key
Required
Your API key from Settings page
X-Tenant-Id
Required
Your tenant identifier for multi-tenant isolation
Content-Type
Conditional
Required for POST/PUT requests: application/json
bash
curl -X GET https://api.qawaid.ai/api/v1/rules \
  -H "X-Api-Key: qw_live_your_api_key" \
  -H "X-Tenant-Id: your-tenant-id"
Base URL
https://api.qawaid.ai

All API paths are relative to this base URL. Always use HTTPS in production.

POST/api/v1/validation/validate

Validate a single payload against all published rules in the given context.

200Validation result returned400Invalid request body401Unauthorized

Request Body

json
{
  "context": "loan-application",
  "payload": {
    "applicant": { "age": 25, "income": 75000 },
    "loan": { "amount": 250000, "term": 30 }
  }
}

Response

json
{
  "isValid": false,
  "totalRulesEvaluated": 5,
  "failures": [
    {
      "ruleCode": "INCOME-RATIO-001",
      "ruleName": "Income to Loan Ratio",
      "severity": "Error",
      "message": "Loan amount exceeds 3x annual income",
      "errorCode": "INCOME_RATIO",
      "fieldPath": "loan.amount",
      "actualValue": 250000,
      "expectedValue": 225000
    }
  ],
  "executionTimeMs": 12
}
bash
curl -X POST https://api.qawaid.ai/api/v1/validation/validate \
  -H "X-Api-Key: qw_live_your_api_key" \
  -H "X-Tenant-Id: your-tenant-id" \
  -H "Content-Type: application/json" \
  -d '{
    "context": "loan-application",
    "payload": {
      "applicant": { "age": 25, "income": 75000 },
      "loan": { "amount": 250000, "term": 30 }
    }
  }'
POST/api/v1/validation/validate-batch

Validate multiple payloads in a single request. Ideal for bulk data processing scenarios.

200Batch results returned400Invalid request body401Unauthorized

Request Body

json
{
  "context": "order-validation",
  "items": [
    { "id": "order-1", "payload": { "total": 150, "currency": "USD" } },
    { "id": "order-2", "payload": { "total": 25, "currency": "USD" } },
    { "id": "order-3", "payload": { "total": 500, "currency": "EUR" } }
  ]
}

Response

json
{
  "results": [
    { "id": "order-1", "isValid": true, "failures": [] },
    { "id": "order-2", "isValid": false, "failures": [{ "ruleCode": "MIN-ORDER-001", "message": "Order must be at least $50" }] },
    { "id": "order-3", "isValid": true, "failures": [] }
  ],
  "totalProcessed": 3,
  "totalFailed": 1,
  "executionTimeMs": 28
}
bash
curl -X POST https://api.qawaid.ai/api/v1/validation/validate-batch \
  -H "X-Api-Key: qw_live_your_api_key" \
  -H "X-Tenant-Id: your-tenant-id" \
  -H "Content-Type: application/json" \
  -d '{
    "context": "order-validation",
    "items": [
      { "id": "order-1", "payload": { "total": 150, "currency": "USD" } },
      { "id": "order-2", "payload": { "total": 25, "currency": "USD" } }
    ]
  }'
POST/api/v1/validation/validate-transaction

Validate a complete transaction with multiple rule contexts evaluated atomically.

200Transaction result returned400Invalid request body401Unauthorized

Request Body

json
{
  "transactionId": "txn-20240115-001",
  "contexts": ["kyc-check", "aml-screening", "credit-assessment"],
  "payload": {
    "customer": { "name": "John Doe", "country": "US", "pep": false },
    "transaction": { "amount": 50000, "type": "wire-transfer" }
  }
}

Response

json
{
  "transactionId": "txn-20240115-001",
  "overallResult": "Rejected",
  "contextResults": [
    { "context": "kyc-check", "isValid": true, "failures": [] },
    { "context": "aml-screening", "isValid": true, "failures": [] },
    { "context": "credit-assessment", "isValid": false, "failures": [
      { "ruleCode": "CREDIT-LIMIT-001", "message": "Amount exceeds single transaction limit" }
    ]}
  ],
  "executionTimeMs": 45
}
bash
curl -X POST https://api.qawaid.ai/api/v1/validation/validate-transaction \
  -H "X-Api-Key: qw_live_your_api_key" \
  -H "X-Tenant-Id: your-tenant-id" \
  -H "Content-Type: application/json" \
  -d '{
    "transactionId": "txn-20240115-001",
    "contexts": ["kyc-check", "aml-screening", "credit-assessment"],
    "payload": {
      "customer": { "name": "John Doe", "country": "US" },
      "transaction": { "amount": 50000, "type": "wire-transfer" }
    }
  }'

HTTP Status Codes

CodeStatusDescription
200OKRequest succeeded
201CreatedResource created successfully
204No ContentResource deleted successfully
400Bad RequestInvalid request body or parameters
401UnauthorizedMissing or invalid API key
402Payment RequiredPayment method required for plan change
404Not FoundResource does not exist
409ConflictResource state conflict (e.g., duplicate or wrong status)
429Too Many RequestsRate limit exceeded, retry after cooldown
500Server ErrorInternal server error, contact support

Ready to Integrate?

Download our Postman collection or follow the integration guides to get started.

Qawaid — Business Rules Engine for Regulated Industries