BigQuery API
This page documents BigQuery-specific payload fields for the datastore API. For generic operations (get, list, update, delete, multi-schema bulk), see Datastore API.
Complete API Reference
For the full interactive API documentation with all request/response schemas, visit the API docs.
BigQuery authenticates with a single credential: the service account key. You can create a datastore with a new inline connection or reuse an existing connection, and BigQuery can be created either as a source or as an enrichment datastore. All modes use the same endpoint:
Endpoint: POST /api/datastores
Permission: Manager
UI ↔ API field mapping
The API names a few fields differently from the UI. The mapping below avoids the most common copy-paste mistake (sending the dataset name where the project belongs).
| UI form field | API field | BigQuery concept | Example |
|---|---|---|---|
| Connection > Connection Name | connection.name |
Label for the saved connection | bigquery_production |
| Connection > Service Account Key | connection.password |
The contents of the service account key JSON file, passed as a string | {"type":"service_account",...} |
| Connection > Temp Dataset ID | connection.parameters.temp_dataset |
Dataset for intermediate query results | qualytics_temp |
| Datastore > Project ID | database |
Google Cloud project | acme-analytics |
| Datastore > Dataset ID | schema |
Dataset inside the project | sales_curated |
Connection Fields
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
database |
string | Yes | — | The Google Cloud Project ID (the value shown as Project ID in the UI). |
schema |
string | Yes | — | The Dataset ID inside the project (the value shown as Dataset ID in the UI). |
password |
string | Yes | — | The contents of the service account key JSON file. The key file is itself JSON, so escape it as a JSON string when embedding it in the request body. |
parameters.temp_dataset |
string | No | — | Temp Dataset ID where the driver stages intermediate query results. |
About trigger_sync
The trigger_sync: true flag in the examples below tells Qualytics to immediately sync metadata after creating the datastore (equivalent to ticking the Initiate Sync checkbox in the UI). Set it to false if you want to defer the first sync.
Create a Source Datastore
Example request and response
Request:
curl -X POST "https://your-instance.qualytics.io/api/datastores" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "BigQuery Production",
"connection": {
"name": "bigquery_production",
"type": "bigquery",
"password": "<contents of the service account key JSON, escaped as a string>",
"parameters": {
"temp_dataset": "qualytics_temp"
}
},
"database": "acme-analytics",
"schema": "sales_curated",
"teams": ["Data Platform"],
"trigger_sync": true
}'
Response (200 OK):
If you have already created a BigQuery connection (via this API or the UI), reuse it by passing its connection_id. The credentials are reused from the existing connection: you only need to specify datastore-level fields like database, schema, and teams.
Example request and response
Request:
curl -X POST "https://your-instance.qualytics.io/api/datastores" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "BigQuery Finance",
"connection_id": 7,
"database": "acme-analytics",
"schema": "finance_curated",
"teams": ["Finance Team"],
"trigger_sync": true
}'
Response (200 OK):
Create an Enrichment Datastore
BigQuery can also host an enrichment datastore. The payload is the same as for a source datastore, plus "enrichment_only": true. Point schema at the dataset Qualytics should write enrichment tables to; the service account needs the read-write roles listed on the Permissions page.
Example request and response
Request:
curl -X POST "https://your-instance.qualytics.io/api/datastores" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "BigQuery Enrichment",
"connection_id": 7,
"database": "acme-analytics",
"schema": "qualytics_enrichment",
"teams": ["Data Platform"],
"enrichment_only": true
}'
Response (200 OK):
Field name
The flag is enrichment_only, not enrich_only. The API silently ignores unknown fields, so a misspelled flag creates a regular source datastore instead of an enrichment datastore.
To link an enrichment datastore to a source datastore, see Datastore API › Link Enrichment Datastore.
Other Operations
For get, list, update, delete, test connection, multi-schema bulk creation, and end-to-end automation examples, see the Datastore API reference.