EndpointsHrm Leave Policies

Hrm Leave Policies

Function-calling namespace: hrmLeavePolicies

  • 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.

get

Source: backend/endpoints/hrm-leave-policies/get

Input Fields

FieldTypeRequiredConstraints
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": "hrmLeavePolicies",
  "apiName": "get",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

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

save

Source: backend/endpoints/hrm-leave-policies/save

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
leavePoliciesarray<object>Yesmin items: 1

Nested Field Structures

leavePolicies item

FieldTypeRequiredConstraints
leaveTypestringYes-
daysPerYearnumberNo-
isActivebooleanNonullable; default: true

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token>" \
  -d '{
  "namespace": "hrmLeavePolicies",
  "apiName": "save",
  "data": {
    "organizationId": "org_123",
    "leavePolicies": [
      {
        "leaveType": "CASUAL",
        "daysPerYear": 12,
        "isActive": true
      }
    ]
  }
}'

Example Response

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