Batch Operations (v4 API)
You can specify multiple operations to apply to various objects of various types.
/api/v4/
backend-deployment-id
/batch.json
POST
Batch Operation Limit
Up to 1000 operations are supported per payload. If more than 1000 operations are included in a payload the request will be considered invalid and result in an error.
Parameters
An array of operations is supplied in a hash under the key operations
. These operations are applied in the order they appear in the array. Each operation consists of a hash with required fields: method
, containing an appropriate keyword, and object
containing a hash with, at least, the two required fields - type
and id
. If the optional key stop_on_error: true
is supplied alongside operations
, any operations following an error will not be applied.
Create an object
"method"
: "post"
"object"
: Hash with fields:
"type"
: (required) The name of the model."id"
: (optional) The object ID. If omitted, one will be generated. If provided and the ID already exists, the operation will fail.All the fields that represent the entire object
Replace an object
"method"
: "put"
"object"
: Hash with fields:
"type"
: (required) The name of the model."id"
: (required) The object IDAll the fields that represent the entire object
Partial update on an object
"method"
: "patch"
"object"
: Hash with fields:
"type"
: (required) The name of the model."id"
: (required) The object IDOnly the fields to be updated on the object
Delete an object
"method"
: "delete"
"object"
: Hash with fields:
"type"
: (required) The name of the model."id"
: (required) The object ID
Response
An ill-formed or illegal request will fail without performing any of the operations. A well-formed request should execute each operation in order, and return a success response. The body of the response should contain the requested method, object model and object id, as well as a "success"
flag and any relevant "error"
details for each operation. See Error Responses for a description of each error.
Example
Stop on error
Last updated