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 G Suite 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)

asps.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 OAuth 2.0 Overview.

Type

Enums
TYPE_UNDEFINED
ALL All sub-organizational units.
CHILDREN Immediate children only (default).