Update Lab Unit (v1)
Method & Path
PATCH /api/v1/workspace/:workspaceId/labs/units/:labUnitId
Actual backend path: /v1/workspace/:workspaceId/labs/units/:labUnitId
Description
Update an existing lab unit.
Authentication
Required: JWT token in Authorization header
Required Permissions:
labs.manage
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer token: Bearer <token> |
Content-Type | string | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace identifier (MongoDB ObjectId) |
labUnitId | string | Yes | Lab unit identifier (MongoDB ObjectId) |
Request Body
{
"labUnitTitle": "mmol/L"
}
| Field | Type | Required | Description |
|---|---|---|---|
labUnitTitle | string | No | Lab unit title (1-500 characters) |
Response 200 OK
{
"labUnit": {
"id": "507f1f77bcf86cd799439011",
"workspaceId": "507f1f77bcf86cd799439012",
"labUnitTitle": "mmol/L",
"createdAt": "2025-01-15T10:00:00.000Z",
"updatedAt": "2025-01-15T11:00:00.000Z",
"deletedAt": null
}
}
Common Errors
400 Bad Request: Invalid request body
401 Unauthorized: Missing or invalid authentication token
403 Forbidden: Insufficient permissions (labs.manage required)
404 Not Found: Lab unit or workspace not found
409 Conflict: Lab unit with the same title already exists
422 Validation Error: Invalid workspace ID, lab unit ID format, or validation errors