EndpointsConsultations

Consultations

Function-calling namespace: consultations

  • 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.

assignTherapist

Source: backend/endpoints/consultations/assign-therapist

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
consultationIdstringYes-
therapistUserIdstringYes-
assignmentDatestringYesformat: YYYY-MM-DD
serviceIdstringNo-

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": "consultations",
  "apiName": "assignTherapist",
  "data": {
    "organizationId": "org_123",
    "consultationId": "consultation_123",
    "therapistUserId": "therapistuser_123",
    "assignmentDate": "2026-03-12"
  }
}'

Example Response

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

create

Source: backend/endpoints/consultations/create

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
appointmentIdstringYes-
patientIdstringYes-
doctorIdstringYes-
chiefComplaintstringNo-
symptomsarray<string>No-
diagnosisstringNo-
clinicalNotesstringNo-
followUpDatestringNoformat: YYYY-MM-DD
followUpInstructionsstringNo-
medicationsarray<object>No-
labTestsarray<object>No-
instructionsarray<object>No-
proceduresarray<object>No-
hangoutsarray<object>No-
vitalsarray<object>No-
prescriptionsarray<object>No-
labOrdersarray<object>No-
recordingUrlstringNo-
audioRecordingUrlstringNo-
subjectivearray<string>No-
objectivearray<string>No-
interventionsUsedarray<string>No-
nextSessionobjectNonullable
lifestyleRecommendationsarray<string>No-
restrictionsarray<string>No-
dosAndDontsobjectNonullable
isDraftbooleanNonullable
consultationComplaintsarray<object>Nonullable
consultationFindingsarray<object>Nonullable
consultationDiagnosisarray<object>Nonullable

Nested Field Structures

medications item

FieldTypeRequiredConstraints
namestringNo-
medicine_typestringNo-
dosagestringNo-
morningbooleanNo-
afternoonbooleanNo-
eveningbooleanNo-
nightbooleanNo-
sosbooleanNo-
statbooleanNo-
duration_valueintegerNo-
duration_unitstringNo-
food_timingstringNo-

labTests item

FieldTypeRequiredConstraints
namestringNo-
dateanyNo-

instructions item

FieldTypeRequiredConstraints
namestringNo-

procedures item

FieldTypeRequiredConstraints
namestringNo-
dateintegerNo-

hangouts item

FieldTypeRequiredConstraints
idstringNo-

vitals item

FieldTypeRequiredConstraints
bloodPressurestringNo-
heartRatenumberNonullable
temperatureobjectNonullable
oxygenSaturationnumberNonullable
respiratoryRatenumberNonullable
weightnumberNonullable
heightnumberNonullable

prescriptions item

FieldTypeRequiredConstraints
medicationsarray<object>No-
notesstringNo-

labOrders item

FieldTypeRequiredConstraints
testsarray<object>No-
prioritystringNo-
notesstringNo-

nextSession

FieldTypeRequiredConstraints
startDatestringNoformat: YYYY-MM-DD
timestringNoformat: HH:mm
repeatstringNo-
numberOfSessionsintegerNo-
recurrenceGroupIdstringNo-

dosAndDonts

FieldTypeRequiredConstraints
dosarray<string>No-
dontsarray<string>No-

consultationComplaints item

FieldTypeRequiredConstraints
namestringNo-
durationValuenumberNonullable
durationUnitstringNo-
notestringNo-

consultationFindings item

FieldTypeRequiredConstraints
namestringNo-
notestringNo-

consultationDiagnosis item

FieldTypeRequiredConstraints
namestringNo-
notestringNo-
rankintegerNo-
isPrimarybooleanNo-

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": "consultations",
  "apiName": "create",
  "data": {
    "organizationId": "org_123",
    "appointmentId": "appointment_123",
    "patientId": "patient_123",
    "doctorId": "doctor_123"
  }
}'

Example Response

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

delete

Source: backend/endpoints/consultations/delete

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-

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": "consultations",
  "apiName": "delete",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

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

getById

Source: backend/endpoints/consultations/get-by-id

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-

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": "consultations",
  "apiName": "getById",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

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

getPatientConsultationDetails

Source: backend/endpoints/consultations/get-patient-details

Input Fields

FieldTypeRequiredConstraints
consultationIdstringNo-
patientIdstringNo-
appointmentIdstringNo-
languagestringNo-

Translation Notes

  • language is optional. Supported values are english/en, tamil/ta, hindi/hi, and telugu/te.
  • Empty language or English returns the original English data.
  • Translation is applied dynamically to the response DTO after reading the English data from PostgreSQL.
  • The API does not store translated values in the database.
  • Translation provider failures fall back to the original English text.
  • This patient-facing details API does not require a Stack authentication token in the request payload.

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": "consultations",
  "apiName": "getPatientConsultationDetails",
  "data": {
    "appointmentId": "1779175596213010000-C0saMcys",
    "language": "tamil"
  }
}'

Example Response

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

getProcedureAssignment

Source: backend/endpoints/consultations/get-procedure-assignment

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
consultationIdstringYes-
procedureIdstringYes-
doctorIdstringYes-

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": "consultations",
  "apiName": "getProcedureAssignment",
  "data": {
    "organizationId": "org_123",
    "consultationId": "consultation_123",
    "procedureId": "procedure_123",
    "doctorId": "doctor_123"
  }
}'

Example Response

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

listByDoctorId

Source: backend/endpoints/consultations/list-by-doctor-id

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
doctorIdstringYes-
pageintegerNo-
pageSizeintegerNo-

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": "consultations",
  "apiName": "listByDoctorId",
  "data": {
    "organizationId": "org_123",
    "doctorId": "doctor_123"
  }
}'

