更新 Agent 設定
curl --request PUT \
--url https://api.pathors.com/v1/projects/{projectId}/agent \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"type": "<string>",
"status": "<string>",
"globalPrompt": {},
"executionMode": {},
"timezone": {},
"memoryEnabled": true,
"beforeStartConfig": {},
"postSessionWebhook": {},
"postEvaluationConfig": {},
"placeholderMessages": {},
"variableConfigs": {}
}
'import requests
url = "https://api.pathors.com/v1/projects/{projectId}/agent"
payload = {
"name": "<string>",
"type": "<string>",
"status": "<string>",
"globalPrompt": {},
"executionMode": {},
"timezone": {},
"memoryEnabled": True,
"beforeStartConfig": {},
"postSessionWebhook": {},
"postEvaluationConfig": {},
"placeholderMessages": {},
"variableConfigs": {}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
type: '<string>',
status: '<string>',
globalPrompt: {},
executionMode: {},
timezone: {},
memoryEnabled: true,
beforeStartConfig: {},
postSessionWebhook: {},
postEvaluationConfig: {},
placeholderMessages: {},
variableConfigs: {}
})
};
fetch('https://api.pathors.com/v1/projects/{projectId}/agent', 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.pathors.com/v1/projects/{projectId}/agent",
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([
'name' => '<string>',
'type' => '<string>',
'status' => '<string>',
'globalPrompt' => [
],
'executionMode' => [
],
'timezone' => [
],
'memoryEnabled' => true,
'beforeStartConfig' => [
],
'postSessionWebhook' => [
],
'postEvaluationConfig' => [
],
'placeholderMessages' => [
],
'variableConfigs' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.pathors.com/v1/projects/{projectId}/agent"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"status\": \"<string>\",\n \"globalPrompt\": {},\n \"executionMode\": {},\n \"timezone\": {},\n \"memoryEnabled\": true,\n \"beforeStartConfig\": {},\n \"postSessionWebhook\": {},\n \"postEvaluationConfig\": {},\n \"placeholderMessages\": {},\n \"variableConfigs\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://api.pathors.com/v1/projects/{projectId}/agent")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"status\": \"<string>\",\n \"globalPrompt\": {},\n \"executionMode\": {},\n \"timezone\": {},\n \"memoryEnabled\": true,\n \"beforeStartConfig\": {},\n \"postSessionWebhook\": {},\n \"postEvaluationConfig\": {},\n \"placeholderMessages\": {},\n \"variableConfigs\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathors.com/v1/projects/{projectId}/agent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"status\": \"<string>\",\n \"globalPrompt\": {},\n \"executionMode\": {},\n \"timezone\": {},\n \"memoryEnabled\": true,\n \"beforeStartConfig\": {},\n \"postSessionWebhook\": {},\n \"postEvaluationConfig\": {},\n \"placeholderMessages\": {},\n \"variableConfigs\": {}\n}"
response = http.request(request)
puts response.read_body更新 Agent 設定
更新 Agent 組態(部分更新)
PUT
/
v1
/
projects
/
{projectId}
/
agent
更新 Agent 設定
curl --request PUT \
--url https://api.pathors.com/v1/projects/{projectId}/agent \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"type": "<string>",
"status": "<string>",
"globalPrompt": {},
"executionMode": {},
"timezone": {},
"memoryEnabled": true,
"beforeStartConfig": {},
"postSessionWebhook": {},
"postEvaluationConfig": {},
"placeholderMessages": {},
"variableConfigs": {}
}
'import requests
url = "https://api.pathors.com/v1/projects/{projectId}/agent"
payload = {
"name": "<string>",
"type": "<string>",
"status": "<string>",
"globalPrompt": {},
"executionMode": {},
"timezone": {},
"memoryEnabled": True,
"beforeStartConfig": {},
"postSessionWebhook": {},
"postEvaluationConfig": {},
"placeholderMessages": {},
"variableConfigs": {}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
type: '<string>',
status: '<string>',
globalPrompt: {},
executionMode: {},
timezone: {},
memoryEnabled: true,
beforeStartConfig: {},
postSessionWebhook: {},
postEvaluationConfig: {},
placeholderMessages: {},
variableConfigs: {}
})
};
fetch('https://api.pathors.com/v1/projects/{projectId}/agent', 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.pathors.com/v1/projects/{projectId}/agent",
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([
'name' => '<string>',
'type' => '<string>',
'status' => '<string>',
'globalPrompt' => [
],
'executionMode' => [
],
'timezone' => [
],
'memoryEnabled' => true,
'beforeStartConfig' => [
],
'postSessionWebhook' => [
],
'postEvaluationConfig' => [
],
'placeholderMessages' => [
],
'variableConfigs' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.pathors.com/v1/projects/{projectId}/agent"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"status\": \"<string>\",\n \"globalPrompt\": {},\n \"executionMode\": {},\n \"timezone\": {},\n \"memoryEnabled\": true,\n \"beforeStartConfig\": {},\n \"postSessionWebhook\": {},\n \"postEvaluationConfig\": {},\n \"placeholderMessages\": {},\n \"variableConfigs\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://api.pathors.com/v1/projects/{projectId}/agent")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"status\": \"<string>\",\n \"globalPrompt\": {},\n \"executionMode\": {},\n \"timezone\": {},\n \"memoryEnabled\": true,\n \"beforeStartConfig\": {},\n \"postSessionWebhook\": {},\n \"postEvaluationConfig\": {},\n \"placeholderMessages\": {},\n \"variableConfigs\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathors.com/v1/projects/{projectId}/agent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"status\": \"<string>\",\n \"globalPrompt\": {},\n \"executionMode\": {},\n \"timezone\": {},\n \"memoryEnabled\": true,\n \"beforeStartConfig\": {},\n \"postSessionWebhook\": {},\n \"postEvaluationConfig\": {},\n \"placeholderMessages\": {},\n \"variableConfigs\": {}\n}"
response = http.request(request)
puts response.read_body請求
PUT https://api.pathors.com/v1/projects/{projectId}/agent
路徑參數
string
required
專案 ID
標頭
string
required
使用您的 Developer Key 進行 Bearer 令牌認證
請求主體
所有欄位皆為選填。只需包含您想更新的欄位。string
Agent 顯示名稱(1-128 個字元)
string
Agent 類型:
monolithic 或 skillstring
Agent 狀態:
draft 或 publishedstring | null
全系統提示
string | null
smart、turbo 或 balancestring | null
時區字串(例如:
Asia/Taipei)boolean
啟用/停用 Agent 記憶
object | null
會話開始前的執行設定
object | null
會話結束後的 Webhook 設定
object | null
自動評估設定
object | null
依語言區分的佔位訊息
array | null
變數擷取設定
回應
回傳更新後的 Agent 設定。範例
curl -X PUT https://api.pathors.com/v1/projects/{projectId}/agent \
-H "Authorization: Bearer dk_your_key" \
-H "Content-Type: application/json" \
-d '{
"globalPrompt": "You are a helpful assistant.",
"executionMode": "smart",
"memoryEnabled": true
}'
⌘I
