Operations (sample payloads)

Main operations
Copy

Add or update columns in table
Copy

Add or update one or more columns in a table in BigQuery via the API, so you don't have to create them manually. Useful when you're looking to ensure that a table matches a schema before running an "Insert Rows" operation.

Sample Input

1
{
2
"project_id": "my-bigquery-project",
3
"dataset_id": "sales_data",
4
"table_id": "customer_transactions",
5
"fields": [
6
{
7
"name": "customer_id",
8
"mode": "REQUIRED",
9
"type": "STRING",
10
"description": "Unique identifier for the customer"
11
},
12
{
13
"name": "transaction_date",
14
"mode": "REQUIRED",
15
"type": "DATE",
16
"description": "Date of the transaction"
17
},
18
{
19
"name": "amount",
20
"mode": "REQUIRED",
21
"type": "FLOAT",
22
"description": "Transaction amount in USD"
23
},
24
{
25
"name": "product_category",
26
"mode": "NULLABLE",
27
"type": "STRING",
28
"description": "Category of the product purchased"
29
},
30
{
31
"name": "customer_info",
32
"mode": "NULLABLE",
33
"type": "RECORD",
34
"description": "Nested record containing customer information",
35
"fields": [
36
{
37
"name": "name",
38
"mode": "REQUIRED",
39
"type": "STRING",
40
"description": "Customer's full name"
41
},
42
{
43
"name": "email",
44
"mode": "NULLABLE",
45
"type": "STRING",
46
"description": "Customer's email address"
47
}
48
]
49
}
50
]
51
}

Sample Output

1
{
2
"kind": "bigquery#table",
3
"etag": "\"mCOGFE+ego/Jm3g3HdKrcmcuy/M/rXbMbKfEG+4mYcI=\"",
4
"id": "my-bigquery-project:sales_data.customer_transactions",
5
"selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/my-bigquery-project/datasets/sales_data/tables/customer_transactions",
6
"tableReference": {
7
"projectId": "my-bigquery-project",
8
"datasetId": "sales_data",
9
"tableId": "customer_transactions"
10
},
11
"schema": {
12
"fields": [
13
{
14
"name": "customer_id",
15
"type": "STRING",
16
"mode": "REQUIRED"
17
},
18
{
19
"name": "transaction_date",
20
"type": "DATE",
21
"mode": "REQUIRED"
22
},
23
{
24
"name": "amount",
25
"type": "FLOAT",
26
"mode": "REQUIRED"
27
},
28
{
29
"name": "product_category",
30
"type": "STRING",
31
"mode": "NULLABLE"
32
},
33
{
34
"name": "customer_info",
35
"type": "RECORD",
36
"mode": "NULLABLE",
37
"fields": [
38
{
39
"name": "name",
40
"type": "STRING",
41
"mode": "REQUIRED"
42
},
43
{
44
"name": "email",
45
"type": "STRING",
46
"mode": "NULLABLE"
47
}
48
]
49
}
50
]
51
},
52
"numBytes": "0",
53
"numLongTermBytes": "0",
54
"numRows": "0",
55
"creationTime": "1625097600000",
56
"lastModifiedTime": "1625097600000",
57
"type": "TABLE"
58
}

Create table
Copy

Create a new, empty table in the dataset.

Sample Input

1
{
2
"table_reference": {
3
"project_id": "my-bigquery-project",
4
"dataset_id": "sales_data",
5
"table_id": "transactions_2023"
6
},
7
"friendly_name": "Sales Transactions 2023",
8
"description": "This table contains all sales transactions for the year 2023",
9
"expiration_time": "2024-12-31T23:59:59Z",
10
"labels": [
11
{
12
"key": "department",
13
"value": "sales"
14
},
15
{
16
"key": "data_type",
17
"value": "transactions"
18
}
19
],
20
"schema": {
21
"fields": [
22
{
23
"name": "transaction_id",
24
"type": "STRING",
25
"mode": "REQUIRED",
26
"description": "Unique identifier for each transaction"
27
},
28
{
29
"name": "date",
30
"type": "DATE",
31
"mode": "REQUIRED",
32
"description": "Date of the transaction"
33
},
34
{
35
"name": "customer_id",
36
"type": "STRING",
37
"mode": "REQUIRED",
38
"description": "Unique identifier for the customer"
39
},
40
{
41
"name": "amount",
42
"type": "FLOAT",
43
"mode": "REQUIRED",
44
"description": "Total amount of the transaction"
45
},
46
{
47
"name": "items",
48
"type": "RECORD",
49
"mode": "REPEATED",
50
"description": "List of items in the transaction",
51
"fields": [
52
{
53
"name": "product_id",
54
"type": "STRING",
55
"mode": "REQUIRED",
56
"description": "Unique identifier for the product"
57
},
58
{
59
"name": "quantity",
60
"type": "INTEGER",
61
"mode": "REQUIRED",
62
"description": "Quantity of the product purchased"
63
},
64
{
65
"name": "unit_price",
66
"type": "FLOAT",
67
"mode": "REQUIRED",
68
"description": "Price per unit of the product"
69
}
70
]
71
}
72
]
73
}
74
}

