For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

get
/error-codes
Responses
200

Complete error code catalog

application/json

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/error-codes
GET /api/v1/error-codes HTTP/1.1
Host: api.peakcommerce.app
Accept: */*
200

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.

get
/status
Responses
200

Component health status (may be operational, degraded, or incident)

application/json
statusstring · enumRequired

Worst-case status across all components

Possible values:
cachedAtstring · date-timeRequired

When this status snapshot was computed (TTL: 30 s)

get/status
GET /api/v1/status HTTP/1.1
Host: api.peakcommerce.app
Accept: */*
200

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.

get
/usage
Authorizations
X-API-KeystringRequired

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.

Query parameters
fromstring · date-timeOptional

Start of the time window (ISO 8601). Defaults to 24 hours ago.

tostring · date-timeOptional

End of the time window (ISO 8601). Defaults to now.

apiKeyIdstringOptional

API key ID to filter. Defaults to the calling key. Pass * to see all keys on the tenant.

routestringOptional

Filter to a specific route pattern (e.g. /accounts/:id).

Responses
200

Usage summary with per-route and per-bucket breakdowns

application/json

Per-key API usage metrics aggregated by route and time bucket

get/usage
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?