# REST Resource: customers.tempTables

- [Resource: TempTable](https://developers.google.com/ads-data-hub/reference/rest/v1/customers.tempTables#TempTable)
  - [JSON representation](https://developers.google.com/ads-data-hub/reference/rest/v1/customers.tempTables#TempTable.SCHEMA_REPRESENTATION)
- [QueryType](https://developers.google.com/ads-data-hub/reference/rest/v1/customers.tempTables#QueryType)
- [Methods](https://developers.google.com/ads-data-hub/reference/rest/v1/customers.tempTables#METHODS_SUMMARY)

## Resource: TempTable

Defines a temp table created by an Ads Data Hub query. Temp tables are created using CREATE TABLE temp_table AS (...) in an Ads Data Hub query. Temp tables remain active for 72 hours before needing to be refreshed.

| JSON representation |
|---|
| ``` { "name": string, "tablePath": string, "adsDataCustomerId": string, "matchDataCustomerId": string, "queryType": enum (`https://developers.google.com/ads-data-hub/reference/rest/v1/customers.tempTables#QueryType`), "usableQueryTypes": [ enum (`https://developers.google.com/ads-data-hub/reference/rest/v1/customers.tempTables#QueryType`) ], "columns": [ { object (`https://developers.google.com/ads-data-hub/reference/rest/v1/Column`) } ], "createTime": string, "operation": string } ``` |

| Fields ||
|---|---|
| `name` | `string` Name that uniquely identifies a table. It has the form customers/\[customerId\]/tempTables/\[resource_id\]. The resource ID is generated by the server. |
| `tablePath` | `string` Fully qualified table path, e.g. 'tmp.table' |
| `adsDataCustomerId` | `string (https://developers.google.com/discovery/v1/type-format format)` Linked Ads Data Hub customer ID used when executing the original temp table query. |
| `matchDataCustomerId` | `string (https://developers.google.com/discovery/v1/type-format format)` Linked Ads Data Hub customer ID used when executing the original temp table query. |
| `queryType` | ``enum (`https://developers.google.com/ads-data-hub/reference/rest/v1/customers.tempTables#QueryType`)`` Type of query that created the table. Temp tables are only accessible to to queries of the same type unless usableQueryTypes is set. |
| `usableQueryTypes[]` | ``enum (`https://developers.google.com/ads-data-hub/reference/rest/v1/customers.tempTables#QueryType`)`` Types of queries that can access this temp table. If empty, this temp table is only accessible to queries of the same type as its queryType. |
| `columns[]` | ``object (`https://developers.google.com/ads-data-hub/reference/rest/v1/Column`)`` A list of table columns. |
| `createTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Timestamp when the temp table is created, in micros. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `operation` | `string` Operation that created the temp table. It has the form operations/\[jobId\] |

## QueryType

Query type.

| Enums ||
|---|---|
| `QUERY_TYPE_UNSPECIFIED` | No query type specified. |
| `ANALYSIS` | An AnalysisQuery. |
| `USER_LIST` | A UserListQuery. |
| `SPECIAL_ENDPOINT` | A query triggered by a special endpoint. |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/ads-data-hub/reference/rest/v1/customers.tempTables/get` | Retrieves the requested Ads Data Hub temp table. |
| ### `https://developers.google.com/ads-data-hub/reference/rest/v1/customers.tempTables/list` | Lists the Ads Data Hub temp tables that the customer has created. |