URL : v3/api/admin/approval-workflow

Method : POST

Parameters:

Parameter Type Optional/Required Description
id Integer Optional Approval workflow id. Required for update. Id integer 0 indicates create operation.
name string Required Approval workflow name. Max 255 char. Unique.
levels array Required Approval workflow levels. Must be an associative array with level data.

 

Levels:

Parameter Type Optional/Required Description
id Integer Optional Level id. Required for update. Id integer 0 indicates create operation.
name string Required Level name. Max 255 char.
match string Required Approver matching condition all / any.
order integer Required Level order. Min 1. Max 255
approvers array Required Level approvers. Must be an associative array with approver data.

 

Level Approvers:

Parameter Type Optional/Required Description
users array Optional Array of user ids. Required if approval departments is missing.
user_types array Optional Array of User Type ids. Required if approval users is missing.

 

Sample Input:

{

"id": 0,

"name": "My approval workflow",

"levels": [{

    "id": 0,

    "name": "Level 1",

    "match": "all",

"order": 1,

    "approvers": {

        "users": [1, 2, 3],

        "user_types": []

    }

}, {

    "id": 0,

    "name": "Level 2",

    "match": "any",

"order": 2,

    "approvers": {

        "users": [],

        "user_types": [1, 2]

    }

}]

}

Response:



{

"success": true,

"message": "Approval workflow saved"

}

 

Tagged: