API Documentation

Connect your hospital systems to Revtect.ai

Authentication

Secure API access using API keys

Using API Keys

Include your API key in the request header for all API calls:

# Include in HTTP headers
X-API-Key: your_api_key_here

Note: API keys are generated from your dashboard. Navigate to Settings → API Keys to create one.

Data Ingestion

Send patient and billing data for anomaly detection

POST /api/v1/dashboard/ingest-data

Upload patient and billing data for processing and anomaly detection.

Auth: API Key | Plan: All plans

Request Body

{
  "patient_data": [
    {
      "patient_id": "P001",
      "visit_id": "V001",
      "department": "Admission",
      "item_code": "ADM001",
      "item_name": "Emergency Admission",
      "expected_charge": 1500.00,
      "billed_charge": 0.00,
      "quantity": 1.0,
      "timestamp": "2025-01-15T10:30:00Z"
    }
  ],
  "billing_data": []
}

Example: cURL

# Send data to API
curl -X POST "https://ai-revenue-agent.onrender.com/api/v1/dashboard/ingest-data" \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "patient_data": [{
      "patient_id": "P001",
      "visit_id": "V001",
      "department": "Admission",
      "item_code": "ADM001",
      "item_name": "Emergency Admission",
      "expected_charge": 1500.00,
      "billed_charge": 0.00,
      "quantity": 1.0,
      "timestamp": "2025-01-15T10:30:00Z"
    }]
  }'

Example: Python

import requests

# API endpoint
url = "https://ai-revenue-agent-backend.onrender.com/api/v1/dashboard/ingest-data"
headers = {
  "X-API-Key": "your_api_key_here",
  "Content-Type": "application/json"
}

data = {
  "patient_data": [{
    "patient_id": "P001",
    "visit_id": "V001",
    "department": "Admission",
    "item_code": "ADM001",
    "item_name": "Emergency Admission",
    "expected_charge": 1500.00,
    "billed_charge": 0.00,
    "quantity": 1.0,
    "timestamp": "2025-01-15T10:30:00Z"
  }]
}

response = requests.post(url, headers=headers, json=data)
print(response.json())

Real-Time Event Processing

Send events as they happen for instant anomaly detection

POST /api/v1/dashboard/realtime-event

Process a single real-time event (admission, lab order, pharmacy issue, billing). Triggers instant ledger update, anomaly detection, and alerts.

Auth: API Key | Plan: All plans

Request Body

{
  "event_type": "admission", // or "lab_order", "pharmacy_issue", "bill_created"
  "patient_id": "P001",
  "visit_id": "V001",
  "department": "Admission",
  "item_code": "ADM001",
  "item_name": "Emergency Admission",
  "timestamp": "2025-01-15T10:30:00Z",
  "expected_charge": 1500.00,
  "billed_charge": 0.00,
  "quantity": 1.0
}

Anomaly Retrieval

Get detected anomalies and leakage information

GET /api/v1/dashboard/anomalies

Retrieve detected anomalies with filtering and pagination.

Auth: API Key | Plan: All plans

GET /api/v1/dashboard/patient/{patient_id}

Get anomalies for a specific patient.

Auth: API Key | Plan: All plans

GET /api/v1/dashboard/overview

Get summary statistics and department breakdown.

Auth: API Key | Plan: All plans

Anomaly Resolution

Mark anomalies as resolved

POST /api/v1/dashboard/anomalies/{anomaly_id}/resolve

Mark an anomaly as resolved.

Auth: API Key | Plan: All plans

Need Help Integrating?

Contact our support team for integration assistance

Contact Support