- [HTTP request](https://developers.google.com/ads-data-hub/reference/rest/v1/customers.analysisQueries/validate#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/ads-data-hub/reference/rest/v1/customers.analysisQueries/validate#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/ads-data-hub/reference/rest/v1/customers.analysisQueries/validate#body.request_body)
  - [JSON representation](https://developers.google.com/ads-data-hub/reference/rest/v1/customers.analysisQueries/validate#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/ads-data-hub/reference/rest/v1/customers.analysisQueries/validate#body.response_body)
  - [JSON representation](https://developers.google.com/ads-data-hub/reference/rest/v1/customers.analysisQueries/validate#body.ValidateAnalysisQueryResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/ads-data-hub/reference/rest/v1/customers.analysisQueries/validate#body.aspect)

Performs static validation checks on the provided analysis query.

### HTTP request

`POST https://adsdatahub.googleapis.com/v1/{parent=customers/*}/analysisQueries:validate`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` The parent resource name that owns the query, e.g. 'customers/123'. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "query": { object (`https://developers.google.com/ads-data-hub/reference/rest/v1/customers.analysisQueries#AnalysisQuery`) }, "adsDataCustomerId": string, "matchDataCustomerId": string, "spec": { object (`https://developers.google.com/ads-data-hub/reference/rest/v1/QueryExecutionSpec`) }, "includePerformanceInfo": boolean } ``` |

| Fields ||
|---|---|
| `query` | ``object (`https://developers.google.com/ads-data-hub/reference/rest/v1/customers.analysisQueries#AnalysisQuery`)`` The query to validate. |
| `adsDataCustomerId (deprecated)` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. Specific linked Ads Data Hub customer ID to use for validating ads data and temp table access. Defaults to all the linked customers. Deprecated. Use the adsDataCustomerId inside query_execution_spec. |
| `matchDataCustomerId (deprecated)` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. Specific linked Ads Data Hub customer ID to use for validating match data and temp table access. Defaults to all the linked customers. Deprecated. Use the match_table_customer_id inside query_execution_spec. |
| `spec` | ``object (`https://developers.google.com/ads-data-hub/reference/rest/v1/QueryExecutionSpec`)`` Optional. The duplicated fields inside query_execution_spec will override the fields outside. |
| `includePerformanceInfo` | `boolean` Optional. If true, call BigQuery to dry run the query to collect some performance info. It may take longer compared to only validating the query. The startDate, endDate and parameters inside query_execution_spec need to be set for the dry run. |

### Response body

Response to a analysisQueries.validate request.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "processedBytes": string, "queryPerformanceInfo": { object (`https://developers.google.com/ads-data-hub/reference/rest/v1/QueryPerformanceInfo`) }, "filteredRowSummary": { object (`https://developers.google.com/ads-data-hub/reference/rest/v1/customers.analysisQueries#FilteredRowSummary`) }, "warningsStatus": [ { object (`https://developers.google.com/ads-data-hub/reference/rest/v1/operations#Status`) } ], "status": [ { object (`https://developers.google.com/ads-data-hub/reference/rest/v1/operations#Status`) } ] } ``` |

| Fields ||
|---|---|
| `processedBytes (deprecated)` | `string (https://developers.google.com/discovery/v1/type-format format)` > [!WARNING] > This item is deprecated! Deprecated, and use queryPerformanceInfo instead. Bytes of data this query reads. See <https://cloud.google.com/bigquery/pricing#data> for details on how this is calculated. Returned if includePerformanceInfo is true. We round the processedBytes to MB, and then convert it to bytes. -1 means we couldn't fetch it for this query. |
| `queryPerformanceInfo` | ``object (`https://developers.google.com/ads-data-hub/reference/rest/v1/QueryPerformanceInfo`)`` Returned if includePerformanceInfo is true. |
| `filteredRowSummary` | ``object (`https://developers.google.com/ads-data-hub/reference/rest/v1/customers.analysisQueries#FilteredRowSummary`)`` Filtered row summary that would be used when the query is executed: the rows that are not sufficiently aggregated are dropped from the result, filtered row summary describes how to summarize these rows. For details see <https://developers.google.com/ads-data-hub/guides/legacy-diff-checks#filtered_row_summary>. |
| `warningsStatus[] (deprecated)` | ``object (`https://developers.google.com/ads-data-hub/reference/rest/v1/operations#Status`)`` > [!WARNING] > Deprecated. Use status instead. Additional warnings from validation, if any. This may include use of deprecated fields or features, or privacy anti-patterns in the query. These warnings will not block query execution, but should be considered for best results. |
| `status[]` | ``object (`https://developers.google.com/ads-data-hub/reference/rest/v1/operations#Status`)`` Additional information from validation, if any. This may include helpful information or warnings, such as privacy anti-patterns in the query. It will not block query execution, but should be considered for best results. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/adsdatahub`