Risk Score AI|API Documentation

Risk Score AI - Public API Documentation

Comprehensive guide for integrating with our organization-based API endpoints

Authentication

All public API endpoints require organization API key authentication. You must first register or login to your organization account to obtain an API key.

Getting Your API Key

To access the public APIs, you need to:

  1. Register: Create a new organization account at the register page
  2. Login: Access your account at the login page
  3. Generate API Key: Use the dashboard to generate your organization-specific API key

Using Your API Key

Once you have your API key, you can provide it in one of the following ways:

1. Query Parameter

bash
GET /api/encounters?apiKey=your_api_key_here

2. Header (Recommended)

bash
x-api-key: your_api_key_here

3. Authorization Header

bash
Authorization: Bearer your_api_key_here

Base URL

bash
https://api.riskscoreai.com/api/v1

All endpoints are relative to this base URL.

Organization Setup

Before you can use the public APIs, you need to set up your organization account and obtain an API key.

Important: After successful registration or login, you'll receive an API key that you can use to authenticate your requests to the public APIs. Keep this API key secure and don't share it publicly.

Encounters API

Calculate Risk Score

POST/encounters/calculate-risk-score

Calculate risk score for an encounter using AI-powered analysis.

Request Body

ParameterTypeRequiredDescription
physicianIdstringRequiredRisk Score registered physician ID (from Add Physician API)
encounterDatestringRequiredDate of the encounter (ISO 8601 format)
soapNotesstringRequiredComplete SOAP notes in text format containing Subjective, Objective, Assessment, and Plan sections

SOAP Notes Format

SOAP Notes Structure (String Format)

The soapNotes parameter should contain a complete clinical note in text format with the following sections:

SUBJECTIVE:
  • Chief Complaint
  • History of Present Illness
  • Past Medical History
  • Current Medications
  • Allergies
  • Social History
OBJECTIVE:
  • Vital Signs
  • Physical Examination
  • Diagnostic Results
  • Laboratory Values
ASSESSMENT:
  • Primary Diagnosis
  • Differential Diagnosis
  • Clinical Reasoning
PLAN:
  • Treatment Plan
  • Patient Instructions
  • Follow-up Plan
  • Safety Requirements

Note: The SOAP notes should be provided as a single string with clear section headers (SUBJECTIVE, OBJECTIVE, ASSESSMENT, PLAN) and well-structured content for optimal AI analysis.

Example Request

json
POST https://api.riskscoreai.com/api/v1/encounters/calculate-risk-score?apiKey=org_abc123...
Content-Type: application/json
{
  "physicianId": "6890742f1039c6d567a787ec",
  "encounterDate": "2025-08-25T14:30:00Z",
  "soapNotes": "SUBJECTIVE:\nChief Complaint: Severe headache and blurred vision\n\nHistory of Present Illness: \nPatient reports the onset of severe headache and blurred vision that started 3 days ago after prolonged screen exposure. The headache is described as throbbing, primarily frontal and temporal, with intensity of 8/10. Associated symptoms include photophobia and mild nausea. No fever, neck stiffness, or neurological deficits noted.\n\nPast Medical History: \n- Hypertension (diagnosed 2018, well-controlled on ACE inhibitors)\n- Migraine (episodic, usually triggered by stress and lack of sleep)\n- No history of head trauma or stroke\n\nCurrent Medications: \n- Lisinopril 10mg daily\n- Ibuprofen PRN for headaches\n\nAllergies: Penicillin (rash)\n\nSocial History: Works as software developer, spends 8-10 hours daily on computer\n\nOBJECTIVE:\nVital Signs:\n- Blood Pressure: 150/95 mmHg\n- Heart Rate: 88 bpm\n- Respiratory Rate: 16 breaths/min  \n- Temperature: 98.6°F (37°C)\n- Oxygen Saturation: 98% on room air\n- BMI: 24.5\n\nPhysical Examination:\nGeneral: Patient appears fatigued but alert and oriented x3. No acute distress.\nHEENT: Pupils equal, round, reactive to light. No papilledema on fundoscopic exam. No neck stiffness or lymphadenopathy.\nCardiovascular: Regular rate and rhythm, no murmurs, gallops, or rubs\nPulmonary: Clear to auscultation bilaterally\nNeurological: Cranial nerves II-XII intact. Motor strength 5/5 in all extremities. Deep tendon reflexes 2+ and symmetric. No focal neurological deficits.\n\nDiagnostic Results: \n- CT scan pending\n- Basic metabolic panel: Within normal limits\n- Complete blood count: WBC 7.2, Hgb 14.5, Plt 250\n\nASSESSMENT:\nPrimary Diagnosis: Migraine exacerbation, likely triggered by prolonged screen exposure and elevated blood pressure\n\nDifferential Diagnosis:\n1. Tension headache - possible but less likely given throbbing nature and photophobia\n2. Cluster headache - timing and characteristics not consistent  \n3. Hypertensive crisis - blood pressure elevated but not in crisis range\n4. Secondary headache due to intracranial pathology - low suspicion given normal neurological exam\n\nClinical Reasoning:\nPatient's presentation is most consistent with migraine exacerbation. The combination of throbbing headache, photophobia, and history of migraines supports this diagnosis. Elevated blood pressure may be contributing factor and requires monitoring. Normal neurological examination makes secondary causes less likely, but CT scan ordered to rule out structural abnormalities given severity of symptoms.\n\nPLAN:\nTreatment Plan:\n1. Prescribed sumatriptan 50mg, may repeat once in 2 hours if needed\n2. Encourage adequate hydration (8-10 glasses water daily)\n3. Rest in dark, quiet environment\n4. Apply cold compress to forehead\n5. Blood pressure management - consider medication adjustment if remains elevated\n\nPatient Instructions:\n- Take sumatriptan at onset of headache symptoms\n- Avoid bright screens and reduce computer usage\n- Implement 20-20-20 rule (every 20 minutes, look at something 20 feet away for 20 seconds)\n- Monitor blood pressure daily\n- Return to ED if headache worsens, develops fever, neck stiffness, or neurological symptoms\n\nFollow-up Plan:\n- Follow-up appointment with primary care physician in 1 week\n- Ophthalmology referral if vision problems persist\n- Consider neurology consultation if migraines become more frequent\n\nSafety Requirements: Patient advised not to drive until symptoms improve and vision clears completely."
}

