curl --request POST \
--url https://api.egp.scale.com/v5/builds/{build_id}/cancel \
--header 'x-api-key: <api-key>'import requests
url = "https://api.egp.scale.com/v5/builds/{build_id}/cancel"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.egp.scale.com/v5/builds/{build_id}/cancel', 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.egp.scale.com/v5/builds/{build_id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.egp.scale.com/v5/builds/{build_id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.egp.scale.com/v5/builds/{build_id}/cancel")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v5/builds/{build_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"cloud_provider_build_id": "<string>",
"agent_name": "<string>",
"image_name": "<string>",
"image_tag": "<string>",
"build_status": "queued",
"source_repo": "<string>",
"source_commit": "<string>",
"source_ref": "<string>",
"source_subpath": "<string>",
"working_tree_hash": "<string>",
"source_dirty": true,
"account_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "<string>",
"type": "user",
"object": "identity"
},
"object": "agentex_cloud_build",
"agent_id": "<string>",
"image_url": "<string>",
"build_start_time": "2023-11-07T05:31:56Z",
"build_end_time": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Cancel a build
Request cancellation of a build and return 202 Accepted.
Cancellation runs asynchronously: the endpoint verifies the build exists and then hands it off to a background workflow that marks the build as cancelling, asks the cloud build provider to stop it, and polls until the build reaches a terminal state before recording the final status. Only builds that are still queued or running are actually cancelled; if the build has already finished, or cancellation is already in progress, the request is still accepted but has no effect. The returned record reflects the build’s state at the time of the call, so it will not yet show the pending cancellation. The request is rejected if no such build exists for the caller’s account.
curl --request POST \
--url https://api.egp.scale.com/v5/builds/{build_id}/cancel \
--header 'x-api-key: <api-key>'import requests
url = "https://api.egp.scale.com/v5/builds/{build_id}/cancel"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.egp.scale.com/v5/builds/{build_id}/cancel', 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.egp.scale.com/v5/builds/{build_id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.egp.scale.com/v5/builds/{build_id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.egp.scale.com/v5/builds/{build_id}/cancel")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v5/builds/{build_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"cloud_provider_build_id": "<string>",
"agent_name": "<string>",
"image_name": "<string>",
"image_tag": "<string>",
"build_status": "queued",
"source_repo": "<string>",
"source_commit": "<string>",
"source_ref": "<string>",
"source_subpath": "<string>",
"working_tree_hash": "<string>",
"source_dirty": true,
"account_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "<string>",
"type": "user",
"object": "identity"
},
"object": "agentex_cloud_build",
"agent_id": "<string>",
"image_url": "<string>",
"build_start_time": "2023-11-07T05:31:56Z",
"build_end_time": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Headers
Path Parameters
Response
Successful Response
The unique identifier of the entity.
The unique identifier of the build from the cloud provider, or an internal UUID when an existing image is copied without a provider build.
The name of the agent that this build belongs to
The name of the container image to build.
The tag for the container image.
The current build lifecycle status
queued, running, success, failed, cancelling, cancelled, deleting, delete_failed, timed_out, error, unknown Normalized git remote the build context came from (host/path, no credentials).
Git commit the build context was at, when a git work tree.
Git branch or tag for source_commit, when resolvable.
Build-context path relative to the repo root (which agent, in a monorepo).
Deterministic SHA-256 content hash of the build inputs (not the tarball).
Whether the work tree had uncommitted changes at build time (null outside git).
The ID of the account that owns the given entity.
The date and time when the entity was created in ISO format.
The identity that created the entity.
Show child attributes
Show child attributes
"agentex_cloud_build"The UUID of the agent that this build belongs to
The URL of the container image. This is not guaranteed to be present until the build is complete.
When the cloud provider started the build
When the cloud provider finished the build

