# List Deals and their reporting data

List the Deals
This call returns all information you get with a deal and also the reporting data for a specified time interval (time_window : "yesterday", "last_7_days", "last_30_days", "month_to_date", or a custom range using "start_date" and "end_date"). You should only send time_window or start_date/end_date but not a combination of the both.
The filters field allows you to filter the results based on what you need, e.g: "filters": [{"field":"id", "op":"in", "value": [123]}] will look for deals that have 123 in their ID.
{"field" :"match_rate", "op":">", "value" :0} will return deals that have a "match_rate" greater than 0. You can also use the "sorting" field to sort the results, eg: "sorting":[{"field":"viewability_rate", "dir":"asc"}] will give the results sorted by the viewability_rate field.

```{
  "reporting": {
    "organization_id": 100048,
    "time_window": "last_7_days",
    "start_date": null,
    "end_date": null
  },
  "filters": [
   {"field": "id",
               "op": "in",
               "value" : [447824]},
               {"field": "match_rate",
               "op": ">",
               "value" : 0}
  ],
  "sorting": [
      {
               "field": "viewability_rate",
               "dir": "asc"
           }
 
  ],
  "paging": {
    "page_offset": 0
  }
}
```

Endpoint: POST /deal_analytics
Version: 2.0
Security: Bearer

## Security:

  - `Bearer` (unknown)
    apiKey in header Authorization

## Query parameters:

  - `owner.organization_id` (integer, required)
    Organization ID that owns the deals

  - `permissions.organization_ids` (string)
    Comma-separated list of organization IDs to filter deals by. Returns deals permissioned to at least one of the specified organizations (OR within this parameter). If combined with permissions.agency_ids or permissions.advertiser_ids, a deal must match at least one ID from each provided parameter (AND between parameters). Users may only request IDs they have access to; unauthorized IDs return 400.

  - `permissions.agency_ids` (string)
    Comma-separated list of agency IDs to filter deals by. Returns deals permissioned to at least one of the specified agencies (OR within this parameter). If combined with permissions.organization_ids or permissions.advertiser_ids, a deal must match at least one ID from each provided parameter (AND between parameters). Users may only request IDs they have access to; unauthorized IDs return 400.

  - `permissions.advertiser_ids` (string)
    Comma-separated list of advertiser IDs to filter deals by. Returns deals permissioned to at least one of the specified advertisers (OR within this parameter). If combined with permissions.organization_ids or permissions.agency_ids, a deal must match at least one ID from each provided parameter (AND between parameters). Users may only request IDs they have access to; unauthorized IDs return 400.

## Header parameters:

  - `Content-Type` (string, required)
    Content-Type

  - `Cookie` (string, required)
    Cookie

## Request body:

  - `application/json` (unknown)
    Request body for deal analytics query

## Request fields (application/json):

  - `reporting` (object, required)

  - `reporting.organization_id` (integer, required)
    Organization ID for which to retrieve reporting data

  - `reporting.time_window` (string)
    Predefined time window (use either this OR start_date/end_date)
    Enum: "yesterday", "last_7_days", "last_30_days", "month_to_date"

  - `reporting.start_date` (string)
    Custom start date (YYYY-MM-DD). Use with end_date instead of time_window

  - `reporting.end_date` (string)
    Custom end date (YYYY-MM-DD). Use with start_date instead of time_window

  - `filters` (array)
    Filter criteria for deals

  - `filters.field` (string)
    Field name to filter on (e.g., "id", "match_rate", "name")

  - `filters.op` (string)
    Operator (e.g., "in", ">", "<", "=", "!=")

  - `filters.value` (any)
    Value or array of values to filter by

  - `sorting` (array)
    Sort criteria

  - `sorting.field` (string)
    Field name to sort by (e.g., "viewability_rate", "name", "id")

  - `sorting.dir` (string)
    Sort direction
    Enum: "asc", "desc"

  - `paging` (object)

  - `paging.page_offset` (integer)
    Offset for pagination

  - `paging.page_limit` (integer)
    Number of results per page

## Response 200:

  - `200` (unknown)
    Returns deals with performance/reporting data

