Appointments
Function-calling namespace: appointments
- 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.
create
Source: backend/endpoints/appointments/create
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
organizationBranchId | string | No | - |
patientId | string | Yes | - |
doctorId | string | Yes | - |
serviceId | string | No | - |
scheduledDate | string | Yes | format: YYYY-MM-DD |
scheduledTime | string | Yes | format: HH:mm |
duration | integer | Yes | min: 1 |
type | string | Yes | - |
status | string | No | default: scheduled |
reason | string | No | - |
notes | string | No | - |
consultationFee | number | No | nullable |
paymentStatus | string | No | - |
amountPaid | number | No | nullable |
paymentMethod | string | No | - |
isPreConsultationCompleted | boolean | No | nullable |
followUpDate | string | No | format: YYYY-MM-DD |
followUpStatus | 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": "appointments",
"apiName": "create",
"data": {
"organizationId": "org_123",
"patientId": "patient_123",
"doctorId": "doctor_123",
"scheduledDate": "2026-03-12",
"scheduledTime": "10:30",
"duration": 30,
"type": "in_person",
"reason": "Follow-up consultation"
}
}'Example Response
{ "status": "ok", "data": {} }createByDoctor
Source: backend/endpoints/appointments/create-by-doctor
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
doctorId | string | Yes | - |
patientDetails | object | Yes | - |
scheduledDate | string | Yes | format: YYYY-MM-DD |
scheduledTime | string | Yes | format: HH:mm |
duration | integer | Yes | min: 1 |
reason | string | No | - |
serviceId | string | No | - |
notes | string | No | - |
Nested Field Structures
patientDetails
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | No | - |
patientName | string | No | - |
dob | string | No | - |
gender | string | No | - |
address | object | No | - |
mobileNumber | string | No | - |
emailId | 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": "appointments",
"apiName": "createByDoctor",
"data": {
"organizationId": "org_123",
"doctorId": "doctor_123",
"patientDetails": {
"id": "id_123",
"patientName": "value",
"dob": "value",
"gender": "value",
"address": "221B Baker Street",
"mobileNumber": "value",
"emailId": "email_123"
},
"scheduledDate": "2026-03-12",
"scheduledTime": "10:30",
"duration": 1
}
}'Example Response
{ "status": "ok", "data": {} }createPending
Source: backend/endpoints/appointments/create-pending
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
patientId | string | Yes | - |
doctorId | string | Yes | - |
serviceId | string | No | - |
scheduledDate | string | Yes | format: YYYY-MM-DD |
scheduledTime | string | Yes | format: HH:mm |
duration | integer | Yes | min: 1 |
type | string | Yes | - |
status | string | No | - |
reason | string | No | - |
notes | string | No | - |
consultationFee | number | No | nullable |
paymentMethod | 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": "appointments",
"apiName": "createPending",
"data": {
"organizationId": "org_123",
"patientId": "patient_123",
"doctorId": "doctor_123",
"scheduledDate": "2026-03-12",
"scheduledTime": "10:30",
"duration": 1,
"type": "general"
}
}'Example Response
{ "status": "ok", "data": {} }createReservedSlotByDoctor
Source: backend/endpoints/appointments/create-reserved-slot-by-doctor
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
doctorId | string | Yes | - |
slotDate | string | Yes | format: YYYY-MM-DD |
startTime | array<string> | Yes | - |
endTime | array<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": "appointments",
"apiName": "createReservedSlotByDoctor",
"data": {
"doctorId": "doctor_123",
"slotDate": "2026-03-12",
"startTime": "10:30",
"endTime": "10:30"
}
}'Example Response
{ "status": "ok", "data": {} }delete
Source: backend/endpoints/appointments/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": "appointments",
"apiName": "delete",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }getByDoctorUserId
Source: backend/endpoints/appointments/get-by-doctor-user-id
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
doctorUserId | string | Yes | - |
organizationId | string | Yes | - |
dateFilter | string | No | - |
status | array<string> | No | - |
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": "appointments",
"apiName": "getByDoctorUserId",
"data": {
"doctorUserId": "doctoruser_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }getById
Source: backend/endpoints/appointments/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": "appointments",
"apiName": "getById",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }getDashboardTrends
Source: backend/endpoints/appointments/get-dashboard-trends
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
period | string | No | - |
date | string | No | format: 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": "appointments",
"apiName": "getDashboardTrends",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }getPatientDetails
Source: backend/endpoints/appointments/get-patient-details
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
appointmentId | 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": "appointments",
"apiName": "getPatientDetails",
"data": {
"appointmentId": "appointment_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }getStats
Source: backend/endpoints/appointments/get-stats
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
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": "appointments",
"apiName": "getStats",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }listByOrganization
Source: backend/endpoints/appointments/list-by-organization
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
searchQuery | string | No | - |
dateFilter | string | No | - |
appointmentType | string | No | - |
scheduledTime | string | No | format: HH:mm |
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": "appointments",
"apiName": "listByOrganization",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }listByPatient
Source: backend/endpoints/appointments/list-by-patient
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
patientId | string | Yes | - |
appointmentDate | string | No | format: YYYY-MM-DD |
status | array<string> | No | - |
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": "appointments",
"apiName": "listByPatient",
"data": {
"patientId": "patient_123"
}
}'Example Response
{ "status": "ok", "data": {} }listByPatientId
Source: backend/endpoints/appointments/list-by-patient-id
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
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": "appointments",
"apiName": "listByPatientId",
"data": {
"organizationId": "org_123",
"patientId": "patient_123"
}
}'Example Response
{ "status": "ok", "data": {} }listReservedSlots
Source: backend/endpoints/appointments/list-reserved-slots
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
doctorId | string | Yes | - |
serviceId | string | No | - |
slotDate | string | No | format: YYYY-MM-DD |
startDate | string | No | format: YYYY-MM-DD |
endDate | string | No | format: 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": "appointments",
"apiName": "listReservedSlots",
"data": {
"doctorId": "doctor_123"
}
}'Example Response
{ "status": "ok", "data": {} }markPaymentSuccess
Source: backend/endpoints/appointments/mark-payment-success
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
amountPaid | number | No | nullable |
paidAt | integer | No | unix-ms timestamp; nullable |
paymentMethod | string | No | - |
gateway | string | No | - |
gatewayOrderId | string | No | - |
gatewayPaymentId | string | No | - |
gatewaySignature | string | No | - |
checkoutSessionId | string | No | - |
status | 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": "appointments",
"apiName": "markPaymentSuccess",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }patientJoinedCall
Source: backend/endpoints/appointments/patient-joined-call
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
appointmentId | 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": "appointments",
"apiName": "patientJoinedCall",
"data": {
"appointmentId": "appointment_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }reschedule
Source: backend/endpoints/appointments/reschedule
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
scheduledDate | string | Yes | format: YYYY-MM-DD |
scheduledTime | string | Yes | format: HH:mm |
duration | integer | No | nullable |
status | string | No | - |
rescheduleReason | string | No | - |
reason | string | No | - |
notes | string | No | - |
consultationFee | number | 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": "appointments",
"apiName": "reschedule",
"data": {
"id": "id_123",
"organizationId": "org_123",
"scheduledDate": "2026-03-12",
"scheduledTime": "10:30"
}
}'Example Response
{ "status": "ok", "data": {} }triggerCallJoinNotification
Source: backend/endpoints/appointments/trigger-call-join-notification
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
appointmentId | string | Yes | - |
organizationId | string | Yes | - |
doctorId | 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": "appointments",
"apiName": "triggerCallJoinNotification",
"data": {
"appointmentId": "appointment_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }update
Source: backend/endpoints/appointments/update
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
serviceId | string | No | nullable |
scheduledDate | string | No | format: YYYY-MM-DD; nullable |
scheduledTime | string | No | format: HH:mm; nullable |
duration | integer | No | nullable |
type | string | No | nullable |
status | string | No | nullable |
reason | string | No | nullable |
notes | string | No | nullable |
rescheduleReason | string | No | nullable |
cancelledAt | integer | No | unix-ms timestamp; nullable |
cancelledReason | string | No | nullable |
consultationFee | number | No | nullable |
paymentStatus | string | No | nullable |
amountPaid | number | No | nullable |
paidAt | integer | No | unix-ms timestamp; nullable |
paymentMethod | string | No | nullable |
isPreConsultationCompleted | boolean | No | nullable |
followUpDate | string | No | format: YYYY-MM-DD; nullable |
followUpStatus | string | No | nullable |
followUpNotificationSent | boolean | 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": "appointments",
"apiName": "update",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }