EndpointsOrganizations

Organizations

Function-calling namespace: organizations

  • 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/organizations/create

Input Fields

FieldTypeRequiredConstraints
stackTeamIdstringYes-
namestringYes-
slugstringNo-
verificationStatusstringNo-
typestringNo-
organizationTypeIdstringNouuid
facilitiesobjectNo-
logoIdstringNo-
logoUrlstringNo-
settingsobjectNo-
addressobjectNo-
coordinatesobjectNo-
addressStreetstringNo-
addressCitystringNo-
addressStatestringNo-
addressPostalCodestringNo-
addressCountrystringNo-
contactEmailstringNo-
contactPhonestringNo-
contactCustomerCarePhonestringNo-
contactCustomerCareEmailstringNo-
customerCarePhonestringNo-
customerCareEmailstringNo-
bankDetailsobjectNo-
openingHoursobjectNo-
serviceAudiencesarray<string>Nodive; oneof: MEN
serviceOccasionsarray<string>Nodive; oneof: BRIDE
isActivebooleanNo-
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": "organizations",
  "apiName": "create",
  "data": {
    "stackTeamId": "org_123",
    "name": "value"
  }
}'

Example Response

{
  "status": "ok",
  "data": {
    "items": [
      {
        "organizationId": "org_123",
        "organizationBranchId": "branch_123",
        "slug": "aivida-pharmacy",
        "name": "Aivida Pharmacy",
        "lat": 13.0827,
        "log": 80.2707,
        "address": "123 Main Street, Chennai, Tamil Nadu, 600001, India",
        "ratings": 4.5,
        "reviewCount": 12,
        "productsCount": 42,
        "todayOpeningHours": {
          "day": "monday",
          "isOpen": true,
          "is24Hours": false,
          "from": "09:00",
          "to": "21:00"
        },
        "imageUrl": "https://cdn.aivida.in/pharmacy-front.jpg",
        "distanceKm": 2.35
      }
    ],
    "total": 1,
    "totalPharmacyCount": 25,
    "nearbyPharmacyCount": 1,
    "page": 1,
    "pageSize": 20,
    "totalPages": 1
  }
}

Response Notes

  • items[].organizationBranchId is included only when the returned pharmacy location is a branch.
  • Organization-level pharmacy results omit organizationBranchId.

delete

Source: backend/endpoints/organizations/delete

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-
deleteModestringNo-
modestringNo-
hardDeletebooleanNonullable

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

Example Response

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

diagnosticServicesStats

Source: backend/endpoints/organizations/diagnostic-services-stats

Input Fields

FieldTypeRequiredConstraints
idstringNo-
namestringNo-
codestringNo-
labTestCountintegerNo-
imagingCountintegerNo-
labPackageCountintegerNo-
totalCountintegerNo-

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": "organizations",
  "apiName": "diagnosticServicesStats",
  "data": {
    "id": "id_123",
    "name": "value"
  }
}'

Example Response

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

getById

Source: backend/endpoints/organizations/get-by-id

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringNo-

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

Example Response

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

getByName

Source: backend/endpoints/organizations/get-by-name

Input Fields

FieldTypeRequiredConstraints
namestringYes-

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": "organizations",
  "apiName": "getByName",
  "data": {
    "name": "value"
  }
}'

Example Response

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

getByStackTeamId

Source: backend/endpoints/organizations/get-by-stack-team-id

Input Fields

FieldTypeRequiredConstraints
stackTeamIdstringYes-

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": "organizations",
  "apiName": "getByStackTeamId",
  "data": {
    "stackTeamId": "org_123"
  }
}'

Example Response

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

getLocations

Source: backend/endpoints/organizations/get-locations

Input Fields

FieldTypeRequiredConstraints
organizationIdsarray<string>Yesmin: 1; dive

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": "organizations",
  "apiName": "getLocations",
  "data": {
    "organizationIds": [
      "value"
    ]
  }
}'

Example Response

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

getStats

Source: backend/endpoints/organizations/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": "organizations",
  "apiName": "getStats",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

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

getTypeAndFacilities

Source: backend/endpoints/organizations/get-type-and-facilities

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

Example Response

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

list

Source: backend/endpoints/organizations/list

Input Fields

FieldTypeRequiredConstraints
searchstringNo-
sortBystringNo-
sortOrderstringNo-
cursorstringNo-
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": "organizations",
  "apiName": "list",
  "data": {
    "search": "value",
    "sortBy": "value",
    "sortOrder": "value",
    "cursor": "value",
    "page": 1,
    "pageSize": 1
  }
}'

Example Response

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

listActivePublic

Source: backend/endpoints/organizations/list-active-public

Input Fields

FieldTypeRequiredConstraints
typestringNo-
organizationTypeIdstringNo-
pageintegerNo-
pageSizeintegerNo-
limitintegerNo-

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": "organizations",
  "apiName": "listActivePublic",
  "data": {
    "type": "general",
    "organizationTypeId": "organizationtype_123",
    "page": 1,
    "pageSize": 1,
    "limit": 1
  }
}'

