Publish the current draft version
curl --request POST \
--url https://api.usehasp.com/v1/agents/{agentId}/draft/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usehasp.com/v1/agents/{agentId}/draft/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.usehasp.com/v1/agents/{agentId}/draft/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.usehasp.com/v1/agents/{agentId}/draft/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.usehasp.com/v1/agents/{agentId}/draft/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.usehasp.com/v1/agents/{agentId}/draft/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usehasp.com/v1/agents/{agentId}/draft/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{
"success": true,
"data": {
"version": {
"id": "<string>",
"agent_id": "<string>",
"version": 123,
"is_draft": true,
"is_deprecated": true,
"is_retired": true,
"persona": "<string>",
"model": "<string>",
"tool_allowlist": [
"<string>"
],
"default_scope_grants": [
{}
],
"input_schema": {},
"output_schema": {},
"behavior_constraints": {},
"invocation_limits": {},
"schema_hash": "<string>",
"visibility": "<string>",
"released_at": "<string>",
"released_by": "<string>",
"deprecated_at": "<string>",
"retired_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
}
}{
"success": false,
"error": {
"type": "authentication",
"code": "INVALID_API_KEY",
"message": "Bearer token is missing, malformed, or revoked.",
"param": null,
"details": null,
"retryable": false,
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
},
"meta": {
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
}
}{
"success": false,
"error": {
"type": "permission",
"code": "MISSING_SCOPE",
"message": "The caller is authenticated but lacks the scope or capability this route requires.",
"param": null,
"details": null,
"retryable": false,
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
},
"meta": {
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
}
}{
"success": true,
"error": {
"code": "<string>",
"type": "<string>",
"message": "<string>",
"retryable": true
}
}AgentVersions
Publish the current draft version
POST /v1/agents//draft/publish
Enforces ADR-QVWZEY invariant 8: both input_schema and output_schema must be present on the draft before publishing.
Returns the now-published version.
POST
/
agents
/
{agentId}
/
draft
/
publish
Publish the current draft version
curl --request POST \
--url https://api.usehasp.com/v1/agents/{agentId}/draft/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usehasp.com/v1/agents/{agentId}/draft/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.usehasp.com/v1/agents/{agentId}/draft/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.usehasp.com/v1/agents/{agentId}/draft/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.usehasp.com/v1/agents/{agentId}/draft/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.usehasp.com/v1/agents/{agentId}/draft/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usehasp.com/v1/agents/{agentId}/draft/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{
"success": true,
"data": {
"version": {
"id": "<string>",
"agent_id": "<string>",
"version": 123,
"is_draft": true,
"is_deprecated": true,
"is_retired": true,
"persona": "<string>",
"model": "<string>",
"tool_allowlist": [
"<string>"
],
"default_scope_grants": [
{}
],
"input_schema": {},
"output_schema": {},
"behavior_constraints": {},
"invocation_limits": {},
"schema_hash": "<string>",
"visibility": "<string>",
"released_at": "<string>",
"released_by": "<string>",
"deprecated_at": "<string>",
"retired_at": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
}
}{
"success": false,
"error": {
"type": "authentication",
"code": "INVALID_API_KEY",
"message": "Bearer token is missing, malformed, or revoked.",
"param": null,
"details": null,
"retryable": false,
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
},
"meta": {
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
}
}{
"success": false,
"error": {
"type": "permission",
"code": "MISSING_SCOPE",
"message": "The caller is authenticated but lacks the scope or capability this route requires.",
"param": null,
"details": null,
"retryable": false,
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
},
"meta": {
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
}
}{
"success": true,
"error": {
"code": "<string>",
"type": "<string>",
"message": "<string>",
"retryable": true
}
}⌘I