Hrm Departments
Function-calling namespace: hrmDepartments
- Base URL:
https://api.aivida.in - Engine endpoint:
POST /api - Auth: private API; Stack access token is required.
- Send token in header:
x-stack-access-token: <access_token>(orAuthorization: Bearer <access_token>). - Allowed roles:
platform_admin,hr. - Missing or invalid token returns
401; authenticated users without an allowed role return403.
create
Source: backend/endpoints/hrm-departments/create
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | No | - |
departmentName | string | No | - |
departmentCode | string | No | - |
description | string | No | - |
isActive | 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>" \
-d '{
"namespace": "hrmDepartments",
"apiName": "create",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }delete
Source: backend/endpoints/hrm-departments/delete
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | No | - |
departmentId | string | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token>" \
-d '{
"namespace": "hrmDepartments",
"apiName": "delete",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }getById
Source: backend/endpoints/hrm-departments/get-by-id
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | No | - |
departmentId | string | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token>" \
-d '{
"namespace": "hrmDepartments",
"apiName": "getById",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }list
Source: backend/endpoints/hrm-departments/list
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | No | - |
search | string | No | - |
sortBy | 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>" \
-d '{
"namespace": "hrmDepartments",
"apiName": "list",
"data": {
"organizationId": "org_123"
}
}'Response Data Format
| Field | Type | Required | Constraints |
|---|---|---|---|
items | array<object> | No | - |
total | integer | No | - |
page | integer | No | - |
pageSize | integer | No | - |
totalPages | integer | No | - |
Response Data Format Nested Structures
items[] item
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | No | - |
organizationId | string | No | - |
departmentName | string | No | - |
departmentCode | string | No | - |
description | string | No | - |
staffCount | integer | No | - |
isActive | boolean | No | - |
isDeleted | boolean | No | - |
deletedAt | integer | No | unix-ms timestamp; nullable |
createdAt | integer | No | unix-ms timestamp |
updatedAt | integer | No | unix-ms timestamp |
Response Data Format Example
{
"items": [
{
"id": "id_123",
"organizationId": "org_123",
"departmentName": "value",
"departmentCode": "value",
"description": "value",
"staffCount": 1,
"isActive": true,
"isDeleted": false,
"deletedAt": 1710201600000,
"createdAt": 1710201600000,
"updatedAt": 1710201600000
}
],
"total": 1,
"page": 1,
"pageSize": 1,
"totalPages": 1
}Example Response
{
"status": "ok",
"data": {
"items": [
{
"id": "id_123",
"organizationId": "org_123",
"departmentName": "value",
"departmentCode": "value",
"description": "value",
"staffCount": 1,
"isActive": true,
"isDeleted": false,
"deletedAt": 1710201600000,
"createdAt": 1710201600000,
"updatedAt": 1710201600000
}
],
"total": 1,
"page": 1,
"pageSize": 1,
"totalPages": 1
}
}update
Source: backend/endpoints/hrm-departments/update
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | No | - |
departmentId | string | No | - |
departmentName | string | No | nullable |
departmentCode | string | No | nullable |
description | string | No | nullable |
isActive | 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>" \
-d '{
"namespace": "hrmDepartments",
"apiName": "update",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }