Updated on 2026-04-03 GMT+08:00

Querying an Account Organization

Function

This API is used to query an account organization.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.

URI

GET /v5/setting/account/organization-tree

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

Definition

Enterprise project ID, which is used to filter assets in different enterprise projects. For details, see Obtaining an Enterprise Project ID.

To query assets in all enterprise projects, set this parameter to all_granted_eps.

Constraints

You need to set this parameter only after the enterprise project function is enabled.

Range

The value can contain 1 to 256 characters.

Default Value

0: default enterprise project.

is_refresh

No

Boolean

Definition

Whether to ignore the local cache and forcibly synchronize the latest organization tree information from the organization service.

Constraints

No restrictions. You can choose whether to forcibly synchronize information as required.

Range

true (forcible synchronization), false (The local cache is used. This is the default value.)

Default Value

false

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Security-Token

No

String

Definition

Specifies the security token (session token) of your temporary security credentials. If a temporary security credential is used, this header is required.

Constraints

N/A

Range

The value contains 1 to 2,048 characters.

Default Value

N/A

X-Auth-Token

Yes

String

Definition

User token, which contains user identity and permissions. The token can be used for identity authentication when an API is called. For details about how to obtain the token, see Obtaining a User Token.

Constraints

N/A

Range

The value can contain 1 to 32,768 characters.

Default Value

N/A

region

No

String

Definition

Region ID, which is used to query assets in the required region. For details about how to obtain a region ID, see Obtaining a Region ID.

Constraints

N/A

Range

The value can contain 1 to 128 characters.

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response header parameters

Parameter

Type

Description

X-request-id

String

Request ID used for task tracing. The value format is request_uuid-timestamp-hostname.

Table 4 Response body parameters

Parameter

Type

Description

total_num

Integer

Definition

Total number.

Range

The value range is 0 to 2,147,483,647.

data_list

Array of OrganizationNodeResponseInfo objects

Definition

The list of details about the queried organization tree nodes.

Range

The length of the array ranges from 0 to the default value of limit of the current query. (Generally, the default value is 10. If it is specified, the default platform rule will be applied). The array elements are OrganizationNodeResponseInfo objects.

Table 5 OrganizationNodeResponseInfo

Parameter

Type

Description

parent_id

String

Definition

Unique ID of the parent node of the current organization node, which is used to identify the hierarchy of the organization tree. (The parent ID of the root node is usually 0 or null).

Range

The value is a string of 1 to 64 characters and must comply with the naming rule of the platform organization node ID.

id

String

Definition

Unique ID of an organization tree node, which uniquely identifies an organization node.

Range

The value is a string of 1 to 64 characters and complies with the naming rules of the platform organization node ID (for example, UUID or numbers).

urn

String

Definition

URN of an organization node, which uniquely identifies an organization resource across services.

Range

A string that complies with the naming rules of the platform URN, containing 1 to 256 characters. The format is organizations::{management_account_id}:xxxxx:{org_id}/xxxxxxxx.

name

String

Definition

Name of an organization node (which may be the name of an organization unit or account corresponding to org_type).

Range

The value can contain 1 to 64 characters, including letters, numbers, hyphens (-), and underscores (_). It cannot start or end with a special character.

org_type

String

Definition

Type of the node (OU or account).

Range

unit (OU), account (account)

delegated

Boolean

Definition

Whether the authorization of an organization node (OU or account) is complete.

Range

true (authorized, no need to be authorized again) or false (unauthorized, need to be authorized before being used)

Example Requests

Query all account organizations in the root directory. Organization information is not forcibly synchronized from the organization.

GET https://{endpoint}/v5/setting/account/organization-tree?is_refresh=false&parent_id=root&enterprise_project_id=all_granted_eps

Example Responses

Status code: 200

Request succeeded.

{
  "data_list" : [ {
    "parent_id" : "r-32rp34usb1n12d2sdk2cv2w7igod0lud",
    "id" : "6a321faa6e6c4a18b5bf19dd954377b5",
    "urn" : "organizations:6e5b687e10224a18af014e5d81bf9b3c:account:o-jbg8sokerqszi0zdo6vvaulwdsenonxz/6a321faa6e6c4a18b5bf19dd954377b5",
    "name" : "scc_test",
    "org_type" : "account",
    "delegated" : true
  } ],
  "total_num" : 1
}

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.