---
title: "Enable or disable a script connection"
method: POST
path: "/api/script-connections/{id}/disable"
tags: ["Script Connections"]
---

# Enable or disable a script connection

`POST /api/script-connections/{id}/disable`

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `enabled` boolean, required

## Response `200`

Updated script connection

- object
  - `connection` object, required
    - `id` string, required
    - `slug` string, required
    - `displayName` string, nullable, required
    - `kind` 'raw' | 'openapi' | 'mcp' | 'graphql', required
    - `scope` 'global' | 'agent' | 'repo', required
    - `scopeId` string, nullable, required
    - `baseUrl` string, nullable, required
    - `baseUrlSource` 'user' | 'spec', required
    - `baseUrlMismatch` object
      - `specUrl` string, required
      - `effectiveUrl` string, required
    - `allowedHosts` string[], required
    - `credentialBindingId` string, nullable, required
    - `authType` 'none' | 'bearer' | 'header' | 'query' | 'oauth', required
    - `authConfigKey` string, nullable, required
    - `authAuthorizationId` string, nullable, required
    - `authParamName` string, nullable, required
    - `authTemplateOverride` string, nullable, required
    - `authHostsOverride` string[], nullable, required
    - `openapiSpecSourceKind` 'url' | 'inline' | 'agent_fs' | 'vendored' | 'null', nullable, required
    - `openapiSpecSource` string, nullable, required
    - `openapiSpecEtag` string, nullable, required
    - `openapiSpecFetchedAt` string, nullable, required
    - `mcpServerId` string, nullable, required
    - `generatedAt` string, nullable, required
    - `generationError` string, nullable, required
    - `enabled` boolean, required
    - `version` number, required
    - `createdAt` string, required
    - `updatedAt` string, required
    - `createdBy` string, nullable, required
    - `updatedBy` string, nullable, required
    - `operationCount` number, required
    - `toolCount` number, required
    - `credentialBinding` object, nullable, required
      - `id` string, required
      - `configKey` string, required
      - `authKind` 'config' | 'oauth', required
      - `oauthAuthorizationId` string
      - `tokenStatus` 'ok' | 'expiring' | 'refresh-failed' | 'revoked' | 'missing'
    - `auth` object, required
      - `type` 'none' | 'bearer' | 'header' | 'query' | 'oauth', required
      - `configKey` string
      - `authorizationId` string
      - `paramName` string
      - `status` 'ok' | 'expiring' | 'refresh-failed' | 'revoked' | 'missing'

## Other responses

- `403` — Only the lead agent can manage script connections
- `404` — Script connection not found

---

[API](https://skmtc.net/desplega-ai/apis/agent-swarm-api.md) · [All operations](https://skmtc.net/desplega-ai/apis/agent-swarm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/desplega-ai/agent-swarm-api/versions/ef761849166b/schema)
