# Deals

Metrics that describe the path from a matched bid opportunity (biddable) to a delivered impression (win) for private marketplace deals.
The data is stored in UTC timezone and is available by hour.
**NOTE: this dataset requires the use of filter `organization_id` with exactly 1 value, and `deal_id` with at least 1 value.**
### Fields
| Field | Time Windows | Rollups |
|  --- | --- | --- |
| **Dimensions** |  |  |
| `agg_timestamp` | `current_day`, `last_X_hours`, `last_X_days`, `yesterday`, `month_to_date` | `by_hour`, `by_day`, `by_week`, `by_month` |
| `deal_external_id` | Any | Any |
| `deal_group_id` | Any | Any |
| `deal_group_name` | Any | Any |
| `deal_id` | Any | Any |
| `deal_name` | Any | Any |
| `deal_price_type` | Any | Any |
| `deal_publisher_id`Deal Publisher ID | Any | Any |
| `exchange_id` | Any | Any |
| `exchange_name` | Any | Any |
| **Metrics** |  |  |
| `bid_rate` | Any | Any |
| `biddables` | Any | Any |
| `bids` | Any | Any |
| `matches` | Any | Any |
| `win_rate` | Any | Any |
| `wins` | Any | Any |

### Pageable
Yes
### Time Windows
`current_day`, `last_X_hours`, `last_X_days`, `yesterday`, `month_to_date`
### Rollups
`all`, `by_hour`, `by_day`, `by_week`, `by_month`
### Data Retention / Lookback Window
1 year

Endpoint: POST /deals
Version: 1.0.0
Security: Auth0

## Description:

  - `Fields` ()
    FieldTime WindowsRollupsDimensionsagg_timestampcurrent_day, last_X_hours, last_X_days, yesterday, month_to_dateby_hour, by_day, by_week, by_monthdeal_external_idAnyAnydeal_group_idAnyAnydeal_group_nameAnyAnydeal_idAnyAnydeal_nameAnyAnydeal_price_typeAnyAnydeal_publisher_idDeal Publisher IDAnyAnyexchange_idAnyAnyexchange_nameAnyAnyMetricsbid_rateAnyAnybiddablesAnyAnybidsAnyAnymatchesAnyAnywin_rateAnyAnywinsAnyAny

  - `Pageable` ()
    Yes

  - `Time Windows` ()
    current_day, last_X_hours, last_X_days, yesterday, month_to_date

  - `Rollups` ()
    all, by_hour, by_day, by_week, by_month

  - `Data Retention / Lookback Window` ()
    1 year

## Security:

  - `Auth0` (unknown)
    oauth2 scopes: offline_access

## Request fields (application/json):

  - `end_time` (string)

  - `fields` (array, required)

  - `filters` (array, required)

  - `filters.field` (string)

  - `filters.filters` (array)

  - `filters.filters.field` (string)

  - `filters.filters.filters` (array)
    An array of filters. Required if `op` is `and` or `or`.

  - `filters.filters.op` (string)
    * `=`: Equals or contains if `value` is an array
* `!=`: Not equals
* `>`: Greater than
* `>=`: Greater than or equals
* `<`: Less than
* `<=`: Less than or equals
* `=~`: Text contains (case-insensitive)
* `and`: All filters must match
* `or`: At least one filter must match
* `isNull`: Is null
* `isNotNull`: Is not null

  - `filters.filters.value` (any)

  - `filters.op` (string)
    * `=`: Equals or contains if `value` is an array
* `!=`: Not equals
* `>`: Greater than
* `>=`: Greater than or equals
* `<`: Less than
* `<=`: Less than or equals
* `=~`: Text contains (case-insensitive)
* `and`: All filters must match
* `or`: At least one filter must match
* `isNull`: Is null
* `isNotNull`: Is not null

  - `filters.value` (any)

  - `full_entities` (array)

  - `max_results` (integer)
    Maximum number of results to return. Only applicable for streaming responses. No limit if absent or `null`.

  - `order` (array)

  - `order.desc` (boolean)

  - `order.field` (string, required)

  - `order.nulls_last` (boolean)

  - `pagination` (object)
    Streaming response if absent or `null`, Paginated response otherwise

  - `pagination.page_index` (integer)

  - `pagination.page_size` (integer)

  - `rollup` (string, required)

  - `start_time` (string)

  - `time_window` (string)

  - `time_zone` (string)
    **Only in supported datasets:** `campaign`, `UTC` or a time zone name defined in https://www.iana.org/time-zones

## Response 200:

  - `200` (unknown)
    JSON for Paginated, JSONL for Streaming

## Response 200 fields (application/json):

  - `meta` (object)

  - `meta.items_count` (integer)

  - `meta.page_index` (integer)

  - `meta.status` (string)
    Enum: "OK"

  - `meta.total_items_count` (integer)

  - `meta.total_pages` (integer)

  - `results` (array)

## Response 400:

  - `400` (unknown)
    The request is not valid

## Response 400 fields (application/json):

  - `error_code` (string)

  - `message` (string)

  - `request_id` (string)

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `error_code` (string)

  - `message` (string)

  - `request_id` (string)

## Response 5XX:

  - `5XX` (unknown)
    An error occurred

## Response 5XX fields (application/json):

  - `error_code` (string)

  - `message` (string)

  - `request_id` (string)

