Publish Tool
curl --request POST \
--url https://api.agents.slng.ai/v1/agents/tools/{tool_id}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.agents.slng.ai/v1/agents/tools/{tool_id}/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.agents.slng.ai/v1/agents/tools/{tool_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.agents.slng.ai/v1/agents/tools/{tool_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_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.agents.slng.ai/v1/agents/tools/{tool_id}/publish"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.agents.slng.ai/v1/agents/tools/{tool_id}/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agents.slng.ai/v1/agents/tools/{tool_id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"published": true,
"version_number": 4,
"checks": {
"static": {
"config_valid": {
"passed": true
},
"secrets_exist": {
"passed": true
},
"name_unique": {
"passed": true
}
},
"green_run": {
"passed": true
}
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"published": true,
"version_number": 4,
"checks": {
"static": {
"config_valid": {
"passed": true
},
"secrets_exist": {
"passed": true
},
"name_unique": {
"passed": true
}
},
"green_run": {
"passed": true
}
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}API Reference
Publish Tool
Run the publish gates for the draft and, when they all pass, create the next immutable version. If any gate fails, returns 409 with the same PublishResult body, published set to false, and the per-gate check results.
POST
/
v1
/
agents
/
tools
/
{tool_id}
/
publish
Publish Tool
curl --request POST \
--url https://api.agents.slng.ai/v1/agents/tools/{tool_id}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.agents.slng.ai/v1/agents/tools/{tool_id}/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.agents.slng.ai/v1/agents/tools/{tool_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.agents.slng.ai/v1/agents/tools/{tool_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_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.agents.slng.ai/v1/agents/tools/{tool_id}/publish"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.agents.slng.ai/v1/agents/tools/{tool_id}/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agents.slng.ai/v1/agents/tools/{tool_id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"published": true,
"version_number": 4,
"checks": {
"static": {
"config_valid": {
"passed": true
},
"secrets_exist": {
"passed": true
},
"name_unique": {
"passed": true
}
},
"green_run": {
"passed": true
}
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"published": true,
"version_number": 4,
"checks": {
"static": {
"config_valid": {
"passed": true
},
"secrets_exist": {
"passed": true
},
"name_unique": {
"passed": true
}
},
"green_run": {
"passed": true
}
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}{
"detail": "The tool is attached to an active agent.",
"error": {
"code": "TOOL_DELETE_BLOCKED",
"message": "The tool is attached to an active agent.",
"retryable": false
}
}Authorizations
Your SLNG consumer API key.
Path Parameters
The tool UUID. Curated tools are visible but read-only, and a tool owned by another organisation returns 404.
Response
The publish result. A new immutable version is created and the per-gate checks are reported; if a gate fails, the same body is returned with a 409 and published set to false.
Outcome of a publish attempt, with the new version number and per-gate checks.