Skip to main content
PATCH
/
v1
/
projects
/
{projectId}
/
pathway
/
nodes
/
{nodeId}
更新節點
curl --request PATCH \
  --url https://api.pathors.com/v1/projects/{projectId}/pathway/nodes/{nodeId} \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "data": {
    "data.title": "<string>",
    "data.prompt": "<string>",
    "data.tools": [
      "<string>"
    ]
  },
  "position": {}
}
'
import requests

url = "https://api.pathors.com/v1/projects/{projectId}/pathway/nodes/{nodeId}"

payload = {
"data": {
"data.title": "<string>",
"data.prompt": "<string>",
"data.tools": ["<string>"]
},
"position": {}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
'data.title': '<string>',
'data.prompt': '<string>',
'data.tools': ['<string>']
},
position: {}
})
};

fetch('https://api.pathors.com/v1/projects/{projectId}/pathway/nodes/{nodeId}', 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}/pathway/nodes/{nodeId}",
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([
'data' => [
'data.title' => '<string>',
'data.prompt' => '<string>',
'data.tools' => [
'<string>'
]
],
'position' => [

]
]),
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}/pathway/nodes/{nodeId}"

payload := strings.NewReader("{\n \"data\": {\n \"data.title\": \"<string>\",\n \"data.prompt\": \"<string>\",\n \"data.tools\": [\n \"<string>\"\n ]\n },\n \"position\": {}\n}")

req, _ := http.NewRequest("PATCH", 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.patch("https://api.pathors.com/v1/projects/{projectId}/pathway/nodes/{nodeId}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"data.title\": \"<string>\",\n \"data.prompt\": \"<string>\",\n \"data.tools\": [\n \"<string>\"\n ]\n },\n \"position\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.pathors.com/v1/projects/{projectId}/pathway/nodes/{nodeId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"data.title\": \"<string>\",\n \"data.prompt\": \"<string>\",\n \"data.tools\": [\n \"<string>\"\n ]\n },\n \"position\": {}\n}"

response = http.request(request)
puts response.read_body

請求

PATCH https://api.pathors.com/v1/projects/{projectId}/pathway/nodes/{nodeId}
只需傳送您想更新的欄位。既有欄位會被保留。

路徑參數

projectId
string
required
專案 ID
nodeId
string
required
節點 ID

標頭

Authorization
string
required
使用您的 Developer Key 進行 Bearer 令牌認證

請求主體

data
object
要合併的部分節點資料。只需包含您想變更的欄位。
position
object
更新後的畫布位置:{ "x": number, "y": number }

回應

回傳完整的更新後節點。

範例:更新提示文字

curl -X PATCH https://api.pathors.com/v1/projects/{projectId}/pathway/nodes/{nodeId} \
  -H "Authorization: Bearer dk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "data": {
      "prompt": "Updated: Help the user complete their booking and confirm details."
    }
  }'

範例:更新工具綁定

curl -X PATCH https://api.pathors.com/v1/projects/{projectId}/pathway/nodes/{nodeId} \
  -H "Authorization: Bearer dk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "data": {
      "tools": ["tool-uuid-1", "tool-uuid-2"]
    }
  }'