Skip to contentSkip to page list

Docs

Replace an agent's stop plan

Replaces every target at once; an empty list clears the plan. Each target must name what the organisation holds: a Databricks governance source, a stored AWS connection or a gateway virtual key. Anything else is a 422 agent_stop_target_invalid naming the target's position. Send expectedVersion with the version you read to refuse the save (409 agent_stop_plan_conflict) when someone else saved the plan since. A target removed from the plan also leaves the agent's open stop, so it no longer holds that stop or its restore from finishing; a restore leaves it as it is.

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

Success

application/json · Generated from schema

{  "data": {    "agentId": "string",    "targets": [      {        "id": "string",        "label": "string",        "target": {          "kind": null,          "ingestionSourceId": null,          "endpointName": null        }      }    ],    "updatedAt": "string",    "version": 0  }}
api-reference/governance-kill-switch/replace-an-agent-s-stop-plan

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

Request body

application/json · Required

targetsobject[]required
Option 1kind: "databricks_serving_endpoint"object
kindstringrequired
Always"databricks_serving_endpoint"
ingestionSourceIdstringrequired
At least 1 character
endpointNamestringrequired
At least 1 characterUp to 63 charactersPattern ^[A-Za-z0-9_-]+$
Option 2kind: "bedrock_agent_alias"object
kindstringrequired
Always"bedrock_agent_alias"
awsConnectionIdstringrequired
At least 1 character
regionstringrequired
Pattern ^[a-z]{2}(-[a-z]+)+-\d$
agentIdstringrequired
Pattern ^[0-9a-zA-Z]{10}$
agentAliasIdstringrequired
Pattern ^[0-9a-zA-Z]{10}$
Option 3kind: "gateway_virtual_key"object
kindstringrequired
Always"gateway_virtual_key"
virtualKeyIdstringrequired
At least 1 character
expectedVersioninteger
Minimum 0Maximum 9007199254740991

Responses

200

Success

application/json

dataobjectrequired
agentIdstringrequired
targetsobject[]required
updatedAtstring | nullrequired
versionintegerrequired
Minimum 0Maximum 9007199254740991
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