Sample Output

1
{
2
"kind": "bigquery#table",
3
"etag": "\"mTRxODTXWKzTJ0cCZLWzIw==\"",
4
"id": "my-bigquery-project:sales_data.transactions_2023",
5
"selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/my-bigquery-project/datasets/sales_data/tables/transactions_2023",
6
"tableReference": {
7
"projectId": "my-bigquery-project",
8
"datasetId": "sales_data",
9
"tableId": "transactions_2023"
10
},
11
"schema": {
12
"fields": [
13
{
14
"name": "transaction_id",
15
"type": "STRING",
16
"mode": "REQUIRED",
17
"description": "Unique identifier for each transaction"
18
},
19
{
20
"name": "date",
21
"type": "DATE",
22
"mode": "REQUIRED",
23
"description": "Date of the transaction"
24
},
25
{
26
"name": "customer_id",
27
"type": "STRING",
28
"mode": "REQUIRED",
29
"description": "Unique identifier for the customer"
30
},
31
{
32
"name": "amount",
33
"type": "FLOAT",
34
"mode": "REQUIRED",
35
"description": "Total amount of the transaction"
36
},
37
{
38
"name": "items",
39
"type": "RECORD",
40
"mode": "REPEATED",
41
"description": "List of items in the transaction",
42
"fields": [
43
{
44
"name": "product_id",
45
"type": "STRING",
46
"mode": "REQUIRED",
47
"description": "Unique identifier for the product"
48
},
49
{
50
"name": "quantity",
51
"type": "INTEGER",
52
"mode": "REQUIRED",
53
"description": "Quantity of the product purchased"
54
},
55
{
56
"name": "unit_price",
57
"type": "FLOAT",
58
"mode": "REQUIRED",
59
"description": "Price per unit of the product"
60
}
61
]
62
}
63
]
64
},
65
"numBytes": "0",
66
"numLongTermBytes": "0",
67
"numRows": "0",
68
"creationTime": "1625097600000",
69
"expirationTime": "1735689599000",
70
"lastModifiedTime": "1625097600000",
71
"type": "TABLE",
72
"location": "US"
73
}

Delete table
Copy

Delete the table specified by table_id from the dataset. If the table contains data, all the data will be deleted.

Sample Input

1
{
2
"project_id": "my-bigquery-project",
3
"dataset_id": "sales_data",
4
"table_id": "customer_transactions"
5
}

Sample Output

1
{
2
"success": true
3
}

Get job
Copy

Find a job by it's ID.

Sample Input

1
{
2
"project_id": "my-bigquery-project",
3
"job_id": "job_ABC123XYZ"
4
}

Sample Output

