List all departments.

Permission Level: Read

GET /users/department

Operation id: DepartmentService_ListDepartments

Tags: DepartmentService

Parameters

Query parameters

NameTypeRequiredDescription
domainstringNoDomain of the department (example: zpa, reflexis, wfc, etc). Required: false
excludeTenantIdsarrayNoList of tenant IDs to exclude. Required: false
genericFilterstringNoGeneric filter for department fields (name, parent, displayName) If it contains a whitespace, it splits the text and filter by both words. Required: false
includeUsersbooleanNoWhether to include list of users who belong to the department. Required : false
pageSizeinteger (int32)NoItems per page. Required: false
pageTokenstringNoMongo DB Field, describes the encoded page token for page traversal. Required: false
scopestringNoScope of the department. Required: false
sortFieldstringNoSort field valid values: name, parent, displayName, lastUpdated. Default: name. Required: false
sortTypestringNoSort Type for the results. Default: ASC, Required: false
specificFilter.displayNamestringNoOnly non blank
specificFilter.hierarchyNodeSpecificFilter.isHierarchyNodebooleanNo
specificFilter.parentSpecificFilter.parentstringNo
startsWithSingleCharacterbooleanNoAbility to search for a single starts with character, only applicable to specific_filter: display_name. Default: false, Required: false
statusInScopestringNoThe enabled status of the department's scope in this request to search on, Default: enabled, Required: false - ENTITY_ENABLED: Entity is enabled - ENTITY_DISABLED: Entity is disabled - ENTITY_BOTH_ENABLED_DISABLED: Entity either enabled or disabled
tenantIdstringNoTenantId of the Department. Required: false (False as this can be inferred from the token)

Security

  • Authorization (apiKey)
    • Bearer token

Responses

200 — A successful response.

Content type: application/json

default — An unexpected error response.

Content type: application/json

Response models

200 — A successful response.

Content type: application/json

Schema

PropertyTypeRequiredDescription
departmentsarrayNo
nextPageTokenstringNo
{
  "type": "object",
  "properties": {
    "departments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "parent": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "ancestors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "descendants": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "displayName": {
            "type": "string"
          },
          "attributes": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "enabledScopes": {
            "type": "object"
          },
          "creationTime": {
            "type": "string",
            "format": "date-time"
          },
          "domain": {
            "type": "string"
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": "string"
          },
          "expiration": {
            "type": "object"
          },
          "users": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    },
    "nextPageToken": {
      "type": "string"
    }
  }
}

default — An unexpected error response.

Content type: application/json

Schema

PropertyTypeRequiredDescription
codeinteger (int32)No
messagestringNo
detailsarrayNo
{
  "type": "object",
  "properties": {
    "code": {
      "type": "integer",
      "format": "int32"
    },
    "message": {
      "type": "string"
    },
    "details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "@type": {
            "type": "string"
          }
        }
      }
    }
  }
}