diff --git a/docs.json b/docs.json index d91fa81..c10ad83 100644 --- a/docs.json +++ b/docs.json @@ -147,6 +147,7 @@ "references/api/utilities", "references/api/get-chains", "references/api/get-chains-liquidity", + "references/api/get-integrators-usage", "references/api/get-currencies-v2", "references/api/get-token-price", "references/api/transactions-index", diff --git a/references/api/api-keys.mdx b/references/api/api-keys.mdx index 1d694d4..08cb5fb 100644 --- a/references/api/api-keys.mdx +++ b/references/api/api-keys.mdx @@ -26,6 +26,7 @@ The [Relay Dashboard](https://dashboard.relay.link) is also where you observe wh - **Custom views** — save any combination of filters, sort order, and columns as a reusable view for your team, each with its own name, icon, and color. - **Keys** — create, rename, and revoke keys for your account. - **Webhooks** — configure a per-key [webhook endpoint](/references/api/api_guides/webhooks) so transaction status updates are pushed to your backend instead of polling. +- **Programmatic usage metrics** — the [Get Integrator Usage](/references/api/get-integrators-usage) endpoint returns aggregated request counts grouped by endpoint, status code, and error code across `minutely` / `hourly` / `daily` buckets, so you can wire the same data the Dashboard shows into your own monitoring. When debugging a specific transaction, paste the `requestId` from your application into the dashboard's search to jump straight to the matching record. diff --git a/references/api/get-integrators-usage.mdx b/references/api/get-integrators-usage.mdx new file mode 100644 index 0000000..06ab854 --- /dev/null +++ b/references/api/get-integrators-usage.mdx @@ -0,0 +1,11 @@ +--- +title: "Get Integrator Usage" +description: "Returns aggregated request counts grouped by API key, endpoint, status code, and error code" +openapi: get /integrators/usage +--- + +Programmatic counterpart to the Dashboard's request history — returns the same aggregated counts you see under **Requests**, broken down by endpoint, HTTP status, and (for `400` responses) the machine-readable `errorCode`. + +The `granularity` query parameter controls the time bucket and the default window: `minutely` (last 24h), `hourly` (last 7d), or `daily` (last 14d). Data older than 14 days is not retained. + +Use `granularity=minutely` to build a near-real-time uptime view; use `granularity=daily` for longer-range trend analysis. The `errorCode` field on `400` rows lets you distinguish validation errors (e.g. `AMOUNT_TOO_LOW`, `UNSUPPORTED_CHAIN`) from other client errors when calculating a meaningful success rate.