Updated on 2025-08-20 GMT+08:00

Modifying a Workspace

Function

This API is used to modify a workspace.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

PUT /v1/{project_id}/workspaces/{workspace_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID and Name.

workspace_id

Yes

String

Workspace ID For details about how to obtain the value, see Querying the Workspace List. If no workspace is created, the default value is 0. If a workspace is created and used, the actual value prevails.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API that is used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

grants

No

Array of grants objects

Dataset of a training job. This parameter cannot be used with data_url, dataset_id, or dataset_version_id.

auth_type

No

String

Authorization type. The value can be PUBLIC, PRIVATE, or INTERNAL. The default value is PUBLIC.

  • PUBLIC: accessible to tenants

  • PRIVATE: accessible only to the creator and primary account

  • INTERNAL: accessible to the creator, primary account, and specified IAM users. This parameter must be used together with grants.

name

No

String

Workspace name The value contains 4 to 64 characters, including uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). In addition, default is the default workspace name reserved by the system. You cannot create a workspace named default.

description

No

String

Workspace description. By default, this parameter is left blank. Enter 0 to 256 characters.

Table 4 grants

Parameter

Mandatory

Type

Description

user_id

No

String

IAM user ID. Either this parameter or user_name must be configured. If both of them are available, user_id will be used preferentially.

user_name

No

String

IAM username. Either this parameter or user_id must be set.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

workspace_id

String

Workspace ID

Example Requests

PUT https://{endpoint}/v1/{project_id}/workspaces/ccd05d1a553b4e188ea878e7dcb85e47

{
  "name" : "my_workspace",
  "description" : "It is my workspace",
  "auth_type" : "INTERNAL",
  "grants" : [ {
    "user_name" : "my_iam_user"
  } ]
}

Example Responses

Status code: 200

Response parameter indicating that a workspace is modified

{
  "workspace_id" : "***05d1a553b4e188ea878e7dcb85***"
}

Status Codes

Status Code

Description

200

Response parameter indicating that a workspace is modified

Error Codes

See Error Codes.