Create or Update Test Design Result (v1)
Method & Path
POST /api/v1/workspace/:workspaceId/labs/tests/:testId/design-result
Actual backend path: /v1/workspace/:workspaceId/labs/tests/:testId/design-result
Description
Create a new test design result for a test ID, or update it if it already exists.
Authentication
Required: JWT token in Authorization header
Persona Access:
- Workspace Owner: Allowed
- Staff: Allowed (role-based)
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) |
testId | number | Yes | Numeric test ID |
Request Body
{
"sections": [],
"commentRules": [],
"calculationsRules": []
}
| Field | Type | Required | Description |
|---|---|---|---|
sections | array | No | Test UI sections definition |
commentRules | array | No | Comment rules |
calculationsRules | array | No | Calculation rules |
Response 200 OK
{
"designResult": {
"id": "507f1f77bcf86cd799439050",
"workspaceId": "507f1f77bcf86cd799439012",
"testId": 101,
"sections": [],
"commentRules": [],
"calculationsRules": [],
"deletedAt": null,
"createdAt": "2026-01-10T12:00:00.000Z",
"updatedAt": "2026-01-11T08:00:00.000Z"
}
}
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: Workspace not found
422 Validation Error: Invalid workspace ID or invalid test ID