1
{
2
"kind": "bigquery#job",
3
"etag": "\"cX5UmbB_R-S07ii743IKGH9YCYM/MT\"",
4
"id": "my-bigquery-project:US.job_ABC123XYZ",
5
"selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/my-bigquery-project/jobs/job_ABC123XYZ",
6
"jobReference": {
7
"projectId": "my-bigquery-project",
8
"jobId": "job_ABC123XYZ"
9
},
10
"configuration": {
11
"load": {
12
"schema": {
13
"fields": [
14
{
15
"name": "id",
16
"type": "INTEGER",
17
"mode": "REQUIRED"
18
},
19
{
20
"name": "name",
21
"type": "STRING",
22
"mode": "NULLABLE"
23
},
24
{
25
"name": "age",
26
"type": "INTEGER",
27
"mode": "NULLABLE"
28
}
29
]
30
},
31
"destinationTable": {
32
"projectId": "my-bigquery-project",
33
"datasetId": "my_dataset",
34
"tableId": "my_table"
35
},
36
"fieldDelimiter": ",",
37
"skipLeadingRows": 1,
38
"maxBadRecords": 0,
39
"allowQuotedNewlines": false,
40
"sourceFormat": "CSV",
41
"allowJaggedRows": false,
42
"ignoreUnknownValues": false
43
}
44
},
45
"status": {
46
"state": "DONE"
47
},
48
"statistics": {
49
"creationTime": "1625097600000",
50
"startTime": "1625097605000",
51
"endTime": "1625097610000",
52
"load": {
53
"inputFiles": "1",
54
"inputFileBytes": "1024",
55
"outputRows": "100",
56
"outputBytes": "2048"
57
}
58
},
59
"user_email": "user@example.com"
60
}

Get table
Copy

Gets full details about a Google BigQuery table.

Sample Input

1
{
2
"project_id": "my-bigquery-project",
3
"dataset_id": "sales_data",
4
"table_id": "customer_transactions"
5
}

Sample Output

1
{
2
"kind": "bigquery#table",
3
"etag": "\"mC5E4Yl3IZPXPKfaWvRTHQ==\"",
4
"id": "my-bigquery-project:sales_data.customer_transactions",
5
"selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/my-bigquery-project/datasets/sales_data/tables/customer_transactions",
6
"tableReference": {
7
"projectId": "my-bigquery-project",
8
"datasetId": "sales_data",
9
"tableId": "customer_transactions"
10
},
11
"schema": {
12
"fields": [
13
{
14
"name": "customer_id",
15
"type": "INTEGER",
16
"mode": "REQUIRED"
17
},
18
{
19
"name": "transaction_date",
20
"type": "DATE",
21
"mode": "REQUIRED"
22
},
23
{
24
"name": "amount",
25
"type": "FLOAT",
26
"mode": "REQUIRED"
27
},
28
{
29
"name": "product_id",
30
"type": "STRING",
31
"mode": "NULLABLE"
32
}
33
]
34
},
35
"numBytes": "1048576",
36
"numLongTermBytes": "1048576",
37
"numRows": "10000",
38
"creationTime": "1625097600000",
39
"lastModifiedTime": "1625184000000",
40
"type": "TABLE",
41
"location": "US"
42
}

Insert job
Copy

Start a new asynchronous job.

Sample Input

1
{
2
"project_id": "my-project-123",
3
"configuration": {
4
"job_type": "QUERY",
5
"query": {
6
"query": "SELECT * FROM `my-project-123.my_dataset.my_table` LIMIT 1000",
7
"destination_table": {
8
"project_id": "my-project-123",
9
"dataset_id": "my_dataset",
10
"table_id": "query_results"
11
},
12
"create_disposition": "CREATE_IF_NEEDED",
13
"write_disposition": "WRITE_TRUNCATE",
14
"use_legacy_sql": false,
15
"allow_large_results": true,
16
"priority": "INTERACTIVE",
17
"use_query_cache": true,
18
"maximum_bytes_billed": "1000000000"
19
}
20
},
21
"job_reference": {
22
"project_id": "my-project-123",
23
"job_reference": "my_query_job_001",
24
"location": "US"
25
}
26
}

Sample Output

1
{
2
"kind": "bigquery#job",
3
"etag": "\"cX5UmbB_R-S07ii743IKGH9YCYM/MT\"",
4
"id": "my-project-123:US.my_query_job_001",
5
"selfLink": "https://www.googleapis.com/bigquery/v2/projects/my-project-123/jobs/my_query_job_001",
6
"user_email": "user@example.com",
7
"configuration": {
8
"query": {
9
"query": "SELECT * FROM `my-project-123.my_dataset.my_table` LIMIT 1000",
10
"destinationTable": {
11
"projectId": "my-project-123",
12
"datasetId": "my_dataset",
13
"tableId": "query_results"
14
},
15
"createDisposition": "CREATE_IF_NEEDED",
16
"writeDisposition": "WRITE_TRUNCATE",
17
"priority": "INTERACTIVE",
18
"allowLargeResults": true,
19
"useQueryCache": true,
20
"useLegacySql": false,
21
"maximumBytesBilled": "1000000000"
22
},
23
"jobType": "QUERY"
24
},
25
"jobReference": {
26
"projectId": "my-project-123",
27
"jobId": "my_query_job_001",
28
"location": "US"
29
},
30
"statistics": {
31
"creationTime": "1625097600000",
32
"startTime": "1625097601000",
33
"endTime": "1625097605000"
34
},
35
"status": {
36
"state": "DONE"
37
}
38
}

