Publish
Update agent
Update selected fields of an owned agent.
PATCH
/
v3
/
publish
/
agent
/
{agentId}
Update agent
curl --request PATCH \
--url https://api.darwin.so/api/v3/publish/agent/{agentId} \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"expectedRevision": 1
}
'import requests
url = "https://api.darwin.so/api/v3/publish/agent/{agentId}"
payload = { "expectedRevision": 1 }
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({expectedRevision: 1})
};
fetch('https://api.darwin.so/api/v3/publish/agent/{agentId}', 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.darwin.so/api/v3/publish/agent/{agentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expectedRevision' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.darwin.so/api/v3/publish/agent/{agentId}"
payload := strings.NewReader("{\n \"expectedRevision\": 1\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
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.patch("https://api.darwin.so/api/v3/publish/agent/{agentId}")
.header("Idempotency-Key", "<idempotency-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"expectedRevision\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.darwin.so/api/v3/publish/agent/{agentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expectedRevision\": 1\n}"
response = http.request(request)
puts response.read_body{
"agent": {
"agentId": "<string>",
"handle": "<string>",
"name": "<string>",
"description": "<string>",
"avatarUrl": "<string>",
"visibility": "<string>",
"revision": 0,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Read Get agent, then send its
revision as expectedRevision, the fields to change, and an Idempotency-Key. Omitted fields stay unchanged. Use avatarUrl: null to clear an image. A stale revision or handle conflict returns 409; reread and review the change before retrying with a new key.Authorizations
apiKeyapiKeyBearer
Headers
Stable key for this exact mutation. Reusing it with different input returns 409.
Required string length:
1 - 200Path Parameters
Body
application/json
Required range:
1 <= x <= 2147483647Pattern:
^[a-z0-9](?:[a-z0-9-]{0,39}[a-z0-9])?$Required string length:
1 - 160Maximum string length:
5000Maximum string length:
2000Available options:
PRIVATE, RESTRICTED, PUBLIC Response
Current owner-scoped result. A mutation retry returns its saved response.
Show child attributes
Show child attributes
Last modified on October 19, 2026
⌘I
Update agent
curl --request PATCH \
--url https://api.darwin.so/api/v3/publish/agent/{agentId} \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"expectedRevision": 1
}
'import requests
url = "https://api.darwin.so/api/v3/publish/agent/{agentId}"
payload = { "expectedRevision": 1 }
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({expectedRevision: 1})
};
fetch('https://api.darwin.so/api/v3/publish/agent/{agentId}', 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.darwin.so/api/v3/publish/agent/{agentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expectedRevision' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.darwin.so/api/v3/publish/agent/{agentId}"
payload := strings.NewReader("{\n \"expectedRevision\": 1\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
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.patch("https://api.darwin.so/api/v3/publish/agent/{agentId}")
.header("Idempotency-Key", "<idempotency-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"expectedRevision\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.darwin.so/api/v3/publish/agent/{agentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expectedRevision\": 1\n}"
response = http.request(request)
puts response.read_body{
"agent": {
"agentId": "<string>",
"handle": "<string>",
"name": "<string>",
"description": "<string>",
"avatarUrl": "<string>",
"visibility": "<string>",
"revision": 0,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}