Bulk Create, Update, Delete
It is recommended to use Bulk Create, Update, Delete methods when working with a lot of data at once.
Operation Name
Endpoint
Create, Update
.*batch-modify
Delete
*.batch-delete

Bulk Create, Update

Pipeliner API supports creating, updating records in one *.batch-modifyrequest
  1. 1.
    When the ID is specified in an object, it works as an update method
  2. 2.
    When the ID is not specified in an object, it works as a create method
Snippet
1
POST /entities/{{Entity-name}}/batch-modify
2
[
3
{"id": "123", "name": "update"},
4
{"name": "create"}
5
]
Copied!

Using Rollback for Bulk operations

Rollback is API parameter, that can help you to rollback data that has failed for some reason (eg. data became invalid).
Example
In this example, we are going to bulk update Accounts, with the rollback method turned on.
Rollback = 0
If at least one object in a request is invalid, any operation isn´t executed (all data are rollbacked)
1
POST {{baseUrl}}/entities/Accounts/batch-modify?rollback-method=0
2
[
3
{
4
"id": "0bc376a4-c579-413a-9221-e86e4a134766",
5
"name": "Account - Updated"
6
},
7
{
8
"name": "Account - Created"
9
}
10
]
Copied!
1
{
2
"code": 40000,
3
"name": "ERROR_ENTITY_VALIDATION",
4
"message": "\n[owner_id] Relation Account.owner_id=00000000-0000-0000-0000-000000011a3d to Client doesn't exist!",
5
"entity_id": "0bc376a4-c579-413a-9221-e86e4a134766",
6
"entity_name": "Account",
7
"entity_errors": [],
8
"field_errors": [
9
{
10
"field_id": "5b67c561-0136-0c86-9dc0-0b4c9acb42f5",
11
"field_name": "owner_id",
12
"name": "ERROR_FIELD_VALIDATION",
13
"code": 40002,
14
"errors": [
15
{
16
"code": 120,
17
"name": "ERROR_RELATIONS_DOESNT_EXIST",
18
"message": "[owner_id] Relation Account.owner_id=00000000-0000-0000-0000-000000011a3d to Client doesn't exist!",
19
"field_id": "5b67c561-0136-0c86-9dc0-0b4c9acb42f5",
20
"field_name": "owner_id"
21
}
22
]
23
}
24
],
25
"step_checklist_errors": [],
26
"entity_index": null,
27
"http_status": 422,
28
"success": false
29
}
Copied!
Rollback=1
If an object in a request is invalid, it is not saved but other valid records are saved successfully. If the error occurs it is then returned in a response
1
POST {{baseUrl}}/entities/Accounts/batch-modify?rollback-method=1
2
[
3
{
4
"id": "0bc376a4-c579-413a-9221-e86e4a134766",
5
"name": "Account - Updated"
6
},
7
{
8
"name": "Account - Created",
9
"owner_id": "00000000-0000-0000-0000-000000011a7d"
10
}
11
]
Copied!
1
{
2
"success": false,
3
"data": [
4
{
5
"code": 40000,
6
"name": "ERROR_ENTITY_VALIDATION",
7
"message": "\n[owner_id] Relation Account.owner_id=00000000-0000-0000-0000-000000011a3d to Client doesn't exist!"
8
},
9
"f75fc63f-8c6f-499e-b9d2-ff16bcefdd83"
10
]
11
}
Copied!