function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lalith BachimanchiLalith Bachimanchi 

Record is being approved when actionType is Submit

Hi,

I have refered below link to submit a record for approval.
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_process_approvals_submit.htm

I am using REST API to submit a record for approval. When I submit a record, instead of submitting a record for approval, it is being approved.
Even though the approval process has two steps, when I make a REST call with non-admin to just submit a record, the response shows that record is approved. When I check in Salesforce UI, record is approved and Field Update and Email Alert has also fired. 

Below is the request and Response:
POST https://instance//services/data/v44.0/process/approvals
json:
{
"requests" : [{
"actionType":"Submit",
"contextId":"a2k2D000000e03aQAA",
"comments":"submitted for approval 1 nov",
"processDefinitionNameOrId" : "US_Account_Approval_Process"}]
}

Response:
[
    {
        "actorIds": null,
        "entityId": "a2k2D000000e03aQAA",
        "errors": null,
        "instanceId": "04g2D00000073vXQAQ",
        "instanceStatus": "Approved",
        "newWorkitemIds": [],
        "success": true
    }
]


Please let me know why it is behaving this way? Is it a defect in Salesforce API?