Save the Single Agent Draft
const url = 'https://api.agentaab.com/api/app/example/single-agent/';const options = { method: 'PATCH', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"definition":{"kind":"single_agent","version":1,"interaction_mode":"completion","instructions":{"system":"example","user_template":"example"},"model":{"provider":"example","model":"example","credential_ref":"example","api_base":"https://example.com","temperature":1,"top_p":1,"frequency_penalty":1,"presence_penalty":1},"tools":[{"id":"example","kind":"mcp","version":"example","tool_name":"example","endpoint":"https://example.com","credential_ref":"example","credential_mode":"bearer"}],"input_schema":{},"output_schema":{},"limits":{"timeout_ms":1,"max_output_tokens":1,"max_tool_calls":1},"configuration":{}},"base_revision":"example","changelog":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.agentaab.com/api/app/example/single-agent/ \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "definition": { "kind": "single_agent", "version": 1, "interaction_mode": "completion", "instructions": { "system": "example", "user_template": "example" }, "model": { "provider": "example", "model": "example", "credential_ref": "example", "api_base": "https://example.com", "temperature": 1, "top_p": 1, "frequency_penalty": 1, "presence_penalty": 1 }, "tools": [ { "id": "example", "kind": "mcp", "version": "example", "tool_name": "example", "endpoint": "https://example.com", "credential_ref": "example", "credential_mode": "bearer" } ], "input_schema": {}, "output_schema": {}, "limits": { "timeout_ms": 1, "max_output_tokens": 1, "max_tool_calls": 1 }, "configuration": {} }, "base_revision": "example", "changelog": "example" }'Validate and save the full v1 Definition only when base_revision still matches. This does not create or activate a Capability Release.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Complete authoritative editable Definition for one Single Agent. Raw secret-like fields and values are rejected recursively.
object
object
object
Optional absolute HTTPS provider endpoint without userinfo or secret query parameters.
A pinned Tool identity and optional server-managed credential reference. Raw credential values are forbidden.
object
Exact absolute HTTPS endpoint. Required for MCP Tools.
Name of a server-side Worker secret binding, never a credential value.
JSON Schema with an object root.
object
JSON Schema with an object root.
object
object
object
Exact opaque draft_revision returned by the latest GET or successful PATCH.
Responses
Section titled “Responses”The saved Draft and its new opaque Revision.
object
Complete authoritative editable Definition for one Single Agent. Raw secret-like fields and values are rejected recursively.
object
object
object
Optional absolute HTTPS provider endpoint without userinfo or secret query parameters.
A pinned Tool identity and optional server-managed credential reference. Raw credential values are forbidden.
object
Exact absolute HTTPS endpoint. Required for MCP Tools.
Name of a server-side Worker secret binding, never a credential value.
JSON Schema with an object root.
object
JSON Schema with an object root.
object
object
object
Opaque compare-and-set token; clients must not derive or modify it.
object
Complete authoritative editable Definition for one Single Agent. Raw secret-like fields and values are rejected recursively.
object
object
object
Optional absolute HTTPS provider endpoint without userinfo or secret query parameters.
A pinned Tool identity and optional server-managed credential reference. Raw credential values are forbidden.
object
Exact absolute HTTPS endpoint. Required for MCP Tools.
Name of a server-side Worker secret binding, never a credential value.
JSON Schema with an object root.
object
JSON Schema with an object root.
object
object
object
object
Complete authoritative editable Definition for one Single Agent. Raw secret-like fields and values are rejected recursively.
object
object
object
Optional absolute HTTPS provider endpoint without userinfo or secret query parameters.
A pinned Tool identity and optional server-managed credential reference. Raw credential values are forbidden.
object
Exact absolute HTTPS endpoint. Required for MCP Tools.
Name of a server-side Worker secret binding, never a credential value.
JSON Schema with an object root.
object
JSON Schema with an object root.
object
object
object
object
Example
{ "definition": { "kind": "single_agent", "version": 1, "interaction_mode": "completion", "tools": [ { "kind": "mcp", "credential_mode": "bearer" } ] }, "versions": [ { "definition": { "kind": "single_agent", "version": 1, "interaction_mode": "completion", "tools": [ { "kind": "mcp", "credential_mode": "bearer" } ] } } ], "active_version": { "definition": { "kind": "single_agent", "version": 1, "interaction_mode": "completion", "tools": [ { "kind": "mcp", "credential_mode": "bearer" } ] } }, "migration": { "source": "legacy_prompt", "persisted": false }}The Definition is invalid or contains raw secret material.
object
object
Examplegenerated
{ "error": "example", "code": "example", "draft_revision": "example", "issues": [ { "code": "example", "path": "example", "message": "example" } ]}A newer Draft exists. The response code is single_agent_revision_conflict and includes its opaque Draft Revision.
object
object
Examplegenerated
{ "error": "example", "code": "example", "draft_revision": "example", "issues": [ { "code": "example", "path": "example", "message": "example" } ]}The bounded Draft payload exceeds 256 KiB.
object
object
Examplegenerated
{ "error": "example", "code": "example", "draft_revision": "example", "issues": [ { "code": "example", "path": "example", "message": "example" } ]}