تحديث الوكيل
curl --request PATCH \
--url https://api.truthlocks.com/v1/agents/{agentId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"description": "<string>",
"display_name": "<string>",
"metadata": "<unknown>",
"status": "<string>"
}
'const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
display_name: '<string>',
metadata: '<unknown>',
status: '<string>'
})
};
fetch('https://api.truthlocks.com/v1/agents/{agentId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/agents/{agentId}"
payload = {
"description": "<string>",
"display_name": "<string>",
"metadata": "<unknown>",
"status": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/agents/{agentId}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"display_name\": \"<string>\",\n \"metadata\": \"<unknown>\",\n \"status\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_type": "orchestrator",
"display_name": "<string>",
"description": "<string>",
"status": "active",
"scopes": [
"<string>"
],
"metadata": {},
"trust_score": 0.5,
"public_key": "<string>",
"session_count": 123,
"keys": [
{
"kid": "<string>",
"algorithm": "<string>",
"public_key": "<string>",
"status": "active"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}وكلاء الآلة
تحديث الوكيل
تحديث اسم عرض الوكيل أو وصفه أو بياناته الوصفية أو حالته
PATCH
/
v1
/
agents
/
{agentId}
تحديث الوكيل
curl --request PATCH \
--url https://api.truthlocks.com/v1/agents/{agentId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"description": "<string>",
"display_name": "<string>",
"metadata": "<unknown>",
"status": "<string>"
}
'const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
display_name: '<string>',
metadata: '<unknown>',
status: '<string>'
})
};
fetch('https://api.truthlocks.com/v1/agents/{agentId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/agents/{agentId}"
payload = {
"description": "<string>",
"display_name": "<string>",
"metadata": "<unknown>",
"status": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/agents/{agentId}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"display_name\": \"<string>\",\n \"metadata\": \"<unknown>\",\n \"status\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_type": "orchestrator",
"display_name": "<string>",
"description": "<string>",
"status": "active",
"scopes": [
"<string>"
],
"metadata": {},
"trust_score": 0.5,
"public_key": "<string>",
"session_count": 123,
"keys": [
{
"kid": "<string>",
"algorithm": "<string>",
"public_key": "<string>",
"status": "active"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}تحديث وكيل
PATCH /v1/agents/{agentID}
يحدث الحقول القابلة للتغيير في هوية وكيل جهاز موجود. يتم تعديل الحقول المقدمة في نص الطلب فقط؛ تظل جميع الحقول الأخرى دون تغيير. يجب توفير حقل واحد على الأقل.
لتغيير نطاقات الوكيل، استخدم نظام التفويض أو أعد تسجيل
الوكيل. لا يمكن تعديل النطاقات مباشرة من خلال نقطة النهاية هذه للحفاظ على
مسار تدقيق تغييرات النطاق.
المصادقة
يتطلب رأسX-API-Key أو رمز Bearer JWT. يتم اشتقاق مساحة العمل من بيانات الاعتماد الموثقة؛ لا ترسل X-Tenant-ID.
نص الطلب
جميع الحقول اختيارية، ولكن يجب توفير حقل واحد على الأقل.الاستجابة
يعرض كائن هوية الوكيل المحدث بالكامل.مثال
curl -X PATCH https://api.truthlocks.com/v1/agents/maip:t1234567:01HYX3KPZQ7RJGBN0WFMV8SDEH \
-H "X-API-Key: tl_live_..." \
-H "Content-Type: application/json" \
-d '{
"display_name": "Customer Support Bot v2",
"description": "Upgraded to handle Tier-1 and Tier-2 support with escalation",
"metadata": {
"team": "support",
"model": "claude-opus-4",
"environment": "production",
"version": "2.0"
}
}'
الجسم
application/json
الاستجابة
تم تحديث الوكيل