Example Response

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

listAllActiveSalon

Source: backend/endpoints/organizations/list-all-active-salon

Input Fields

FieldTypeRequiredConstraints
searchstringNo-

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": "organizations",
  "apiName": "listAllActiveSalon",
  "data": {
    "search": "value"
  }
}'

Example Response

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

listByOrganization

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

Example Response

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

listDoctorServiceCounts

Source: backend/endpoints/organizations/list-doctor-service-counts

Input Fields

FieldTypeRequiredConstraints
searchstringNo-
sortOrderstringNo-
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": "organizations",
  "apiName": "listDoctorServiceCounts",
  "data": {
    "search": "value",
    "sortOrder": "value",
    "page": 1,
    "pageSize": 1
  }
}'

Example Response

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

listPatientPharmacies

Source: backend/endpoints/organizations/list-patient-pharmacies

Input Fields

FieldTypeRequiredConstraints
typestringNo-
hasPharmacybooleanNonullable
latitudenumberNonullable
longitudenumberNonullable
latnumberNounix-ms timestamp; nullable
lngnumberNonullable
lotnumberNonullable
radiusKmnumberNonullable
openNowbooleanNonullable
is24HoursbooleanNonullable
nearestbooleanNonullable
pageintegerNo-
pageSizeintegerNo-
limitintegerNo-

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": "organizations",
  "apiName": "listPatientPharmacies",
  "data": {
    "type": "general",
    "hasPharmacy": true,
    "latitude": 1,
    "longitude": 1,
    "lat": 1710201600000,
    "lng": 1
  }
}'

Example Response

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

listProductCounts

Source: backend/endpoints/organizations/list-product-counts

Input Fields

FieldTypeRequiredConstraints
searchstringNo-
typesarray<string>No-
hasStockbooleanNo-
sortBystringNo-
sortOrderstringNo-
cursorstringNo-
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": "organizations",
  "apiName": "listProductCounts",
  "data": {
    "search": "value",
    "types": [
      "value"
    ],
    "hasStock": true,
    "sortBy": "value",
    "sortOrder": "value",
    "cursor": "value"
  }
}'

Example Response

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

update

Source: backend/endpoints/organizations/update

Input Fields

FieldTypeRequiredConstraints
idstringNonullable
organizationIdstringYes-
stackTeamIdstringNonullable
namestringNonullable
slugstringNonullable
verificationStatusstringNonullable
typestringNonullable
organizationTypeIdstringNouuid; nullable
facilitiesobjectNonullable
logoIdstringNonullable
logoUrlstringNonullable
settingsobjectNonullable
addressobjectNonullable
coordinatesobjectNonullable
addressStreetstringNonullable
addressCitystringNonullable
addressStatestringNonullable
addressPostalCodestringNonullable
addressCountrystringNonullable
contactEmailstringNonullable
contactPhonestringNonullable
contactCustomerCarePhonestringNonullable
contactCustomerCareEmailstringNonullable
customerCarePhonestringNonullable
customerCareEmailstringNonullable
bankDetailsobjectNonullable
openingHoursobjectNonullable
serviceAudiencesarray<string>Nodive; oneof: MEN
serviceOccasionsarray<string>Nodive; oneof: BRIDE
commissionPercentnumberNonullable
isActivebooleanNonullable
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": "organizations",
  "apiName": "update",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

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

upsertFromStackAuth

Source: backend/endpoints/organizations/upsert-from-stack-auth

Input Fields

FieldTypeRequiredConstraints
stackTeamIdstringYes-
namestringYes-
slugstringYes-
typestringNo-
organizationTypeIdstringNouuid
logoIdstringNonullable
logoUrlstringNonullable
facilitiesobjectNonullable
coordinatesobjectNonullable
serviceAudiencesarray<string>Nodive; oneof: MEN
serviceOccasionsarray<string>Nodive; oneof: BRIDE
addressStreetstringYes-
addressCitystringYes-
addressStatestringYes-
addressPostalCodestringYes-
addressCountrystringYes-
bankAccountHolderNamestringNonullable
bankNamestringNonullable
bankAccountNumberstringNonullable
bankIfscCodestringNonullable

Nested Field Structures

facilities

FieldTypeRequiredConstraints
hasPharmacybooleanNo-
hasBloodBankbooleanNo-
hasLabsbooleanNo-

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": "organizations",
  "apiName": "upsertFromStackAuth",
  "data": {
    "stackTeamId": "org_123",
    "name": "value",
    "slug": "value",
    "addressStreet": "221B Baker Street",
    "addressCity": "221B Baker Street",
    "addressState": "221B Baker Street",
    "addressPostalCode": "221B Baker Street",
    "addressCountry": "221B Baker Street"
  }
}'

Example Response

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