agents
Rebuild and redeploy an agent from a new source archive, bumping its
Rebuild and redeploy an agent from a new source archive, bumping its
version. Runs the build asynchronously (poll via /uploads/{id} SSE or
/deploys/{build_id}/stream). Owner-or-superuser only.
PUT
/
api
/
agents
/
{id}
/
update
Rebuild and redeploy an agent from a new source archive, bumping its
curl --request PUT \
--url https://api.example.com/api/agents/{id}/update \
--header 'Content-Type: multipart/form-data' \
--form source='@example-file' \
--form 'changelog=<string>' \
--form 'version=<string>'import requests
url = "https://api.example.com/api/agents/{id}/update"
files = { "source": ("example-file", open("example-file", "rb")) }
payload = {
"changelog": "<string>",
"version": "<string>"
}
response = requests.put(url, data=payload, files=files)
print(response.text)const form = new FormData();
form.append('source', '<string>');
form.append('changelog', '<string>');
form.append('version', '<string>');
const options = {method: 'PUT'};
options.body = form;
fetch('https://api.example.com/api/agents/{id}/update', 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.example.com/api/agents/{id}/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"source\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"changelog\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data"
],
]);
$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.example.com/api/agents/{id}/update"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"source\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"changelog\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PUT", url, payload)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/api/agents/{id}/update")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"source\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"changelog\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/agents/{id}/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"source\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"changelog\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"build_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"new_version": "<string>",
"previous_version": "<string>",
"status": "<string>"
}Path Parameters
Agent id
Body
multipart/form-data
⌘I
Rebuild and redeploy an agent from a new source archive, bumping its
curl --request PUT \
--url https://api.example.com/api/agents/{id}/update \
--header 'Content-Type: multipart/form-data' \
--form source='@example-file' \
--form 'changelog=<string>' \
--form 'version=<string>'import requests
url = "https://api.example.com/api/agents/{id}/update"
files = { "source": ("example-file", open("example-file", "rb")) }
payload = {
"changelog": "<string>",
"version": "<string>"
}
response = requests.put(url, data=payload, files=files)
print(response.text)const form = new FormData();
form.append('source', '<string>');
form.append('changelog', '<string>');
form.append('version', '<string>');
const options = {method: 'PUT'};
options.body = form;
fetch('https://api.example.com/api/agents/{id}/update', 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.example.com/api/agents/{id}/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"source\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"changelog\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data"
],
]);
$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.example.com/api/agents/{id}/update"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"source\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"changelog\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PUT", url, payload)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/api/agents/{id}/update")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"source\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"changelog\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/agents/{id}/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"source\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"changelog\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"version\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"build_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"new_version": "<string>",
"previous_version": "<string>",
"status": "<string>"
}