Observability
Add an overview of the Observability API here. This block is preserved across regenerations.
Endpoints
GET /api/v1/error-codes
Stable error code catalog. Returns every error code the v1 API can return, its HTTP status, description, and whether the error is retryable.
Complete error code catalog
Catalog of all stable v1 API error codes. Every error response from /api/v1 includes a code field that matches one of these entries. Use retryable to decide whether to back off and retry.
GET /api/v1/error-codes HTTP/1.1
Host: api.peakcommerce.app
Accept: */*
Complete error code catalog
{
"codes": [
{
"code": "rate_limit_exceeded",
"description": "text",
"retryable": true
}
]
}Notes, examples, or caveats for GET /error-codes go here.
GET /api/v1/status
Component-level health status suitable for status-page consumption. No auth required. Cached for 30 seconds.
Component health status (may be operational, degraded, or incident)
Worst-case status across all components
When this status snapshot was computed (TTL: 30 s)
GET /api/v1/status HTTP/1.1
Host: api.peakcommerce.app
Accept: */*
Component health status (may be operational, degraded, or incident)
{
"status": "operational",
"components": [
{
"name": "database",
"status": "operational",
"latencyMs": 1,
"detail": "text"
}
],
"cachedAt": "2026-01-01T00:00:00.000Z"
}This endpoint is public and unauthenticated, so each component reports only subsystem reachability — operational when the dependency is reachable, degraded/incident otherwise. It deliberately does not expose any tenant-specific detail (integration names or types, per-tenant catalog-sync state, or active-webhook counts); those are cross-tenant data and are only available through authenticated, tenant-scoped endpoints.
GET /api/v1/usage
Per-key API usage metrics (admin scope). Returns request counts, error counts, rate-limit hits, and latency broken down by route and 1-minute time bucket.
Scoped secret API key — send an sk_live_… value (keys issued before the typed format carry a bare pk_<hex> prefix and are also secret; they still work). A publishable pk_live_…/pk_test_… key is browser-safe, carries no scopes, and is refused by every endpoint in this spec with publishable_key_not_allowed. Coarse scopes: read, commerce, admin (admin covers everything below). Narrow per-resource scopes: journeys|pages :read|write|publish|delete, productsets :read|write|publish|delete, components|rules :read|write|delete, context :read (read-only context tier), catalog :read|write-native. publish is never implied by write.
Start of the time window (ISO 8601). Defaults to 24 hours ago.
End of the time window (ISO 8601). Defaults to now.
API key ID to filter. Defaults to the calling key. Pass * to see all keys on the tenant.
Filter to a specific route pattern (e.g. /accounts/:id).
Usage summary with per-route and per-bucket breakdowns
Per-key API usage metrics aggregated by route and time bucket
API key required
Insufficient scope (admin required)
GET /api/v1/usage HTTP/1.1
Host: api.peakcommerce.app
X-API-Key: YOUR_API_KEY
Accept: */*
{
"summary": {
"totalRequests": 1,
"totalErrors": 1,
"totalRateLimited": 1,
"avgLatencyMs": 1,
"errorRate": 1
},
"byRoute": [
{
"route": "/accounts/:id",
"method": "GET",
"requests": 1,
"errors": 1,
"rateLimited": 1,
"avgLatencyMs": 1
}
],
"byBucket": [
{
"timeBucket": "2026-01-01T00:00:00.000Z",
"requests": 1,
"errors": 1,
"rateLimited": 1,
"avgLatencyMs": 1
}
],
"window": {
"from": "2026-01-01T00:00:00.000Z",
"to": "2026-01-01T00:00:00.000Z",
"granularity": "minute"
},
"apiKey": {
"id": "text",
"prefix": "text",
"name": "text"
}
}Notes, examples, or caveats for GET /usage go here.
Last updated
Was this helpful?
