Skip to main content

List Test Groups (v1)

Method & Path

GET /api/v1/workspace/:workspaceId/labs/test-groups

Actual backend path: /v1/workspace/:workspaceId/labs/test-groups

Description

Get all test groups in a workspace with pagination and search support.

Authentication

Required: JWT token in Authorization header

Required Permissions:

  • labs.view

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token: Bearer <token>

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier (MongoDB ObjectId)

Query Parameters

ParameterTypeRequiredDescription
pagenumberNoPage number (default: 1)
pageSizenumberNoItems per page (default: 20, max: 100)
searchstringNoSearch by title or ID
includeDeletedbooleanNoInclude deleted test groups (default: false)

Response 200 OK

{
"testGroups": [
{
"id": "507f1f77bcf86cd799439011",
"workspaceId": "507f1f77bcf86cd799439012",
"testGroupId": 5196,
"testGroupTitle": "Liver Functions+",
"testGroupDefaultPrice": 17.14,
"testGroupAccountId": 382,
"deletedAt": null,
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-15T10:00:00Z"
}
],
"pagination": {
"page": 1,
"pageSize": 20,
"total": 1,
"totalPages": 1
}
}

Common Errors

  • 400 Bad Request: Invalid query parameters
  • 401 Unauthorized: Missing or invalid authentication token
  • 403 Forbidden: Insufficient permissions (requires labs.view)
  • 404 Not Found: Workspace not found
  • 500 Internal Server Error: Server error