# List departments div strong 🔨 In Development — This section is still being developed and may change. Retrieve a list of departments within an organization. Only returns departments that belong to the authenticated user's organization. #### Path Parameters **`organization_id`** string required The organization ID. #### Query Parameters **`include_inactive`** boolean optional · Defaults to `false` Whether to include inactive departments in the response. ## Returns An array of [Department](/docs/api-reference/organizations/departments/department-object) objects. ```bash curl https://api.freddy.aitronos.com/v1/organizations/ORG_797C4DDB256A300C/departments \ -H "Authorization: Bearer $FREDDY_API_KEY" ``` ```python import requests response = requests.get( f"https://api.freddy.aitronos.com/v1/organizations/{organization_id}/departments", headers={"Authorization": f"Bearer {api_key}"} ) departments = response.json() print(f"Found {len(departments)} departments") for dept in departments: print(f"- {dept['name']}: {dept['description'] or 'No description'}") ``` ```javascript const response = await fetch(`https://api.freddy.aitronos.com/v1/organizations/${organizationId}/departments`, { headers: { 'Authorization': `Bearer ${apiKey}` } }); const departments = await response.json(); console.log(`Found ${departments.length} departments`); departments.forEach(dept => { console.log(`- ${dept.name}: ${dept.description || 'No description'}`); }); ``` ## Response ```json [ { "id": "dep_eng_abc123456", "name": "Engineering", "description": "Software development and technical teams", "organization_id": "ORG_797C4DDB256A300C", "created_by": null, "is_active": true, "is_default": true, "color": "#2196F3", "created_at": "2025-01-10T09:00:00Z", "updated_at": "2025-01-10T09:00:00Z", "is_deleted": false }, { "id": "dep_ds_xyz789012", "name": "Data Science", "description": "Machine learning and data analytics team", "organization_id": "ORG_797C4DDB256A300C", "created_by": "uid_admin_user_123", "is_active": true, "is_default": false, "color": "#9C27B0", "created_at": "2025-01-12T14:30:00Z", "updated_at": "2025-01-15T10:20:00Z", "is_deleted": false }, { "id": "dep_sales_def456789", "name": "Sales", "description": "Sales and business development teams", "organization_id": "ORG_797C4DDB256A300C", "created_by": null, "is_active": true, "is_default": true, "color": "#4CAF50", "created_at": "2025-01-10T09:00:00Z", "updated_at": "2025-01-10T09:00:00Z", "is_deleted": false } ] ```