PeopleSync API
  1. Departments
PeopleSync API
  • Authentication
    • Authenticate user
      POST
    • Get current user
      GET
  • Roles
    • List all roles
      GET
    • Create a new role
      POST
    • Get role details
      GET
    • Update role
      PUT
  • Departments
    • List all departments
      GET
    • Create a new department
      POST
    • Get department details
      GET
    • Update department
      PUT
  • Employees
    • List employees
      GET
    • Create employee
      POST
    • Get employee details
      GET
    • Update employee
      PUT
  • Attendances
    • Record clock-in
      POST
    • Sync offline attendances
      POST
  • Leaves
    • List leaves
      GET
    • Create leave request
      POST
    • Approve/reject leave
      PATCH
  • SalaryComponents
    • List all salary components
      GET
    • Create a new salary component
      POST
    • Get salary component details
      GET
    • Update salary component
      PUT
  • Payroll
    • Generate payroll
  • Jobs
    • Check job status
  • Uploads
    • Get presigned upload URL
  • Settings
    • Get organization settings
    • Update settings
  • ActivityLogs
    • List activity logs
  • Notifications
    • List notifications
  • System
    • Health check
  • Schemas
    • Schemas
      • MetaPagination
      • ErrorResponse
      • UUID
      • AuthLoginRequest
      • User
      • AuthLoginResponse
      • Role
      • Department
      • DepartmentCreate
      • DepartmentUpdate
      • Employee
      • EmployeeCreate
      • EmployeeUpdate
      • Attendance
      • AttendanceClockIn
      • AttendanceSync
      • Leave
      • LeaveCreate
      • LeaveApprove
      • SalaryComponent
      • SalaryComponentCreate
      • SalaryComponentUpdate
      • Payroll
      • PayrollItem
      • PayrollGenerate
      • PayrollSnapshot
      • ActivityLog
      • Notification
      • Setting
      • SettingUpdate
      • JobStatus
      • PresignedUrl
      • PresignRequest
      • HealthCheck
    • Response
      • Unauthorized
      • Forbidden
      • NotFound
      • ValidationError
      • Conflict
  1. Departments

Update department

Develop Env
https://dev.your-api-server.com
Develop Env
https://dev.your-api-server.com
PUT
/departments/{id}

Request

Authorization
JWT Bearer
Add the parameter
Authorization
to Headers
Example:
Authorization: ********************
or
Path Params

Body Params application/jsonRequired

Example
{
    "name": "Engineering",
    "code": "ENG",
    "parent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PUT 'https://dev.your-api-server.com/departments/' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Engineering",
    "code": "ENG",
    "parent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}'

Responses

🟢200OK
application/json
Department updated successfully
Body

Example
{
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "Engineering",
    "code": "ENG",
    "parent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "created_at": "2025-01-12T10:15:00Z"
}
🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
🟠404Not Found
Modified at 2025-11-17 05:13:15
Previous
Get department details
Next
List employees
Built with