curl --request POST \
--url https://api.erstan.com/v1/public/authoring/agents/{id}/publish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'If-Match: <if-match>' \
--data '{}'import requests
url = "https://api.erstan.com/v1/public/authoring/agents/{id}/publish"
payload = {}
headers = {
"If-Match": "<if-match>",
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'If-Match': '<if-match>',
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://api.erstan.com/v1/public/authoring/agents/{id}/publish', 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.erstan.com/v1/public/authoring/agents/{id}/publish",
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([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"If-Match: <if-match>"
],
]);
$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.erstan.com/v1/public/authoring/agents/{id}/publish"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("If-Match", "<if-match>")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.erstan.com/v1/public/authoring/agents/{id}/publish")
.header("If-Match", "<if-match>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erstan.com/v1/public/authoring/agents/{id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["If-Match"] = '<if-match>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"agent": {
"name": "<string>",
"description": "<string>",
"category": "<string>",
"tags": [
"<string>"
],
"difficulty": "<string>",
"estimatedTime": "<string>",
"behaviorType": "interactive",
"runAsSelf": true,
"nodes": [
{}
],
"edges": [
{}
],
"id": "<string>",
"status": "<string>",
"currentVersion": 2,
"publishedVersion": 2,
"defaultTeamId": "<string>",
"revision": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"isEditable": true,
"presentationKnown": true
},
"builderUrl": "<string>",
"selectedVersion": 123,
"issuedWebhookCredentials": [
{}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
],
"requestId": "<string>"
}
}publish agent authoring content
Requires the stagedAuthoring workspace capability. Reads require agents:read; lists also require agents:list; writes and validation require agents:read plus agents:write. Saving stages content; publication is a separate operation. Current permissions are checked again on every retry. Multi-resource operations are not atomic.
curl --request POST \
--url https://api.erstan.com/v1/public/authoring/agents/{id}/publish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'If-Match: <if-match>' \
--data '{}'import requests
url = "https://api.erstan.com/v1/public/authoring/agents/{id}/publish"
payload = {}
headers = {
"If-Match": "<if-match>",
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'If-Match': '<if-match>',
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://api.erstan.com/v1/public/authoring/agents/{id}/publish', 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.erstan.com/v1/public/authoring/agents/{id}/publish",
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([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"If-Match: <if-match>"
],
]);
$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.erstan.com/v1/public/authoring/agents/{id}/publish"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("If-Match", "<if-match>")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.erstan.com/v1/public/authoring/agents/{id}/publish")
.header("If-Match", "<if-match>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erstan.com/v1/public/authoring/agents/{id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["If-Match"] = '<if-match>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"agent": {
"name": "<string>",
"description": "<string>",
"category": "<string>",
"tags": [
"<string>"
],
"difficulty": "<string>",
"estimatedTime": "<string>",
"behaviorType": "interactive",
"runAsSelf": true,
"nodes": [
{}
],
"edges": [
{}
],
"id": "<string>",
"status": "<string>",
"currentVersion": 2,
"publishedVersion": 2,
"defaultTeamId": "<string>",
"revision": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"isEditable": true,
"presentationKnown": true
},
"builderUrl": "<string>",
"selectedVersion": 123,
"issuedWebhookCredentials": [
{}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
],
"requestId": "<string>"
}
}Authorizations
Workspace API key created in Erstan Settings. Keys carry scopes (agents:list, agents:read, agents:write, agents:run, runs:read, tasks:execute, documents:read, documents:write, files:read, files:write). Agent access follows the key creator's current workspace, team, and agent permissions. Agent draft creation requires agents:write; update, validation, and publishing require both agents:read and agents:write; draft testing also requires agents:run. Keys with tasks:execute must include at least one allowed project or team (allowedProjectIds / allowedTeamIds); keys with document or file scopes must include at least one allowed team. Empty allowlists mean no access — the API fails closed.
Headers
One strong quoted ETag from the content being edited; wildcard and weak tags are rejected.
1–200 visible ASCII characters. Reuse with identical content and If-Match after response loss. Committed responses are encrypted and recoverable for 24 hours; expired/pending keys are never blindly reused.
1 - 200Path Parameters
Body
The body is of type object.