Skip to main content
PATCH
/
v1
/
agents
/
{agentId}
Update Agent
curl --request PATCH \
  --url https://api.truthlocks.com/v1/agents/{agentId} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "display_name": "<string>",
  "description": "<string>",
  "scopes": [
    "<string>"
  ],
  "metadata": {}
}
'
{
  "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"
}

Update Agent

PATCH /v1/agents/{agentID} Updates mutable fields on an existing machine agent identity. Only the fields provided in the request body are modified; all other fields remain unchanged. At least one field must be provided.
To change an agent’s scopes, use the delegation system or re-register the agent. Scopes cannot be modified directly through this endpoint to preserve the audit trail of scope changes.

Authentication

Requires X-API-Key header or Bearer JWT token. Tenant-scoped via X-Tenant-ID.

Path Parameters

agentID
string
required
The MAIP agent identifier (e.g., maip:t1234567:01HYX3KPZQ7RJGBN0WFMV8SDEH).

Request Body

All fields are optional, but at least one must be provided.
display_name
string
Updated human-readable name. Maximum 256 characters.
description
string
Updated description. Maximum 2048 characters.
metadata
object
Replacement metadata object. Replaces the entire metadata field (not a merge). Maximum 16 KB serialized.
status
string
Update the agent’s lifecycle status. One of: "active", "suspended". Use the dedicated suspend or revoke endpoints for status changes that require a reason for audit compliance.

Response

Returns the full updated agent identity object.
id
string
Internal UUID primary key.
agent_id
string
MAIP-compliant agent identifier.
display_name
string
The updated display name.
description
string
The updated description.
metadata
object
The updated metadata object.
status
string
Current lifecycle status after update.
updated_at
string
ISO 8601 timestamp reflecting the update.

Example

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"
    }
  }'

Authorizations

X-API-Key
string
header
required

API key for machine-to-machine authentication

Path Parameters

agentId
string<uuid>
required

Agent identifier

Body

application/json
display_name
string
Maximum string length: 256
description
string
scopes
string[]
metadata
object

Response

Agent updated

id
string<uuid>
agent_type
enum<string>
Available options:
orchestrator,
worker,
inference,
pipeline,
service,
bot,
llm
display_name
string
Maximum string length: 256
description
string
status
enum<string>
Available options:
active,
suspended,
revoked
scopes
string[]
metadata
object
trust_score
number<float>
Required range: 0 <= x <= 1
public_key
string

Base64-encoded public key

session_count
integer
keys
object[]
created_at
string<date-time>
updated_at
string<date-time>