Create a multi-statement transaction. The resulting transaction id
may be used in the
txid request parameter of subsequent
requests to force evaluation to take place in the context of the created
A symbolic name for the transaction. Default: |
The transaction time limit to apply to this transaction, in seconds.
Default: The request timeout configured for the App Server. If the
transaction is not committed or rolled back within this time limit,
the transaction is automatically rolled back. You may not set the
limit to a value greater than the default request timeout configured
for the App Server. For details, see
|database?||Perform this operation on the named content database instead of the default content database associated with the REST API instance. Using an alternative database requires the "eval-in" privilege; for details, see Security Requirements in the REST Application Developer's Guide.|
Upon success, the Location header contains a transaction URI of the
Upon success, MarkLogic Server returns a status 303 (See Created
Transaction) and returns the transaction id in the
rest-writerrole, or the following privileges:
By default, each REST request is serviced in a single transaction.
The transaction is committed (or rolled back, in the case of error)
automatically before the response sent. Use this request to create a
transaction that can service multiple requests. Pass the transaction
id in the
txid parameter of subsequent requests to service
a request in the created transaction.
Transactions created in this way should be explicitly committed or
rolled back using the
/transactions service. Transactions
which are not explicitly committed are rolled back when the session or
request times out.
$ curl --anyauth --user user:password -X POST -d "" -i \ -H "Content-type: text/plain" \ http://localhost:8004/v1/transactions ==> A transaction is created. MarkLogic Server returns the transaction ID is returned in the Location header of the response. Use the contents of the Location header as the value of the "txid" parameter in other methods. The transaction ID is of the form /transactions/transactionid. For example, the following headers are returned: Server: MarkLogic Content-Type: text/plain; charset=UTF-8 Content-Length: 31 Connection: close HTTP/1.1 303 See Created Transaction Location: /transactions/3148548124558550433 Server: MarkLogic Content-Length: 0 Connection: close