ListOrganizations - Query organizations

Updated at:

Use OpenAPI to query a list of organizations.

Applicable editions

Central edition

Endpoint and authorization information

  • Get an endpoint. Replace {domain} in the request syntax.

  • Get a personal access token.

  • Obtain the organizationId: Required only for the Central edition. Go to the Basic Information page in the Organization Management console to retrieve the organization ID.

Product

Resource

Required permission

Organization Management

Organization

Read-only

Request syntax

Central edition

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

Request headers

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

Personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Location

Required

Description

Example value

userId

string

query

No

The user ID. For the Standard Edition, this parameter is ignored and the API returns the organizations that the user associated with the personal access token has joined. For the Exclusive Edition, if this parameter is empty, all organizations are returned. If a user ID is specified, the organizations that the specified user has joined are returned.

Request example

curl -X 'GET' \
  'https://{domain}/oapi/v1/platform/organizations?userId={userId}&page={page}&perPage={perPage}' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example value

-

array

-

object

createdAt

string

Creation time.

2023-08-31T03:59:16.201Z

creatorId

string

Organization creator

99d1****6124

defaultRole

string

The default role.

99d1****6124

description

string

The description of the organization.

Example description

id

string

The organization ID.

99d1****6124

name

string

The name of the organization.

Example name

updateAt

string

The time when the organization was last updated.

2023-08-31T03:59:16.201Z

Response example

[
    {
        "createdAt": "2023-08-31T03:59:16.201Z",
        "creatorId": "99d1****6124",
        "defaultRole": "99d1****6124",
        "description": "Example description",
        "id": "99d1****6124",
        "name": "Example name",
        "updateAt": "2023-08-31T03:59:16.201Z"
    }
]

Response headers

Parameter

Description

Example value

x-next-page

Next Page

2

x-page

Current page.

1

x-per-page

The number of entries on each page.

100

x-prev-page

Previous

1

x-total

Total data volume

2

x-total-pages

The total number of pages.

1

Error codes

For more information about API error codes, see Error Code Center.