Skip to main content

Update Process API

The following APIs allow you to update a single process. A process can be updated basis its chakra processId or via its primaryKey value.

Note: All the apis accept api key based token authentication and return data within the wrapper { _data:{}, _meta: {}, _errors:[] }

Update by processId

PUT /v1/ext/procedure/<procedureShortId>/process/<processId>

Following are valid examples of the path

PUT /v1/ext/procedure/lead/process/1bc10281-5882-43aa-b48d-28c527335e7a
PUT /v1/ext/procedure/ticket/process/705bab28-0042-43d5-9b7f-6e72eb411b5b
PUT /v1/ext/procedure/fieldvisit/process/c6216cc5-81d1-4741-941d-a1a65751a8aa

Request Body

{
"data": {
"firstname": "Ted",
"lastname": "Mosby",
"score": 5
},
"status": "COMPLETED",
"state": "CONVERTED",
"nextActionAt": 1618558867539
}

Above is the payload structure for an update request.

data - should be an object. keys should be attribute short ids. value should denote the update value for the provided attribute
status - the updated status of the process - can be one of OPEN, COMPLETED or CANCELLED.
state - the updated state - the list of possible states depends on the procedure to which this process belongs
nextActionAt - accepts a unix epoch timestamp in milliseconds. This value updates the nextActionAt field of a process

Do note that you need to pass only those fields that you want to update in a process. Following are valid examples of process update payloads

{
"status": "CANCELLED"
}
{
"state": "NOT_INTERESTED"
}
{
"data": {
"city": "Memphis"
}
}

Update by primaryKey value

PUT /v1/ext/procedure/<procedureShortId>/process/<primaryKeyShortId>/<primaryKeyValue>

Following are valid examples of the path

PUT /v1/ext/procedure/lead/process/lead_id/LEAD-001
PUT /v1/ext/procedure/ticket/process/ticket_id/1
PUT /v1/ext/procedure/fieldvisit/process/fieldvisit_id/abc123

Request and response structure is the same as "Update by processId" api.