CircleCI API approve

Hello there. I integrated a way to automatically approve my hold jobs based on some conditions. First I’m calling https://circleci.com/api/v2/workflow/{id}/job to get the approval_request_id and afterwards I’m calling https://circleci.com/api/v2/workflow/{id}/approve/approval_request_id in order to approve it. The problem is that inside the pipeline the response is “Job already approved.” even if the job wasn’t approved. If i’m making the call using Postman for the exact workflow and approval_request_id I get Accepted and the hold job is approved. Am I doing something wrong?

1 Like

Hi @Roxana006,

Thank you for sharing your issue on our forum!

Could you confirm for me if you are trying to approve an approval job in an upstream job?

If so, you will be unable to do so until the workflow has progressed until the point where the approval job is preventing further progression of the workflow. The error message shown is misleading however.