# Get metric distributions for a dynamic set.

`GET /sets/{set_id}/distribution`

> Wheelhouse Revenue Management API. Web version: https://docs.usewheelhouse.com/rm/reference/rm-get-set-distribution · OpenAPI spec: https://docs.usewheelhouse.com/rm/openapi.yaml · Operation ID: `rmGetSetDistribution` · Tag: Dynamic Sets

Returns histogram distributions for one or more metrics for a given calendar month, aggregated across the active member listings of the set.
**Paid sets only.** Returns `404 Not Found` for a free set — upgrade it first with `POST /sets/{set_id}/upgrade`.

Available metrics: `occupancy`, `occupancy_adjusted`, `asking_rate_w_fees`, `adr_w_fees`, `lead_time`, `revpar_adjusted_w_fees`, `revpar_w_fees`, `length_of_stay`.

## Request

`GET https://api.usewheelhouse.com/ss_api/v1/sets/{set_id}/distribution`

Authentication: send your RM API key in the `X-Integration-Api-Key` header (see https://docs.usewheelhouse.com/rm/authentication.md). Read-only keys can call this endpoint.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `set_id` | integer | yes | The Wheelhouse internal dynamic set ID. |

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `metric` | array of string | no | Metrics to include. Defaults to all metrics. Send more than one in brackets (`?metric[]=asking_rate_w_fees&metric[]=occupancy`); a key repeated without brackets keeps only its last value. (each item one of: `occupancy`, `occupancy_adjusted`, `asking_rate_w_fees`, `adr_w_fees`, `lead_time`, `revpar_adjusted_w_fees`, `revpar_w_fees`, `length_of_stay`) |
| `month` | string (date) | no | The month to retrieve distributions for (YYYY-MM-DD or YYYY-MM, e.g. `2026-05-01` or `2026-05`). Defaults to the start of the current month. (example: `2026-05-01`) |

### Example request

```bash
curl -X GET 'https://api.usewheelhouse.com/ss_api/v1/sets/{set_id}/distribution' \
  -H 'X-Integration-Api-Key: <your RM API key>'
```

Only required parameters and body fields are filled in, with placeholder values. Add the optional ones you need from the lists above; some are required in combination, as their descriptions say.

## Responses

### 200

Metric distributions for the dynamic set for the month.

Body (`application/json`): object

- `currency` (string): ISO-4217 currency code for monetary metrics.
- `month` (string (date)): The start of the month these distributions cover (YYYY-MM-DD).
- `updated_at` (string, example: `2026-08-30 04:17:22 UTC`): When the underlying set report was last generated, as a timestamp with a time zone abbreviation rather than ISO-8601.
- `data` (map of string to array of object): Distribution buckets keyed by metric name. Each metric maps to an array of histogram
  buckets sorted by probability descending.
  - `bucket_min_incl` (number): Inclusive lower bound of the bucket.
  - `bucket_max_excl` (number): Exclusive upper bound of the bucket.
  - `probability` (number): Fraction of observations in this bucket (0–1).
  - `percentile` (number): Cumulative probability up to and including this bucket (0–1).

Example shape (generated from the schema; placeholder values, not a real response):

```json
{
  "currency": "string",
  "month": "2026-01-01",
  "updated_at": "2026-08-30 04:17:22 UTC",
  "data": {
    "key": [
      {
        "bucket_min_incl": 0,
        "bucket_max_excl": 0,
        "probability": 0,
        "percentile": 0
      }
    ]
  }
}
```

### 204

Not enough data for the requested parameters.

### 400

Invalid parameter value (e.g. month out of range).

### 401

API key authorization failed.

### 404

Dynamic set not found, not accessible to the user, or not a paid set.

### 429

Rate limit exceeded — the API key has sent too many requests. Wait before retrying. See the **Rate Limits** section in the overview for the recommended exponential backoff strategy.

Body (`application/json`): object

- `error` (string, example: `API token is at rate limit`)

Example shape (generated from the schema; placeholder values, not a real response):

```json
{
  "error": "API token is at rate limit"
}
```