## Response 200 fields (application/json):

  - `data` (array)

  - `data.id` (integer)

  - `data.name` (string)

  - `data.description` (string)

  - `data.created_on` (string)

  - `data.updated_on` (string)

  - `data.supply_source_id` (integer)

  - `data.sub_supply_source_id` (integer | null)

  - `data.deal_identifier` (string)

  - `data.start_datetime` (string)

  - `data.end_datetime` (string)

  - `data.price_type` (string)
    Enum: "FIXED", "FLOOR"

  - `data.price_method` (string)
    Enum: "CPM"

  - `data.status` (boolean)

  - `data.bill_type` (string)
    Enum: "EXCHANGE", "NONE", "PUBLISHER"

  - `data.deal_type` (string)
    Enum: "PG", "STANDARD"

  - `data.impressions` (integer | null)

  - `data.publisher_id` (integer | null)

  - `data.strategies_count` (integer)
    Number of strategies targeting this deal

  - `data.organization_id` (integer)
    Organization ID that owns this deal

  - `data.effective_status` (string)
    Current effective status of the deal

  - `data.severity` (string | null)

  - `data.permissions` (object)

  - `data.permissions.all_organizations` (boolean)

  - `data.permissions.organization_ids` (array)

  - `data.permissions.agency_ids` (array)

  - `data.permissions.advertiser_ids` (array)

  - `data.owner` (object)

  - `data.owner.type` (string)
    Enum: "ADVERTISER", "AGENCY", "INTERNAL", "ORGANIZATION"

  - `data.owner.id` (integer)

  - `data.price` (object)

  - `data.price.value` (string)

  - `data.price.currency_code` (string)

  - `data.entity_type` (string)

  - `data.performance_data` (object)
    Performance metrics for the deal during the specified time period

  - `data.performance_data.bid_requests` (integer)

  - `data.performance_data.bids` (integer)

  - `data.performance_data.bid_rate` (number)

  - `data.performance_data.wins` (integer)

  - `data.performance_data.win_rate` (number)

  - `data.performance_data.matches` (integer)

  - `data.performance_data.match_rate` (number)

  - `data.performance_data.total_spend` (object)

  - `data.performance_data.total_spend.value` (number)

  - `data.performance_data.total_spend.currencyCode` (string)

  - `data.performance_data.impressions` (integer)

  - `data.performance_data.e_CPM` (object)

  - `data.performance_data.e_CPM.value` (number)

  - `data.performance_data.e_CPM.currencyCode` (string)

  - `data.performance_data.media_spend` (object)

  - `data.performance_data.media_spend.value` (number)

  - `data.performance_data.media_spend.currencyCode` (string)

  - `data.performance_data.v_CPM` (object)

  - `data.performance_data.v_CPM.value` (number)

  - `data.performance_data.v_CPM.currencyCode` (string)

  - `data.performance_data.viewability_rate` (object)

  - `data.performance_data.viewability_rate.value` (number | null)

  - `data.performance_data.viewability_rate.currencyCode` (string)

  - `data.performance_data.videoCompleteRate` (object)

  - `data.performance_data.videoCompleteRate.value` (number | null)

  - `data.performance_data.videoCompleteRate.currencyCode` (string)

  - `data.performance_data.total_spend_CPA` (object)

  - `data.performance_data.total_spend_CPA.value` (number)

  - `data.performance_data.total_spend_CPA.currencyCode` (string)

  - `data.performance_data.media_spend_CPM` (object)

  - `data.performance_data.media_spend_CPM.value` (number)

  - `data.performance_data.media_spend_CPM.currencyCode` (string)

  - `data.performance_data.clicks` (integer)

  - `data.performance_data.ctr` (number)

  - `data.performance_data.response_rate` (object)

  - `data.performance_data.response_rate.value` (number)

  - `data.performance_data.response_rate.is_percent` (boolean)

  - `data.performance_data.uniques` (integer)

  - `data.performance_data.frequency` (number)

  - `data.issues` (array)
    Array of issues or problems with the deal

  - `data.deal_groups` (array)

  - `data.supply_source` (object)
    Supply source details

  - `data.supply_source.id` (integer)
    Supply source ID

  - `data.supply_source.name` (string)
    Supply source name

  - `data.channels` (array)
    Channels associated with this deal

  - `data.channels.id` (string)
    Channel ID (string format)

  - `data.channels.name` (string)

  - `data.publisher` (object | null)
    Publisher details

  - `data.publisher.id` (string)

  - `data.publisher.name` (string)

  - `data.is_favorite` (boolean)
    Whether this deal is marked as favorite

  - `meta` (object)

  - `meta.total_count` (integer)

  - `meta.count` (integer)

  - `meta.status` (string | null)

  - `meta.offset` (integer)

  - `meta.next_page` (string | null)