Example Response

Success Response (200 OK)
json
{
  "message": "Score calculated successfully",
  "data": {
    "encounterId": "68ac44421dbcd43d30b5c15a",
    "scoring": {
      "subjective_score": {
        "chief_complaint_score": 5,
        "history_of_present_illness_score": 10,
        "past_medical_history_score": 5,
        "medications_and_allergies_score": 5,
        "total_score": 25
      },
      "objective_score": {
        "vital_signs_score": 5,
        "physical_examination_score": 10,
        "diagnostic_results_score": 5,
        "measurable_data_quality_score": 5,
        "total_score": 25
      },
      "assessment_score": {
        "primary_diagnosis_score": 10,
        "differential_diagnosis_score": 5,
        "clinical_reasoning_score": 10,
        "total_score": 25
      },
      "plan_score": {
        "treatment_plan_score": 10,
        "patient_instructions_score": 5,
        "follow_up_plan_score": 5,
        "referral_score": 0,
        "total_score": 20
      },
      "critical_elements": {
        "total_score": 0
      }
    },
    "totalScore": 95,
    "riskCategory": "VERY_LOW_RISK"
  }
}

Physicians API

Add Physician

POST/api/v1/insurance-partner-user

Add a new physician to an insurance partner organization.

Request Body

ParameterTypeRequiredDescription
partnerIdstringRequiredSelected insurance partner ID
emailstringRequiredPhysician's email address
firstNamestringRequiredPhysician's first name
lastNamestringRequiredPhysician's last name
companystringRequiredYour Scribe Company Name
specialitystringRequiredPhysician's specialty (e.g., Cardiology)
countrystringRequiredCountry of the physician (ISO country name or code)

Example Request

bash
curl -X POST "https://api.riskscoreai.com/api/v1/insurance-partner-user" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "John",
    "lastName": "Doe",
    "email": "john.doe@clinic.com",
    "company": "Your Scribe Company Name",
    "partnerId": "PARTNER_ID",
    "speciality": "Cardiology",
    "country": "USA"
  }'

Example Response

Success Response (201 Created)
json
{
  "message": "User added successfully",
  "data": {
    "_id": "507f1f77bcf86cd799439014",
    "partnerId": "507f1f77bcf86cd799439013",
    "email": "dr.smith@hospital.com",
    "firstName": "John",
    "lastName": "Smith",
    "isActive": true,
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-01-15T10:30:00Z"
  }
}

Insurance Partners API

Get All Insurance Partners

GET/api/v1/public/insurance-partners

Retrieve a list of all insurance companies/partners in the system.

Headers

HeaderTypeRequiredDescription
x-api-keystringRequiredYour organization API key for authentication

Example Request

bash
curl --location 'https://api.riskscoreai.com/api/v1/public/insurance-partners' \
--header 'x-api-key: YOUR_API_KEY_HERE' \
--header 'Accept: application/json'

Example Response

Success Response (200 OK)
json
{
    "partners": [
        {
            "id": "688ca2ae91f138cddf323b60",
            "companyName": "Estes Clark Trading",
            "logoUrl": "https://res.cloudinary.com/dyfd8fgyy/image/upload/v1749644221/floush7ykmgzv0xsarmu.png"
        },
        {
            "id": "68906851c7ce08af4e4e034d",
            "companyName": "Test hereeeeegergerg",
            "logoUrl": "https://res.cloudinary.com/dyfd8fgyy/image/upload/v1749644221/floush7ykmgzv0xsarmu.png"
        },
        {
            "id": "6890a58edb48cd2bce673dd3",
            "companyName": "Sanford and Lopez LLC",
            "logoUrl": "https://www.xirofab.org"
        }
    ],
    "total": 3
}

Response Fields

FieldTypeDescription
partnersarrayList of partners with id, companyName, logoUrl
totalnumberTotal number of partners returned
;

Error Codes

Status CodeError TypeDescription
400Bad RequestInvalid request parameters or missing required fields
401UnauthorizedInvalid or missing API key
403ForbiddenAPI key is valid but organization is inactive
404Not FoundResource not found (encounter, physician, etc.)
409ConflictResource already exists (e.g., physician with same email)
422Unprocessable EntityInvalid data format or validation errors
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer error occurred

Example Error Response

json
{
  "statusCode": 401,
  "message": "API key is required",
  "error": "Unauthorized"
}

Rate Limiting

To ensure fair usage and system stability, API requests are rate-limited per organization:

  • Default Limit: 1000 requests per hour per organization
  • Burst Limit: 100 requests per minute
  • Headers: Rate limit information is included in response headers

Rate Limit Headers

bash
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1642233600

Note: When rate limit is exceeded, the API returns a 429 status code with a retry-after header indicating when you can make requests again.

Support

For technical support, API key management, or general inquiries:

  • Email: support@riskscoreai.com

Important: Always include your organization email in the subject in support requests for faster resolution.