Insert rows
Copy

Inserts up to 500 rows into a Google BigQuery table.

Sample Input

1
{
2
"project_id": "my-bigquery-project",
3
"dataset_id": "sales_data",
4
"table_id": "transactions",
5
"rows": [
6
{
7
"data": {
8
"transaction_id": "TX123456",
9
"customer_name": "John Doe",
10
"product": "Widget A",
11
"quantity": 5,
12
"price": 19.99,
13
"date": "2023-05-15"
14
},
15
"insert_id": "INS001"
16
},
17
{
18
"data": {
19
"transaction_id": "TX123457",
20
"customer_name": "Jane Smith",
21
"product": "Widget B",
22
"quantity": 2,
23
"price": 29.99,
24
"date": "2023-05-15"
25
},
26
"insert_id": "INS002"
27
}
28
]
29
}

Sample Output

1
{
2
"kind": "bigquery#tableDataInsertAllResponse",
3
"success": true
4
}

Insert rows from CSV file
Copy

Uploads a CSV file to BigQuery, saves the rows into a table.

Sample Input

1
{
2
"project_id": "my-bigquery-project",
3
"dataset_id": "sales_data",
4
"table_id": "monthly_sales",
5
"file": {
6
"name": "sales_june_2023.csv",
7
"content": "date,product,quantity,revenue\n2023-06-01,Widget A,100,5000\n2023-06-02,Widget B,75,4500\n2023-06-03,Widget C,50,3000"
8
},
9
"import_options": {
10
"allow_jagged_rows": true,
11
"skip_leading_rows": 1,
12
"allow_quoted_new_lines": true,
13
"null_marker": "NULL",
14
"ignore_unknown_values": true
15
}
16
}

Sample Output

1
{
2
"kind": "bigquery#job",
3
"etag": "\"cX5UmbB_R-S07ii743IKGH9YCYM/MT\"",
4
"id": "my-bigquery-project:US.job_ABC123XYZ",
5
"selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/my-bigquery-project/jobs/job_ABC123XYZ",
6
"user_email": "user@example.com",
7
"configuration": {
8
"load": {
9
"schema": {
10
"fields": [
11
{
12
"name": "date",
13
"type": "DATE",
14
"mode": "NULLABLE"
15
},
16
{
17
"name": "product",
18
"type": "STRING",
19
"mode": "NULLABLE"
20
},
21
{
22
"name": "quantity",
23
"type": "INTEGER",
24
"mode": "NULLABLE"
25
},
26
{
27
"name": "revenue",
28
"type": "FLOAT",
29
"mode": "NULLABLE"
30
}
31
]
32
},
33
"destinationTable": {
34
"projectId": "my-bigquery-project",
35
"datasetId": "sales_data",
36
"tableId": "monthly_sales"
37
},
38
"nullMarker": "NULL",
39
"skipLeadingRows": 1,
40
"allowQuotedNewlines": true,
41
"allowJaggedRows": true,
42
"ignoreUnknownValues": true
43
},
44
"jobType": "LOAD"
45
},
46
"jobReference": {
47
"projectId": "my-bigquery-project",
48
"jobId": "job_ABC123XYZ",
49
"location": "US"
50
},
51
"statistics": {
52
"creationTime": "1625097600000",
53
"startTime": "1625097601000"
54
},
55
"status": {
56
"state": "RUNNING"
57
}
58
}

List datasets
Copy

List all the datasets for a project.

Sample Input

1
{
2
"project_id": "my-bigquery-project",
3
"list_all": true,
4
"max_results": 100,
5
"page_token": "eyJwYWdlX3NpemUiOjEwMCwicGFnZV90b2tlbiI6IkFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaIiwidG90YWxfcm93cyI6NTAwfQ=="
6
}

Sample Output

