Who Approved My Approval Job?

Overview

When working with CircleCI workflows that include approval jobs, you may need to identify who approved a specific job for auditing, troubleshooting, or reporting purposes. This article explains how to use the CircleCI API v2 to retrieve approval information.

What You'll Need

  • A CircleCI API token with appropriate permissions
  • The job ID or project information for the approval job you want to investigate

Using the Get Job Details Endpoint

The CircleCI API v2 provides a getJobDetails endpoint that returns detailed information about jobs, including approval data for approval-type jobs.

API Endpoint

GET https://circleci.com/api/v2/project/{project-slug}/job/{job-number}'

After making the call, your response will look something like this:

{
  "job_number": 20,
  "stopped_at": "2025-07-14T19:23:26Z",
  "started_at": "2025-07-14T19:22:18Z",
  "name": "build",
  "project_slug": "gh/org/project",
  "approved_by": "user-id",
  "type": "approval",
  "approval_request_id": "request-id",
  "status": "success",
  "id": "job-id"
}

This provides you with the value for the UID who the job was "canceled_by". Take that User ID and pass it to the Get User API endpoint. You should receive a response that looks like this:

{
"name": "Martin",
"login": "martincircleci",
"id": <user_id>
}

Additional Resources:

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.