---
title: "Get tenant metrics"
method: GET
path: "/v2/{tenant_slug}/metrics"
tags: ["Metrics"]
---

# Get tenant metrics

`GET /v2/{tenant_slug}/metrics`

## Request

- Base URL: `https://api.demo-retail.urbanfox.io`
- URL: `https://api.demo-retail.urbanfox.io/v2/{tenant_slug}/metrics`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://api.demo-retail.urbanfox.io/v2/oauth/token` scopes: `read:metrics`
- TypeScript: <https://skmtc.dev/urbanfox/apis/urbanfox-customer-api/docs/v2/:tenant_slug/metrics/get.ts> (a function with typed inputs; its response is checked against the schema)

Retrieve tenant activity metrics for a selected date range.

## Path parameters

- `tenant_slug` string, required: Tenant DNS slug (lowercase letters, digits, and hyphens; 3-100 characters).

## Query parameters

- `start_date` string, date-time, required: Inclusive start of the metrics query window (RFC 3339 / ISO 8601 UTC, milliseconds optional).
- `end_date` string, date-time, required: Exclusive end of the metrics query window (RFC 3339 / ISO 8601 UTC, milliseconds optional). Events at exactly `end_date` are not included; must be strictly greater than `start_date`.
- `aggregation` 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year'
- `metric` 'timestamp' | 'total_events' | 'guest_sessions' | 'non_guest_sessions' | 'unique_sessions' | 'unique_ids' | 'session_starts'

## Response `200`

Successful Response

- APIResponseMetricListResponse
  - `data` MetricListResponse, required
    - `metrics` MetricDataPoint[], required: Array of time-series metric data points ordered by timestamp
      - `timestamp` string, date-time, required: Start of the aggregation bucket this data point covers (RFC 3339 / ISO 8601 UTC)
      - `total_events` integer, nullable: Total events recorded in the bucket starting at `timestamp`
      - `guest_sessions` integer, nullable: Sessions for unauthenticated users in the bucket starting at `timestamp`
      - `non_guest_sessions` integer, nullable: Sessions for authenticated users in the bucket starting at `timestamp`
      - `unique_sessions` integer, nullable: Distinct session identifiers seen in the bucket starting at `timestamp`
      - `unique_ids` integer, nullable: Distinct end-user identifiers seen in the bucket starting at `timestamp`
      - `session_starts` integer, nullable: Session-start events recorded in the bucket starting at `timestamp`

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `422`: Request Validation Failed
- `500`: Internal Server Error
- `502`: Bad Gateway

---

[API](https://skmtc.dev/urbanfox/apis/urbanfox-customer-api.md) - [All operations](https://skmtc.dev/urbanfox/apis/urbanfox-customer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/urbanfox/apis/urbanfox-customer-api/revisions/2850fb315db8?raw)
