EndpointsMedication Logs

Medication Logs

Function-calling namespace: medicationLogs

  • Base URL: https://api.aivida.in
  • Engine endpoint: POST /api
  • Auth: Stack token middleware enabled in optional mode.
  • Send token in header: x-stack-access-token: <access_token> (or Authorization: Bearer <access_token>).
  • In optional mode: no token is allowed; invalid token is rejected with 401.

createReminder

Source: backend/endpoints/medication-logs/create-reminder

Input Fields

FieldTypeRequiredConstraints
stackUserIdstringYes-
medicineNamestringYes-
medicineTypestringNooneof: TABLET
frequencystringNooneof: ONCE_DAILY
reminderTimesarray<string>Yesmin items: 1; unique HH:mm values
startDatestringYesformat: YYYY-MM-DD
endDatestringNoformat: YYYY-MM-DD
notesstringNo-
isEnabledbooleanNonullable; default: true

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "createReminder",
  "data": {
    "stackUserId": "stackuser_123",
    "medicineName": "Paracetamol 500mg",
    "medicineType": "TABLET",
    "frequency": "THREE_TIMES_DAILY",
    "reminderTimes": [
      "08:00",
      "13:00",
      "20:00"
    ],
    "startDate": "2026-06-25",
    "endDate": "2026-07-02",
    "notes": "After food",
    "isEnabled": true
  }
}'

Example Response

{ "status": "ok", "data": {} }

deleteReminder

Source: backend/endpoints/medication-logs/delete-reminder

Input Fields

FieldTypeRequiredConstraints
idstringYes-
stackUserIdstringYes-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "deleteReminder",
  "data": {
    "id": "reminder_123",
    "stackUserId": "stackuser_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

generateMedicationSchedule

Source: backend/endpoints/medication-logs/generate-medication-schedule

Input Fields

FieldTypeRequiredConstraints
stackUserIdstringYes-
prescriptionIdstringYes-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "generateMedicationSchedule",
  "data": {
    "stackUserId": "stackuser_123",
    "prescriptionId": "prescription_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getActivePrescriptionsWithTracking

Source: backend/endpoints/medication-logs/get-active-prescriptions-with-tracking

Input Fields

FieldTypeRequiredConstraints
stackUserIdstringYes-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "getActivePrescriptionsWithTracking",
  "data": {
    "stackUserId": "stackuser_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getAdherenceStats

Source: backend/endpoints/medication-logs/get-adherence-stats

Input Fields

FieldTypeRequiredConstraints
stackUserIdstringYes-
prescriptionIdstringNo-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "getAdherenceStats",
  "data": {
    "stackUserId": "stackuser_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getMedicationHistory

Source: backend/endpoints/medication-logs/get-medication-history

Input Fields

FieldTypeRequiredConstraints
stackUserIdstringYes-
startDatestringNoformat: YYYY-MM-DD
endDatestringNoformat: YYYY-MM-DD
limitintegerNomin: 1; max: 365

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "getMedicationHistory",
  "data": {
    "stackUserId": "stackuser_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getPrescriptionProgress

Source: backend/endpoints/medication-logs/get-prescription-progress

Input Fields

FieldTypeRequiredConstraints
stackUserIdstringYes-
prescriptionIdstringYes-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "getPrescriptionProgress",
  "data": {
    "stackUserId": "stackuser_123",
    "prescriptionId": "prescription_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getTodaysMedications

Source: backend/endpoints/medication-logs/get-todays-medications

Input Fields

FieldTypeRequiredConstraints
stackUserIdstringYes-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "getTodaysMedications",
  "data": {
    "stackUserId": "stackuser_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

listActiveReminders

Source: backend/endpoints/medication-logs/list-active-reminders

Input Fields

FieldTypeRequiredConstraints
stackUserIdstringYes-
datestringNoformat: YYYY-MM-DD

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "listActiveReminders",
  "data": {
    "stackUserId": "stackuser_123",
    "date": "2026-06-25"
  }
}'

Example Response

{ "status": "ok", "data": {} }

markMedicationSkipped

Source: backend/endpoints/medication-logs/mark-medication-skipped

Input Fields

FieldTypeRequiredConstraints
stackUserIdstringYes-
logIdstringYes-
notesstringNo-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "markMedicationSkipped",
  "data": {
    "stackUserId": "stackuser_123",
    "logId": "log_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

markMedicationTaken

Source: backend/endpoints/medication-logs/mark-medication-taken

Input Fields

FieldTypeRequiredConstraints
stackUserIdstringYes-
logIdstringYes-
notesstringNo-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "markMedicationTaken",
  "data": {
    "stackUserId": "stackuser_123",
    "logId": "log_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

markMissedMedications

Source: backend/endpoints/medication-logs/mark-missed-medications

Input Fields

FieldTypeRequiredConstraints
stackUserIdstringYes-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "markMissedMedications",
  "data": {
    "stackUserId": "stackuser_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

toggleReminder

Source: backend/endpoints/medication-logs/toggle-reminder

Input Fields

FieldTypeRequiredConstraints
idstringYes-
stackUserIdstringYes-
isEnabledbooleanNo-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "toggleReminder",
  "data": {
    "id": "reminder_123",
    "stackUserId": "stackuser_123",
    "isEnabled": false
  }
}'

Example Response

{ "status": "ok", "data": {} }

updateReminder

Source: backend/endpoints/medication-logs/update-reminder

Input Fields

FieldTypeRequiredConstraints
idstringYes-
stackUserIdstringYes-
medicineNamestringYes-
medicineTypestringNooneof: TABLET
frequencystringNooneof: ONCE_DAILY
reminderTimesarray<string>Yesmin items: 1; unique HH:mm values
startDatestringYesformat: YYYY-MM-DD
endDatestringNoformat: YYYY-MM-DD
notesstringNo-
isEnabledbooleanNonullable

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "medicationLogs",
  "apiName": "updateReminder",
  "data": {
    "id": "reminder_123",
    "stackUserId": "stackuser_123",
    "medicineName": "Paracetamol 500mg",
    "medicineType": "TABLET",
    "frequency": "TWICE_DAILY",
    "reminderTimes": [
      "08:00",
      "20:00"
    ],
    "startDate": "2026-06-25",
    "endDate": "2026-07-02",
    "notes": "After food",
    "isEnabled": true
  }
}'

Example Response

{ "status": "ok", "data": {} }