Consultations
Function-calling namespace: consultations
- Base URL:
https://api.aivida.in - Engine endpoint:
POST /api - Auth: Stack token middleware enabled in
optionalmode. - Send token in header:
x-stack-access-token: <access_token>(orAuthorization: Bearer <access_token>). - In
optionalmode: no token is allowed; invalid token is rejected with401.
assignTherapist
Source: backend/endpoints/consultations/assign-therapist
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
consultationId | string | Yes | - |
therapistUserId | string | Yes | - |
assignmentDate | string | Yes | format: YYYY-MM-DD |
serviceId | string | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
appointmentId | string | Yes | - |
patientId | string | Yes | - |
doctorId | string | Yes | - |
chiefComplaint | string | No | - |
symptoms | array<string> | No | - |
diagnosis | string | No | - |
clinicalNotes | string | No | - |
followUpDate | string | No | format: YYYY-MM-DD |
followUpInstructions | string | No | - |
medications | array<object> | No | - |
labTests | array<object> | No | - |
instructions | array<object> | No | - |
procedures | array<object> | No | - |
hangouts | array<object> | No | - |
vitals | array<object> | No | - |
prescriptions | array<object> | No | - |
labOrders | array<object> | No | - |
recordingUrl | string | No | - |
audioRecordingUrl | string | No | - |
subjective | array<string> | No | - |
objective | array<string> | No | - |
interventionsUsed | array<string> | No | - |
nextSession | object | No | nullable |
lifestyleRecommendations | array<string> | No | - |
restrictions | array<string> | No | - |
dosAndDonts | object | No | nullable |
isDraft | boolean | No | nullable |
consultationComplaints | array<object> | No | nullable |
consultationFindings | array<object> | No | nullable |
consultationDiagnosis | array<object> | No | nullable |
Nested Field Structures
medications item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
medicine_type | string | No | - |
dosage | string | No | - |
morning | boolean | No | - |
afternoon | boolean | No | - |
evening | boolean | No | - |
night | boolean | No | - |
sos | boolean | No | - |
stat | boolean | No | - |
duration_value | integer | No | - |
duration_unit | string | No | - |
food_timing | string | No | - |
labTests item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
date | any | No | - |
instructions item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
procedures item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
date | integer | No | - |
hangouts item
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | No | - |
vitals item
| Field | Type | Required | Constraints |
|---|---|---|---|
bloodPressure | string | No | - |
heartRate | number | No | nullable |
temperature | object | No | nullable |
oxygenSaturation | number | No | nullable |
respiratoryRate | number | No | nullable |
weight | number | No | nullable |
height | number | No | nullable |
prescriptions item
| Field | Type | Required | Constraints |
|---|---|---|---|
medications | array<object> | No | - |
notes | string | No | - |
labOrders item
| Field | Type | Required | Constraints |
|---|---|---|---|
tests | array<object> | No | - |
priority | string | No | - |
notes | string | No | - |
nextSession
| Field | Type | Required | Constraints |
|---|---|---|---|
startDate | string | No | format: YYYY-MM-DD |
time | string | No | format: HH:mm |
repeat | string | No | - |
numberOfSessions | integer | No | - |
recurrenceGroupId | string | No | - |
dosAndDonts
| Field | Type | Required | Constraints |
|---|---|---|---|
dos | array<string> | No | - |
donts | array<string> | No | - |
consultationComplaints item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
durationValue | number | No | nullable |
durationUnit | string | No | - |
note | string | No | - |
consultationFindings item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
note | string | No | - |
consultationDiagnosis item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
note | string | No | - |
rank | integer | No | - |
isPrimary | boolean | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
consultationId | string | No | - |
patientId | string | No | - |
appointmentId | string | No | - |
language | string | No | - |
Translation Notes
languageis optional. Supported values areenglish/en,tamil/ta,hindi/hi, andtelugu/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
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
consultationId | string | Yes | - |
procedureId | string | Yes | - |
doctorId | string | Yes | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
doctorId | string | Yes | - |
page | integer | No | - |
pageSize | integer | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
page | integer | No | - |
pageSize | integer | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | No | - |
patientId | string | Yes | - |
page | integer | No | - |
pageSize | integer | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
doctorId | string | Yes | - |
page | integer | No | - |
pageSize | integer | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
consultationId | string | No | - |
appointmentId | string | No | - |
organizationId | string | No | - |
diagnosis | string | No | nullable |
clinicalNotes | string | No | nullable |
medications | array<object> | No | nullable |
labTests | array<object> | No | nullable |
instructions | array<object> | No | nullable |
procedures | array<object> | No | nullable |
hangouts | array<object> | No | nullable |
audioRecordingUrl | string | No | nullable |
subjective | array<string> | No | nullable |
objective | array<string> | No | nullable |
interventionsUsed | array<string> | No | nullable |
nextSession | object | No | nullable |
lifestyleRecommendations | array<string> | No | nullable |
restrictions | array<string> | No | nullable |
dosAndDonts | object | No | nullable |
isFeedbackCompleted | boolean | No | nullable |
rating | integer | No | nullable |
feedback | string | No | nullable |
consultationComplaints | array<object> | No | nullable |
consultationFindings | array<object> | No | nullable |
consultationDiagnosis | array<object> | No | nullable |
Nested Field Structures
medications item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
medicine_type | string | No | - |
dosage | string | No | - |
morning | boolean | No | - |
afternoon | boolean | No | - |
evening | boolean | No | - |
night | boolean | No | - |
sos | boolean | No | - |
stat | boolean | No | - |
duration_value | integer | No | - |
duration_unit | string | No | - |
food_timing | string | No | - |
labTests item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
date | any | No | - |
instructions item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
procedures item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
date | integer | No | - |
hangouts item
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | No | - |
nextSession
| Field | Type | Required | Constraints |
|---|---|---|---|
startDate | string | No | format: YYYY-MM-DD |
time | string | No | format: HH:mm |
repeat | string | No | - |
numberOfSessions | integer | No | - |
recurrenceGroupId | string | No | - |
dosAndDonts
| Field | Type | Required | Constraints |
|---|---|---|---|
dos | array<string> | No | - |
donts | array<string> | No | - |
consultationComplaints item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
durationValue | number | No | nullable |
durationUnit | string | No | - |
note | string | No | - |
consultationFindings item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
note | string | No | - |
consultationDiagnosis item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
note | string | No | - |
rank | integer | No | - |
isPrimary | boolean | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
consultationId | string | Yes | - |
procedureId | string | Yes | - |
doctorId | string | Yes | - |
therapyDetails | object | No | - |
status | string | No | nullable |
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": {} }