Seed Test Groups (v1)
Method & Path
POST /api/v1/workspace/:workspaceId/labs/test-groups/seed
Actual backend path: /v1/workspace/:workspaceId/labs/test-groups/seed
Description
Seed test groups from external API source. This fetches test groups from the external API and stores them in the database. Also seeds the associated tests for each test group.
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
{
"success": true,
"message": "Test groups seeded successfully",
"count": 150,
"testsCount": 1200
}
Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the seeding was successful |
message | string | Success message |
count | number | Number of test groups seeded |
testsCount | number | Total number of tests associated with groups |
Common Errors
- 401 Unauthorized: Missing or invalid authentication token
- 403 Forbidden: Insufficient permissions (requires
labs.manage) - 404 Not Found: Workspace not found
- 500 Internal Server Error: Server error or external API failure
Notes
- This operation may take some time depending on the number of test groups
- Test groups are upserted (updated if exists, created if new)
- Associated tests for each group are also seeded
- Source data is cached in JSON files in
lab-seed/testgroups/directory