Method: orgunits.list

Retrieves a list of all organizational units for an account.

HTTP request

GET https://admin.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
customerId

string

The unique ID for the customer's Google Workspace account. As an account administrator, you can also use the my_customer alias to represent your account's customerId. The customerId is also returned as part of the Users resource.

Query parameters

Parameters
orgUnitPath

string

The full path to the organizational unit or its unique ID. Returns the children of the specified organizational unit.

type

enum (Type)

Whether to return all sub-organizations or just immediate children.

Request body

The request body must be empty.

Response body

If successful, the response body contains data with the following structure:

JSON representation
{
  "kind": string,
  "etag": string,
  "organizationUnits": [
    {
      object (OrgUnit)
    }
  ]
}
Fields
kind

string

The type of the API resource. For Org Unit resources, the type is admin#directory#orgUnits.

etag

string

ETag of the resource.

organizationUnits[]

object (OrgUnit)

A list of organizational unit objects.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://apps-apis.google.com/a/feeds/policies/
  • https://www.googleapis.com/auth/admin.directory.orgunit
  • https://www.googleapis.com/auth/admin.directory.orgunit.readonly

For more information, see the Authorization guide.

Type

Enums
ALL All sub-organizational units.
CHILDREN Immediate children only (default).
ALL_INCLUDING_PARENT All sub-organizational units and the specified organizational unit (root if not specified).