Get agent job
Retrieves the current status and details of an agent job. Poll this endpoint to track job progress.
Authenticate with an admin API key.
Poll this endpoint to track the progress of an agent job. The status field transitions through active → completed or failed.
After the agent creates a pull request, the prLink field contains the link.
Related topics
GET /v2/agent/{projectId}/job/{id}
curl --request GET \
--url https://api.mintlify.com/v2/agent/{projectId}/job/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mintlify.com/v2/agent/{projectId}/job/{id}"
headers = {
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: "GET", headers: {"Authorization": "Bearer <token>"}};
fetch("https://api.mintlify.com/v2/agent/{projectId}/job/{id}", options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mintlify.com/v2/agent/{projectId}/job/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mintlify.com/v2/agent/{projectId}/job/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mintlify.com/v2/agent/{projectId}/job/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mintlify.com/v2/agent/{projectId}/job/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "active",
"source": {
"repository": "<string>",
"ref": "<string>"
},
"model": "<string>",
"prLink": "https://github.com/org/repo/pull/123",
"createdAt": "<string>",
"archivedAt": "<string>"
}{
"error": "<string>"
}Authorizations
Section titled “Authorizations”AuthorizationstringrequiredThe Authorization header expects a Bearer token. Use an admin API key. This is a server-side secret key. Generate one on the API keys page in your dashboard.
Path Parameters
Section titled “Path Parameters”projectIdstringrequiredYour project ID. Can be copied from the API keys page in your dashboard.
idstringrequiredThe unique identifier of the agent job.
Response
Section titled “Response”200 — Agent job details
id?stringUnique identifier for the agent job.
status?enum<string>Current status of the job. active — the agent is currently processing the prompt. completed — the agent finished successfully and a PR may have been created (check prLink). archived — the job has been archived. failed — the agent encountered an unrecoverable error. Poll until status is completed, archived, or failed.
Available options: active, completed, archived, failed
source?objectSource repository information.
Show child attributes
repository?stringFull URL of the GitHub repository.
ref?string | nullGit branch the agent is working on.
model?stringThe AI model used for this job.
prLink?string | nullGitHub pull request URL created by the agent. null while the job is still active or if no files were changed. Populated once the agent successfully creates a PR.
Example: https://github.com/org/repo/pull/123
createdAt?stringTimestamp when the job was created.
archivedAt?string | nullTimestamp when the job was archived.