Platform Departments
Function-calling namespace: platformDepartments
- 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/platform-departments/create
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | Yes | - |
code | string | Yes | - |
description | string | No | - |
category | string | No | - |
imageUrl | string | No | - |
role | string | No | - |
roles | array<string> | No | - |
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": "platformDepartments",
"apiName": "create",
"data": {
"name": "value",
"code": "value"
}
}'Example Response
{ "status": "ok", "data": {} }delete
Source: backend/endpoints/platform-departments/delete
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | 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": "platformDepartments",
"apiName": "delete",
"data": {
"id": "id_123"
}
}'Example Response
{ "status": "ok", "data": {} }getById
Source: backend/endpoints/platform-departments/get-by-id
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | 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": "platformDepartments",
"apiName": "getById",
"data": {
"id": "id_123"
}
}'Example Response
{ "status": "ok", "data": {} }listByOrganization
Source: backend/endpoints/platform-departments/list-by-organization
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
search | string | No | - |
sortBy | string | No | - |
sortOrder | string | No | - |
excludePlatformDepartmentIDs | array<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": "platformDepartments",
"apiName": "listByOrganization",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }update
Source: backend/endpoints/platform-departments/update
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
name | string | No | nullable |
code | string | No | nullable |
description | string | No | nullable |
category | string | No | nullable |
imageUrl | string | No | nullable |
role | string | No | nullable |
roles | array<string> | 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": "platformDepartments",
"apiName": "update",
"data": {
"id": "id_123"
}
}'Example Response
{ "status": "ok", "data": {} }