Bulk Update Process API
PATCH
/v1/ext/procedure/{procedureShortId}/processThe following API allows you to update multiple processes in a single API call. This API is asynchronous - meaning the request is accepted and an acknowledgment is returned while the updates are carried out in the background. Use this api when you have to update 1000s of processes in one go.
Request Body
In the request body you need to pass a list of processes which are to be updated. Each update item will need the following parts
Process Identifier
A way to identify the process which needs to be updated. The identifier can be the process id or the process primary key
Eg:
"id": "LEAD-001"
"phone_number": "9901258433"
Where phone_number is the primary key for the corresponding procedure
update
The actual update to be made. The update inputs need to be encapuslated and sent against the key "update". Supported parameters that can be updated are
data - a json object composed of attribute shortIds and the values that are to be updated
Eg:
{ "data": { "score": 42, "city": "Bangalore", "name": "Shane Warne" } }
state - the process state
Eg:
{ "state": "IN_PROGRESS" }
status - the process status
Eg:
{ "status": "CANCELLED" }
status can be one of OPEN, COMPLETED, CANCELLED
assignedTo - who the process is assignedTo
Eg:
{ assignedTo: "shane.warne" }
nextActionAt - the nextActionAt timestamp in epoch milliseconds
Eg:
{ "nextActionAt": 1616253910842 }
isDeleted - set isDeleted to true to delete a process
Eg:
{ "isDeleted": true }
Following are valid examples of the request body
{
"processes": [
{
"id": "46ce67e5-684e-4cfc-b47e-345a485d1cdd",
"state": "IN_PROGRESS",
"status": "OPEN",
"assignedTo": "shane.warne",
"nextActionAt": "1616253910842",
"data": {
"first_name": "shane",
"last_name": "warne"
}
}
]
}
{
"processes": [
{
"lead_id": "LEAD-910",
"data": {
"country": "Japan",
"city": "Tokyo"
}
}
]
}
{
"processes": [
{
"status": "COMPLETED"
}
]
}
Request
The short id of the procedure whose processes you want to update
Request samples
Responses
{
"processes": [
{
"lead_id": "EXT-TEST-143",
"update": {
"data": {
"score": "105"
}
}
},
{
"id": "1e50dd73-9ce6-405b-932a-9c4c5e7b5599",
"update": {
"data": {
"city": "Goa"
},
"state": "IN_PROGRESS"
}
}
]
}