Skip to main content

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

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token: Bearer <token>

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier (MongoDB ObjectId)

Response 200 OK

{
"count": 15,
"message": "Successfully seeded 15 lab units"
}
FieldTypeDescription
countnumberNumber of lab units seeded
messagestringSuccess 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