Tests
Duration percentiles, the duration histogram and the pass, failure and flakiness rates for the tests matching the filters, over the date range and the range of the same length before it. Pass signature for a single test. The filters and metric_settings behave as they do on GET /tests/{projectId}, so the numbers agree with the rows there.
An organization API key, sent as Authorization: Bearer <key>. A key carries one scope for the whole API: a read key reaches the GET endpoints, a write key reaches all of them. A crnts_pat_ personal access token is accepted as a Bearer while its owner remains an eligible administrator in its active organization. Each operation requires the corresponding scope stored on that token.
The project ID
proj_abc123Start date in ISO 8601 format
2024-01-01T00:00:00.000ZEnd date in ISO 8601 format
2024-01-31T23:59:59.999ZFilter by tags (can be specified multiple times using bracket notation, e.g., tags[]=value1&tags[]=value2)
["tag1","tag2"]Filter by groups (can be specified multiple times using bracket notation, e.g., groups[]=group1&groups[]=group2)
["group1","group2"]Filter by git authors (can be specified multiple times using bracket notation, e.g., authors[]=author1&authors[]=author2)
["author1","author2"]Filter by environment (can be specified multiple times using bracket notation, e.g., environments[]=staging&environments[]=production)
["staging","production"]Limit the metrics to one test
Filter tests by spec file name (partial match)
Filter tests by title (partial match)
Overrides which outcomes feed each metric. Keys: executions, avgDuration, flakinessRate, failureRate — each value is an array of RecordedTestOutcome. Omitted keys use defaults. Pass as a JSON value (same encoding as content: application/json for this parameter).
Filter by test annotations. The parameter value must be a JSON-stringified array of objects: [{ "type": "string", "description": "string" | ["string"] or null }]. description is optional; omit or set to null to match any value for that annotation.
[{"type":"owner","description":["John Doe"]},{"type":"skip"}]Successful response
Invalid request parameters
Authentication failed
The credential authenticated but is not permitted to use this endpoint. Five refusals share the status: a read API key on an endpoint that writes, an OAuth token that was not granted the scope the endpoint needs (insufficient_scope), an OAuth token that was granted it but whose holder no longer has a role permitting it (insufficient_role), an OAuth token on an endpoint that accepts an API key and nothing else (api_key_required), and an API key on an endpoint that answers for a user (user_credential_required). Discriminate on code rather than on the message, which is free-form. The first refusal predates the codes and sets none. Only insufficient_scope carries the challenge header, because it is the only one a client can act on by re-authorizing.
Resource not found
GET /v1/tests/{projectId}/metrics?date_start=2026-01-01T00%3A00%3A00.000Z&date_end=2026-01-01T00%3A00%3A00.000Z HTTP/1.1
Host: api.currents.dev
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"status": "OK",
"data": {
"current": {
"executions": 1,
"overallExecutions": 1,
"avgMs": 1,
"p50Ms": 1,
"p90Ms": 1,
"p95Ms": 1,
"passRate": 1,
"failureRate": 1,
"flakinessRate": 1,
"suiteSize": 1,
"testsPerExecution": 1
},
"previous": {
"executions": 1,
"overallExecutions": 1,
"avgMs": 1,
"p50Ms": 1,
"p90Ms": 1,
"p95Ms": 1,
"passRate": 1,
"failureRate": 1,
"flakinessRate": 1,
"suiteSize": 1,
"testsPerExecution": 1
},
"minMs": 1,
"maxMs": 1,
"distribution": [
{
"minMs": 1,
"maxMs": 1,
"executions": 1
}
]
}
}Last updated
Was this helpful?