Mettre à jour l'agent
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
}Agents machine
Mettre à jour l'agent
Mettre à jour le nom d’affichage, la description, les métadonnées ou le statut d’un agent
PATCH
/
v1
/
agents
/
{agentId}
Mettre à jour l'agent
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
}Mettre à jour l’agent
PATCH /v1/agents/{agentID}
Met à jour les champs modifiables d’une identité d’agent machine existante. Seuls les champs fournis dans le corps de la requête sont modifiés ; tous les autres champs restent inchangés. Au moins un champ doit être fourni.
Pour modifier les étendues d’un agent, utilisez le système de délégation ou réenregistrez l’agent.
agent. Les portées ne peuvent pas être modifiées directement via ce point de terminaison pour préserver
la piste d’audit des changements de portée.
Authentification
Nécessite l’en-têteX-API-Key ou un jeton JWT Bearer. L’espace de travail est dérivé de l’identifiant authentifié ; n’envoyez pas X-Tenant-ID.
Corps de la requête
Tous les champs sont facultatifs, mais au moins un doit être fourni.Réponse
Renvoie l’objet d’identité d’agent mis à jour complet.Exemple
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"
}
}'
Corps
application/json
Réponse
Agent mis à jour

