EndpointsPlatform Departments

Platform Departments

Function-calling namespace: platformDepartments

  • 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/platform-departments/create

Input Fields

FieldTypeRequiredConstraints
namestringYes-
codestringYes-
descriptionstringNo-
categorystringNo-
imageUrlstringNo-
rolestringNo-
rolesarray<string>No-
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": "platformDepartments",
  "apiName": "create",
  "data": {
    "name": "value",
    "code": "value"
  }
}'

Example Response

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

delete

Source: backend/endpoints/platform-departments/delete

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

Example Response

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

getById

Source: backend/endpoints/platform-departments/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": "platformDepartments",
  "apiName": "getById",
  "data": {
    "id": "id_123"
  }
}'

Example Response

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

listByOrganization

Source: backend/endpoints/platform-departments/list-by-organization

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
searchstringNo-
sortBystringNo-
sortOrderstringNo-
excludePlatformDepartmentIDsarray<string>No-
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": "platformDepartments",
  "apiName": "listByOrganization",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

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

update

Source: backend/endpoints/platform-departments/update

Input Fields

FieldTypeRequiredConstraints
idstringYes-
namestringNonullable
codestringNonullable
descriptionstringNonullable
categorystringNonullable
imageUrlstringNonullable
rolestringNonullable
rolesarray<string>Nonullable
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": "platformDepartments",
  "apiName": "update",
  "data": {
    "id": "id_123"
  }
}'

Example Response

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