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

# POST /v1/{+database}/documents:beginTransaction

`POST /v1/{+database}/documents:beginTransaction`

Starts a new transaction.

## Path parameters

- `database` string, required

## Request body

- BeginTransactionRequest — The request for Firestore.BeginTransaction.
  - `options` TransactionOptions — Options for creating a new transaction.
    - `readOnly` ReadOnly — Options for a transaction that can only be used to read documents.
      - `readTime` string, google-datetime — Reads documents 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.
    - `readWrite` ReadWrite — Options for a transaction that can be used to read and write documents.
      - `concurrencyMode` 'CONCURRENCY_MODE_UNSPECIFIED' | 'OPTIMISTIC' | 'PESSIMISTIC' — Optional. The concurrency control mode to use for this transaction. A database is able to use different concurrency modes for different transactions simultaneously. 3rd party auth requests are only allowed to create optimistic read-write transactions and must specify that here even if the database-level setting is already configured to optimistic.
      - `retryTransaction` string, byte — An optional transaction to retry.
  - `requestOptions` RequestOptions — Options for a server request.
    - `requestTags` string[] — Optional. The request tags for the request.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/firestore.md) · [All operations](https://skmtc.net/google/apis/firestore/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/firestore/versions/11bc07a83431/schema)
