Seed Lab Units (v1)
Method & Path
POST /api/v1/workspace/:workspaceId/labs/units/seed
Actual backend path: /v1/workspace/:workspaceId/labs/units/seed
Description
Seed lab units from external sources. This endpoint replaces existing lab units and adds missing ones from the seed data.
Authentication
Required: JWT token in Authorization header
Required Permissions:
labs.manage
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer token: Bearer <token> |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace identifier (MongoDB ObjectId) |
Response 200 OK
{
"count": 15,
"message": "Successfully seeded 15 lab units"
}
| Field | Type | Description |
|---|---|---|
count | number | Number of lab units seeded |
message | string | Success message |
Common Errors
401 Unauthorized: Missing or invalid authentication token
403 Forbidden: Insufficient permissions (labs.manage required)
404 Not Found: Workspace not found
422 Validation Error: Invalid workspace ID format
500 Internal Server Error: Error during seeding process