EndpointsHrm Employees

Hrm Employees

Function-calling namespace: hrmEmployees

  • 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> (or Authorization: Bearer <access_token>).
  • Allowed roles: platform_admin, hr.
  • Missing or invalid token returns 401; authenticated users without an allowed role return 403.

create

Source: backend/endpoints/hrm-employees/create

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
organizationBranchIdsarray<string>Nooptional; maps the created employee user to these organization branches
employeeCodestringYes-
employeeNamestringYes-
emailstringYes-
phoneNumberstringYes-
genderstringNo-
departmentIdstringYes-
designationIdstringYes-
joiningDatestringYesformat: YYYY-MM-DD
dateOfBirthstringNo-
bloodGroupstringNo-
addressstringNo-
citystringNo-
statestringNo-
countrystringNo-
pincodestringNo-
religionstringNo-
nationalitystringNo-
qualificationstringNo-
experienceYearsnumberNo-
employeeTypestringYes-
statusstringYes-
aadharNumberstringNo-
panNumberstringNo-
profileImageUrlstringNo-
signatureImageUrlstringNo-
officialEmailstringNo-
personalEmailstringNo-
emergencyContactNamestringNo-
emergencyContactNumberstringNo-
reportingManagerIdstringNo-
workLocationstringNo-
probationEndDatestringNoformat: YYYY-MM-DD
confirmationDatestringNoformat: YYYY-MM-DD
lastWorkingDatestringNoformat: YYYY-MM-DD
uanNumberstringNo-
esiNumberstringNo-
documentsarray<object>No-
bankDetailsobjectNonullable
salaryobjectNonullable
statutoryDeductionsobjectNonullable

Nested Field Structures

documents item

FieldTypeRequiredConstraints
documentNamestringNo-
documentTypestringNo-
documentUrlstringNo-
remarksstringNo-

bankDetails

FieldTypeRequiredConstraints
accountHolderNamestringNo-
bankNamestringNo-
branchNamestringNo-
accountNumberstringNo-
ifscCodestringNo-
upiIdstringNo-
isPrimarybooleanNonullable

salary

FieldTypeRequiredConstraints
baseSalarynumberNo-
hranumberNo-
dearnessAllowancenumberNo-
conveyanceAllowancenumberNo-
medicalAllowancenumberNo-
specialAllowancenumberNo-

statutoryDeductions

FieldTypeRequiredConstraints
pfEnabledbooleanNo-
pfTypestringNo-
pfPercentagenumberNo-
esiEnabledbooleanNo-
esiTypestringNo-
esiPercentagenumberNo-
tdsEnabledbooleanNo-
tdsPercentagenumberNo-
professionalTaxEnabledbooleanNo-
professionalTaxAmountnumberNo-

Branch Mapping Notes

  • organizationBranchIds is optional.
  • When organizationBranchIds is provided, the created employee user is mapped to those branches in user_organization_branches.
  • Branch IDs are validated against the same organizationId; invalid branch IDs are rejected.
  • The response returns organizationBranchIds and organizationBranchNames from the saved branch mapping.

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token>" \
  -d '{
  "namespace": "hrmEmployees",
  "apiName": "create",
  "data": {
    "organizationId": "org_123",
    "organizationBranchIds": [
      "branch_123"
    ],
    "employeeCode": "EMP-001",
    "employeeName": "Anitha Kumar",
    "email": "anitha.kumar@example.com",
    "phoneNumber": "+911234567890",
    "departmentId": "department_123",
    "designationId": "designation_123",
    "joiningDate": "2026-03-12",
    "employeeType": "full_time",
    "status": "active"
  }
}'

Example Response

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

delete

Source: backend/endpoints/hrm-employees/delete

Input Fields

FieldTypeRequiredConstraints
idstringNo-
organizationIdstringNo-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token>" \
  -d '{
  "namespace": "hrmEmployees",
  "apiName": "delete",
  "data": {
    "organizationId": "org_123",
    "id": "id_123"
  }
}'

