EndpointsHealth Passports

Health Passports

Function-calling namespace: healthPassports

  • 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/health-passports/create

Input Fields

FieldTypeRequiredConstraints
patientIdstringNo-
patientProfileIdstringNo-
stackUserIdstringNo-
statusstringNo-
recordNamestringNo-
categorystringNo-
doctorNamestringNo-
recordGenerationDatestringNoformat: YYYY-MM-DD
documentsarray<string>No-
documentUrlsarray<string>No-
additionalNotesstringNo-
medicalRecordsarray<object>No-

Nested Field Structures

medicalRecords item

FieldTypeRequiredConstraints
recordNamestringNo-
categorystringNo-
doctorNamestringNo-
organizationNamestringNo-
recordGenerationDatestringNoformat: YYYY-MM-DD
documentsarray<string>No-
additionalNotesstringNo-

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": "healthPassports",
  "apiName": "create",
  "data": {
    "patientId": "patient_123",
    "status": "scheduled",
    "medicalRecords": [
      {
        "recordName": "value",
        "category": "value",
        "doctorName": "value",
        "organizationName": "value",
        "recordGenerationDate": "2026-03-12",
        "documents": [
          "value"
        ],
        "additionalNotes": "value"
      }
    ]
  }
}'

Example Response

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

deleteMedicalRecord

Source: backend/endpoints/health-passports/delete-medical-record

Input Fields

FieldTypeRequiredConstraints
idstringYes-

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": "healthPassports",
  "apiName": "deleteMedicalRecord",
  "data": {
    "id": "id_123"
  }
}'

Example Response

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

getById

Source: backend/endpoints/health-passports/get-by-id

Input Fields

FieldTypeRequiredConstraints
idstringYes-

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

Example Response

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

getByPatientId

Source: backend/endpoints/health-passports/get-by-patient-id

Input Fields

FieldTypeRequiredConstraints
patientIdstringYes-

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

Example Response

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

getMine

Source: backend/endpoints/health-passports/get-mine

Input Fields

FieldTypeRequiredConstraints
stackUserIdstringNo-

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": "healthPassports",
  "apiName": "getMine",
  "data": {
    "stackUserId": "stackuser_123"
  }
}'

Example Response

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

update

Source: backend/endpoints/health-passports/update

Input Fields

FieldTypeRequiredConstraints
idstringYes-
statusstringNonullable
documentUrlsarray<string>No-
medicalRecordsarray<object>No-
additionalNotesstringNonullable
isDeletedbooleanNonullable
deletedAtintegerNounix-ms timestamp; nullable

Nested Field Structures

medicalRecords item

FieldTypeRequiredConstraints
idstringNo-
passportIdstringNo-
recordNamestringNo-
categorystringNo-
doctorNamestringNo-
organizationNamestringNo-
recordGenerationDatestringNoformat: YYYY-MM-DD
documentsarray<string>No-
additionalNotesstringNo-
createdAtintegerNounix-ms timestamp
updatedAtintegerNounix-ms timestamp

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": "healthPassports",
  "apiName": "update",
  "data": {
    "id": "id_123"
  }
}'

Example Response

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