Method: projects.databases.documents.beginTransaction

Starts a new transaction.

HTTP request

POST https://firestore.googleapis.com/v1/{database=projects/*/databases/*}/documents:beginTransaction

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
database

string

Required. The database name. In the format: projects/{projectId}/databases/{databaseId}.

Request body

The request body contains data with the following structure:

JSON representation
{
  "options": {
    object (TransactionOptions)
  }
}
Fields
options

object (TransactionOptions)

The options for the transaction. Defaults to a read-write transaction.

Response body

The response for Firestore.BeginTransaction.

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

JSON representation
{
  "transaction": string
}
Fields
transaction

string (bytes format)

The transaction that was started.

A base64-encoded string.

Authorization scopes

Requires one of the following OAuth scopes:

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

For more information, see the Authentication Overview.