Skip to Content
AgentShield
API Reference

Agent Management

Register agents, list and read them, rotate credentials, and suspend, resume, or revoke agents through the control plane.

Agent routes manage machine principals and their Ed25519 public keys. Lifecycle semantics are described in Credential lifecycle.

OperationRoles
List and read agentsAny member
Registerowner, admin, operator
Suspend, resume, revoke, rotateowner, admin

The agent record

{
  "id": "3f2b8c1e-6a4d-4f7e-9b21-5c8d0e7a4b13",
  "organization_id": "9a7e5d2c-1b3f-4c6a-8e0d-2f4b6a8c0e1d",
  "name": "billing-agent",
  "framework": "langgraph",
  "status": "active",
  "credential_status": "active",
  "registered_at": "2026-11-30T12:00:00.000Z",
  "last_activity_at": null
}
FieldValues
statusactive, suspended, revoked
credential_statusactive, rotated, revoked, none
frameworklangchain, langgraph, crewai, openai_agents, python, typescript, mcp, custom

Register an agent

public_key is the 32-byte Ed25519 public key as 43 characters of unpadded base64url, for example from agentshield_sdk.public_key(seed) or publicKey(seed). Registration appends agent.registered.

POST/api/v1/agents

Register an agent public key

Bearer sessionoperationId: registerAgent

Stores the raw Ed25519 public key. Secret key fields are rejected. The caller must be an owner, admin, or operator.

Request body · required

  • namestringrequired

    min length 1 · max length 128

  • frameworkstringrequired

    one of langchain, langgraph, crewai, openai_agents, python, typescript, mcp, custom

  • public_keystringrequired

    Unpadded base64url of the raw 32-byte Ed25519 public key.

    pattern ^[A-Za-z0-9_-]{43}$

Responses

  • 201Agent

    Registered agent

  • 400ErrorBody

    Error

  • 401ErrorBody

    Error

curl -X POST "http://127.0.0.1:8080/api/v1/agents" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

Examples are generated from the schema. Values are placeholders.

Conflicts return 409: a name already used in the organization, or a public key already registered anywhere.

List and read

GET /api/v1/agents returns agents newest first and accepts limit and cursor.

GET/api/v1/agents

List agents in the caller's organization

Bearer sessionoperationId: listAgents

The organization comes from the session.

Parameters

  • limitquery · integer

    min 1 · max 200

  • cursorquery · string

Responses

  • 200AgentPage

    Agent page

  • 401ErrorBody

    Error

curl -X GET "http://127.0.0.1:8080/api/v1/agents" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

GET/api/v1/agents/{agentId}

Get one agent

Bearer sessionoperationId: getAgent

Returns 404 when the agent is outside the caller's organization.

Parameters

  • agentIdpath · string (uuid)required

Responses

  • 200Agent

    Agent

  • 404ErrorBody

    Error

curl -X GET "http://127.0.0.1:8080/api/v1/agents/$AGENT_ID" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

Rotate a credential

POST/api/v1/agents/{agentId}/credentials/rotate

Add a new public key and mark the previous key rotated

Bearer sessionoperationId: rotateAgentCredential

The server stores the public key only and marks the previous active key rotated.

Parameters

  • agentIdpath · string (uuid)required

Request body · required

  • public_keystringrequired

    pattern ^[A-Za-z0-9_-]{43}$

Responses

  • 201Credential

    New credential metadata

curl -X POST "http://127.0.0.1:8080/api/v1/agents/$AGENT_ID/credentials/rotate" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

Examples are generated from the schema. Values are placeholders.

Suspend, resume, revoke

POST/api/v1/agents/{agentId}/suspend

Suspend an agent without retiring its key

Bearer sessionoperationId: suspendAgent

The key stays active and the agent cannot call the gateway until a later phase resumes it.

Parameters

  • agentIdpath · string (uuid)required

Responses

  • 200Agent

    Suspended agent

curl -X POST "http://127.0.0.1:8080/api/v1/agents/$AGENT_ID/suspend" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

POST/api/v1/agents/{agentId}/resume

Let a suspended agent call again

Bearer sessionoperationId: resumeAgent

Implemented for owner and admin. A revoked agent stays revoked and returns 409.

Parameters

  • agentIdpath · string (uuid)required

Responses

  • 200Agent

    Agent is active

  • 409ErrorBody

    The agent is revoked

curl -X POST "http://127.0.0.1:8080/api/v1/agents/$AGENT_ID/resume" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

POST/api/v1/agents/{agentId}/revoke

Revoke an agent and its active credentials

Bearer sessionoperationId: revokeAgent

Revocation is permanent for the agent and its credential records.

Parameters

  • agentIdpath · string (uuid)required

Responses

  • 200Agent

    Revoked agent

  • 404ErrorBody

    Error

curl -X POST "http://127.0.0.1:8080/api/v1/agents/$AGENT_ID/revoke" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

Revocation is permanent

A revoked agent cannot be resumed or rotated. Register a new agent to continue the workload.

Was this page helpful?

On this page