Skip to main content

Agents API

Register, manage, and discover AI agents.

Register Agent​

POST /api/v1/agents

Register a new agent and receive a one-time API key.

Request Body​

FieldTypeRequiredDescription
namestringYesHuman-readable name
agent_typestringYescompliance, security, monitoring, remediation, audit
descriptionstringNoAgent purpose description
capabilitiesstring[]NoAuthorized MCP tool names
data_classificationsstring[]Nopublic, internal, confidential, restricted
certificate_fingerprintstringNoSHA-256 certificate fingerprint for mTLS
metadataobjectNoArbitrary key-value metadata

Example Request​

curl -X POST https://api.clawgrc.com/api/v1/agents \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "compliance-bot",
"agent_type": "compliance",
"description": "Automated compliance evidence collector",
"capabilities": ["grc.list_frameworks", "grc.get_compliance_score"],
"data_classifications": ["internal"]
}'

Example Response (201 Created)​

{
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"api_key": "cgrc_ABCDEFghijklmnopqrstuvwxyz1234567890ABCD"
}
warning

The api_key is returned only once. Store it securely.


List Agents​

GET /api/v1/agents

List agents for the authenticated organization.

Query Parameters​

ParameterTypeDefaultDescription
limitinteger50Maximum results (1-200)
offsetinteger0Pagination offset
statusstring-Filter: active, inactive

Example Response​

{
"agents": [
{
"id": "agent-uuid",
"org_id": "org-uuid",
"name": "compliance-bot",
"agent_type": "compliance",
"capabilities": ["grc.list_frameworks", "grc.get_compliance_score"],
"data_classifications": ["internal"],
"trust_score": 0.85,
"status": "active",
"description": "Automated compliance evidence collector",
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-15T14:30:00Z"
}
],
"total": 3,
"limit": 50,
"offset": 0
}

Get Agent​

GET /api/v1/agents/:agent_id

Returns a single agent by ID.


Update Agent​

PUT /api/v1/agents/:agent_id

Update mutable agent properties.

Request Body​

All fields are optional. Only provided fields are updated.

FieldTypeDescription
namestringUpdated name
descriptionstringUpdated description
capabilitiesstring[]Updated capabilities list
data_classificationsstring[]Updated data classifications
statusstringactive or inactive
certificate_fingerprintstringUpdated certificate fingerprint
metadataobjectUpdated metadata

Example Request​

curl -X PUT https://api.clawgrc.com/api/v1/agents/agent-uuid \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"capabilities": ["grc.list_frameworks", "grc.get_compliance_score", "grc.create_finding"]
}'

Deregister Agent​

DELETE /api/v1/agents/:agent_id

Soft-delete an agent by setting status to inactive.

Response (204 No Content)​


Rotate API Key​

POST /api/v1/agents/:agent_id/rotate-key

Generate a new API key, invalidating the old one immediately.

Example Response​

{
"agent_id": "agent-uuid",
"api_key": "cgrc_NEWKEYxyz..."
}

Discover Agents​

POST /api/v1/agents/discover

Find agents by capability and trust score within your organization.

Request Body​

FieldTypeRequiredDescription
capabilitiesstring[]NoRequired capabilities
min_trust_scorenumberNoMinimum trust score (0.0-1.0, default: 0.0)
statusstringNoAgent status filter (default: active)
limitintegerNoMaximum results (default: 50)

Example Request​

curl -X POST https://api.clawgrc.com/api/v1/agents/discover \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"capabilities": ["grc.trigger_scan"],
"min_trust_score": 0.7
}'

Example Response​

{
"agents": [
{
"id": "agent-uuid",
"name": "security-scanner",
"agent_type": "security",
"trust_score": 0.92,
"capabilities": ["grc.trigger_scan", "grc.create_finding"],
"status": "active"
}
],
"total": 1
}

Results are sorted by trust_score descending.


Invoke Agent​

POST /api/v1/agents/:agent_id/invoke

Invoke another agent on behalf of the caller.

Request Body​

FieldTypeRequiredDescription
methodstringYesMethod to call on the target agent
paramsobjectNoParameters for the method
min_trust_scorenumberNoMinimum trust score required (default: 0.0)
required_capabilitystringNoCapability the target must have

Example Response (202 Accepted)​

{
"request_id": "req-uuid",
"source_agent_id": "caller-uuid",
"target_agent_id": "target-uuid",
"method": "analyze",
"status": "queued",
"duration_ms": 15,
"interaction_id": "interaction-uuid"
}

Error Responses​

StatusDescription
403Trust score too low or calling agent not active
404Target agent not found
409Target agent is inactive
422Target agent lacks required capability