# Disconnect GitHub repository Disconnect a GitHub repository from an automation. The current code is preserved, but automatic synchronization stops. #### Path Parameters **`automation_id`** string required The ID of the automation to disconnect. #### Headers **`Authorization`** string required ## Returns Returns the updated automation object with GitHub connection removed. Basic Request ```bash curl -X DELETE "https://api.aitronos.com/v1/streamline/automations/auto_abc123/github/disconnect" \ -H "Authorization: Bearer $FREDDY_SESSION_TOKEN" ``` ```python import os import requests automation_id = "auto_abc123" response = requests.delete( f"https://api.aitronos.com/v1/streamline/automations/{automation_id}/github/disconnect", headers={ "Authorization": f"Bearer {os.environ['FREDDY_SESSION_TOKEN']}" } ) response.raise_for_status() automation = response.json() ``` ```javascript const automationId = "auto_abc123"; const res = await fetch( `https://api.aitronos.com/v1/streamline/automations/${automationId}/github/disconnect`, { method: "DELETE", headers: { Authorization: `Bearer ${process.env.FREDDY_SESSION_TOKEN}` } } ); const automation = await res.json(); ``` With Confirmation ```bash # Disconnect and verify AUTOMATION_ID="auto_abc123" curl -X DELETE "https://api.aitronos.com/v1/streamline/automations/$AUTOMATION_ID/github/disconnect" \ -H "Authorization: Bearer $FREDDY_SESSION_TOKEN" | jq '.git_repository_url' ``` ```python import os import requests automation_id = "auto_abc123" response = requests.delete( f"https://api.aitronos.com/v1/streamline/automations/{automation_id}/github/disconnect", headers={"Authorization": f"Bearer {os.environ['FREDDY_SESSION_TOKEN']}"} ) response.raise_for_status() automation = response.json() # Verify disconnection assert automation["git_repository_url"] is None print(f"Successfully disconnected automation {automation_id}") ``` ```javascript const automationId = "auto_abc123"; const response = await fetch( `https://api.aitronos.com/v1/streamline/automations/${automationId}/github/disconnect`, { method: "DELETE", headers: { Authorization: `Bearer ${process.env.FREDDY_SESSION_TOKEN}` } } ); if (!response.ok) { throw new Error(`Failed to disconnect: ${response.status}`); } const automation = await response.json(); console.log(`Disconnected. Git URL: ${automation.git_repository_url}`); ``` **Response:** 200 OK ```json { "id": "auto_abc123", "name": "My Automation", "organization_id": "org_xyz789", "automation_id": "internal_id", "execution_file_path": "main.py", "upload_method": "manual", "description": "Automation description", "parameters": {}, "git_repository_url": null, "git_branch": null, "git_last_commit_sha": null, "git_last_sync_at": null, "git_webhook_id": null, "schedule_enabled": false, "cron_expression": null, "timezone": null, "is_active": true, "created_at": "2025-11-15T10:00:00Z", "updated_at": "2025-11-15T10:35:00Z" } ``` 401 Unauthorized ```json { "success": false, "error": { "code": "AUTHENTICATION_REQUIRED", "message": "Missing or invalid JWT token", "status": 401, "trace_id": "req_bf0fa421" } } ``` 404 Not Found ```json { "success": false, "error": { "code": "RESOURCE_NOT_FOUND", "message": "Automation not found", "status": 404, "trace_id": "req_05f27f1d" } } ```