All Products
Search
Document Center

Platform For AI:ListWorkspaces

Last Updated:Oct 29, 2025

Lists the workspaces in a region.

Operation description

You can specify different query options with the options parameter to retrieve information about workspaces.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

paiworkspace:ListWorkspaces

list

*All Resource

*

None None

Request syntax

GET /api/v1/workspaces HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

PageNumber

integer

No

The page number of the workspace list. The value starts from 1. The default value is 1.

1

PageSize

integer

No

The number of entries to return on each page for a paged query. The default value is 20.

20

SortBy

string

No

The field to use for sorting in a paged query. The default value is GmtCreateTime. Valid values:

  • GmtCreateTime (default): Sorts by creation time.

  • GmtModifiedTime: Sorts by modification time.

GmtCreateTime

Order

string

No

The sort order for the specified field in a paged query. Valid values:

  • ASC (default): Ascending order.

  • DESC: Descending order.

ASC

WorkspaceName

string

No

The workspace name.

abc

ModuleList

string

No

A comma-separated list of modules. Default value: PAI.

PAI

Status

string

No

The workspace status. The following values are supported:

  • ENABLED: The workspace is running normally.

  • INITIALIZING: The workspace is being initialized.

  • FAILURE: The workspace failed to be created or updated.

  • DISABLED: The workspace is manually disabled.

  • FROZEN: The workspace is frozen due to an overdue payment.

  • UPDATING: The workspace is being updated.

ENABLED

Option

string

No

The option. Valid values:

  • GetWorkspaces (default): Gets the list of workspaces. The Workspaces parameter is returned.

  • GetResourceLimits: Gets the resource limits. The ResourceLimits parameter is returned.

GetWorkspaces

Verbose

boolean

No

Specifies whether to display the detailed information of the workspace. Valid values:

  • false (default): Does not display the details.

  • true: Displays the details.

true

Fields

string

No

A list of fields to return for workspace details. This limits the workspace properties in the response. Separate multiple properties with commas (,). Currently, only Id is supported, which indicates the workspace ID.

Id

WorkspaceIds

string

No

A list of workspace IDs. Separate multiple workspace IDs with commas (,).

123,234

ResourceGroupId

string

No

The ID of the resource group. For more information about how to view the resource group ID, see View the basic information of a resource group.

rg-acfmwp7rky****

Response elements

Element

Type

Description

Example

object

The response object.

RequestId

string

The request ID.

8D7B2E70-F770-505B-A672-09F1D8F2EC1E

Workspaces

array<object>

The list of workspace details. This list is returned when Option is set to GetWorkspaces.

array<object>

The workspace details.

WorkspaceId

string

The workspace ID.

123

WorkspaceName

string

The workspace name.

workspace-example

GmtCreateTime

string

The time when the workspace was created. The time follows the ISO 8601 standard and is in the yyyy-MM-ddTHH:mm:ss.SSSZ format. The time is displayed in UTC.

2021-01-21T17:12:35.232Z

GmtModifiedTime

string

The time when the workspace was last modified. The time follows the ISO 8601 standard and is in the yyyy-MM-ddTHH:mmZ format. The time is displayed in UTC.

2021-01-21T17:12:35.232Z

Description

string

The workspace description.

workspace description example

Creator

string

The user ID of the creator.

122424353535

EnvTypes

array

The list of environments in the workspace.

string

The environment in the workspace. The environments depend on the workspace mode:

  • A workspace in basic mode has only the production environment (prod).

  • A workspace in standard mode has both a development environment (dev) and a production environment (prod).

prod

Status

string

The workspace status.

ENABLED

AdminNames

array

The list of administrator account names.

string

The administrator account name.

demo_test@***.aliyunid.com

IsDefault

boolean

Indicates whether the workspace is the default workspace.

false

ExtraInfos

object

Additional information. This currently includes TenantId, which indicates the tenant ID.

{"TenantId": "4286******98"}

resourceGroupId

string

The resource group ID.

rg-acfmwp7rky****

TotalCount

integer

The total number of workspaces that meet the query conditions.

1

ResourceLimits

object

The types and quantity limits of resources that a user can activate in a workspace. This list is returned when Option is set to GetResourceLimits. The following resource types are supported:

  • MaxCompute_share: pay-as-you-go MaxCompute.

  • MaxCompute_isolate: subscription MaxCompute.

  • DLC_share: pay-as-you-go DLC.

  • PAI_isolate: subscription PAI.

  • PAI_share: pay-as-you-go PAI.

  • DataWorks_isolate: subscription DataWorks.

  • DataWorks_share: pay-as-you-go DataWorks.

{ "MaxCompute_share": 1, "MaxCompute_isolate": 1, "DLC_share": 1 }

Examples

Success response

JSON format

{
  "RequestId": "8D7B2E70-F770-505B-A672-09F1D8F2EC1E",
  "Workspaces": [
    {
      "WorkspaceId": "123",
      "WorkspaceName": "workspace-example",
      "GmtCreateTime": "2021-01-21T17:12:35.232Z",
      "GmtModifiedTime": "2021-01-21T17:12:35.232Z",
      "Description": "workspace description example",
      "Creator": "122424353535",
      "EnvTypes": [
        "prod"
      ],
      "Status": "ENABLED",
      "AdminNames": [
        "demo_test@***.aliyunid.com"
      ],
      "IsDefault": false,
      "ExtraInfos": {
        "TenantId": "4286******98"
      },
      "resourceGroupId": "rg-acfmwp7rky****"
    }
  ],
  "TotalCount": 1,
  "ResourceLimits": {
    "MaxCompute_share": 1,
    "MaxCompute_isolate": 1,
    "DLC_share": 1
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.