Example Response

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

getById

Source: backend/endpoints/hrm-employees/get-by-id

Input Fields

FieldTypeRequiredConstraints
idstringNo-
organizationIdstringNo-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token>" \
  -d '{
  "namespace": "hrmEmployees",
  "apiName": "getById",
  "data": {
    "organizationId": "org_123",
    "id": "id_123"
  }
}'

Example Response

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

list

Source: backend/endpoints/hrm-employees/list

Input Fields

FieldTypeRequiredConstraints
organizationIdstringNo-
branchIdstringNo-
departmentIdstringNo-
designationIdstringNo-
statusstringNo-
searchstringNo-
pageintegerNo-
pageSizeintegerNo-

Response Notes

  • branchId is optional and filters records assigned to that organization branch.
  • Each returned item includes organizationBranchIds and organizationBranchNames from the saved user branch mapping.
  • The response merges hrm_employees records with organization users records that do not already have an HRM employee entry.
  • Merged user-only records also include organizationBranchIds and organizationBranchNames when the user has branch mappings.
  • User-only records are returned in the same employee item shape, using the user ID as both id and userId.
  • When departmentId or designationId is provided, user-only records are skipped because those filters are HRM-employee fields.

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token>" \
  -d '{
  "namespace": "hrmEmployees",
  "apiName": "list",
  "data": {
    "organizationId": "org_123",
    "status": "scheduled"
  }
}'

Response Data Format

FieldTypeRequiredConstraints
itemsarray<object>No-
totalintegerNo-
pageintegerNo-
pageSizeintegerNo-
totalPagesintegerNo-

Response Data Format Nested Structures

items[] item

FieldTypeRequiredConstraints
idstringNo-
organizationIdstringNo-
userIdstringNo-
organizationBranchIdsarray<string>No-
organizationBranchNamesarray<string>No-
employeeCodestringNo-
employeeNamestringNo-
emailstringNo-
phoneNumberstringNo-
genderstringNo-
departmentIdstringNo-
departmentNamestringNo-
designationIdstringNo-
designationNamestringNo-
joiningDatestringNoformat: YYYY-MM-DD
dateOfBirthstringNo-
bloodGroupstringNo-
addressstringNo-
citystringNo-
statestringNo-
countrystringNo-
pincodestringNo-
religionstringNo-
nationalitystringNo-
qualificationstringNo-
experienceYearsnumberNo-
employeeTypestringNo-
statusstringNo-
aadharNumberstringNo-
panNumberstringNo-
profileImageUrlstringNo-
signatureImageUrlstringNo-
officialEmailstringNo-
personalEmailstringNo-
emergencyContactNamestringNo-
emergencyContactNumberstringNo-
reportingManagerIdstringNo-
workLocationstringNo-
probationEndDatestringNoformat: YYYY-MM-DD
confirmationDatestringNoformat: YYYY-MM-DD
lastWorkingDatestringNoformat: YYYY-MM-DD
uanNumberstringNo-
esiNumberstringNo-
isActivebooleanNo-
isDeletedbooleanNo-
deletedAtintegerNounix-ms timestamp; nullable
createdAtintegerNounix-ms timestamp
updatedAtintegerNounix-ms timestamp
documentsarray<object>No-
bankDetailsobjectNonullable
salaryobjectNonullable
statutoryDeductionsobjectNonullable

items[].documents[] item

FieldTypeRequiredConstraints
idstringNo-
organizationIdstringNo-
employeeIdstringNo-
documentNamestringNo-
documentTypestringNo-
documentUrlstringNo-
remarksstringNo-
isDeletedbooleanNo-
deletedAtintegerNounix-ms timestamp; nullable
createdAtintegerNounix-ms timestamp
updatedAtintegerNounix-ms timestamp

items[].bankDetails