1
{
2
"datasets": [
3
{
4
"datasetId": "sales_data",
5
"projectId": "my-bigquery-project",
6
"location": "US",
7
"creationTime": "1625097600000",
8
"lastModifiedTime": "1640995200000",
9
"description": "Dataset containing sales information"
10
},
11
{
12
"datasetId": "customer_data",
13
"projectId": "my-bigquery-project",
14
"location": "EU",
15
"creationTime": "1627776000000",
16
"lastModifiedTime": "1641081600000",
17
"description": "Dataset containing customer information"
18
},
19
{
20
"datasetId": "analytics",
21
"projectId": "my-bigquery-project",
22
"location": "US",
23
"creationTime": "1630454400000",
24
"lastModifiedTime": "1641168000000",
25
"description": "Dataset for analytics and reporting"
26
}
27
],
28
"nextPageToken": "eyJwYWdlX3NpemUiOjEwMCwicGFnZV90b2tlbiI6IlpZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBIiwidG90YWxfcm93cyI6NTAwfQ=="
29
}

List job query results
Copy

List the results of a query job.

Sample Input

1
{
2
"project_id": "my-bigquery-project",
3
"job_id": "job_abcdefghijklmnop",
4
"location": "US",
5
"use_int64_timestamp": false,
6
"timeout_ms": 15000,
7
"max_results": 100,
8
"page_token": "next_page_token_123",
9
"start_index": "0",
10
"raw_response": false
11
}

Sample Output

1
{
2
"kind": "bigquery#getQueryResultsResponse",
3
"etag": "\"abcdefghijklmnop\"",
4
"schema": {
5
"fields": [
6
{
7
"name": "name",
8
"type": "STRING",
9
"mode": "NULLABLE"
10
},
11
{
12
"name": "age",
13
"type": "INTEGER",
14
"mode": "NULLABLE"
15
},
16
{
17
"name": "city",
18
"type": "STRING",
19
"mode": "NULLABLE"
20
}
21
]
22
},
23
"jobReference": {
24
"projectId": "my-bigquery-project",
25
"jobId": "job_abcdefghijklmnop",
26
"location": "US"
27
},
28
"totalRows": "1000",
29
"pageToken": "next_page_token_456",
30
"rows": [
31
{
32
"f": [
33
{
34
"v": "John Doe"
35
},
36
{
37
"v": "30"
38
},
39
{
40
"v": "New York"
41
}
42
]
43
},
44
{
45
"f": [
46
{
47
"v": "Jane Smith"
48
},
49
{
50
"v": "25"
51
},
52
{
53
"v": "Los Angeles"
54
}
55
]
56
}
57
],
58
"totalBytesProcessed": "1024",
59
"jobComplete": true,
60
"cacheHit": false
61
}

List jobs
Copy

List all the jobs for a project.

Sample Input

1
{
2
"project_id": "my-bigquery-project",
3
"all_users": true,
4
"projection": "full",
5
"state_filter": "running",
6
"max_results": 10,
7
"page_token": "abc123xyz"
8
}

Sample Output

1
{
2
"kind": "bigquery#jobList",
3
"etag": "\"cX5UmbB_R-S07ii743USF__fAYM/XYZ\"",
4
"jobs": [
5
{
6
"id": "my-bigquery-project:job_ABC123",
7
"kind": "bigquery#job",
8
"jobReference": {
9
"projectId": "my-bigquery-project",
10
"jobId": "job_ABC123"
11
},
12
"state": "RUNNING",
13
"statistics": {
14
"creationTime": "1625097600000",
15
"startTime": "1625097605000"
16
},
17
"status": {
18
"state": "RUNNING"
19
}
20
},
21
{
22
"id": "my-bigquery-project:job_DEF456",
23
"kind": "bigquery#job",
24
"jobReference": {
25
"projectId": "my-bigquery-project",
26
"jobId": "job_DEF456"
27
},
28
"state": "RUNNING",
29
"statistics": {
30
"creationTime": "1625097700000",
31
"startTime": "1625097705000"
32
},
33
"status": {
34
"state": "RUNNING"
35
}
36
}
37
]
38
}

List projects
Copy

List all the projects you have in your Google BigQuery account.

Sample Input

1
{
2
"max_results": 3,
3
"page_token": "abc123xyz"
4
}

Sample Output

