API Reference
Get timeseries data for a task
Daily data points from the metrics database.
GET /api/metrics/data/timeseries/{taskId}
Daily data points from the metrics database.
Operation ID: getMetricsTimeseries
Authentication
Option 1
- BearerAuth (
http bearer) API key token. Create via POST /api/api-keys. Format:envoy_<hex>
Option 2
- CookieAuth (
apiKey) Session cookie set after login + TOTP verification
Path parameters
taskId—integer,required
Query parameters
days—integerNumber of days to look back Example:30- Default:
30 - Maximum: 90
- Default:
Success responses
200
Timeseries data
Content type: application/json
- Type:
object - Properties:
available(boolean)task(string)points(array<object>)- Items:
- Type:
object - Properties:
day(string)- Format:
date
- Format:
success(integer)error(integer)avg_duration_ms(number)total_items(integer)
- Type:
- Items:
Error responses
404
Resource not found
Content type: application/json
- Reference:
Error- Type:
object - Properties:
error(string)- Example:
NOT_FOUND
- Example:
message(string)- Example:
Resource not found
- Example:
- Type:
Example:
{
"error": "NOT_FOUND",
"message": "Resource not found"
}Examples
cURL
curl --request GET \
--url 'https://your-envoy.example.com/api/metrics/data/timeseries/YOUR_TASK_ID' \
--header 'Authorization: Bearer $API_KEY'JavaScript (fetch)
const response = await fetch('https://your-envoy.example.com/api/metrics/data/timeseries/YOUR_TASK_ID', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
},
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = response.status === 204 ? null : await response.json();
console.log(data);