agents
Get Agent Run
Retrieve the status and result of an agent run.
Returns the current status, progress, and any available results for the specified agent run. The agent run must belong to the specified organization. If the agent run is still in progress, this endpoint can be polled to check for completion.
Rate limit: 60 requests per 30 seconds.
GET
/
v1
/
organizations
/
{org_id}
/
agent
/
run
/
{agent_run_id}
Get Agent Run
curl --request GET \
--url https://api.codegen.com/v1/organizations/{org_id}/agent/run/{agent_run_id}import requests
url = "https://api.codegen.com/v1/organizations/{org_id}/agent/run/{agent_run_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.codegen.com/v1/organizations/{org_id}/agent/run/{agent_run_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.codegen.com/v1/organizations/{org_id}/agent/run/{agent_run_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.codegen.com/v1/organizations/{org_id}/agent/run/{agent_run_id}"
req, _ := http.NewRequest("GET", url, nil)
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.codegen.com/v1/organizations/{org_id}/agent/run/{agent_run_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.codegen.com/v1/organizations/{org_id}/agent/run/{agent_run_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": 123,
"organization_id": 123,
"status": "<string>",
"created_at": "<string>",
"web_url": "<string>",
"result": "<string>"
}{
"message": "You do not have access to this organization.",
"status_code": 403
}{
"message": "Agent run not found.",
"status_code": 404
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"message": "Rate limit exceeded. Please try again later.",
"status_code": 429
}Was this page helpful?
⌘I
Get Agent Run
curl --request GET \
--url https://api.codegen.com/v1/organizations/{org_id}/agent/run/{agent_run_id}import requests
url = "https://api.codegen.com/v1/organizations/{org_id}/agent/run/{agent_run_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.codegen.com/v1/organizations/{org_id}/agent/run/{agent_run_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.codegen.com/v1/organizations/{org_id}/agent/run/{agent_run_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.codegen.com/v1/organizations/{org_id}/agent/run/{agent_run_id}"
req, _ := http.NewRequest("GET", url, nil)
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.codegen.com/v1/organizations/{org_id}/agent/run/{agent_run_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.codegen.com/v1/organizations/{org_id}/agent/run/{agent_run_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": 123,
"organization_id": 123,
"status": "<string>",
"created_at": "<string>",
"web_url": "<string>",
"result": "<string>"
}{
"message": "You do not have access to this organization.",
"status_code": 403
}{
"message": "Agent run not found.",
"status_code": 404
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"message": "Rate limit exceeded. Please try again later.",
"status_code": 429
}