Skip to contentSkip to page list

Docs

Approve a pending stop

Approves a stop waiting for a decision; its targets are then applied. Send expectedTargetIds with the stop's target ids you reviewed to refuse the approval (409 agent_stop_plan_changed) when its targets changed since. A stop that is no longer pending is a 409 agent_stop_not_pending; the key that requested the stop cannot approve it (409 agent_stop_self_approval).

POST/api/v1/governance/agent-stops/{stopId}/approve
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/governance/agent-stops/<stopId>/approve"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "Authorization": "Bearer " + api_key,}​response = requests.post(    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/approve-a-pending-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

stopIdstringrequired
At least 1 character

Request body

application/json

notestring
Up to 2000 characters
expectedTargetIdsstring[]

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[]
409

The stop or its plan is not in a state that allows this

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