> **Source:** https://knowledge.leegality.com/sign-station/api/update > **Site:** Leegality Knowledge Base — https://knowledge.leegality.com > **About:** Leegality is a document execution platform covering eSigning, stamps, NeSL, workflows, and REST API integration. > **Navigation:** Every article on this site has a plain-text version at `.txt` (this format). To get an index of all articles with their `.txt` links, read: https://knowledge.leegality.com/llms.txt > **AI Guide:** For instructions on how to navigate this knowledge base as an AI agent, read: https://knowledge.leegality.com/ai-readable.txt --- # PUT /api/v1/departments/{id} — Update department Updates an existing department for the current user's organization. The request body requires all department properties, even if only updating one. **Authentication:** `X-Auth-Token` header required on every request. ## Request URL ``` PUT https://app1.leegality.com/api/api/v1/departments/{id} ``` **Environments:** - Production: `https://app1.leegality.com/api/api/v1/departments/{id}` - Sandbox: `https://sandbox.leegality.com/api/api/v1/departments/{id}` --- ## Parameters | Name | In | Required | Type | Description | Example | |------|----|----------|------|-------------|---------| | `id` | path | Yes | string | Department ID to be updated | — | --- ## Request Body **Content-Type:** `application/json` | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `name` | string | Yes | The updated department name (e.g., "Human Resources"). Must be between 2 and 255 characters. | — | | `enabled` | boolean | No | Shows the updated status of the department. For an active department, the value is set to true; for an inactive department, it is set to false. | — | ### Sample Request ```json { "name": "string", "enabled": false } ``` --- ## Responses ### 200 — Department updated successfully | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Response status code | — | | `message` | string | No | Response message | — | | `data` | DepartmentVO | No | See **DepartmentVO** below. | — | #### DepartmentVO | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `id` | string | No | Department unique identifier | `3fa85f64-5717-4562-b3fc-2c963f66afa6` | | `name` | string | No | The department's name (e.g., "Human Resources"). | `Human Resources` | | `enabled` | boolean | No | Indicates whether the department is active or inactive. | `true` | | `createdAt` | string | No | The date and time when the department was created. | `2025-12-15T10:20:30Z` | | `totalUsers` | integer | No | Total number of users in the department. | `25` | ### 400 — Invalid request data | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Top-level error code | `LE_ERR_SS_400` | | `errors` | array\ | No | List of error details See **ErrorDetailUpdateDepartment400VO** below. | — | #### ErrorDetailUpdateDepartment400VO | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `message` | string | No | Detailed error message | `Invalid value for field [name], Department name must be betw` | | `path` | string | No | API path that generated the error | `/api/v1/departments/{id}` | | `code` | string | No | Specific error code | `null` | ### 401 — Unauthorized - Invalid or expired token | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Top-level error code | `LE_ERR_SS_401` | | `errors` | array\ | No | List of error details See **ErrorDetail401Unauthorized** below. | — | #### ErrorDetail401Unauthorized | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `message` | string | No | Detailed error message | `Invalid or expired token` | | `path` | string | No | API path that generated the error | `/api/v1/*` | | `code` | string | No | Specific error code | `LE_ERR_SS_303` | ### 404 — Department not found | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Top-level error code | `LE_ERR_SS_404` | | `errors` | array\ | No | List of error details See **ErrorDetailUpdateDepartment404VO** below. | — | #### ErrorDetailUpdateDepartment404VO | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `message` | string | No | Detailed error message | `Department does not exist.` | | `path` | string | No | API path that generated the error | `/api/v1/departments/acd77746-6eb2-4ad3-9356-e9f12f7ef502` | | `code` | string | No | Specific error code | `LE_ERR_SS_001` | ### 500 — Internal server error | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Top-level error code | `LE_ERR_SS_500` | | `errors` | array\ | No | List of error details See **ErrorDetailToken500VO** below. | — | #### ErrorDetailToken500VO | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `message` | string | No | Detailed error message | `Internal Server Error` | | `path` | string | No | API path that generated the error | `null` | | `code` | string | No | Specific error code | `null` | ### Sample Response (200) ```json { "code": "string", "message": "string", "data": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "Human Resources", "enabled": true, "createdAt": "2025-12-15T10:20:30Z", "totalUsers": 25 } } ```