All Products
Search
Document Center

AI Coding Assistant Lingma:ListDepartments

Last Updated:Mar 18, 2026

Call this API to query the list of organization departments.

Supported editions

Enterprise Dedicated Edition

Service endpoints

Get the service endpoint and replace {domain} in the API request syntax with your endpoint .

Authorization information

Product

Resource

Required permission

Organization Management

Organization departments

Read-only

Request syntax

GET https://{domain}/oapi/v1/platform/organizations/{organizationId}/departments

Request description

Query the list of organization departments

curl -X 'GET' \
  'https://test-domain-***.rdc.aliyuncs.com/oapi/v1/platform/organizations/9a2b****5ef1/departments' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Query all subdepartments under a specific department

curl -X 'GET' \
  'https://test-domain-***.rdc.aliyuncs.com/oapi/v1/platform/organizations/9a2b****5ef1/departments?parentId=99d1****71d4&page=1&perPage=100' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Request headers (Headers)

x-yunxiao-token string (Required)

The access token. See Access token for details.

Example: pt-0fh3****0fbG_35af****0484.

Request parameters

organizationId string (Required)

The organization ID. You can go to the System Management page in the Organization Management console to obtain the organization ID (organizationId).

parentId string (Optional)

The parent department ID.

page integer (Optional) Default value: 1

The current page.

perPage integer (Optional) Default value: 100

The number of entries per page. Valid values: [1, 100].

Response parameters

Sample response

[
    {
        "creatorId": "99d1****6124",
        "hasSub": true,
        "id": "99d1****6124",
        "name": "Example",
        "organizationId": "99d1****6124",
        "parentId": "99d1****6124"
    }
]

creatorId string

The creator ID.

hasSub boolean

Indicates whether the department has subdepartments.

id string

The department ID.

name string

The department name.

organizationId string

The organization ID.

parentId string

The parent department ID.

Response header

Parameter

Description

Sample value

x-next-page

The next page.

1

x-page

The current page.

2

x-per-page

The number of entries per page.

1

x-prev-page

The previous page.

2

x-total

The total number of entries.

1

x-total-pages

The total number of pages.

10

Error codes

For more information, see Error codes.