1
{
2
"kind": "bigquery#projectList",
3
"etag": "\"cX5UmbB_R-S07ii743AICX__EYc/XYZ\"",
4
"projects": [
5
{
6
"kind": "bigquery#project",
7
"id": "project-1",
8
"numericId": "1234567890",
9
"projectReference": {
10
"projectId": "project-1"
11
},
12
"friendlyName": "My First Project"
13
},
14
{
15
"kind": "bigquery#project",
16
"id": "project-2",
17
"numericId": "2345678901",
18
"projectReference": {
19
"projectId": "project-2"
20
},
21
"friendlyName": "Analytics Project"
22
},
23
{
24
"kind": "bigquery#project",
25
"id": "project-3",
26
"numericId": "3456789012",
27
"projectReference": {
28
"projectId": "project-3"
29
},
30
"friendlyName": "Data Warehouse"
31
}
32
],
33
"totalItems": 3
34
}

List tables
Copy

List all the tables for a dataset.

Sample Input

1
{
2
"project_id": "my-bigquery-project",
3
"dataset_id": "sales_data",
4
"max_results": 3,
5
"page_token": "abc123xyz"
6
}

Sample Output

1
{
2
"kind": "bigquery#tableList",
3
"etag": "\"cX5UmbB_R-S07ii743USAQ==\"",
4
"tables": [
5
{
6
"kind": "bigquery#table",
7
"id": "my-bigquery-project:sales_data.customers",
8
"tableReference": {
9
"projectId": "my-bigquery-project",
10
"datasetId": "sales_data",
11
"tableId": "customers"
12
},
13
"type": "TABLE",
14
"creationTime": "1625097600000"
15
},
16
{
17
"kind": "bigquery#table",
18
"id": "my-bigquery-project:sales_data.orders",
19
"tableReference": {
20
"projectId": "my-bigquery-project",
21
"datasetId": "sales_data",
22
"tableId": "orders"
23
},
24
"type": "TABLE",
25
"creationTime": "1625184000000"
26
},
27
{
28
"kind": "bigquery#table",
29
"id": "my-bigquery-project:sales_data.products",
30
"tableReference": {
31
"projectId": "my-bigquery-project",
32
"datasetId": "sales_data",
33
"tableId": "products"
34
},
35
"type": "TABLE",
36
"creationTime": "1625270400000"
37
}
38
],
39
"totalItems": 3
40
}

Run query
Copy

Create a query job.

Sample Input

1
{
2
"project_id": "my-bigquery-project",
3
"query": "SELECT id, email, first_name, last_name FROM `my-dataset.users` LIMIT 5",
4
"max_results": 5,
5
"timeout_ms": 15000,
6
"dry_run": false,
7
"use_query_cache": true,
8
"raw_response": false
9
}

Sample Output

1
{
2
"kind": "bigquery#queryResponse",
3
"schema": {
4
"fields": [
5
{
6
"name": "id",
7
"type": "INTEGER",
8
"mode": "NULLABLE"
9
},
10
{
11
"name": "email",
12
"type": "STRING",
13
"mode": "NULLABLE"
14
},
15
{
16
"name": "first_name",
17
"type": "STRING",
18
"mode": "NULLABLE"
19
},
20
{
21
"name": "last_name",
22
"type": "STRING",
23
"mode": "NULLABLE"
24
}
25
]
26
},
27
"jobReference": {
28
"projectId": "my-bigquery-project",
29
"jobId": "job_abcdefghijklmnop"
30
},
31
"totalRows": "5",
32
"pageToken": "ABCDEFGHIJKLMNOP",
33
"rows": [
34
{
35
"id": "1",
36
"email": "john.doe@example.com",
37
"first_name": "John",
38
"last_name": "Doe"
39
},
40
{
41
"id": "2",
42
"email": "jane.smith@example.com",
43
"first_name": "Jane",
44
"last_name": "Smith"
45
},
46
{
47
"id": "3",
48
"email": "bob.johnson@example.com",
49
"first_name": "Bob",
50
"last_name": "Johnson"
51
},
52
{
53
"id": "4",
54
"email": "alice.williams@example.com",
55
"first_name": "Alice",
56
"last_name": "Williams"
57
},
58
{
59
"id": "5",
60
"email": "charlie.brown@example.com",
61
"first_name": "Charlie",
62
"last_name": "Brown"
63
}
64
],
65
"totalBytesProcessed": "1024",
66
"jobComplete": true,
67
"cacheHit": false
68
}

DDL operations
Copy

