⚠️ Using our API via a dedicated deployment? Just replace
api.langdock.com with your deployment’s base URL: <deployment-url>/api/publicThis is the new Agents API with native Vercel AI SDK compatibility. If you’re using the legacy Assistants API, see the migration guide.
Use Cases
- Temporarily disable an agent that needs maintenance or updates
- Re-enable a previously disabled agent
- Control agent availability during rollouts or testing
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | UUID of the agent to enable/disable |
disabled | boolean | Yes | true to disable, false to enable |
Example
Response Format
Success Response (200 OK)
Error Handling
| Status Code | Description |
|---|---|
| 400 | Invalid parameters (missing agentId or disabled) |
| 401 | Invalid or missing API key |
| 403 | Insufficient permissions to disable agents |
| 404 | Agent not found or API key does not have access |
| 429 | Rate limit exceeded |
Behavior
When an agent is disabled:- Users cannot start new conversations with the agent
- The agent does not appear in the agent library for regular users
- Existing conversations may still be viewable but the agent cannot respond
- Admins can still view and manage the agent
- The agent can be re-enabled at any time
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.