# Get repository automations Get all automations connected to a specific GitHub repository. Optionally filter by branch. #### Headers **`Authorization`** string required `Bearer ${FREDDY_SESSION_TOKEN}` session token for the logged-in user. #### Query Parameters **`organization_id`** string required Organization ID to filter automations. **`repository_url`** string required GitHub repository URL (e.g., `https://github.com/owner/repo`). **`branch`** string optional Branch name to filter automations. Returns all branches if not specified. ## Returns An object containing `repository_url`, `branch`, an `automations` array with full automation objects, and `total_count`. All Branches ```bash curl "https://api.aitronos.com/v1/streamline/repositories/automations?organization_id=org_xyz789&repository_url=https://github.com/owner/repo" \ -H "Authorization: Bearer $FREDDY_SESSION_TOKEN" ``` ```python import os import requests session = os.environ["FREDDY_SESSION_TOKEN"] organization_id = "org_xyz789" repository_url = "https://github.com/owner/repo" response = requests.get( "https://api.aitronos.com/v1/streamline/repositories/automations", headers={ "Authorization": f"Bearer {session}" }, params={ "organization_id": organization_id, "repository_url": repository_url } ) response.raise_for_status() data = response.json() print(f"Repository: {data['repository_url']}") print(f"Branch: {data['branch']}") print(f"Total automations: {data['total_count']}\n") for automation in data['automations']: print(f"• {automation['name']} ({automation['id']})") print(f" Status: {'Active' if automation['is_active'] else 'Inactive'}") print(f" Last sync: {automation['git_last_sync_at']}") print(f" Executions: {automation['execution_count']}") print() ``` ```javascript const token = process.env.FREDDY_SESSION_TOKEN; const organizationId = "org_xyz789"; const repositoryUrl = "https://github.com/owner/repo"; const url = new URL("https://api.aitronos.com/v1/streamline/repositories/automations"); url.searchParams.set("organization_id", organizationId); url.searchParams.set("repository_url", repositoryUrl); const apiKey = process.env.FREDDY_API_KEY; const response = await fetch(url, { headers: { Authorization: `Bearer ${apiKey}` } }); if (!response.ok) throw new Error("Request failed"); const data = await response.json(); console.log(`Repository: ${data.repository_url}`); console.log(`Total automations: ${data.total_count}`); ``` Specific Branch ```bash curl "https://api.aitronos.com/v1/streamline/repositories/automations?organization_id=org_xyz789&repository_url=https://github.com/owner/repo&branch=main" \ -H "Authorization: Bearer $FREDDY_SESSION_TOKEN" ``` ```python import os import requests params = { "organization_id": "org_xyz789", "repository_url": "https://github.com/owner/repo", "branch": "main" } headers = {"Authorization": f"Bearer {os.environ['FREDDY_SESSION_TOKEN']}"} response = requests.get( "https://api.aitronos.com/v1/streamline/repositories/automations", params=params, headers=headers ) response.raise_for_status() automations = response.json()["automations"] print(f"Found {len(automations)} automations on main branch") ``` ```javascript const token = process.env.FREDDY_SESSION_TOKEN; const url = new URL("https://api.aitronos.com/v1/streamline/repositories/automations"); url.searchParams.set("organization_id", "org_xyz789"); url.searchParams.set("repository_url", "https://github.com/owner/repo"); url.searchParams.set("branch", "main"); const apiKey = process.env.FREDDY_API_KEY; const response = await fetch(url, { headers: { Authorization: `Bearer ${apiKey}` } }); const { automations } = await response.json(); const activeCount = automations.filter(a => a.is_active).length; console.log(`${activeCount} active automations on main branch`); ``` Find Inactive ```bash token="$FREDDY_SESSION_TOKEN" endpoint="https://api.aitronos.com/v1/streamline/repositories/automations" query="organization_id=org_xyz789&repository_url=https://github.com/owner/repo" curl -s "$endpoint?$query" \ -H "Authorization: Bearer $token" | jq '.automations[] | select(.is_active == false) | {id, name, last_executed_at}' ``` ```python import os import requests session = os.environ["FREDDY_SESSION_TOKEN"] url = "https://api.aitronos.com/v1/streamline/repositories/automations" response = requests.get( url, headers={"Authorization": f"Bearer {session}"}, params={ "organization_id": "org_xyz789", "repository_url": "https://github.com/owner/repo" } ) response.raise_for_status() # Find automations with no active status inactive = [a for a in response.json()["automations"] if not a['is_active']] if inactive: print(f"⚠ Found {len(inactive)} inactive automations:") for automation in inactive: print(f" • {automation['name']} (ID: {automation['id']})") else: print("✓ All automations are active") ``` ```javascript const apiKey = process.env.FREDDY_API_KEY; import https from "node:https"; const token = process.env.FREDDY_SESSION_TOKEN; const payload = new URLSearchParams({ organization_id: "org_xyz789", repository_url: "https://github.com/owner/repo" }); const request = https.request( `https://api.aitronos.com/v1/streamline/repositories/automations?${payload.toString()}`, { method: "GET", headers: { Authorization: `Bearer ${apiKey}`, Accept: "application/json" } }, (res) => { let body = ""; res.on("data", (chunk) => (body += chunk)); res.on("end", () => { const parsed = JSON.parse(body); const inactive = parsed.automations.filter(a => !a.is_active); console.log(`Found ${inactive.length} inactive automations`); console.table(inactive.map(({ id, name, execution_count }) => ({ id, name, execution_count }))); }); } ); request.on("error", console.error); request.end(); ``` **Response:** 200 OK ```json { "repository_url": "https://github.com/owner/repo", "branch": "main", "automations": [ { "id": "auto_abc123", "name": "Data Processing Automation", "organization_id": "org_xyz789", "created_by_user_id": "usr_abc123", "automation_id": "streamline_internal_id", "upload_method": "git", "git_repository_url": "https://github.com/owner/repo", "git_branch": "main", "git_last_commit_sha": "abc123def456", "git_last_sync_at": "2025-11-15T10:30:00Z", "git_webhook_id": "12345678", "execution_file_path": "main.py", "execution_return_mode": "stream", "parameters": { "param1": "value1" }, "schedule_enabled": false, "schedule_cron": null, "schedule_timezone": "UTC", "schedule_next_run_at": null, "is_active": true, "last_executed_at": "2025-11-15T09:00:00Z", "execution_count": 42, "created_at": "2025-11-15T08:00:00Z", "updated_at": "2025-11-15T10:30:00Z" } ], "total_count": 1 } ``` 400 Bad Request ```json { "success": false, "error": { "code": "INVALID_QUERY", "message": "organization_id and repository_url are required", "status": 400, "trace_id": "req_48da6b1c" } } ``` 401 Unauthorized ```json { "success": false, "error": { "code": "UNAUTHORIZED", "message": "Missing or invalid session token", "status": 401, "trace_id": "req_320af89e" } } ``` 404 Not Found ```json { "success": false, "error": { "code": "RESOURCE_NOT_FOUND", "message": "No automations found for this repository", "system_message": "No automations found for this repository", "type": "client_error", "status": 404, "details": { "repository_url": "https://github.com/owner/repo", "branch": "main", "organization_id": "org_xyz789" }, "trace_id": "abc-123-def", "timestamp": "2025-11-15T10:30:00Z" } } ``` 429 Rate Limit ```json { "success": false, "error": { "code": "RATE_LIMIT", "message": "Too many Streamline requests", "status": 429, "retry_after": 30, "trace_id": "req_f871efab" } } ``` 500 Server Error ```json { "success": false, "error": { "code": "INTERNAL_ERROR", "message": "Unexpected Streamline failure", "status": 500, "trace_id": "req_a1c02f47" } } ``` ## Related - [List repositories](/docs/api-reference/streamline/repositories-list) - [Get automation details](/docs/api-reference/streamline/automations-retrieve)