Control Plane API
Complete reference for the AgentShield control plane. Sessions, members, agents, policies, approvals, audit, alerts, evidence, metrics, and chaos.
The control plane API is for humans and the automation that acts for them. Every /api/v1 route except sign-in and invitations requires Authorization: Bearer <token>. Agent signature headers are refused. Base URL in local development: http://127.0.0.1:8080.
The organization for every call is taken from the session's membership. No route accepts an organization id as authority.
Health
/health/liveProcess liveness
This reports the process, not that every management route exists.
Responses
200HealthLiveProcess is running
curl -X GET "http://127.0.0.1:8080/health/live"Examples are generated from the schema. Values are placeholders.
/health/readyReadiness
Returns 200 when PostgreSQL answers, otherwise 503.
Responses
200HealthReadyDatabase answered
503HealthReadyProcess is up and the database is not available
curl -X GET "http://127.0.0.1:8080/health/ready"Examples are generated from the schema. Values are placeholders.
Sessions
/api/v1/sessionsCreate a human session
Checks the email and password of a bootstrapped user. There is no public registration route. The token is returned once and only its SHA-256 is stored. Agent signature headers are rejected.
Request body · required
emailstring (email)requiredpasswordstringrequiredmin length 12 · max length 128
Responses
201SessionSession token
401ErrorBodyError
403ErrorBodyError
curl -X POST "http://127.0.0.1:8080/api/v1/sessions" \
-H "Content-Type: application/json" \
--data-binary @body.jsonExamples are generated from the schema. Values are placeholders.
/api/v1/sessions/currentThe caller's user, organization, role, and session expiry
Responses
200CurrentSessionCurrent session
401ErrorBodyError
curl -X GET "http://127.0.0.1:8080/api/v1/sessions/current" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/sessions/currentEnd the session that made this request
Responses
204no bodySession ended. The token is refused from now on.
curl -X DELETE "http://127.0.0.1:8080/api/v1/sessions/current" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/sessions/current/passwordChange the caller's password and end their other sessions
Request body · required
current_passwordstringrequirednew_passwordstringrequiredmin length 12 · max length 128
Responses
204no bodyPassword changed. The calling session stays valid.
403ErrorBodyThe current password is wrong
curl -X POST "http://127.0.0.1:8080/api/v1/sessions/current/password" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @body.jsonExamples are generated from the schema. Values are placeholders.
Members
Owners and admins manage the organization's members. With SMTP_URL configured, new members receive an emailed invitation; otherwise a one-time temporary password is returned once.
/api/v1/membersList the organization's members
Implemented for owner and admin.
Responses
200objectMembers
curl -X GET "http://127.0.0.1:8080/api/v1/members" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/membersAdd a user with a generated temporary password
Implemented for owner and admin. Only an owner can grant owner. temporary_password is returned once and only its Argon2id hash is stored.
Request body · required
emailstring (email)requireddisplay_namestringrequiredmin length 1 · max length 128
rolestringrequiredone of
owner,admin,operator,auditor,approver
Responses
201anyMember added
409ErrorBodyA user with this email exists
curl -X POST "http://127.0.0.1:8080/api/v1/members" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @body.jsonExamples are generated from the schema. Values are placeholders.
/api/v1/members/{userId}Change a member's role or status
Implemented for owner and admin. Nobody changes their own role or status. Only an owner grants owner or changes an owner. The organization keeps an active owner. Disabling a user ends their sessions.
Parameters
userIdpath · string (uuid)required
Request body · required
rolestringone of
owner,admin,operator,auditor,approverstatusstringone of
active,disabled
Responses
200MemberUpdated member
403ErrorBodyThe change is not allowed for this caller
curl -X PATCH "http://127.0.0.1:8080/api/v1/members/$USER_ID" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @body.jsonExamples are generated from the schema. Values are placeholders.
/api/v1/members/{userId}/invitationEmail a new invitation and close the previous link
Implemented for owner and admin when SMTP_URL is set. 409 when mail is not configured or the member has no open invitation.
Parameters
userIdpath · string (uuid)required
Responses
201MemberInvitation sent
409ErrorBodyError
502ErrorBodyThe mail server refused or did not answer
curl -X POST "http://127.0.0.1:8080/api/v1/members/$USER_ID/invitation" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
Invitations
Public routes used by the invitation page. Every unknown, used, or expired token returns the same 404.
/api/v1/invitations/lookupWho an open invitation is for
Public. The token is sent in the body, never the URL. Unknown, used, and expired tokens all return 404.
Request body · required
tokenstringrequiredpattern
^[A-Za-z0-9_-]{43}$
Responses
200objectOpen invitation
404ErrorBodyError
curl -X POST "http://127.0.0.1:8080/api/v1/invitations/lookup" \
-H "Content-Type: application/json" \
--data-binary @body.jsonExamples are generated from the schema. Values are placeholders.
/api/v1/invitations/acceptChoose a password and close the invitation
Public. Works once. The invitee then signs in with POST /api/v1/sessions.
Request body · required
Responses
204no bodyPassword set. The link no longer works.
400ErrorBodyError
404ErrorBodyError
curl -X POST "http://127.0.0.1:8080/api/v1/invitations/accept" \
-H "Content-Type: application/json" \
--data-binary @body.jsonExamples are generated from the schema. Values are placeholders.
Agents
/api/v1/agentsList agents in the caller's organization
The organization comes from the session.
Parameters
limitquery · integermin 1 · max 200
cursorquery · string
Responses
200AgentPageAgent page
401ErrorBodyError
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.
/api/v1/agentsRegister an agent public key
Stores the raw Ed25519 public key. Secret key fields are rejected. The caller must be an owner, admin, or operator.
Request body · required
namestringrequiredmin length 1 · max length 128
frameworkstringrequiredone of
langchain,langgraph,crewai,openai_agents,python,typescript,mcp,custompublic_keystringrequiredUnpadded base64url of the raw 32-byte Ed25519 public key.
pattern
^[A-Za-z0-9_-]{43}$
Responses
201AgentRegistered agent
400ErrorBodyError
401ErrorBodyError
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.jsonExamples are generated from the schema. Values are placeholders.
/api/v1/agents/{agentId}Get one agent
Returns 404 when the agent is outside the caller's organization.
Parameters
agentIdpath · string (uuid)required
Responses
200AgentAgent
404ErrorBodyError
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.
/api/v1/agents/{agentId}/revokeRevoke an agent and its active credentials
Revocation is permanent for the agent and its credential records.
Parameters
agentIdpath · string (uuid)required
Responses
200AgentRevoked agent
404ErrorBodyError
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.
/api/v1/agents/{agentId}/suspendSuspend an agent without retiring its key
The key stays active and the agent cannot call the gateway until a later phase resumes it.
Parameters
agentIdpath · string (uuid)required
Responses
200AgentSuspended 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.
/api/v1/agents/{agentId}/resumeLet a suspended agent call again
Implemented for owner and admin. A revoked agent stays revoked and returns 409.
Parameters
agentIdpath · string (uuid)required
Responses
200AgentAgent is active
409ErrorBodyThe 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.
/api/v1/agents/{agentId}/credentials/rotateAdd a new public key and mark the previous key rotated
The server stores the public key only and marks the previous active key rotated.
Parameters
agentIdpath · string (uuid)required
Request body · required
public_keystringrequiredpattern
^[A-Za-z0-9_-]{43}$
Responses
201CredentialNew 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.jsonExamples are generated from the schema. Values are placeholders.
Policies
/api/v1/policiesList policies in the caller's organization
Evaluation does not read this list. It reads policy_versions.
Responses
200PolicyPagePolicy page
curl -X GET "http://127.0.0.1:8080/api/v1/policies" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/policiesCreate a policy and its first immutable version
Inserts an immutable version. A second active policy for the same organization or agent is a conflict.
Request body · required
namestringrequiredscopestringrequiredone of
organization,agentagent_idstring (uuid)documentPolicyDocumentrequiredunknown fields rejected
Show child fields
agentobjectunknown fields rejected
Show child fields
idstring
permissionsobjectrequiredunknown fields rejected
Show child fields
allowedstring[]requireddeniedstring[]requiredapproval_requiredstring[]required
Responses
201PolicyCreated policy
curl -X POST "http://127.0.0.1:8080/api/v1/policies" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @body.jsonExamples are generated from the schema. Values are placeholders.
/api/v1/policies/{policyId}Read one policy and the document of its current version
Implemented for any member of the organization.
Parameters
policyIdpath · string (uuid)required
Responses
200anyPolicy and current document
404ErrorBodyError
curl -X GET "http://127.0.0.1:8080/api/v1/policies/$POLICY_ID" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/policies/{policyId}Append a new policy version and move the current pointer
Appends a version and moves the current pointer. Existing version rows are not edited.
Parameters
policyIdpath · string (uuid)required
Request body · required
documentPolicyDocumentrequiredunknown fields rejected
Show child fields
agentobjectunknown fields rejected
Show child fields
idstring
permissionsobjectrequiredunknown fields rejected
Show child fields
allowedstring[]requireddeniedstring[]requiredapproval_requiredstring[]required
Responses
200PolicyUpdated policy pointer
curl -X PUT "http://127.0.0.1:8080/api/v1/policies/$POLICY_ID" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @body.jsonExamples are generated from the schema. Values are placeholders.
Approvals
/api/v1/approvalsList approval requests
Implemented for owner, admin, and approver. Agents cannot call this route.
Responses
200ApprovalPageApproval page
curl -X GET "http://127.0.0.1:8080/api/v1/approvals" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/approvals Reserved · not registeredRecord an approval request for an existing authorization decision
Not implemented. Reserved for the gateway service identity. Agent credentials and the agent that initiated the action are rejected.
Request body · required
authorization_decision_idstring (uuid)requiredpayload_hashstringrequiredpattern
^[0-9a-f]{64}$expires_atstring (date-time)required
Responses
201ApprovalPending approval
403ErrorBodyError
curl -X POST "http://127.0.0.1:8080/api/v1/approvals" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @body.jsonExamples are generated from the schema. Values are placeholders.
/api/v1/approvals/{approvalId}/approveApprove the exact bound payload
The caller must be a human approver, admin, or owner in the same organization. The same user id cannot approve an agent with that id. The approval binds to payload_hash and expires.
Parameters
approvalIdpath · string (uuid)required
Responses
200ApprovalApproved, not yet consumed
409ErrorBodyError
curl -X POST "http://127.0.0.1:8080/api/v1/approvals/$APPROVAL_ID/approve" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/approvals/{approvalId}/rejectReject an approval request
A rejected approval cannot be replayed.
Parameters
approvalIdpath · string (uuid)required
Responses
200ApprovalRejected approval
curl -X POST "http://127.0.0.1:8080/api/v1/approvals/$APPROVAL_ID/reject" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
Audit, events, and incidents
/api/v1/eventsList redacted security events
Owner, admin, auditor, and operator can list redacted events for their organization.
Parameters
limitquery · integermin 1 · max 200
cursorquery · string
Responses
200EventPageEvent page
curl -X GET "http://127.0.0.1:8080/api/v1/events" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/incidentsList security incidents
Owner, admin, and auditor sessions can list incidents for their organization.
Responses
200IncidentPageIncident page
curl -X GET "http://127.0.0.1:8080/api/v1/incidents" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/auditList hash-chain links for the caller's organization
Owner, admin, and auditor can list links. Operator cannot.
Responses
200AuditPageAudit page
curl -X GET "http://127.0.0.1:8080/api/v1/audit" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/audit/exportsList exported audit head copies
Owner, admin, and auditor can list exports for their organization.
Responses
200AuditExportPageExport page
curl -X GET "http://127.0.0.1:8080/api/v1/audit/exports" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/audit/exportsExport the current audit head hash
Stores an external copy of the current organization head hash.
Request body · required
destinationstringrequiredmin length 1 · max length 256
Responses
201AuditExportStored export
curl -X POST "http://127.0.0.1:8080/api/v1/audit/exports" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @body.jsonExamples are generated from the schema. Values are placeholders.
Alerts
/api/v1/alertsContent analysis alerts, newest first
Implemented for owner, admin, and auditor. Alerts are advice about calls that already ran.
Parameters
statusquery · stringone of
open,acknowledged,resolved
Responses
200objectAlerts
curl -X GET "http://127.0.0.1:8080/api/v1/alerts" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/alerts/{alertId}Acknowledge or resolve an alert
Implemented for owner and admin. Forward only. Appends alert.acknowledged or alert.resolved. No decision changes.
Parameters
alertIdpath · string (uuid)required
Request body · required
statusstringrequiredone of
acknowledged,resolved
Responses
200AlertUpdated alert
409ErrorBodyError
curl -X PATCH "http://127.0.0.1:8080/api/v1/alerts/$ALERT_ID" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @body.jsonExamples are generated from the schema. Values are placeholders.
Evidence
/api/v1/evidenceEvidence bundles the event relay stored
Implemented for owner, admin, and auditor. Newest first, at most 200.
Parameters
execution_idquery · string (uuid)
Responses
200objectEvidence records
curl -X GET "http://127.0.0.1:8080/api/v1/evidence" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/evidence/{evidenceId}Read one bundle after checking its SHA-256
Implemented for owner, admin, and auditor. 409 evidence_integrity_failed when the stored object no longer matches its recorded hash. Every read appends evidence.viewed or evidence.integrity_failed. 503 when storage is not configured.
Parameters
evidenceIdpath · string (uuid)required
Responses
200objectVerified bundle
409ErrorBodyError
curl -X GET "http://127.0.0.1:8080/api/v1/evidence/$EVIDENCE_ID" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
Metrics
/api/v1/metrics/reliabilityTool reliability over the last N minutes
Implemented for owner, admin, auditor, and operator. Built from per-minute rows the event relay computes.
Parameters
minutesquery · integermin 5 · max 10080
Responses
200objectSummary per tool and calls per minute
curl -X GET "http://127.0.0.1:8080/api/v1/metrics/reliability" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
Chaos
Owners and admins run catalog scenarios against the gateway's real authorization, limit, timeout, and body-limit code. passed is stored only when the defensive behavior was observed; a missing observation is failed.
/api/v1/chaos/scenariosList the chaos scenario catalog
Implemented for owner and admin. Disabled scenarios are listed and cannot be started.
Responses
200objectCatalog
curl -X GET "http://127.0.0.1:8080/api/v1/chaos/scenarios" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/chaos/experimentsList the 50 most recent experiments
Implemented for owner and admin. Newest first.
Responses
200objectRecent experiments
curl -X GET "http://127.0.0.1:8080/api/v1/chaos/experiments" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
/api/v1/chaos/experimentsStart a chaos experiment
Implemented for owner and admin. Runs one enabled catalog scenario. A missing observation is stored as failed. The response is the stored result, and status passed is returned only when the harness observed the defensive behavior.
Request body · required
agent_idstring (uuid)requiredscenario_idstringrequired
Responses
201ChaosExperimentExperiment finished. passed means the defensive behavior was observed.
409ErrorBodyThe scenario is disabled
curl -X POST "http://127.0.0.1:8080/api/v1/chaos/experiments" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @body.jsonExamples are generated from the schema. Values are placeholders.
/api/v1/chaos/experiments/{experimentId}Read one chaos experiment
Implemented for owner and admin. Returns the stored result for the caller's organization.
Parameters
experimentIdpath · string (uuid)required
Responses
200ChaosExperimentStored experiment
404ErrorBodyError
curl -X GET "http://127.0.0.1:8080/api/v1/chaos/experiments/$EXPERIMENT_ID" \
-H "Authorization: Bearer $AGENTSHIELD_TOKEN"Examples are generated from the schema. Values are placeholders.
Was this page helpful?