Edit a draft
curl --request PATCH \
--url https://api.example.com/api/registry/versions/{version_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"spec": {},
"changelog": "<string>",
"display_name": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.example.com/api/registry/versions/{version_id}"
payload = {
"spec": {},
"changelog": "<string>",
"display_name": "<string>",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
spec: {},
changelog: '<string>',
display_name: '<string>',
description: '<string>'
})
};
fetch('https://api.example.com/api/registry/versions/{version_id}', 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/registry/versions/{version_id}",
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([
'spec' => [
],
'changelog' => '<string>',
'display_name' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/registry/versions/{version_id}"
payload := strings.NewReader("{\n \"spec\": {},\n \"changelog\": \"<string>\",\n \"display_name\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.patch("https://api.example.com/api/registry/versions/{version_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"spec\": {},\n \"changelog\": \"<string>\",\n \"display_name\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/registry/versions/{version_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"spec\": {},\n \"changelog\": \"<string>\",\n \"display_name\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "agent",
"scope": "personal",
"name": "<string>",
"display_name": "<string>",
"description": "<string>",
"owner_id": "<string>",
"is_system": true,
"updated_at": "2023-11-07T05:31:56Z",
"versions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": "<string>",
"status": "draft",
"spec": {},
"changelog": "<string>",
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"submitted_by": "<string>",
"submitted_at": "2023-11-07T05:31:56Z",
"reviewed_by": "<string>",
"reviewed_at": "2023-11-07T05:31:56Z",
"review_reason": "<string>",
"deprecated_at": "2023-11-07T05:31:56Z",
"withdrawn_at": "2023-11-07T05:31:56Z",
"withdrawn_reason": "<string>",
"promoted_from_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"used_in_templates": 0
}
],
"parent_artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"promoted_from_artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"latest_version": "<string>",
"latest_status": "draft",
"latest_approved_version": "<string>",
"has_draft": false,
"used_in_templates": 0,
"used_in_agents": 123,
"write": true,
"needs_sign_off": true,
"sensitivity": "<string>",
"health": "ok",
"can_use": true
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}Registry
Edit a draft
Change a draft version. Anything else is a 409.
PATCH
/
api
/
registry
/
versions
/
{version_id}
Edit a draft
curl --request PATCH \
--url https://api.example.com/api/registry/versions/{version_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"spec": {},
"changelog": "<string>",
"display_name": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.example.com/api/registry/versions/{version_id}"
payload = {
"spec": {},
"changelog": "<string>",
"display_name": "<string>",
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
spec: {},
changelog: '<string>',
display_name: '<string>',
description: '<string>'
})
};
fetch('https://api.example.com/api/registry/versions/{version_id}', 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/registry/versions/{version_id}",
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([
'spec' => [
],
'changelog' => '<string>',
'display_name' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/registry/versions/{version_id}"
payload := strings.NewReader("{\n \"spec\": {},\n \"changelog\": \"<string>\",\n \"display_name\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.patch("https://api.example.com/api/registry/versions/{version_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"spec\": {},\n \"changelog\": \"<string>\",\n \"display_name\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/registry/versions/{version_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"spec\": {},\n \"changelog\": \"<string>\",\n \"display_name\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "agent",
"scope": "personal",
"name": "<string>",
"display_name": "<string>",
"description": "<string>",
"owner_id": "<string>",
"is_system": true,
"updated_at": "2023-11-07T05:31:56Z",
"versions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": "<string>",
"status": "draft",
"spec": {},
"changelog": "<string>",
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"submitted_by": "<string>",
"submitted_at": "2023-11-07T05:31:56Z",
"reviewed_by": "<string>",
"reviewed_at": "2023-11-07T05:31:56Z",
"review_reason": "<string>",
"deprecated_at": "2023-11-07T05:31:56Z",
"withdrawn_at": "2023-11-07T05:31:56Z",
"withdrawn_reason": "<string>",
"promoted_from_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"used_in_templates": 0
}
],
"parent_artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"promoted_from_artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"latest_version": "<string>",
"latest_status": "draft",
"latest_approved_version": "<string>",
"has_draft": false,
"used_in_templates": 0,
"used_in_agents": 123,
"write": true,
"needs_sign_off": true,
"sensitivity": "<string>",
"health": "ok",
"can_use": true
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}Authorizations
OAuth2AuthorizationCodeBearerAPIKeyHeader
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
The version's ID.
Body
application/json
Response
Successful Response
An artifact with all its versions.
What an artifact is.
Available options:
agent, skill, mcp_server, tool, context_pack, ontology, prompt, workflow, brand, code_repo Who an artifact is for. tenant is shown as "Global".
Available options:
personal, tenant Show child attributes
Show child attributes
Newest version of any status.
Lifecycle of one version.
Available options:
draft, submitted, approved, rejected, deprecated, withdrawn Context packs only: visible agents whose newest version loads it.
Tools only: effective write flag.
Tools only: a write tool not yet signed off.
Context packs only: the newest approved version's effective sensitivity.
Context packs only: whether its items resolve.
Available options:
ok, stale, broken False: you are limited and it is given to you to view only.
Was this page helpful?

