Atualizar Agente
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
}Agentes de Máquina
Atualizar Agente
Atualizar nome de exibição, descrição, metadados ou status de um agente
PATCH
/
v1
/
agents
/
{agentId}
Atualizar Agente
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
}Atualizar Agente
PATCH /v1/agents/{agentID}
Atualiza campos mutáveis em uma identidade de agente de máquina existente. Apenas os campos fornecidos no corpo da solicitação são modificados; todos os outros campos permanecem inalterados. Pelo menos um campo deve ser fornecido.
Para alterar os escopos de um agente, use o sistema de delegação ou registre novamente o
agente. Os escopos não podem ser modificados diretamente através deste endpoint para preservar
o rastro de auditoria das mudanças de escopo.
Autenticação
Requer cabeçalhoX-API-Key ou token JWT de portador. O espaço de trabalho é derivado da credencial autenticada; não envie X-Tenant-ID.
Corpo da Requisição
Todos os campos são opcionais, mas pelo menos um deve ser fornecido.Resposta
Retorna o objeto de identidade do agente atualizado completo.Exemplo
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"
}
}'
Corpo
application/json
Resposta
Agente atualizado

