agents
Remove Codegen From Pr
Remove Codegen from a PR.
This endpoint performs the same action as banning all checks but with more user-friendly naming. It:
- Flags the PR to prevent future CI/CD check suite events from being processed
- Stops all current agents for that PR
POST
/
v1
/
organizations
/
{org_id}
/
agent
/
run
/
remove-from-pr
Remove Codegen From Pr
curl --request POST \
--url https://api.codegen.com/v1/organizations/{org_id}/agent/run/remove-from-pr \
--header 'Content-Type: application/json' \
--data '
{
"agent_run_id": 123,
"before_card_order_id": "<string>",
"after_card_order_id": "<string>"
}
'import requests
url = "https://api.codegen.com/v1/organizations/{org_id}/agent/run/remove-from-pr"
payload = {
"agent_run_id": 123,
"before_card_order_id": "<string>",
"after_card_order_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
agent_run_id: 123,
before_card_order_id: '<string>',
after_card_order_id: '<string>'
})
};
fetch('https://api.codegen.com/v1/organizations/{org_id}/agent/run/remove-from-pr', 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/remove-from-pr",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_run_id' => 123,
'before_card_order_id' => '<string>',
'after_card_order_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.codegen.com/v1/organizations/{org_id}/agent/run/remove-from-pr"
payload := strings.NewReader("{\n \"agent_run_id\": 123,\n \"before_card_order_id\": \"<string>\",\n \"after_card_order_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.codegen.com/v1/organizations/{org_id}/agent/run/remove-from-pr")
.header("Content-Type", "application/json")
.body("{\n \"agent_run_id\": 123,\n \"before_card_order_id\": \"<string>\",\n \"after_card_order_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.codegen.com/v1/organizations/{org_id}/agent/run/remove-from-pr")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_run_id\": 123,\n \"before_card_order_id\": \"<string>\",\n \"after_card_order_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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
}Headers
Path Parameters
Body
application/json
Response
Successful Response
Was this page helpful?
Previous
Get RepositoriesGet repositories for the specified organization.
Returns a paginated list of all repositories that belong to the specified organization.
Results include repository details such as name, ID, description, visibility, and setup status.
Use pagination parameters to control the number of results returned.
Rate limit: 60 requests per 30 seconds.
Next
⌘I
Remove Codegen From Pr
curl --request POST \
--url https://api.codegen.com/v1/organizations/{org_id}/agent/run/remove-from-pr \
--header 'Content-Type: application/json' \
--data '
{
"agent_run_id": 123,
"before_card_order_id": "<string>",
"after_card_order_id": "<string>"
}
'import requests
url = "https://api.codegen.com/v1/organizations/{org_id}/agent/run/remove-from-pr"
payload = {
"agent_run_id": 123,
"before_card_order_id": "<string>",
"after_card_order_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
agent_run_id: 123,
before_card_order_id: '<string>',
after_card_order_id: '<string>'
})
};
fetch('https://api.codegen.com/v1/organizations/{org_id}/agent/run/remove-from-pr', 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/remove-from-pr",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_run_id' => 123,
'before_card_order_id' => '<string>',
'after_card_order_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.codegen.com/v1/organizations/{org_id}/agent/run/remove-from-pr"
payload := strings.NewReader("{\n \"agent_run_id\": 123,\n \"before_card_order_id\": \"<string>\",\n \"after_card_order_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.codegen.com/v1/organizations/{org_id}/agent/run/remove-from-pr")
.header("Content-Type", "application/json")
.body("{\n \"agent_run_id\": 123,\n \"before_card_order_id\": \"<string>\",\n \"after_card_order_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.codegen.com/v1/organizations/{org_id}/agent/run/remove-from-pr")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_run_id\": 123,\n \"before_card_order_id\": \"<string>\",\n \"after_card_order_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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
}