EndpointsPatient Documents

Patient Documents

Function-calling namespace: patientDocuments

  • 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/patient-documents/create

Input Fields

FieldTypeRequiredConstraints
patientProfileIdstringYes-
stackUserIdstringYes-
namestringYes-
typestringYes-
fileIdstringYes-
fileUrlstringNo-
fileNamestringYes-
fileSizeintegerYes-
mimeTypestringYes-
descriptionstringNo-
documentDatestringNoformat: YYYY-MM-DD
hospitalNamestringNo-
doctorNamestringNo-
isDeletedbooleanNonullable
deletedAtintegerNounix-ms timestamp; nullable
createdAtintegerNounix-ms timestamp; nullable
updatedAtintegerNounix-ms timestamp; 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": "patientDocuments",
  "apiName": "create",
  "data": {
    "patientProfileId": "patientprofile_123",
    "stackUserId": "stackuser_123",
    "name": "value",
    "type": "general",
    "fileId": "file_123",
    "fileName": "value",
    "fileSize": 1,
    "mimeType": "general"
  }
}'

Example Response

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

delete

Source: backend/endpoints/patient-documents/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": "patientDocuments",
  "apiName": "delete",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

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

getById

Source: backend/endpoints/patient-documents/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": "patientDocuments",
  "apiName": "getById",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

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

listByOrganization

Source: backend/endpoints/patient-documents/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": "patientDocuments",
  "apiName": "listByOrganization",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

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

update

Source: backend/endpoints/patient-documents/update

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-
patientProfileIdstringNonullable
stackUserIdstringNonullable
namestringNonullable
typestringNonullable
fileIdstringNonullable
fileUrlstringNonullable
fileNamestringNonullable
fileSizeintegerNonullable
mimeTypestringNonullable
descriptionstringNonullable
documentDatestringNoformat: YYYY-MM-DD; nullable
hospitalNamestringNonullable
doctorNamestringNonullable
isDeletedbooleanNonullable
deletedAtintegerNounix-ms timestamp; nullable
createdAtintegerNounix-ms timestamp; nullable
updatedAtintegerNounix-ms timestamp; 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": "patientDocuments",
  "apiName": "update",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

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