curl --request PATCH \
--url https://agents-api.kolena.com/api/v1/client/agents/{agent_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"metadata": {}
}'import requests
url = "https://agents-api.kolena.com/api/v1/client/agents/{agent_id}"
payload = { "metadata": {} }
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({metadata: {}})
};
fetch('https://agents-api.kolena.com/api/v1/client/agents/{agent_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://agents-api.kolena.com/api/v1/client/agents/{agent_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([
'metadata' => [
]
]),
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://agents-api.kolena.com/api/v1/client/agents/{agent_id}"
payload := strings.NewReader("{\n \"metadata\": {}\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://agents-api.kolena.com/api/v1/client/agents/{agent_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agents-api.kolena.com/api/v1/client/agents/{agent_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 \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"workspace_id": 123,
"name": "<string>",
"objective": "<string>",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"agent_guidelines": {
"prompt": "<string>",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
},
"n_runs": 123,
"prompts": [
{
"created": "2025-01-01T00:00:00",
"documents": [],
"id": 1,
"input_prompt_ids": [],
"last_updated_by": "user@example.com",
"model": {
"type": "efficient",
"version": "2.2.0"
},
"name": "Account number",
"options": {
"code_generation": false,
"document_filter": false,
"enhanced_vision": false,
"prompt": "Find the account number",
"type": "string",
"web_search": false
},
"updated": "2025-01-01T00:00:00"
},
{
"created": "2025-01-01T00:00:00",
"documents": [],
"id": 2,
"input_prompt_ids": [
1
],
"last_updated_by": "user@example.com",
"model": {
"type": "default",
"version": "2.0.0-rc2"
},
"name": "Account info",
"options": {
"code_generation": false,
"document_filter": false,
"enhanced_vision": false,
"fields": [
"full name",
"address"
],
"prompt": "Extract form fields using account number: <kolena-prompt id='1'/>",
"type": "form",
"web_search": false
},
"updated": "2025-01-02T00:00:00"
}
],
"output_templates": [
{
"id": 123,
"filename": "<string>",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
}
],
"metadata": {
"department": "finance",
"environment": "production",
"tags": [
"invoice-processing",
"high-priority"
],
"version": 2
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Update Agent
Update properties of an Agent
curl --request PATCH \
--url https://agents-api.kolena.com/api/v1/client/agents/{agent_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"metadata": {}
}'import requests
url = "https://agents-api.kolena.com/api/v1/client/agents/{agent_id}"
payload = { "metadata": {} }
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({metadata: {}})
};
fetch('https://agents-api.kolena.com/api/v1/client/agents/{agent_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://agents-api.kolena.com/api/v1/client/agents/{agent_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([
'metadata' => [
]
]),
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://agents-api.kolena.com/api/v1/client/agents/{agent_id}"
payload := strings.NewReader("{\n \"metadata\": {}\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://agents-api.kolena.com/api/v1/client/agents/{agent_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agents-api.kolena.com/api/v1/client/agents/{agent_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 \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"workspace_id": 123,
"name": "<string>",
"objective": "<string>",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"agent_guidelines": {
"prompt": "<string>",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
},
"n_runs": 123,
"prompts": [
{
"created": "2025-01-01T00:00:00",
"documents": [],
"id": 1,
"input_prompt_ids": [],
"last_updated_by": "user@example.com",
"model": {
"type": "efficient",
"version": "2.2.0"
},
"name": "Account number",
"options": {
"code_generation": false,
"document_filter": false,
"enhanced_vision": false,
"prompt": "Find the account number",
"type": "string",
"web_search": false
},
"updated": "2025-01-01T00:00:00"
},
{
"created": "2025-01-01T00:00:00",
"documents": [],
"id": 2,
"input_prompt_ids": [
1
],
"last_updated_by": "user@example.com",
"model": {
"type": "default",
"version": "2.0.0-rc2"
},
"name": "Account info",
"options": {
"code_generation": false,
"document_filter": false,
"enhanced_vision": false,
"fields": [
"full name",
"address"
],
"prompt": "Extract form fields using account number: <kolena-prompt id='1'/>",
"type": "form",
"web_search": false
},
"updated": "2025-01-02T00:00:00"
}
],
"output_templates": [
{
"id": 123,
"filename": "<string>",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z"
}
],
"metadata": {
"department": "finance",
"environment": "production",
"tags": [
"invoice-processing",
"high-priority"
],
"version": 2
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Overview
Update properties of an Agent. Onlymetadata is currently supported for updates.Authorizations
Bearer authentication header of the form Bearer <token>. The <token> represents your API key, which must be acquired from the Kolena platform.
Path Parameters
Body
Object of key-value pairs; useful for organizing, filtering, and tracking purposes. Metadata keys must be strings. Metadata values can be primitives (strings, numbers, booleans, or null) or lists of primitives. Updating metadata completely replaces the existing metadata on that Agent (not merged). To remove all metadata from an Agent, send an empty object {} as the metadata value.
Response
Successful Response
The ID of this Agent.
The ID of the workspace hosting this Agent.
The name of this Agent.
A short description of this Agent's objective, e.g. "Extract key information from leases and addendum documents".
When this Agent was created, formatted as an ISO 8601 timestamp (e.g. 2025-12-31T10:15:45+00:00)
When this Agent was last updated, formatted as an ISO 8601 timestamp (e.g. 2025-12-31T10:15:45+00:00)
The email address of the user who created this Agent.
The Agent Guidelines that will be used for all Prompts in this Agent.
Show child attributes
Show child attributes
The number of times this Agent has been Run.
The Prompts configured for this Agent.
Show child attributes
Show child attributes
[ { "created": "2025-01-01T00:00:00", "documents": [], "id": 1, "input_prompt_ids": [], "last_updated_by": "user@example.com", "model": { "type": "efficient", "version": "2.2.0" }, "name": "Account number", "options": { "code_generation": false, "document_filter": false, "enhanced_vision": false, "prompt": "Find the account number", "type": "string", "web_search": false }, "updated": "2025-01-01T00:00:00" }, { "created": "2025-01-01T00:00:00", "documents": [], "id": 2, "input_prompt_ids": [1], "last_updated_by": "user@example.com", "model": { "type": "default", "version": "2.0.0-rc2" }, "name": "Account info", "options": { "code_generation": false, "document_filter": false, "enhanced_vision": false, "fields": ["full name", "address"], "prompt": "Extract form fields using account number: <kolena-prompt id='1'/>", "type": "form", "web_search": false }, "updated": "2025-01-02T00:00:00" } ]
The Templates configured for this Agent, used to generate formatted output documents.
Show child attributes
Show child attributes
Metadata for this Agent.
{ "department": "finance", "environment": "production", "tags": ["invoice-processing", "high-priority"], "version": 2 }
Was this page helpful?
