Run queries inside a transaction

Once you have an open transaction by calling db/{name}/tx, you can run additional statements that form part of your transaction by calling the newly created transaction endpoint. The endpoint will be in the form db/{name}/tx/{txid}, where txid is provided in the response of the initial call to begin the transaction.

Example request

  • POST http://localhost:43573/db/neo4j/tx/16

  • Accept: application/json;charset=UTF-8

  • Content-Type: application/json

{
  "statements" : [ {
    "statement" : "CREATE (n) RETURN n"
  } ]
}

Example response

  • 200: OK

  • Content-Type: application/json;charset=utf-8

{
  "results" : [ {
    "columns" : [ "n" ],
    "data" : [ {
      "row" : [ { } ],
      "meta" : [ {
        "id" : 11,
        "type" : "node",
        "deleted" : false
      } ]
    } ]
  } ],
  "errors" : [ ],
  "commit" : "http://localhost:43573/db/neo4j/tx/16/commit",
  "transaction" : {
    "expires" : "Fri, 8 Jan 2021 15:57:09 GMT"
  }
}