Method: tabledata.insertAll

Streams data into BigQuery one record at a time without needing to run a load job.

HTTP request

POST https://bigquery.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}/insertAll

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
projectId

string

datasetId

string

tableId

string

Request body

The request body contains data with the following structure:

JSON representation
{
  "kind": string,
  "skipInvalidRows": boolean,
  "ignoreUnknownValues": boolean,
  "templateSuffix": string,
  "rows": [
    {
      "insertId": string,
      "json": {
        object
      }
    }
  ]
}
Fields
kind

string

The resource type of the response.

skipInvalidRows

boolean

[Optional] Insert all valid rows of a request, even if invalid rows exist. The default value is false, which causes the entire request to fail if any invalid rows exist.

ignoreUnknownValues

boolean

[Optional] Accept rows that contain values that do not match the schema. The unknown values are ignored. Default is false, which treats unknown values as errors.

templateSuffix

string

If specified, treats the destination table as a base template, and inserts the rows into an instance table named "{destination}{templateSuffix}". BigQuery will manage creation of the instance table, using the schema of the base template table.

See https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables for considerations when working with templates tables.

rows[]

object

rows[].insertId

string

rows[].json

object (Struct format)

Response body

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

JSON representation
{
  "kind": string,
  "insertErrors": [
    {
      "index": integer,
      "errors": [
        {
          object (ErrorProto)
        }
      ]
    }
  ]
}
Fields
kind

string

insertErrors[]

object

insertErrors[].index

integer (uint32 format)

insertErrors[].errors[]

object (ErrorProto)

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/bigquery
  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/bigquery.insertdata

For more information, see the Authentication Overview.

Try it!