---
title: "GET /providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments"
method: GET
path: "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments"
tags: ["Departments"]
---

# GET /providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments

`GET /providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments`

## Request

- Base URL: `https://management.azure.com`
- URL: `https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments`
- Auth: OAuth 2
  - Implicit: `https://login.microsoftonline.com/common/oauth2/authorize`
  - Scopes: `user_impersonation`

Lists the departments that a user has access to. The operation is supported only for billing accounts with agreement type Enterprise Agreement.

## Path parameters

- `billingAccountName` string, required

## Query parameters

- `api-version` string, required
- `$expand` string
- `$filter` string

## Response `200`

OK. The request has succeeded.

- DepartmentListResult: The list of departments.
  - `value` Department[]: The list of departments.
    - `id` string: Resource Id.
    - `name` string: Resource name.
    - `type` string: Resource type.
    - `properties` DepartmentProperties: The properties of a department.
      - `departmentName` string: The name of the department.
      - `costCenter` string: The cost center associated with the department.
      - `status` string: The status of the department.
      - `enrollmentAccounts` EnrollmentAccount[]: Associated enrollment accounts. By default this is not populated, unless it's specified in $expand.
        - `id` string: Resource Id.
        - `name` string: Resource name.
        - `type` string: Resource type.
        - `properties` EnrollmentAccountProperties: The properties of an enrollment account.
          - `accountName` string: The name of the enrollment account.
          - `costCenter` string: The cost center associated with the enrollment account.
          - `accountOwner` string: The owner of the enrollment account.
          - `status` string: The status of the enrollment account.
          - `startDate` string, date-time: The start date of the enrollment account.
          - `endDate` string, date-time: The end date of the enrollment account.
          - `department` Department (recursive)
  - `nextLink` string: The link (url) to the next page of results.

## Other responses

- `default`: Error response describing why the operation failed.

---

[API](https://skmtc.dev/azure/apis/billingmanagementclient.md) - [All operations](https://skmtc.dev/azure/apis/billingmanagementclient/llms.txt) - [OpenAPI document](https://skmtc.dev/azure/apis/billingmanagementclient/revisions/481e7355ac16?raw)
