---
title: "POST /queries"
method: POST
path: "/queries"
tags: ["queries"]
---

# POST /queries

`POST /queries`

Creates a new query.

## Request body

- Query — A single query used to generate a report.
  - `metadata` QueryMetadata — The metadata of the query.
    - `sendNotification` boolean — Whether an email notification is sent to the query creator when a report generated by the query is ready. This value is `false` by default.
    - `shareEmailAddress` string[] — List of additional email addresses with which to share the query. If send_notification is `true`, these email addresses will receive a notification when a report generated by the query is ready. If these email addresses are connected to Display & Video 360 users, the query will be available to them in the Display & Video 360 interface.
    - `title` string — The display name of the query. This value will be used in the file name of reports generated by the query.
    - `format` 'FORMAT_UNSPECIFIED' | 'CSV' | 'XLSX' — The format of the report generated by the query.
    - `dataRange` DataRange — The date range to be reported on.
      - `range` 'RANGE_UNSPECIFIED' | 'CUSTOM_DATES' | 'CURRENT_DAY' | 'PREVIOUS_DAY' | 'WEEK_TO_DATE' | 'MONTH_TO_DATE' | 'QUARTER_TO_DATE' | 'YEAR_TO_DATE' | 'PREVIOUS_WEEK' | 'PREVIOUS_MONTH' | 'PREVIOUS_QUARTER' | 'PREVIOUS_YEAR' | 'LAST_7_DAYS' | 'LAST_30_DAYS' | 'LAST_90_DAYS' | 'LAST_365_DAYS' | 'ALL_TIME' | 'LAST_14_DAYS' | 'LAST_60_DAYS' — The preset date range to be reported on. If `CUSTOM_DATES` is assigned to this field, fields custom_start_date and custom_end_date must be set to specify the custom date range.
      - `customStartDate` Date — Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
        - `month` integer — Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
        - `day` integer — Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
        - `year` integer — Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
      - `customEndDate` Date — Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
        - `month` integer — Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
        - `day` integer — Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
        - `year` integer — Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
  - `params` Parameters — Parameters of a generated report.
    - `groupBys` string[] — Dimensions by which to segment and group the data. Defined by [Filter](/bid-manager/reference/rest/v2/filters-metrics#filters) values.
    - `metrics` string[] — Metrics to define the data populating the report. Defined by [Metric](/bid-manager/reference/rest/v2/filters-metrics#metrics) values.
    - `type` 'REPORT_TYPE_UNSPECIFIED' | 'STANDARD' | 'INVENTORY_AVAILABILITY' | 'AUDIENCE_COMPOSITION' | 'FLOODLIGHT' | 'YOUTUBE' | 'GRP' | 'YOUTUBE_PROGRAMMATIC_GUARANTEED' | 'REACH' | 'UNIQUE_REACH_AUDIENCE' | 'FULL_PATH' | 'PATH_ATTRIBUTION' — The type of the report. The type of the report determines the dimesions, filters, and metrics that can be used.
    - `filters` FilterPair[] — Filters to limit the scope of reported data.
      - `type` string — The type of value to filter by. Defined by a [Filter](/bid-manager/reference/rest/v2/filters-metrics#filters) value.
      - `value` string — The identifying value to filter by, such as a relevant resource ID.
    - `options` Options — Report parameter options.
      - `includeOnlyTargetedUserLists` boolean — Whether to include data for audience lists specifically targeted by filtered line items or insertion orders. Requires the use of `FILTER_INSERTION_ORDER` or `FILTER_LINE_ITEM` filters.
  - `schedule` QuerySchedule — Settings on when and how frequently to run a query.
    - `frequency` 'FREQUENCY_UNSPECIFIED' | 'ONE_TIME' | 'DAILY' | 'WEEKLY' | 'SEMI_MONTHLY' | 'MONTHLY' | 'QUARTERLY' | 'YEARLY' — How frequently to run the query. If set to `ONE_TIME`, the query will only be run when queries.run is called.
    - `nextRunTimezoneCode` string — The canonical code for the timezone the query schedule is based on. Scheduled runs are usually conducted in the morning of a given day. Defaults to `America/New_York`.
    - `startDate` Date — Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
      - `month` integer — Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
      - `day` integer — Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
      - `year` integer — Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
    - `endDate` Date — Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
      - `month` integer — Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
      - `day` integer — Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
      - `year` integer — Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
  - `queryId` string, int64 — Output only. The unique ID of the query.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/doubleclickbidmanager.md) · [All operations](https://skmtc.net/google/apis/doubleclickbidmanager/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/doubleclickbidmanager/versions/645f0c8d982a/schema)