List datasets (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
[
2
{
3
"id": "project-id:dataset1",
4
"datasetId": "dataset1",
5
"projectId": "project-id",
6
"location": "US",
7
"creationTime": "1625097600000",
8
"lastModifiedTime": "1635097600000",
9
"defaultTableExpirationMs": null,
10
"description": "This is dataset 1",
11
"etag": "abcdefghijklmnop",
12
"friendlyName": "Dataset One",
13
"labels": {
14
"environment": "production",
15
"department": "analytics"
16
}
17
},
18
{
19
"id": "project-id:dataset2",
20
"datasetId": "dataset2",
21
"projectId": "project-id",
22
"location": "EU",
23
"creationTime": "1626097600000",
24
"lastModifiedTime": "1636097600000",
25
"defaultTableExpirationMs": "2592000000",
26
"description": "This is dataset 2",
27
"etag": "qrstuvwxyz123456",
28
"friendlyName": "Dataset Two",
29
"labels": {
30
"environment": "staging",
31
"department": "research"
32
}
33
}
34
]

List jobs (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
[
2
{
3
"id": "project-id:us-central1.job_ABC123XYZ",
4
"jobType": "QUERY",
5
"state": "DONE",
6
"creationTime": "1625097600000",
7
"startTime": "1625097601000",
8
"endTime": "1625097605000",
9
"user": "user@example.com",
10
"query": {
11
"query": "SELECT * FROM `dataset.table` LIMIT 1000",
12
"destinationTable": {
13
"projectId": "project-id",
14
"datasetId": "temp_dataset",
15
"tableId": "job_result_ABC123XYZ"
16
},
17
"createDisposition": "CREATE_IF_NEEDED",
18
"writeDisposition": "WRITE_TRUNCATE"
19
}
20
},
21
{
22
"id": "project-id:us-central1.job_DEF456UVW",
23
"jobType": "LOAD",
24
"state": "RUNNING",
25
"creationTime": "1625097700000",
26
"startTime": "1625097701000",
27
"user": "another-user@example.com",
28
"configuration": {
29
"load": {
30
"sourceUris": [
31
"gs://my-bucket/data.csv"
32
],
33
"destinationTable": {
34
"projectId": "project-id",
35
"datasetId": "my_dataset",
36
"tableId": "new_table"
37
},
38
"schema": {
39
"fields": [
40
{
41
"name": "column1",
42
"type": "STRING"
43
},
44
{
45
"name": "column2",
46
"type": "INTEGER"
47
}
48
]
49
},
50
"createDisposition": "CREATE_IF_NEEDED",
51
"writeDisposition": "WRITE_APPEND"
52
}
53
}
54
}
55
]

List projects (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
[
2
{
3
"projectId": "my-project-123",
4
"projectNumber": "123456789012",
5
"name": "My Project",
6
"createTime": "2023-05-15T10:30:45.123Z",
7
"state": "ACTIVE"
8
},
9
{
10
"projectId": "another-project-456",
11
"projectNumber": "456789012345",
12
"name": "Another Project",
13
"createTime": "2023-04-01T08:15:30.456Z",
14
"state": "ACTIVE"
15
},
16
{
17
"projectId": "test-project-789",
18
"projectNumber": "789012345678",
19
"name": "Test Project",
20
"createTime": "2023-03-10T14:20:00.789Z",
21
"state": "ACTIVE"
22
}
23
]

List tables (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
[
2
{
3
"table_name": "users",
4
"ddl": "CREATE TABLE `project_id.dataset_name.users` (\n user_id INT64 NOT NULL,\n username STRING,\n email STRING,\n created_at TIMESTAMP,\n last_login TIMESTAMP\n) PARTITION BY DATE(created_at)\nCLUSTER BY user_id"
5
},
6
{
7
"table_name": "orders",
8
"ddl": "CREATE TABLE `project_id.dataset_name.orders` (\n order_id INT64 NOT NULL,\n user_id INT64,\n order_date DATE,\n total_amount FLOAT64,\n status STRING\n) PARTITION BY order_date\nCLUSTER BY user_id"
9
},
10
{
11
"table_name": "products",
12
"ddl": "CREATE TABLE `project_id.dataset_name.products` (\n product_id INT64 NOT NULL,\n name STRING,\n description STRING,\n price FLOAT64,\n category STRING\n)"
13
}
14
]