Skip to main content
Turns an agent off, or back on, as a governance action. A disabled agent cannot be used until you turn it back on. The response is the updated agent, with the same fields as Get an agent. The Agent Disable API is a different call. It uses the ASSISTANT_API scope and only reaches an agent that key can edit. This call does not require the agent to be shared with the key.

Base URL

Dedicated deploymentsReplace api.langdock.com with <your-deployment-url>/api/public in all requests.

Prerequisites

  • API key with the GOVERNANCE_API scope
  • Enable Governance is on
  • agentId is the agent UUID

Request body

Whitespace at the ends of disabledReason is removed. An empty reason is stored as null. Everyone who can see the agent sees the reason on its Disabled badge. The owner and editors also see it in the agent editor. Turning the agent back on clears disabledReason and disabledAt, including when the request still sends a reason. The API key’s user is stored as the person who disabled the agent. This response does not include that id.

Behavior

  • Turned off: disabled is true, disabledReason is the stored reason, and disabledAt is set.
  • Turned back on: disabled is false, and disabledReason and disabledAt are null.
  • Agent not available? Returns 404 with the message Agent not found.
  • Missing disabled, or a reason longer than 500 characters? Returns 400.
Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.