---
title: "POST /userprofiles/{profileId}/reportdata/query"
method: POST
path: "/userprofiles/{profileId}/reportdata/query"
tags: ["reportData"]
---

# POST /userprofiles/{profileId}/reportdata/query

`POST /userprofiles/{profileId}/reportdata/query`

## Request

- Base URL: `https://dfareporting.googleapis.com/dfareporting/v5`
- URL: `https://dfareporting.googleapis.com/dfareporting/v5/userprofiles/{profileId}/reportdata/query`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/dfareporting`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/dfareporting`
- TypeScript: <https://skmtc.dev/google/apis/dfareporting/docs/userprofiles/:profileId/reportdata/query/post.ts> (a function with typed inputs; its response is checked against the schema)

Executes an ad-hoc query and returns structured JSON payload data.

## Path parameters

- `profileId` string, int64, required

## Request body

- ReportDataQueryRequest: The request body containing ad-hoc query parameters.
  - `dateRange` DateRange: Represents a date range.
    - `endDate` string, date
    - `kind` string: The kind of resource this is, in this case dfareporting#dateRange.
    - `relativeDateRange` 'TODAY' | 'YESTERDAY' | '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' | 'LAST_24_MONTHS' | 'LAST_14_DAYS' | 'LAST_60_DAYS': The date range relative to the date of when the report is run.
    - `startDate` string, date
  - `dimensionFilters` DimensionValue[]: Optional. The list of dimension values on which report lines are filtered. Utilizes the existing legacy filter message `DimensionValue`.
    - `dimensionName` string: The name of the dimension.
    - `etag` string: The eTag of this response for caching purposes.
    - `id` string: The ID associated with the value if available.
    - `kind` string: The kind of resource this is, in this case dfareporting#dimensionValue.
    - `matchType` 'EXACT' | 'BEGINS_WITH' | 'CONTAINS' | 'WILDCARD_EXPRESSION': Determines how the 'value' field is matched when filtering. If not specified, defaults to EXACT. If set to WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable length character sequences, and it can be escaped with a backslash. Note, only paid search dimensions ('dfa:paidSearch*') allow a matchType other than EXACT.
    - `value` string: The value of the dimension.
  - `dimensionNames` string[]: Optional. The list of dimension names to group by.
  - `maxResults` integer: Optional. Maximum number of result rows to return per page. The default value is 100. The maximum allowed value is 1000. Values above 1000 will be coerced (clamped) down to 1000. Negative values will be rejected.
  - `metricNames` string[]: Required. The list of metric names to include.
  - `pageToken` string: Optional. Continuation token for paginating results.
  - `sortBys` SortBy[]: Optional. Sort options across either requested dimensions or metrics.
    - `name` string: Required. The dimension or metric field name to sort on.
    - `sortOrder` 'ASCENDING' | 'DESCENDING': Optional. The sort order of this column.

## Response `200`

Successful response

- ReportDataResponse: Represents a response to report data request.
  - `columnHeaders` ColumnHeader[]: Output only. Ordered descriptors of the requested column fields.
    - `name` string: Output only. The column name.
    - `type` 'COLUMN_TYPE_UNSPECIFIED' | 'DIMENSION' | 'METRIC': Output only. The column type.
  - `nextPageToken` string: Output only. Token to retrieve the next page of rows, or empty if end of results.
  - `rows` ReportDataRow[]: Output only. The resulting set of matching data rows.
    - `values` string[]: Output only. A single sequential list of all cell values matching column_headers indices exactly. - Metric cells that are suppressed due to Minimum Reporting Standard (MRS) privacy protection constraints return "-".
  - `totalRow` ReportDataRow: A row of report data.
    - `values` string[]: Output only. A single sequential list of all cell values matching column_headers indices exactly. - Metric cells that are suppressed due to Minimum Reporting Standard (MRS) privacy protection constraints return "-".

## Changes

- **2026-10-10** `7976e946d342`: 2 breaking
  - removed the request body
  - removed the media type `*/*` for the response with the status `200`
- **2026-10-10** `d243e7dac94a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/google/apis/dfareporting/changes/userprofiles/:profileId/reportdata/query/post.md)

---

[API](https://skmtc.dev/google/apis/dfareporting.md) - [All operations](https://skmtc.dev/google/apis/dfareporting/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/dfareporting/revisions/be73a9a450de?raw)
