Skip to contentSkip to page list

Docs

Get an agent's latest stop

The agent's latest stop with its status and every target's outcome (pending, applied, failed, reverted, revert_failed) and error code. An agent that was never stopped is a 404 agent_stop_not_found.

GET/api/v1/governance/agents/{agentId}/stop
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/governance/agents/<agentId>/stop"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "Authorization": "Bearer " + api_key,}​response = requests.get(    origin + path,    headers=headers,)print(response.json())

Success

application/json · Generated from schema

{  "data": {    "id": "string",    "agentId": "string",    "agentName": "string",    "status": "pending_approval",    "severity": "low",    "approval": "immediate",    "trigger": "user",    "reason": "string",    "requestedBy": {      "userId": "string",      "apiKeyId": "string"    },    "decidedByUserId": "string",    "restoredByUserId": "string",    "targets": [      {        "id": "string",        "label": "string",        "target": {          "kind": null,          "ingestionSourceId": null,          "endpointName": null        },        "state": "pending",        "errorCode": "string",        "appliedAt": "string",        "revertedAt": "string",        "alreadyStopped": false,        "gone": false,        "keptDisabled": false,        "dropped": false,        "dropId": "string"      }    ],    "requestedAt": "string",    "decidedAt": "string",    "quarantinedAt": "string",    "restoreRequestedAt": "string",    "restoredAt": "string",    "lastRequestId": "string"  }}
api-reference/governance-kill-switch/get-an-agent-s-latest-stop

Authorization

Authorizationstringheaderrequired

Admin API key for organization-level operations (managing projects, API keys). Create one in Settings > API Keys or via POST /api/api-keys. Format: sk-lw-{id}_{secret}.

Path parameters

agentIdstringrequired
At least 1 character

Responses

200

Success

application/json

dataobjectrequired
idstringrequired
agentIdstringrequired
agentNamestringrequired
statusstringrequired
One of"pending_approval""denied""stopping""quarantined""stop_failed""restoring""restored""restore_failed"
severitystringrequired
One of"low""medium""high""critical"
approvalstringrequired
One of"immediate""required"
triggerstringrequired
One of"user""api_key"
reasonstringrequired
requestedByobjectrequired
decidedByUserIdstring | nullrequired
restoredByUserIdstring | nullrequired
targetsobject[]required
requestedAtstringrequired
decidedAtstring | nullrequired
quarantinedAtstring | nullrequired
restoreRequestedAtstring | nullrequired
restoredAtstring | nullrequired
lastRequestIdstring
400

Bad Request

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
401

Unauthorized

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
403

Forbidden

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
404

Not Found

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
422

Unprocessable Entity

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
500

Internal Server Error

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]

Documentation