Create or update prompt version
curl --request PUT \
--url https://{controlPlaneURL}/api/ml/v1/prompt-versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"manifest": {
"name": "<string>",
"metadata": {},
"ml_repo": "<string>",
"messages": [
{
"role": "system",
"content": "<string>",
"name": "<string>"
}
],
"version": 2,
"type": "chat_prompt",
"description": "<string>",
"version_alias": "<string>",
"variables": {},
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": false
}
}
],
"mcp_servers": [
{
"type": "mcp-server-fqn",
"integration_fqn": "<string>",
"enable_all_tools": false,
"tools": [
{
"name": "<string>"
}
]
}
],
"guardrails": {
"input_guardrails": [
"<string>"
],
"output_guardrails": [
"<string>"
]
},
"response_format": {
"type": "json_object"
},
"routing_config": {
"type": "weight-based-routing",
"load_balance_targets": [
{
"target": "<string>",
"weight": 123,
"fallback_status_codes": [
"401",
"403",
"404",
"408",
"429",
"500",
"502",
"503"
],
"fallback_candidate": true,
"override_params": {},
"headers_override": {
"remove": [
"<string>"
],
"set": {}
},
"metadata_match": {}
}
]
},
"cache_config": {
"type": "semantic",
"similarity_threshold": 0.5,
"ttl": 3600,
"namespace": "<string>"
},
"tool_call_to_mcp_mapping": {},
"sub_agents": [
{
"name": "<string>"
}
]
}
}
'import requests
url = "https://{controlPlaneURL}/api/ml/v1/prompt-versions"
payload = { "manifest": {
"name": "<string>",
"metadata": {},
"ml_repo": "<string>",
"messages": [
{
"role": "system",
"content": "<string>",
"name": "<string>"
}
],
"version": 2,
"type": "chat_prompt",
"description": "<string>",
"version_alias": "<string>",
"variables": {},
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": False
}
}
],
"mcp_servers": [
{
"type": "mcp-server-fqn",
"integration_fqn": "<string>",
"enable_all_tools": False,
"tools": [{ "name": "<string>" }]
}
],
"guardrails": {
"input_guardrails": ["<string>"],
"output_guardrails": ["<string>"]
},
"response_format": { "type": "json_object" },
"routing_config": {
"type": "weight-based-routing",
"load_balance_targets": [
{
"target": "<string>",
"weight": 123,
"fallback_status_codes": ["401", "403", "404", "408", "429", "500", "502", "503"],
"fallback_candidate": True,
"override_params": {},
"headers_override": {
"remove": ["<string>"],
"set": {}
},
"metadata_match": {}
}
]
},
"cache_config": {
"type": "semantic",
"similarity_threshold": 0.5,
"ttl": 3600,
"namespace": "<string>"
},
"tool_call_to_mcp_mapping": {},
"sub_agents": [{ "name": "<string>" }]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
manifest: {
name: '<string>',
metadata: {},
ml_repo: '<string>',
messages: [{role: 'system', content: '<string>', name: '<string>'}],
version: 2,
type: 'chat_prompt',
description: '<string>',
version_alias: '<string>',
variables: {},
tools: [
{
type: 'function',
function: {name: '<string>', description: '<string>', parameters: {}, strict: false}
}
],
mcp_servers: [
{
type: 'mcp-server-fqn',
integration_fqn: '<string>',
enable_all_tools: false,
tools: [{name: '<string>'}]
}
],
guardrails: {input_guardrails: ['<string>'], output_guardrails: ['<string>']},
response_format: {type: 'json_object'},
routing_config: {
type: 'weight-based-routing',
load_balance_targets: [
{
target: '<string>',
weight: 123,
fallback_status_codes: ['401', '403', '404', '408', '429', '500', '502', '503'],
fallback_candidate: true,
override_params: {},
headers_override: {remove: ['<string>'], set: {}},
metadata_match: {}
}
]
},
cache_config: {type: 'semantic', similarity_threshold: 0.5, ttl: 3600, namespace: '<string>'},
tool_call_to_mcp_mapping: {},
sub_agents: [{name: '<string>'}]
}
})
};
fetch('https://{controlPlaneURL}/api/ml/v1/prompt-versions', 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://{controlPlaneURL}/api/ml/v1/prompt-versions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'manifest' => [
'name' => '<string>',
'metadata' => [
],
'ml_repo' => '<string>',
'messages' => [
[
'role' => 'system',
'content' => '<string>',
'name' => '<string>'
]
],
'version' => 2,
'type' => 'chat_prompt',
'description' => '<string>',
'version_alias' => '<string>',
'variables' => [
],
'tools' => [
[
'type' => 'function',
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
],
'strict' => false
]
]
],
'mcp_servers' => [
[
'type' => 'mcp-server-fqn',
'integration_fqn' => '<string>',
'enable_all_tools' => false,
'tools' => [
[
'name' => '<string>'
]
]
]
],
'guardrails' => [
'input_guardrails' => [
'<string>'
],
'output_guardrails' => [
'<string>'
]
],
'response_format' => [
'type' => 'json_object'
],
'routing_config' => [
'type' => 'weight-based-routing',
'load_balance_targets' => [
[
'target' => '<string>',
'weight' => 123,
'fallback_status_codes' => [
'401',
'403',
'404',
'408',
'429',
'500',
'502',
'503'
],
'fallback_candidate' => true,
'override_params' => [
],
'headers_override' => [
'remove' => [
'<string>'
],
'set' => [
]
],
'metadata_match' => [
]
]
]
],
'cache_config' => [
'type' => 'semantic',
'similarity_threshold' => 0.5,
'ttl' => 3600,
'namespace' => '<string>'
],
'tool_call_to_mcp_mapping' => [
],
'sub_agents' => [
[
'name' => '<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://{controlPlaneURL}/api/ml/v1/prompt-versions"
payload := strings.NewReader("{\n \"manifest\": {\n \"name\": \"<string>\",\n \"metadata\": {},\n \"ml_repo\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"version\": 2,\n \"type\": \"chat_prompt\",\n \"description\": \"<string>\",\n \"version_alias\": \"<string>\",\n \"variables\": {},\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": false\n }\n }\n ],\n \"mcp_servers\": [\n {\n \"type\": \"mcp-server-fqn\",\n \"integration_fqn\": \"<string>\",\n \"enable_all_tools\": false,\n \"tools\": [\n {\n \"name\": \"<string>\"\n }\n ]\n }\n ],\n \"guardrails\": {\n \"input_guardrails\": [\n \"<string>\"\n ],\n \"output_guardrails\": [\n \"<string>\"\n ]\n },\n \"response_format\": {\n \"type\": \"json_object\"\n },\n \"routing_config\": {\n \"type\": \"weight-based-routing\",\n \"load_balance_targets\": [\n {\n \"target\": \"<string>\",\n \"weight\": 123,\n \"fallback_status_codes\": [\n \"401\",\n \"403\",\n \"404\",\n \"408\",\n \"429\",\n \"500\",\n \"502\",\n \"503\"\n ],\n \"fallback_candidate\": true,\n \"override_params\": {},\n \"headers_override\": {\n \"remove\": [\n \"<string>\"\n ],\n \"set\": {}\n },\n \"metadata_match\": {}\n }\n ]\n },\n \"cache_config\": {\n \"type\": \"semantic\",\n \"similarity_threshold\": 0.5,\n \"ttl\": 3600,\n \"namespace\": \"<string>\"\n },\n \"tool_call_to_mcp_mapping\": {},\n \"sub_agents\": [\n {\n \"name\": \"<string>\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://{controlPlaneURL}/api/ml/v1/prompt-versions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"manifest\": {\n \"name\": \"<string>\",\n \"metadata\": {},\n \"ml_repo\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"version\": 2,\n \"type\": \"chat_prompt\",\n \"description\": \"<string>\",\n \"version_alias\": \"<string>\",\n \"variables\": {},\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": false\n }\n }\n ],\n \"mcp_servers\": [\n {\n \"type\": \"mcp-server-fqn\",\n \"integration_fqn\": \"<string>\",\n \"enable_all_tools\": false,\n \"tools\": [\n {\n \"name\": \"<string>\"\n }\n ]\n }\n ],\n \"guardrails\": {\n \"input_guardrails\": [\n \"<string>\"\n ],\n \"output_guardrails\": [\n \"<string>\"\n ]\n },\n \"response_format\": {\n \"type\": \"json_object\"\n },\n \"routing_config\": {\n \"type\": \"weight-based-routing\",\n \"load_balance_targets\": [\n {\n \"target\": \"<string>\",\n \"weight\": 123,\n \"fallback_status_codes\": [\n \"401\",\n \"403\",\n \"404\",\n \"408\",\n \"429\",\n \"500\",\n \"502\",\n \"503\"\n ],\n \"fallback_candidate\": true,\n \"override_params\": {},\n \"headers_override\": {\n \"remove\": [\n \"<string>\"\n ],\n \"set\": {}\n },\n \"metadata_match\": {}\n }\n ]\n },\n \"cache_config\": {\n \"type\": \"semantic\",\n \"similarity_threshold\": 0.5,\n \"ttl\": 3600,\n \"namespace\": \"<string>\"\n },\n \"tool_call_to_mcp_mapping\": {},\n \"sub_agents\": [\n {\n \"name\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{controlPlaneURL}/api/ml/v1/prompt-versions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"manifest\": {\n \"name\": \"<string>\",\n \"metadata\": {},\n \"ml_repo\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"version\": 2,\n \"type\": \"chat_prompt\",\n \"description\": \"<string>\",\n \"version_alias\": \"<string>\",\n \"variables\": {},\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": false\n }\n }\n ],\n \"mcp_servers\": [\n {\n \"type\": \"mcp-server-fqn\",\n \"integration_fqn\": \"<string>\",\n \"enable_all_tools\": false,\n \"tools\": [\n {\n \"name\": \"<string>\"\n }\n ]\n }\n ],\n \"guardrails\": {\n \"input_guardrails\": [\n \"<string>\"\n ],\n \"output_guardrails\": [\n \"<string>\"\n ]\n },\n \"response_format\": {\n \"type\": \"json_object\"\n },\n \"routing_config\": {\n \"type\": \"weight-based-routing\",\n \"load_balance_targets\": [\n {\n \"target\": \"<string>\",\n \"weight\": 123,\n \"fallback_status_codes\": [\n \"401\",\n \"403\",\n \"404\",\n \"408\",\n \"429\",\n \"500\",\n \"502\",\n \"503\"\n ],\n \"fallback_candidate\": true,\n \"override_params\": {},\n \"headers_override\": {\n \"remove\": [\n \"<string>\"\n ],\n \"set\": {}\n },\n \"metadata_match\": {}\n }\n ]\n },\n \"cache_config\": {\n \"type\": \"semantic\",\n \"similarity_threshold\": 0.5,\n \"ttl\": 3600,\n \"namespace\": \"<string>\"\n },\n \"tool_call_to_mcp_mapping\": {},\n \"sub_agents\": [\n {\n \"name\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"fqn": "<string>",
"created_by_subject": {
"subjectId": "<string>",
"subjectSlug": "<string>",
"subjectDisplayName": "<string>",
"subjectPatName": "<string>",
"subjectControllerName": "<string>",
"subjectExternalIdentitySlug": "<string>"
},
"manifest": {
"name": "<string>",
"metadata": {},
"ml_repo": "<string>",
"messages": [
{
"role": "system",
"content": "<string>",
"name": "<string>"
}
],
"version": 2,
"type": "chat_prompt",
"description": "<string>",
"version_alias": "<string>",
"variables": {},
"model_configuration": {
"provider": "<string>",
"model": "<string>",
"parameters": {
"max_tokens": 123,
"temperature": 123,
"top_k": 123,
"top_p": 123,
"stop": [
"<string>"
]
},
"extra_parameters": {}
},
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": false
}
}
],
"mcp_servers": [
{
"type": "mcp-server-fqn",
"integration_fqn": "<string>",
"enable_all_tools": false,
"tools": [
{
"name": "<string>"
}
]
}
],
"guardrails": {
"input_guardrails": [
"<string>"
],
"output_guardrails": [
"<string>"
]
},
"response_format": {
"type": "json_object"
},
"routing_config": {
"type": "weight-based-routing",
"load_balance_targets": [
{
"target": "<string>",
"weight": 123,
"retry_config": {
"attempts": 1,
"delay": 100,
"on_status_codes": [
"429",
"500",
"502",
"503"
]
},
"fallback_status_codes": [
"401",
"403",
"404",
"408",
"429",
"500",
"502",
"503"
],
"fallback_candidate": true,
"override_params": {},
"headers_override": {
"remove": [
"<string>"
],
"set": {}
},
"metadata_match": {}
}
],
"sticky_routing": {
"ttl_seconds": 44100,
"session_identifiers": [
{
"key": "<string>"
}
]
}
},
"cache_config": {
"type": "semantic",
"similarity_threshold": 0.5,
"ttl": 3600,
"namespace": "<string>"
},
"tool_call_to_mcp_mapping": {},
"logging_config": {
"enabled": true,
"tracing_project_fqn": "<string>"
},
"sub_agents": [
{
"name": "<string>"
}
]
},
"ml_repo_id": "<string>",
"prompt_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"tags": [
"<string>"
],
"version_alias": "<string>",
"usage_code_snippet": "<string>",
"usage_code_snippets": [
{
"display_name": "<string>",
"language": "<string>",
"code": "<string>",
"libraries": [
"<string>"
],
"icon": "<string>"
}
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Prompts
Create or update prompt version
Create or update a prompt version.
PUT
/
api
/
ml
/
v1
/
prompt-versions
Create or update prompt version
curl --request PUT \
--url https://{controlPlaneURL}/api/ml/v1/prompt-versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"manifest": {
"name": "<string>",
"metadata": {},
"ml_repo": "<string>",
"messages": [
{
"role": "system",
"content": "<string>",
"name": "<string>"
}
],
"version": 2,
"type": "chat_prompt",
"description": "<string>",
"version_alias": "<string>",
"variables": {},
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": false
}
}
],
"mcp_servers": [
{
"type": "mcp-server-fqn",
"integration_fqn": "<string>",
"enable_all_tools": false,
"tools": [
{
"name": "<string>"
}
]
}
],
"guardrails": {
"input_guardrails": [
"<string>"
],
"output_guardrails": [
"<string>"
]
},
"response_format": {
"type": "json_object"
},
"routing_config": {
"type": "weight-based-routing",
"load_balance_targets": [
{
"target": "<string>",
"weight": 123,
"fallback_status_codes": [
"401",
"403",
"404",
"408",
"429",
"500",
"502",
"503"
],
"fallback_candidate": true,
"override_params": {},
"headers_override": {
"remove": [
"<string>"
],
"set": {}
},
"metadata_match": {}
}
]
},
"cache_config": {
"type": "semantic",
"similarity_threshold": 0.5,
"ttl": 3600,
"namespace": "<string>"
},
"tool_call_to_mcp_mapping": {},
"sub_agents": [
{
"name": "<string>"
}
]
}
}
'import requests
url = "https://{controlPlaneURL}/api/ml/v1/prompt-versions"
payload = { "manifest": {
"name": "<string>",
"metadata": {},
"ml_repo": "<string>",
"messages": [
{
"role": "system",
"content": "<string>",
"name": "<string>"
}
],
"version": 2,
"type": "chat_prompt",
"description": "<string>",
"version_alias": "<string>",
"variables": {},
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": False
}
}
],
"mcp_servers": [
{
"type": "mcp-server-fqn",
"integration_fqn": "<string>",
"enable_all_tools": False,
"tools": [{ "name": "<string>" }]
}
],
"guardrails": {
"input_guardrails": ["<string>"],
"output_guardrails": ["<string>"]
},
"response_format": { "type": "json_object" },
"routing_config": {
"type": "weight-based-routing",
"load_balance_targets": [
{
"target": "<string>",
"weight": 123,
"fallback_status_codes": ["401", "403", "404", "408", "429", "500", "502", "503"],
"fallback_candidate": True,
"override_params": {},
"headers_override": {
"remove": ["<string>"],
"set": {}
},
"metadata_match": {}
}
]
},
"cache_config": {
"type": "semantic",
"similarity_threshold": 0.5,
"ttl": 3600,
"namespace": "<string>"
},
"tool_call_to_mcp_mapping": {},
"sub_agents": [{ "name": "<string>" }]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
manifest: {
name: '<string>',
metadata: {},
ml_repo: '<string>',
messages: [{role: 'system', content: '<string>', name: '<string>'}],
version: 2,
type: 'chat_prompt',
description: '<string>',
version_alias: '<string>',
variables: {},
tools: [
{
type: 'function',
function: {name: '<string>', description: '<string>', parameters: {}, strict: false}
}
],
mcp_servers: [
{
type: 'mcp-server-fqn',
integration_fqn: '<string>',
enable_all_tools: false,
tools: [{name: '<string>'}]
}
],
guardrails: {input_guardrails: ['<string>'], output_guardrails: ['<string>']},
response_format: {type: 'json_object'},
routing_config: {
type: 'weight-based-routing',
load_balance_targets: [
{
target: '<string>',
weight: 123,
fallback_status_codes: ['401', '403', '404', '408', '429', '500', '502', '503'],
fallback_candidate: true,
override_params: {},
headers_override: {remove: ['<string>'], set: {}},
metadata_match: {}
}
]
},
cache_config: {type: 'semantic', similarity_threshold: 0.5, ttl: 3600, namespace: '<string>'},
tool_call_to_mcp_mapping: {},
sub_agents: [{name: '<string>'}]
}
})
};
fetch('https://{controlPlaneURL}/api/ml/v1/prompt-versions', 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://{controlPlaneURL}/api/ml/v1/prompt-versions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'manifest' => [
'name' => '<string>',
'metadata' => [
],
'ml_repo' => '<string>',
'messages' => [
[
'role' => 'system',
'content' => '<string>',
'name' => '<string>'
]
],
'version' => 2,
'type' => 'chat_prompt',
'description' => '<string>',
'version_alias' => '<string>',
'variables' => [
],
'tools' => [
[
'type' => 'function',
'function' => [
'name' => '<string>',
'description' => '<string>',
'parameters' => [
],
'strict' => false
]
]
],
'mcp_servers' => [
[
'type' => 'mcp-server-fqn',
'integration_fqn' => '<string>',
'enable_all_tools' => false,
'tools' => [
[
'name' => '<string>'
]
]
]
],
'guardrails' => [
'input_guardrails' => [
'<string>'
],
'output_guardrails' => [
'<string>'
]
],
'response_format' => [
'type' => 'json_object'
],
'routing_config' => [
'type' => 'weight-based-routing',
'load_balance_targets' => [
[
'target' => '<string>',
'weight' => 123,
'fallback_status_codes' => [
'401',
'403',
'404',
'408',
'429',
'500',
'502',
'503'
],
'fallback_candidate' => true,
'override_params' => [
],
'headers_override' => [
'remove' => [
'<string>'
],
'set' => [
]
],
'metadata_match' => [
]
]
]
],
'cache_config' => [
'type' => 'semantic',
'similarity_threshold' => 0.5,
'ttl' => 3600,
'namespace' => '<string>'
],
'tool_call_to_mcp_mapping' => [
],
'sub_agents' => [
[
'name' => '<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://{controlPlaneURL}/api/ml/v1/prompt-versions"
payload := strings.NewReader("{\n \"manifest\": {\n \"name\": \"<string>\",\n \"metadata\": {},\n \"ml_repo\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"version\": 2,\n \"type\": \"chat_prompt\",\n \"description\": \"<string>\",\n \"version_alias\": \"<string>\",\n \"variables\": {},\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": false\n }\n }\n ],\n \"mcp_servers\": [\n {\n \"type\": \"mcp-server-fqn\",\n \"integration_fqn\": \"<string>\",\n \"enable_all_tools\": false,\n \"tools\": [\n {\n \"name\": \"<string>\"\n }\n ]\n }\n ],\n \"guardrails\": {\n \"input_guardrails\": [\n \"<string>\"\n ],\n \"output_guardrails\": [\n \"<string>\"\n ]\n },\n \"response_format\": {\n \"type\": \"json_object\"\n },\n \"routing_config\": {\n \"type\": \"weight-based-routing\",\n \"load_balance_targets\": [\n {\n \"target\": \"<string>\",\n \"weight\": 123,\n \"fallback_status_codes\": [\n \"401\",\n \"403\",\n \"404\",\n \"408\",\n \"429\",\n \"500\",\n \"502\",\n \"503\"\n ],\n \"fallback_candidate\": true,\n \"override_params\": {},\n \"headers_override\": {\n \"remove\": [\n \"<string>\"\n ],\n \"set\": {}\n },\n \"metadata_match\": {}\n }\n ]\n },\n \"cache_config\": {\n \"type\": \"semantic\",\n \"similarity_threshold\": 0.5,\n \"ttl\": 3600,\n \"namespace\": \"<string>\"\n },\n \"tool_call_to_mcp_mapping\": {},\n \"sub_agents\": [\n {\n \"name\": \"<string>\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://{controlPlaneURL}/api/ml/v1/prompt-versions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"manifest\": {\n \"name\": \"<string>\",\n \"metadata\": {},\n \"ml_repo\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"version\": 2,\n \"type\": \"chat_prompt\",\n \"description\": \"<string>\",\n \"version_alias\": \"<string>\",\n \"variables\": {},\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": false\n }\n }\n ],\n \"mcp_servers\": [\n {\n \"type\": \"mcp-server-fqn\",\n \"integration_fqn\": \"<string>\",\n \"enable_all_tools\": false,\n \"tools\": [\n {\n \"name\": \"<string>\"\n }\n ]\n }\n ],\n \"guardrails\": {\n \"input_guardrails\": [\n \"<string>\"\n ],\n \"output_guardrails\": [\n \"<string>\"\n ]\n },\n \"response_format\": {\n \"type\": \"json_object\"\n },\n \"routing_config\": {\n \"type\": \"weight-based-routing\",\n \"load_balance_targets\": [\n {\n \"target\": \"<string>\",\n \"weight\": 123,\n \"fallback_status_codes\": [\n \"401\",\n \"403\",\n \"404\",\n \"408\",\n \"429\",\n \"500\",\n \"502\",\n \"503\"\n ],\n \"fallback_candidate\": true,\n \"override_params\": {},\n \"headers_override\": {\n \"remove\": [\n \"<string>\"\n ],\n \"set\": {}\n },\n \"metadata_match\": {}\n }\n ]\n },\n \"cache_config\": {\n \"type\": \"semantic\",\n \"similarity_threshold\": 0.5,\n \"ttl\": 3600,\n \"namespace\": \"<string>\"\n },\n \"tool_call_to_mcp_mapping\": {},\n \"sub_agents\": [\n {\n \"name\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{controlPlaneURL}/api/ml/v1/prompt-versions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"manifest\": {\n \"name\": \"<string>\",\n \"metadata\": {},\n \"ml_repo\": \"<string>\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"version\": 2,\n \"type\": \"chat_prompt\",\n \"description\": \"<string>\",\n \"version_alias\": \"<string>\",\n \"variables\": {},\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": false\n }\n }\n ],\n \"mcp_servers\": [\n {\n \"type\": \"mcp-server-fqn\",\n \"integration_fqn\": \"<string>\",\n \"enable_all_tools\": false,\n \"tools\": [\n {\n \"name\": \"<string>\"\n }\n ]\n }\n ],\n \"guardrails\": {\n \"input_guardrails\": [\n \"<string>\"\n ],\n \"output_guardrails\": [\n \"<string>\"\n ]\n },\n \"response_format\": {\n \"type\": \"json_object\"\n },\n \"routing_config\": {\n \"type\": \"weight-based-routing\",\n \"load_balance_targets\": [\n {\n \"target\": \"<string>\",\n \"weight\": 123,\n \"fallback_status_codes\": [\n \"401\",\n \"403\",\n \"404\",\n \"408\",\n \"429\",\n \"500\",\n \"502\",\n \"503\"\n ],\n \"fallback_candidate\": true,\n \"override_params\": {},\n \"headers_override\": {\n \"remove\": [\n \"<string>\"\n ],\n \"set\": {}\n },\n \"metadata_match\": {}\n }\n ]\n },\n \"cache_config\": {\n \"type\": \"semantic\",\n \"similarity_threshold\": 0.5,\n \"ttl\": 3600,\n \"namespace\": \"<string>\"\n },\n \"tool_call_to_mcp_mapping\": {},\n \"sub_agents\": [\n {\n \"name\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"fqn": "<string>",
"created_by_subject": {
"subjectId": "<string>",
"subjectSlug": "<string>",
"subjectDisplayName": "<string>",
"subjectPatName": "<string>",
"subjectControllerName": "<string>",
"subjectExternalIdentitySlug": "<string>"
},
"manifest": {
"name": "<string>",
"metadata": {},
"ml_repo": "<string>",
"messages": [
{
"role": "system",
"content": "<string>",
"name": "<string>"
}
],
"version": 2,
"type": "chat_prompt",
"description": "<string>",
"version_alias": "<string>",
"variables": {},
"model_configuration": {
"provider": "<string>",
"model": "<string>",
"parameters": {
"max_tokens": 123,
"temperature": 123,
"top_k": 123,
"top_p": 123,
"stop": [
"<string>"
]
},
"extra_parameters": {}
},
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": false
}
}
],
"mcp_servers": [
{
"type": "mcp-server-fqn",
"integration_fqn": "<string>",
"enable_all_tools": false,
"tools": [
{
"name": "<string>"
}
]
}
],
"guardrails": {
"input_guardrails": [
"<string>"
],
"output_guardrails": [
"<string>"
]
},
"response_format": {
"type": "json_object"
},
"routing_config": {
"type": "weight-based-routing",
"load_balance_targets": [
{
"target": "<string>",
"weight": 123,
"retry_config": {
"attempts": 1,
"delay": 100,
"on_status_codes": [
"429",
"500",
"502",
"503"
]
},
"fallback_status_codes": [
"401",
"403",
"404",
"408",
"429",
"500",
"502",
"503"
],
"fallback_candidate": true,
"override_params": {},
"headers_override": {
"remove": [
"<string>"
],
"set": {}
},
"metadata_match": {}
}
],
"sticky_routing": {
"ttl_seconds": 44100,
"session_identifiers": [
{
"key": "<string>"
}
]
}
},
"cache_config": {
"type": "semantic",
"similarity_threshold": 0.5,
"ttl": 3600,
"namespace": "<string>"
},
"tool_call_to_mcp_mapping": {},
"logging_config": {
"enabled": true,
"tracing_project_fqn": "<string>"
},
"sub_agents": [
{
"name": "<string>"
}
]
},
"ml_repo_id": "<string>",
"prompt_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"tags": [
"<string>"
],
"version_alias": "<string>",
"usage_code_snippet": "<string>",
"usage_code_snippets": [
{
"display_name": "<string>",
"language": "<string>",
"code": "<string>",
"libraries": [
"<string>"
],
"icon": "<string>"
}
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Manifest containing metadata for the prompt to apply
Show child attributes
Show child attributes
Response
The created or updated prompt version
The prompt version data
Show child attributes
Show child attributes
Was this page helpful?
⌘I