Organizations
Function-calling namespace: organizations
- Base URL:
https://api.aivida.in - Engine endpoint:
POST /api - Auth: Stack token middleware enabled in
optionalmode. - Send token in header:
x-stack-access-token: <access_token>(orAuthorization: Bearer <access_token>). - In
optionalmode: no token is allowed; invalid token is rejected with401.
create
Source: backend/endpoints/organizations/create
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackTeamId | string | Yes | - |
name | string | Yes | - |
slug | string | No | - |
verificationStatus | string | No | - |
type | string | No | - |
organizationTypeId | string | No | uuid |
facilities | object | No | - |
logoId | string | No | - |
logoUrl | string | No | - |
settings | object | No | - |
address | object | No | - |
coordinates | object | No | - |
addressStreet | string | No | - |
addressCity | string | No | - |
addressState | string | No | - |
addressPostalCode | string | No | - |
addressCountry | string | No | - |
contactEmail | string | No | - |
contactPhone | string | No | - |
contactCustomerCarePhone | string | No | - |
contactCustomerCareEmail | string | No | - |
customerCarePhone | string | No | - |
customerCareEmail | string | No | - |
bankDetails | object | No | - |
openingHours | object | No | - |
serviceAudiences | array<string> | No | dive; oneof: MEN |
serviceOccasions | array<string> | No | dive; oneof: BRIDE |
isActive | boolean | No | - |
createdAt | integer | No | unix-ms timestamp; nullable |
updatedAt | integer | No | unix-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[].organizationBranchIdis included only when the returned pharmacy location is a branch.- Organization-level pharmacy results omit
organizationBranchId.
delete
Source: backend/endpoints/organizations/delete
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
deleteMode | string | No | - |
mode | string | No | - |
hardDelete | boolean | No | 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": "delete",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }diagnosticServicesStats
Source: backend/endpoints/organizations/diagnostic-services-stats
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | No | - |
name | string | No | - |
code | string | No | - |
labTestCount | integer | No | - |
imagingCount | integer | No | - |
labPackageCount | integer | No | - |
totalCount | integer | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
name | 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": "organizations",
"apiName": "getByName",
"data": {
"name": "value"
}
}'Example Response
{ "status": "ok", "data": {} }getByStackTeamId
Source: backend/endpoints/organizations/get-by-stack-team-id
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
stackTeamId | 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": "organizations",
"apiName": "getByStackTeamId",
"data": {
"stackTeamId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }getLocations
Source: backend/endpoints/organizations/get-locations
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationIds | array<string> | Yes | min: 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
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | 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": "organizations",
"apiName": "getStats",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }getTypeAndFacilities
Source: backend/endpoints/organizations/get-type-and-facilities
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | 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": "organizations",
"apiName": "getTypeAndFacilities",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }list
Source: backend/endpoints/organizations/list
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
search | string | No | - |
sortBy | string | No | - |
sortOrder | string | No | - |
cursor | string | No | - |
page | integer | No | - |
pageSize | integer | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
type | string | No | - |
organizationTypeId | string | No | - |
page | integer | No | - |
pageSize | integer | No | - |
limit | integer | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
search | string | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
page | integer | No | - |
pageSize | integer | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
search | string | No | - |
sortOrder | string | No | - |
page | integer | No | - |
pageSize | integer | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
type | string | No | - |
hasPharmacy | boolean | No | nullable |
latitude | number | No | nullable |
longitude | number | No | nullable |
lat | number | No | unix-ms timestamp; nullable |
lng | number | No | nullable |
lot | number | No | nullable |
radiusKm | number | No | nullable |
openNow | boolean | No | nullable |
is24Hours | boolean | No | nullable |
nearest | boolean | No | nullable |
page | integer | No | - |
pageSize | integer | No | - |
limit | integer | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
search | string | No | - |
types | array<string> | No | - |
hasStock | boolean | No | - |
sortBy | string | No | - |
sortOrder | string | No | - |
cursor | string | No | - |
page | integer | No | - |
pageSize | integer | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | No | nullable |
organizationId | string | Yes | - |
stackTeamId | string | No | nullable |
name | string | No | nullable |
slug | string | No | nullable |
verificationStatus | string | No | nullable |
type | string | No | nullable |
organizationTypeId | string | No | uuid; nullable |
facilities | object | No | nullable |
logoId | string | No | nullable |
logoUrl | string | No | nullable |
settings | object | No | nullable |
address | object | No | nullable |
coordinates | object | No | nullable |
addressStreet | string | No | nullable |
addressCity | string | No | nullable |
addressState | string | No | nullable |
addressPostalCode | string | No | nullable |
addressCountry | string | No | nullable |
contactEmail | string | No | nullable |
contactPhone | string | No | nullable |
contactCustomerCarePhone | string | No | nullable |
contactCustomerCareEmail | string | No | nullable |
customerCarePhone | string | No | nullable |
customerCareEmail | string | No | nullable |
bankDetails | object | No | nullable |
openingHours | object | No | nullable |
serviceAudiences | array<string> | No | dive; oneof: MEN |
serviceOccasions | array<string> | No | dive; oneof: BRIDE |
commissionPercent | number | No | nullable |
isActive | boolean | No | nullable |
createdAt | integer | No | unix-ms timestamp; nullable |
updatedAt | integer | No | unix-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
| Field | Type | Required | Constraints |
|---|---|---|---|
stackTeamId | string | Yes | - |
name | string | Yes | - |
slug | string | Yes | - |
type | string | No | - |
organizationTypeId | string | No | uuid |
logoId | string | No | nullable |
logoUrl | string | No | nullable |
facilities | object | No | nullable |
coordinates | object | No | nullable |
serviceAudiences | array<string> | No | dive; oneof: MEN |
serviceOccasions | array<string> | No | dive; oneof: BRIDE |
addressStreet | string | Yes | - |
addressCity | string | Yes | - |
addressState | string | Yes | - |
addressPostalCode | string | Yes | - |
addressCountry | string | Yes | - |
bankAccountHolderName | string | No | nullable |
bankName | string | No | nullable |
bankAccountNumber | string | No | nullable |
bankIfscCode | string | No | nullable |
Nested Field Structures
facilities
| Field | Type | Required | Constraints |
|---|---|---|---|
hasPharmacy | boolean | No | - |
hasBloodBank | boolean | No | - |
hasLabs | boolean | No | - |
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": {} }