# Toggle Connection Enable or disable a personal connector credential on demand. When a connection is disabled its tools are immediately excluded from all chat sessions — no token overhead, no tool noise. The credential and OAuth connection are preserved and can be re-enabled at any time without re-authenticating. #### Path Parameters **`credential_id`** string required The credential ID to toggle (e.g., `tcred_43a8fec047f64ba991fbc5f8fa25d2c9`). #### Query Parameters **`organization_id`** string required Organization ID (e.g., `org_722dd7...`). #### Request Body **`is_active`** boolean required `true` to enable the connection, `false` to disable it. ## Returns The updated connection ID and its new active status. **`id`** string — The credential ID. **`is_active`** boolean — The new active status. Request ```bash cURL # Disable a connection curl -X PATCH \ "https://api.aitronos.com/v1/personal-connectors/connections/tcred_43a8fec047f64ba991fbc5f8fa25d2c9/active?organization_id=org_722dd7..." \ -H "X-API-Key: $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{"is_active": false}' ``` ```python Python import os import requests api_key = os.environ["FREDDY_API_KEY"] response = requests.patch( "https://api.aitronos.com/v1/personal-connectors/connections/tcred_43a8fec047f64ba991fbc5f8fa25d2c9/active", headers={ "X-API-Key": api_key, "Content-Type": "application/json", }, params={"organization_id": "org_722dd7..."}, json={"is_active": False}, ) data = response.json() print(f"Connection {data['id']} is now {'active' if data['is_active'] else 'disabled'}") ``` ```javascript JavaScript const apiKey = process.env.FREDDY_API_KEY; const credentialId = "tcred_43a8fec047f64ba991fbc5f8fa25d2c9"; const organizationId = "org_722dd7..."; const response = await fetch( `https://api.aitronos.com/v1/personal-connectors/connections/${credentialId}/active?organization_id=${organizationId}`, { method: "PATCH", headers: { "X-API-Key": apiKey, "Content-Type": "application/json", }, body: JSON.stringify({ is_active: false }), } ); const data = await response.json(); console.log(`Connection ${data.id} is now ${data.is_active ? "active" : "disabled"}`); ``` Response ```json 200 OK { "id": "tcred_43a8fec047f64ba991fbc5f8fa25d2c9", "is_active": false } ``` ```json 404 Not Found { "success": false, "error": { "code": "RESOURCE_NOT_FOUND", "message": "We couldn't find what you were looking for.", "system_message": "Connection tcred_43a8fec047f64ba991fbc5f8fa25d2c9 not found or not owned by user", "type": "client_error", "status": 404, "details": { "credential_id": "tcred_43a8fec047f64ba991fbc5f8fa25d2c9" }, "trace_id": "abc-123-def-456", "timestamp": "2025-12-22T15:30:00Z" } } ``` ```json 401 Unauthorized { "success": false, "error": { "code": "AUTHENTICATION_REQUIRED", "message": "Authentication required. Please provide a valid API key.", "system_message": "Missing or invalid authorization header", "type": "authentication_error", "status": 401, "trace_id": "req_abc123xyz", "timestamp": "2025-12-22T15:30:00Z", "details": {} } } ``` ## Related Resources - [Get Tool Connections](/docs/api-reference/connectors/get-tool-connections) - [Rename Connection](/docs/api-reference/connectors/rename-connection) - [Delete Connection](/docs/api-reference/connectors/delete-connection) - [Disconnect Credential](/docs/api-reference/connectors/disconnect-credential)