---
title: "POST /v1/{+parent}:queryAssets"
method: POST
path: "/v1/{+parent}:queryAssets"
tags: ["v1"]
---

# POST /v1/{+parent}:queryAssets

`POST /v1/{+parent}:queryAssets`

Issue a job that queries assets using a SQL statement compatible with [BigQuery SQL](https://cloud.google.com/bigquery/docs/introduction-sql). If the query execution finishes within timeout and there's no pagination, the full query results will be returned in the `QueryAssetsResponse`. Otherwise, full query results can be obtained by issuing extra requests with the `job_reference` from the a previous `QueryAssets` call. Note, the query result has approximately 10 GB limitation enforced by [BigQuery](https://cloud.google.com/bigquery/docs/best-practices-performance-output). Queries return larger results will result in errors.

## Path parameters

- `parent` string, required

## Request body

- QueryAssetsRequest — QueryAssets request.
  - `readTime` string, google-datetime — Optional. Queries cloud assets as they appeared at the specified point in time.
  - `readTimeWindow` TimeWindow — A time window specified by its `start_time` and `end_time`.
    - `startTime` string, google-datetime — Start time of the time window (exclusive).
    - `endTime` string, google-datetime — End time of the time window (inclusive). If not specified, the current timestamp is used instead.
  - `outputConfig` QueryAssetsOutputConfig — Output configuration query assets.
    - `bigqueryDestination` GoogleCloudAssetV1QueryAssetsOutputConfigBigQueryDestination — BigQuery destination.
      - `writeDisposition` string — Specifies the action that occurs if the destination table or partition already exists. The following values are supported: * WRITE_TRUNCATE: If the table or partition already exists, BigQuery overwrites the entire table or all the partitions data. * WRITE_APPEND: If the table or partition already exists, BigQuery appends the data to the table or the latest partition. * WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY.
      - `table` string — Required. The BigQuery table where the query results will be saved. If this table does not exist, a new table with the given name will be created.
      - `dataset` string — Required. The BigQuery dataset where the query results will be saved. It has the format of "projects/{projectId}/datasets/{datasetId}".
  - `statement` string — Optional. A SQL statement that's compatible with [BigQuery SQL](https://cloud.google.com/bigquery/docs/introduction-sql).
  - `timeout` string, google-duration — Optional. Specifies the maximum amount of time that the client is willing to wait for the query to complete. By default, this limit is 5 min for the first query, and 1 minute for the following queries. If the query is complete, the `done` field in the `QueryAssetsResponse` is true, otherwise false. Like BigQuery [jobs.query API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest) The call is not guaranteed to wait for the specified timeout; it typically returns after around 200 seconds (200,000 milliseconds), even if the query is not complete. The field will be ignored when [output_config] is specified.
  - `pageToken` string — Optional. A page token received from previous `QueryAssets`. The field will be ignored when [output_config] is specified.
  - `jobReference` string — Optional. Reference to the query job, which is from the `QueryAssetsResponse` of previous `QueryAssets` call.
  - `pageSize` integer — Optional. The maximum number of rows to return in the results. Responses are limited to 10 MB and 1000 rows. By default, the maximum row count is 1000. When the byte or row count limit is reached, the rest of the query results will be paginated. The field will be ignored when [output_config] is specified.

## Response `200`

Successful response

---

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