# List repositories Get all unique GitHub repositories connected to automations in an organization. Optionally include automation details for each repository. #### 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 repositories. **`include_automations`** boolean optional · Defaults to `false` Set to `true` to include automation details for each repository. ## Returns An object containing a `repositories` array and `total_count`. Each repository includes URL, branch, sync metadata, automation count, and optionally full automation details. Basic Request ```bash curl "https://api.aitronos.com/v1/streamline/repositories?organization_id=org_xyz789" \ -H "Authorization: Bearer $FREDDY_SESSION_TOKEN" ``` ```python import os import requests session = os.environ["FREDDY_SESSION_TOKEN"] response = requests.get( "https://api.aitronos.com/v1/streamline/repositories", headers={ "Authorization": f"Bearer {session}" }, params={"organization_id": "org_xyz789"} ) response.raise_for_status() data = response.json() print(f"Found {data['total_count']} repositories") for repo in data["repositories"]: print(f"\n{repo['url']} ({repo['branch']})") print(f" Automations: {repo['automations_count']}") print(f" Last sync: {repo['last_sync_at']}") ``` ```javascript const token = process.env.FREDDY_SESSION_TOKEN; const apiKey = process.env.FREDDY_API_KEY; const response = await fetch( "https://api.aitronos.com/v1/streamline/repositories?organization_id=org_xyz789", { headers: { Authorization: `Bearer ${apiKey}` } } ); if (!response.ok) throw new Error("Request failed"); const data = await response.json(); console.log(`Found ${data.total_count} repositories`); ``` With Automations ```bash curl "https://api.aitronos.com/v1/streamline/repositories?organization_id=org_xyz789&include_automations=true" \ -H "Authorization: Bearer $FREDDY_SESSION_TOKEN" ``` ```python import os import requests params = { "organization_id": "org_xyz789", "include_automations": True } headers = {"Authorization": f"Bearer {os.environ['FREDDY_SESSION_TOKEN']}"} response = requests.get( "https://api.aitronos.com/v1/streamline/repositories", params=params, headers=headers ) response.raise_for_status() data = response.json() for repo in data["repositories"]: print(f"\n{repo['url']} ({repo['branch']})") print(f" Automations ({repo['automations_count']}):") for automation in repo['automations']: status = "Active" if automation['is_active'] else "Inactive" print(f" • {automation['name']} - {status}") print(f" Executions: {automation['execution_count']}") ``` ```javascript const token = process.env.FREDDY_SESSION_TOKEN; const url = new URL("https://api.aitronos.com/v1/streamline/repositories"); url.searchParams.set("organization_id", "org_xyz789"); url.searchParams.set("include_automations", "true"); const apiKey = process.env.FREDDY_API_KEY; const response = await fetch(url, { headers: { Authorization: `Bearer ${apiKey}` } }); const data = await response.json(); data.repositories.forEach(repo => { console.log(`\n${repo.url} (${repo.branch})`); repo.automations.forEach(auto => { console.log(` • ${auto.name} - ${auto.is_active ? 'Active' : 'Inactive'}`); }); }); ``` Health Check ```bash token="$FREDDY_SESSION_TOKEN" endpoint="https://api.aitronos.com/v1/streamline/repositories" query="organization_id=org_xyz789" curl -s "$endpoint?$query" \ -H "Authorization: Bearer $token" | jq '.repositories[] | {url, branch, last_sync_at, automations_count}' ``` ```python import os import requests from datetime import datetime, timedelta session = os.environ["FREDDY_SESSION_TOKEN"] url = "https://api.aitronos.com/v1/streamline/repositories" response = requests.get( url, headers={"Authorization": f"Bearer {session}"}, params={"organization_id": "org_xyz789"} ) response.raise_for_status() # Check sync status for all repositories for repo in response.json()["repositories"]: if repo['last_sync_at']: print(f"✓ {repo['url']}: Last synced {repo['last_sync_at']}") else: print(f"✗ {repo['url']}: Never synced") ``` ```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" }); const request = https.request( `https://api.aitronos.com/v1/streamline/repositories?${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); console.table(parsed.repositories.map(({ url, branch, automations_count, last_sync_at }) => ({ url, branch, automations_count, last_sync_at }) )); }); } ); request.on("error", console.error); request.end(); ``` **Response:** 200 OK (Basic) ```json { "repositories": [ { "url": "https://github.com/owner/repo1", "branch": "main", "last_sync_at": "2025-11-15T10:30:00Z", "last_commit_sha": "abc123def456", "automations_count": 3, "automations": null }, { "url": "https://github.com/owner/repo2", "branch": "develop", "last_sync_at": "2025-11-15T09:15:00Z", "last_commit_sha": "def456abc123", "automations_count": 1, "automations": null } ], "total_count": 2 } ``` 200 OK (With Automations) ```json { "repositories": [ { "url": "https://github.com/owner/repo1", "branch": "main", "last_sync_at": "2025-11-15T10:30:00Z", "last_commit_sha": "abc123def456", "automations_count": 3, "automations": [ { "id": "auto_abc123", "name": "Data Processing Automation", "is_active": true, "last_executed_at": "2025-11-15T09:00:00Z", "execution_count": 42 }, { "id": "auto_def456", "name": "Report Generator", "is_active": true, "last_executed_at": "2025-11-15T08:30:00Z", "execution_count": 15 }, { "id": "auto_ghi789", "name": "Data Validator", "is_active": false, "last_executed_at": null, "execution_count": 0 } ] } ], "total_count": 1 } ``` 400 Bad Request ```json { "success": false, "error": { "code": "INVALID_QUERY", "message": "organization_id is 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": "ORG_NOT_FOUND", "message": "organization_id org_missing does not exist", "status": 404, "trace_id": "req_c3e4335a" } } ``` 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 - [Get repository automations](/docs/api-reference/streamline/repositories-automations) - [List automations](/docs/api-reference/streamline/automations-list)