EndpointsAppointments

Appointments

Function-calling namespace: appointments

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

create

Source: backend/endpoints/appointments/create

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
organizationBranchIdstringNo-
patientIdstringYes-
doctorIdstringYes-
serviceIdstringNo-
scheduledDatestringYesformat: YYYY-MM-DD
scheduledTimestringYesformat: HH:mm
durationintegerYesmin: 1
typestringYes-
statusstringNodefault: scheduled
reasonstringNo-
notesstringNo-
consultationFeenumberNonullable
paymentStatusstringNo-
amountPaidnumberNonullable
paymentMethodstringNo-
isPreConsultationCompletedbooleanNonullable
followUpDatestringNoformat: YYYY-MM-DD
followUpStatusstringNo-

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

FieldTypeRequiredConstraints
organizationIdstringYes-
doctorIdstringYes-
patientDetailsobjectYes-
scheduledDatestringYesformat: YYYY-MM-DD
scheduledTimestringYesformat: HH:mm
durationintegerYesmin: 1
reasonstringNo-
serviceIdstringNo-
notesstringNo-

Nested Field Structures

patientDetails

FieldTypeRequiredConstraints
idstringNo-
patientNamestringNo-
dobstringNo-
genderstringNo-
addressobjectNo-
mobileNumberstringNo-
emailIdstringNo-

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

FieldTypeRequiredConstraints
organizationIdstringYes-
patientIdstringYes-
doctorIdstringYes-
serviceIdstringNo-
scheduledDatestringYesformat: YYYY-MM-DD
scheduledTimestringYesformat: HH:mm
durationintegerYesmin: 1
typestringYes-
statusstringNo-
reasonstringNo-
notesstringNo-
consultationFeenumberNonullable
paymentMethodstringNo-

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

FieldTypeRequiredConstraints
doctorIdstringYes-
slotDatestringYesformat: YYYY-MM-DD
startTimearray<string>Yes-
endTimearray<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

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": "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

FieldTypeRequiredConstraints
doctorUserIdstringYes-
organizationIdstringYes-
dateFilterstringNo-
statusarray<string>No-
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": "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

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": "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

FieldTypeRequiredConstraints
organizationIdstringYes-
periodstringNo-
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": "appointments",
  "apiName": "getDashboardTrends",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

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

getPatientDetails

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

Input Fields

FieldTypeRequiredConstraints
appointmentIdstringYes-
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": "appointments",
  "apiName": "getPatientDetails",
  "data": {
    "appointmentId": "appointment_123",
    "organizationId": "org_123"
  }
}'

Example Response

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

getStats

Source: backend/endpoints/appointments/get-stats

Input Fields

FieldTypeRequiredConstraints
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": "appointments",
  "apiName": "getStats",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

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

listByOrganization

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

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
searchQuerystringNo-
dateFilterstringNo-
appointmentTypestringNo-
scheduledTimestringNoformat: HH:mm
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": "appointments",
  "apiName": "listByOrganization",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

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

listByPatient

Source: backend/endpoints/appointments/list-by-patient

Input Fields

FieldTypeRequiredConstraints
patientIdstringYes-
appointmentDatestringNoformat: YYYY-MM-DD
statusarray<string>No-
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": "appointments",
  "apiName": "listByPatient",
  "data": {
    "patientId": "patient_123"
  }
}'

Example Response

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

listByPatientId

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

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
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": "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

FieldTypeRequiredConstraints
doctorIdstringYes-
serviceIdstringNo-
slotDatestringNoformat: YYYY-MM-DD
startDatestringNoformat: YYYY-MM-DD
endDatestringNoformat: 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

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-
amountPaidnumberNonullable
paidAtintegerNounix-ms timestamp; nullable
paymentMethodstringNo-
gatewaystringNo-
gatewayOrderIdstringNo-
gatewayPaymentIdstringNo-
gatewaySignaturestringNo-
checkoutSessionIdstringNo-
statusstringNo-

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

FieldTypeRequiredConstraints
appointmentIdstringYes-
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": "appointments",
  "apiName": "patientJoinedCall",
  "data": {
    "appointmentId": "appointment_123",
    "organizationId": "org_123"
  }
}'

Example Response

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

reschedule

Source: backend/endpoints/appointments/reschedule

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-
scheduledDatestringYesformat: YYYY-MM-DD
scheduledTimestringYesformat: HH:mm
durationintegerNonullable
statusstringNo-
rescheduleReasonstringNo-
reasonstringNo-
notesstringNo-
consultationFeenumberNo-

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

FieldTypeRequiredConstraints
appointmentIdstringYes-
organizationIdstringYes-
doctorIdstringNo-

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

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-
serviceIdstringNonullable
scheduledDatestringNoformat: YYYY-MM-DD; nullable
scheduledTimestringNoformat: HH:mm; nullable
durationintegerNonullable
typestringNonullable
statusstringNonullable
reasonstringNonullable
notesstringNonullable
rescheduleReasonstringNonullable
cancelledAtintegerNounix-ms timestamp; nullable
cancelledReasonstringNonullable
consultationFeenumberNonullable
paymentStatusstringNonullable
amountPaidnumberNonullable
paidAtintegerNounix-ms timestamp; nullable
paymentMethodstringNonullable
isPreConsultationCompletedbooleanNonullable
followUpDatestringNoformat: YYYY-MM-DD; nullable
followUpStatusstringNonullable
followUpNotificationSentbooleanNonullable

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": {} }