Method: projects.instances.databases.sessions.rollback

Rolls back a transaction, releasing any locks it holds. It is a good idea to call this for any transaction that includes one or more or sessions.executeSql requests and ultimately decides not to commit.

sessions.rollback returns OK if it successfully aborts the transaction, the transaction was already aborted, or the transaction is not found. sessions.rollback never returns ABORTED.

HTTP request


The URL uses gRPC Transcoding syntax.

Path parameters



Required. The session in which the transaction to roll back is running.

Authorization requires the following IAM permission on the specified resource session:

  • spanner.databases.beginOrRollbackReadWriteTransaction

Request body

The request body contains data with the following structure:

JSON representation
  "transactionId": string

string (bytes format)

Required. The transaction to roll back.

A base64-encoded string.

Response body

If successful, the response body is empty.

Authorization scopes

Requires one of the following OAuth scopes:


For more information, see the Authentication Overview.