FieldTypeRequiredConstraints
idstringNo-
organizationIdstringNo-
employeeIdstringNo-
accountHolderNamestringNo-
bankNamestringNo-
branchNamestringNo-
accountNumberstringNo-
ifscCodestringNo-
upiIdstringNo-
isPrimarybooleanNo-
createdAtintegerNounix-ms timestamp
updatedAtintegerNounix-ms timestamp

items[].salary

FieldTypeRequiredConstraints
idstringNo-
organizationIdstringNo-
employeeIdstringNo-
baseSalarynumberNo-
hranumberNo-
dearnessAllowancenumberNo-
conveyanceAllowancenumberNo-
medicalAllowancenumberNo-
specialAllowancenumberNo-
grossSalarynumberNo-
annualCtcnumberNo-
createdAtintegerNounix-ms timestamp
updatedAtintegerNounix-ms timestamp

items[].statutoryDeductions

FieldTypeRequiredConstraints
idstringNo-
organizationIdstringNo-
employeeIdstringNo-
pfEnabledbooleanNo-
pfTypestringNo-
pfPercentagenumberNo-
esiEnabledbooleanNo-
esiTypestringNo-
esiPercentagenumberNo-
tdsEnabledbooleanNo-
tdsPercentagenumberNo-
professionalTaxEnabledbooleanNo-
professionalTaxAmountnumberNo-
createdAtintegerNounix-ms timestamp
updatedAtintegerNounix-ms timestamp

Response Data Format Example

