Stop Test Plan
This endpoint creates stop requests for active test results under one or more test plans.
For each given plan ID, the service finds active test results with one of the following statuses: WAITING, PROCESSING, or RUNNING. Matching results are marked as TERMINATING and a stop request is published.
If a plan has no active test results, no stop request is created for that plan and the endpoint still returns a successful empty response.
Endpoint Information
- URL: {gateway-url}/stop-requests/execution
- Method: POST
- Authentication: Required (Bearer Token)
Request Headers
Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer token used for authentication. Example: Bearer <your_access_token> |
Content-Type | Yes | Must be application/json. |
X-Company-Id | Yes | The company ID used by the gateway to authorize and route the request. |
Request Body
{
"plans": [614, 615, 312]
}Request Body Parameters
Field | Type | Required | Description |
|---|---|---|---|
plans | Array | Yes | A non-empty list of test plan IDs. |
plans[] | Long | Yes | Each item in the list must be a non-null test plan ID. |
Response
This response indicates that the stop request operation was completed successfully. No additional data is returned.
{}Response Notes
- Only active test results are processed.
- Active statuses are WAITING, PROCESSING, and RUNNING.
- Test results that are already stop-requested are skipped.
- If a plan has no active result, the response is still successful.
- A non-existing plan ID in the plans list may be ignored if no matching plan is returned by the lookup.
Error Response Format
{
"instance": "/stop-requests/execution",
"status": 400,
"title": "Bad Request",
"type": "https://errors.testinium.com/validation",
"timestamp": "2026-08-18T12:08:41.165927056Z",
"errorType": "VALIDATION",
"errors": [
{
"code": 20005,
"message": "must not be empty",
"field": "plans"
}
]
}HTTP Error Codes
HTTP Code | Error Message | Description |
|---|---|---|
400 | Bad Request | The request body is invalid, malformed, or missing required fields. |
401 | Unauthorized | Authentication is missing or invalid. Check the Bearer token. |
403 | Forbidden | The authenticated user does not have permission for this operation or company. |
405 | Method Not Allowed | The endpoint was called with an unsupported HTTP method. |
500 | Internal Server Error | An unexpected error occurred on the server side. |
503 | Service Unavailable | The routed service is unavailable or cannot be reached through the gateway. |
Application Error Codes
Code | HTTP Status | Source | Description |
|---|---|---|---|
10001 | 401 | Gateway | Authentication is required. |
10002 | 401 | Gateway | Token is invalid or cannot be verified. |
10003 | 403 | Gateway | Authorization failed for the requested resource. |
10004 | 400 | Gateway | A required header, such as X-Company-Id, is missing or invalid. |
10008 | 503 | Gateway | Routed service is unavailable. |
20005 | 400 | Common Validation | Request body validation failed. For example, plans is empty or contains null. |
20009 | 405 | Common Validation | HTTP method is not supported. |
Example Request
curl --location '{gateway-url}/stop-requests/execution' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--header 'X-Company-Id: <company_id>' \
--data '{
"plans": [613]
}'