Example Response

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

listByOrganization

Source: backend/endpoints/consultations/list-by-organization

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
pageintegerNo-
pageSizeintegerNo-

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": "consultations",
  "apiName": "listByOrganization",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

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

listByPatientId

Source: backend/endpoints/consultations/list-by-patient-id

Input Fields

FieldTypeRequiredConstraints
organizationIdstringNo-
patientIdstringYes-
pageintegerNo-
pageSizeintegerNo-

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": "consultations",
  "apiName": "listByPatientId",
  "data": {
    "patientId": "patient_123"
  }
}'

Example Response

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

listByProcedureDoctorId

Source: backend/endpoints/consultations/list-by-procedure-doctor-id

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
doctorIdstringYes-
pageintegerNo-
pageSizeintegerNo-

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": "consultations",
  "apiName": "listByProcedureDoctorId",
  "data": {
    "organizationId": "org_123",
    "doctorId": "doctor_123"
  }
}'

Example Response

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

update

Source: backend/endpoints/consultations/update

Input Fields

FieldTypeRequiredConstraints
consultationIdstringNo-
appointmentIdstringNo-
organizationIdstringNo-
diagnosisstringNonullable
clinicalNotesstringNonullable
medicationsarray<object>Nonullable
labTestsarray<object>Nonullable
instructionsarray<object>Nonullable
proceduresarray<object>Nonullable
hangoutsarray<object>Nonullable
audioRecordingUrlstringNonullable
subjectivearray<string>Nonullable
objectivearray<string>Nonullable
interventionsUsedarray<string>Nonullable
nextSessionobjectNonullable
lifestyleRecommendationsarray<string>Nonullable
restrictionsarray<string>Nonullable
dosAndDontsobjectNonullable
isFeedbackCompletedbooleanNonullable
ratingintegerNonullable
feedbackstringNonullable
consultationComplaintsarray<object>Nonullable
consultationFindingsarray<object>Nonullable
consultationDiagnosisarray<object>Nonullable

Nested Field Structures

medications item

FieldTypeRequiredConstraints
namestringNo-
medicine_typestringNo-
dosagestringNo-
morningbooleanNo-
afternoonbooleanNo-
eveningbooleanNo-
nightbooleanNo-
sosbooleanNo-
statbooleanNo-
duration_valueintegerNo-
duration_unitstringNo-
food_timingstringNo-

labTests item

FieldTypeRequiredConstraints
namestringNo-
dateanyNo-

instructions item

FieldTypeRequiredConstraints
namestringNo-

procedures item

FieldTypeRequiredConstraints
namestringNo-
dateintegerNo-

hangouts item

FieldTypeRequiredConstraints
idstringNo-

nextSession

FieldTypeRequiredConstraints
startDatestringNoformat: YYYY-MM-DD
timestringNoformat: HH:mm
repeatstringNo-
numberOfSessionsintegerNo-
recurrenceGroupIdstringNo-

dosAndDonts

FieldTypeRequiredConstraints
dosarray<string>No-
dontsarray<string>No-

consultationComplaints item

FieldTypeRequiredConstraints
namestringNo-
durationValuenumberNonullable
durationUnitstringNo-
notestringNo-

consultationFindings item

FieldTypeRequiredConstraints
namestringNo-
notestringNo-

consultationDiagnosis item

FieldTypeRequiredConstraints
namestringNo-
notestringNo-
rankintegerNo-
isPrimarybooleanNo-

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": "consultations",
  "apiName": "update",
  "data": {
    "organizationId": "org_123",
    "appointmentId": "appointment_123",
    "medications": [
      {
        "name": "value",
        "medicine_type": "general",
        "dosage": "value",
        "morning": true,
        "afternoon": true,
        "evening": true,
        "night": true,
        "sos": true,
        "stat": true,
        "duration_value": 1,
        "duration_unit": "value",
        "food_timing": "value"
      }
    ],
    "labTests": [
      {
        "name": "value",
        "date": "2026-03-12"
      }
    ],
    "instructions": [
      {
        "name": "value"
      }
    ],
    "procedures": [
      {
        "name": "value",
        "date": "2026-03-12"
      }
    ],
    "hangouts": [
      {
        "id": "id_123"
      }
    ],
    "nextSession": {
      "startDate": "2026-03-12",
      "time": "10:30",
      "repeat": "value",
      "numberOfSessions": 1,
      "recurrenceGroupId": "recurrencegroup_123"
    },
    "dosAndDonts": {
      "dos": [
        "value"
      ],
      "donts": [
        "value"
      ]
    },
    "consultationComplaints": [
      {
        "name": "value",
        "durationValue": 1,
        "durationUnit": "value",
        "note": "value"
      }
    ],
    "consultationFindings": [
      {
        "name": "value",
        "note": "value"
      }
    ],
    "consultationDiagnosis": [
      {
        "name": "value",
        "note": "value",
        "rank": 1,
        "isPrimary": true
      }
    ]
  }
}'

Example Response

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

updateProcedureTherapy

Source: backend/endpoints/consultations/update-procedure-therapy

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
consultationIdstringYes-
procedureIdstringYes-
doctorIdstringYes-
therapyDetailsobjectNo-
statusstringNonullable

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": "consultations",
  "apiName": "updateProcedureTherapy",
  "data": {
    "organizationId": "org_123",
    "consultationId": "consultation_123",
    "procedureId": "procedure_123",
    "doctorId": "doctor_123"
  }
}'

Example Response

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