EndpointsLab Orders

Lab Orders

Function-calling namespace: labOrders

  • 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/lab-orders/create

Input Fields

FieldTypeRequired
organizationIdstringNo
selectedLabIdstringNo
patientIdstringYes
doctorIdstringNo
consultationIdstringNo
orderIdstringNo
tests[]models.LabOrderTestYes
statusstringYes
prioritystringYes
notesstringNo
assignedTostringNo
completedAt*int64No
completedBystringNo
createdAt*int64No
updatedAt*int64No

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": "labOrders",
  "apiName": "create",
  "data": {
    "patientId": "patient_123",
    "tests": [],
    "status": "ACTIVE",
    "priority": "value"
  }
}'

Example Response

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

delete

Source: backend/endpoints/lab-orders/delete

Input Fields

FieldTypeRequired
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": "labOrders",
  "apiName": "delete",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

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

getById

Source: backend/endpoints/lab-orders/get-by-id

Input Fields

FieldTypeRequired
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": "labOrders",
  "apiName": "getById",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

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

listByOrganization

Source: backend/endpoints/lab-orders/list-by-organization

Input Fields

FieldTypeRequired
organizationIdstringYes
pageintNo
pageSizeintNo

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": "labOrders",
  "apiName": "listByOrganization",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

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

update

Source: backend/endpoints/lab-orders/update

Input Fields

FieldTypeRequired
idstringYes
organizationIdstringNo
selectedLabId*stringNo
patientId*stringNo
doctorId*stringNo
consultationId*stringNo
orderId*stringNo
tests*[]models.LabOrderTestNo
status*stringNo
priority*stringNo
notes*stringNo
assignedTo*stringNo
completedAt*int64No
completedBy*stringNo
createdAt*int64No
updatedAt*int64No

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

Example Response

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