API Reference
Project Stats
Query CloudWatch-backed traffic, error, and latency metrics for your deployed projects.
Laatst bijgewerkt:
Project Stats API
Query CloudWatch-backed Amplify metrics for a deployed project. Returns traffic, error, and latency data bucketed over a 24h, 7d, or 30d window.
Get Stats
GET /api/v1/projects/{projectId}/stats?range=24h|7d|30d&debug=1Projects without a deployment return 400 NO_DEPLOYMENT. Upstream CloudWatch errors return 502 UPSTREAM_ERRORwith the AWS error name attached so you can debug permission and dimension issues. Set debug=1 to include diagnostics and the ListMetrics probe result when no datapoints are returned.
{
"data": {
"metrics": [
{ "name": "Requests", "datapoints": [{ "timestamp": "...", "value": 42 }] },
{ "name": "4xxErrors", "datapoints": [...] },
{ "name": "Latency", "datapoints": [...] }
],
"range": "7d",
"hours": 168
}
}