{
  "items": [
    {
      "id": "id_123",
      "organizationId": "org_123",
      "userId": "user_123",
      "organizationBranchIds": [
        "value"
      ],
      "organizationBranchNames": [
        "value"
      ],
      "employeeCode": "value",
      "employeeName": "value",
      "email": "user@example.com",
      "phoneNumber": "+911234567890",
      "gender": "value",
      "departmentId": "department_123",
      "departmentName": "value",
      "designationId": "designation_123",
      "designationName": "value",
      "joiningDate": "2026-03-12",
      "dateOfBirth": "2026-03-12",
      "bloodGroup": "value",
      "address": "221B Baker Street",
      "city": "Bengaluru",
      "state": "Karnataka",
      "country": "India",
      "pincode": "value",
      "religion": "value",
      "nationality": "value",
      "qualification": "value",
      "experienceYears": 1,
      "employeeType": "general",
      "status": "scheduled",
      "aadharNumber": "value",
      "panNumber": "value",
      "profileImageUrl": "value",
      "signatureImageUrl": "value",
      "officialEmail": "user@example.com",
      "personalEmail": "user@example.com",
      "emergencyContactName": "value",
      "emergencyContactNumber": "value",
      "reportingManagerId": "reportingmanager_123",
      "workLocation": "value",
      "probationEndDate": "2026-03-12",
      "confirmationDate": "2026-03-12",
      "lastWorkingDate": "2026-03-12",
      "uanNumber": "value",
      "esiNumber": "value",
      "isActive": true,
      "isDeleted": false,
      "deletedAt": 1710201600000,
      "createdAt": 1710201600000,
      "updatedAt": 1710201600000,
      "documents": [
        {
          "id": "id_123",
          "organizationId": "org_123",
          "employeeId": "employee_123",
          "documentName": "value",
          "documentType": "general",
          "documentUrl": "value",
          "remarks": "value",
          "isDeleted": false,
          "deletedAt": 1710201600000,
          "createdAt": 1710201600000,
          "updatedAt": 1710201600000
        }
      ],
      "bankDetails": {
        "id": "id_123",
        "organizationId": "org_123",
        "employeeId": "employee_123",
        "accountHolderName": "value",
        "bankName": "value",
        "branchName": "value",
        "accountNumber": "value",
        "ifscCode": "value",
        "upiId": "upi_123",
        "isPrimary": true,
        "createdAt": 1710201600000,
        "updatedAt": 1710201600000
      },
      "salary": {
        "id": "id_123",
        "organizationId": "org_123",
        "employeeId": "employee_123",
        "baseSalary": 1,
        "hra": 1,
        "dearnessAllowance": 1,
        "conveyanceAllowance": 1,
        "medicalAllowance": 1,
        "specialAllowance": 1,
        "grossSalary": 1,
        "annualCtc": 1,
        "createdAt": 1710201600000,
        "updatedAt": 1710201600000
      },
      "statutoryDeductions": {
        "id": "id_123",
        "organizationId": "org_123",
        "employeeId": "employee_123",
        "pfEnabled": true,
        "pfType": "general",
        "pfPercentage": 1,
        "esiEnabled": true,
        "esiType": "general",
        "esiPercentage": 1,
        "tdsEnabled": true,
        "tdsPercentage": 1,
        "professionalTaxEnabled": true,
        "professionalTaxAmount": 1,
        "createdAt": 1710201600000,
        "updatedAt": 1710201600000
      }
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 1,
  "totalPages": 1
}

Example Response

{
  "status": "ok",
  "data": {
    "items": [
      {
        "id": "id_123",
        "organizationId": "org_123",
        "userId": "user_123",
        "organizationBranchIds": [
          "value"
        ],
        "organizationBranchNames": [
          "value"
        ],
        "employeeCode": "value",
        "employeeName": "value",
        "email": "user@example.com",
        "phoneNumber": "+911234567890",
        "gender": "value",
        "departmentId": "department_123",
        "departmentName": "value",
        "designationId": "designation_123",
        "designationName": "value",
        "joiningDate": "2026-03-12",
        "dateOfBirth": "2026-03-12",
        "bloodGroup": "value",
        "address": "221B Baker Street",
        "city": "Bengaluru",
        "state": "Karnataka",
        "country": "India",
        "pincode": "value",
        "religion": "value",
        "nationality": "value",
        "qualification": "value",
        "experienceYears": 1,
        "employeeType": "general",
        "status": "scheduled",
        "aadharNumber": "value",
        "panNumber": "value",
        "profileImageUrl": "value",
        "signatureImageUrl": "value",
        "officialEmail": "user@example.com",
        "personalEmail": "user@example.com",
        "emergencyContactName": "value",
        "emergencyContactNumber": "value",
        "reportingManagerId": "reportingmanager_123",
        "workLocation": "value",
        "probationEndDate": "2026-03-12",
        "confirmationDate": "2026-03-12",
        "lastWorkingDate": "2026-03-12",
        "uanNumber": "value",
        "esiNumber": "value",
        "isActive": true,
        "isDeleted": false,
        "deletedAt": 1710201600000,
        "createdAt": 1710201600000,
        "updatedAt": 1710201600000,
        "documents": [
          {
            "id": "id_123",
            "organizationId": "org_123",
            "employeeId": "employee_123",
            "documentName": "value",
            "documentType": "general",
            "documentUrl": "value",
            "remarks": "value",
            "isDeleted": false,
            "deletedAt": 1710201600000,
            "createdAt": 1710201600000,
            "updatedAt": 1710201600000
          }
        ],
        "bankDetails": {
          "id": "id_123",
          "organizationId": "org_123",
          "employeeId": "employee_123",
          "accountHolderName": "value",
          "bankName": "value",
          "branchName": "value",
          "accountNumber": "value",
          "ifscCode": "value",
          "upiId": "upi_123",
          "isPrimary": true,
          "createdAt": 1710201600000,
          "updatedAt": 1710201600000
        },
        "salary": {
          "id": "id_123",
          "organizationId": "org_123",
          "employeeId": "employee_123",
          "baseSalary": 1,
          "hra": 1,
          "dearnessAllowance": 1,
          "conveyanceAllowance": 1,
          "medicalAllowance": 1,
          "specialAllowance": 1,
          "grossSalary": 1,
          "annualCtc": 1,
          "createdAt": 1710201600000,
          "updatedAt": 1710201600000
        },
        "statutoryDeductions": {
          "id": "id_123",
          "organizationId": "org_123",
          "employeeId": "employee_123",
          "pfEnabled": true,
          "pfType": "general",
          "pfPercentage": 1,
          "esiEnabled": true,
          "esiType": "general",
          "esiPercentage": 1,
          "tdsEnabled": true,
          "tdsPercentage": 1,
          "professionalTaxEnabled": true,
          "professionalTaxAmount": 1,
          "createdAt": 1710201600000,
          "updatedAt": 1710201600000
        }
      }
    ],
    "total": 1,
    "page": 1,
    "pageSize": 1,
    "totalPages": 1
  }
}

update

Source: backend/endpoints/hrm-employees/update

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-
organizationBranchIdsarray<string>Nooptional; replaces branch mappings when provided; send [] to clear mappings; nullable
employeeCodestringNonullable
employeeNamestringNonullable
emailstringNonullable
phoneNumberstringNonullable
genderstringNonullable
departmentIdstringNonullable
designationIdstringNonullable
joiningDatestringNoformat: YYYY-MM-DD; nullable
dateOfBirthstringNonullable
bloodGroupstringNonullable
addressstringNonullable
citystringNonullable
statestringNonullable
countrystringNonullable
pincodestringNonullable
religionstringNonullable
nationalitystringNonullable
qualificationstringNonullable
experienceYearsnumberNonullable
employeeTypestringNonullable
statusstringNonullable
aadharNumberstringNonullable
panNumberstringNonullable
profileImageUrlstringNonullable
signatureImageUrlstringNonullable
officialEmailstringNonullable
personalEmailstringNonullable
emergencyContactNamestringNonullable
emergencyContactNumberstringNonullable
reportingManagerIdstringNonullable
workLocationstringNonullable
probationEndDatestringNoformat: YYYY-MM-DD; nullable
confirmationDatestringNoformat: YYYY-MM-DD; nullable
lastWorkingDatestringNoformat: YYYY-MM-DD; nullable
uanNumberstringNonullable
esiNumberstringNonullable
isActivebooleanNonullable
bankDetailsobjectNonullable
salaryobjectNonullable
statutoryDeductionsobjectNonullable

Nested Field Structures

bankDetails

FieldTypeRequiredConstraints
accountHolderNamestringNo-
bankNamestringNo-
branchNamestringNo-
accountNumberstringNo-
ifscCodestringNo-
upiIdstringNo-
isPrimarybooleanNonullable

salary

FieldTypeRequiredConstraints
baseSalarynumberNo-
hranumberNo-
dearnessAllowancenumberNo-
conveyanceAllowancenumberNo-
medicalAllowancenumberNo-
specialAllowancenumberNo-

statutoryDeductions

FieldTypeRequiredConstraints
pfEnabledbooleanNo-
pfTypestringNo-
pfPercentagenumberNo-
esiEnabledbooleanNo-
esiTypestringNo-
esiPercentagenumberNo-
tdsEnabledbooleanNo-
tdsPercentagenumberNo-
professionalTaxEnabledbooleanNo-
professionalTaxAmountnumberNo-

Branch Mapping Notes

  • organizationBranchIds is optional.
  • When organizationBranchIds is provided, it replaces the employee user branch mapping in user_organization_branches.
  • Send an empty array to clear all branch mappings for that employee user.
  • If organizationBranchIds is omitted, existing branch mappings are not changed.
  • Branch IDs are validated against the same organizationId; invalid branch IDs are rejected.

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token>" \
  -d '{
  "namespace": "hrmEmployees",
  "apiName": "update",
  "data": {
    "id": "employee_123",
    "organizationId": "org_123",
    "organizationBranchIds": [
      "branch_123"
    ]
  }
}'

Example Response

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