---
title: "POST /v1/projects/{projectId}:beginTransaction"
method: POST
path: "/v1/projects/{projectId}:beginTransaction"
tags: ["projects"]
---

# POST /v1/projects/{projectId}:beginTransaction

`POST /v1/projects/{projectId}:beginTransaction`

Begins a new transaction.

## Path parameters

- `projectId` string, required

## Request body

- BeginTransactionRequest — The request for Datastore.BeginTransaction.
  - `requestOptions` RequestOptions — Options for a request.
    - `requestTags` string[] — Optional. The request tags for the request. The tags are processed as follows: - Truncated to 510 characters. - Filtered out if empty. - Deduplicated. - Limited to 50 tags.
  - `databaseId` string — The ID of the database against which to make the request. '(default)' is not allowed; please use empty string '' to refer the default database.
  - `transactionOptions` TransactionOptions — Options for beginning a new transaction. Transactions can be created explicitly with calls to Datastore.BeginTransaction or implicitly by setting ReadOptions.new_transaction in read requests.
    - `readWrite` ReadWrite — Options specific to read / write transactions.
      - `previousTransaction` string, byte — The transaction identifier of the transaction being retried.
    - `readOnly` ReadOnly — Options specific to read-only transactions.
      - `readTime` string, google-datetime — Reads entities at the given time. This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/datastore.md) · [All operations](https://skmtc.dev/google/apis/datastore/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/datastore/revisions/aef4907227b2/schema)
