The GET /api/v1/tests/reports/filter endpoint returns the saved testing report filter for the userKey taken from the Bearer token subject. For a company API key, this userKey has the format company-api-key:{companyId} and remains stable after key rotation. Access requires a Bearer token with the tests.read scope.
Which endpoint is used?
Use GET /api/v1/tests/reports/filter. The endpoint returns the current saved testing report filter for the user context from the Bearer token.
| Parameter | Value |
|---|---|
| Method | GET |
| Endpoint | /api/v1/tests/reports/filter |
| Base URL | [https://smartway.pro](https://smartway.pro) |
| Auth | Bearer token |
What is this API endpoint used for?
This endpoint is used to inspect the current filter applied to testing report search and export. It is used before POST /api/v1/tests/reports/search or POST /api/v1/tests/reports/export to understand which constraints will be applied.
What prerequisites are required before sending the request?
| Prerequisite | Description | Required |
|---|---|---|
access_token |
Bearer token | Yes |
tests.read |
Scope for reading the saved filter | Yes |
Which parameters must be sent in the request?
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer token in the Bearer <access_token> format |
Accept |
string | Yes | application/json |
Path parameters
Path parameters are absent.
Query parameters
Query parameters are absent.
Request body
Request body is not used.
curl example
curl -X GET 'https://smartway.pro/api/v1/tests/reports/filter' \
-H 'Authorization: Bearer <access_token>' \
-H 'Accept: application/json'
What response does the API return?
A successful request returns 200 OK and a PublicTestReportFilterResponse object with saved filter parameters.
{
"active": true,
"startDate": "2026-03-01",
"endDate": "2026-03-10",
"groupByName": true,
"testIds": [5, 200001],
"departments": ["Sales"],
"jobTitles": ["Manager"]
}
What do the API response fields mean?
| Field | Type | Description |
|---|---|---|
active |
boolean | Filter by report activity |
startDate |
string | Date range start |
endDate |
string | Date range end |
groupByName |
boolean | Grouping of multiple test attempts |
testIds |
array | Set of test IDs for the filter |
departments |
array | Set of departments for the filter |
jobTitles |
array | Set of job titles for the filter |
What happens under the hood?
-
The filter is bound to
userKey, which is taken from the Bearer token subject. -
For a company API key,
userKeyhas the formatcompany-api-key:{companyId}. -
userKeyremains stable after key rotation. -
The external client does not send
idUser. -
Access requires the
tests.readscope.
Which edge cases should be considered?
| Scenario | API behaviour | Integrator action |
|---|---|---|
| Company API key rotation | userKey remains stable in the company-api-key:{companyId} format |
Do not create a separate binding to the active key ID |
idUser in the request |
The external client does not send idUser |
Do not add idUser to the query string or body |
| Saved filter is active | The filter is applied to search and export | Check the filter before retrieving reports |
Which errors can the API return?
| HTTP status | Description |
|---|---|
401 Unauthorized |
Missing or invalid Bearer token |
403 Forbidden |
Insufficient permissions |
500 Internal Server Error |
Unexpected error |
503 Service Unavailable |
Service failure |
How to use the result in subsequent API requests?
Use the returned filter to understand which constraints will be applied to POST /api/v1/tests/reports/search and POST /api/v1/tests/reports/export.
Example report search after checking the filter:
curl -X POST 'https://smartway.pro/api/v1/tests/reports/search' \
-H 'Authorization: Bearer <access_token>' \
-H 'Accept: application/json'
Which mistakes should integrators avoid?
-
Sending
idUserin the request. -
Expecting the filter to be bound to a specific active key ID.
-
Running search or export without checking the current filter.
-
Calling the endpoint without the
tests.readscope.
FAQ
What is the saved filter bound to?
The filter is bound to userKey, which is taken from the Bearer token subject.
What is the userKey format for a company API key?
For a company API key, userKey has the format company-api-key:{companyId}.
Do I need to send idUser?
No. The external client does not send idUser.
Will the filter change after key rotation?
For a company API key, userKey remains stable after key rotation.
Which scope is required?
The tests.read scope is required.