Updated on 2025-02-25 GMT+08:00

Creating a Workspace

Function

This API is used to create a workspace.

URI

POST /v1/{project_id}/instances/{instance_id}/workspaces

Table 1 URI parameters

Parameter

Mandatory

Type

Description

instance_id

Yes

String

Instance ID.

project_id

Yes

String

Project ID. For how to obtain a project ID, see Obtaining a Project ID.

Request Parameters

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

Obtain a user token by calling IAM's API. X-Subject-Token in the response header is the desired user token. For how to obtain a token, see Authentication.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

configs

No

Map<String,String>

Workspace attribute configuration.

  • If default_dataset_permission is set to 1, all dataset data can be viewed when row-level permissions are not enabled. When set to 0, no dataset data can be viewed when row-level permissions are not enabled.

name

Yes

String

Workspace name.

description

No

String

Workspace description.

eps_id

Yes

String

ID of the enterprise project the workspace belongs to.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

configs

Map<String,String>

Workspace attribute configuration.

  • If default_dataset_permission is set to 1, all dataset data can be viewed when row-level permissions are not enabled. When set to 0, no dataset data can be viewed when row-level permissions are not enabled.

create_time

Long

Creation time.

create_user

String

Creator.

description

String

Workspace description.

domain_id

String

ID of the account the workspace belongs to.

eps_id

String

ID of the enterprise project the workspace belongs to.

id

String

Workspace ID.

instance_id

String

Instance ID.

is_default

Integer

Whether the workspace is the default one.

The value can be 0 or 1.

name

String

Workspace name.

owner_name

String

Workspace owner name.

project_id

String

ID of the project the workspace belongs to.

update_time

Long

Time when workspace details were updated.

update_user

String

Owner who has updated workspace details.

Example Request

Create a workspace under a project.

/v1/{project_id}/instances/{instance_id}/workspaces
{
  "configs" : {
    "mode" : "0",
    "field_show_type" : "0",
    "only_admin_create_datasource" : "0",
    "works_authorized" : "0",
    "works_public" : "1",
    "works_view" : "0"
  },
  "name": "Test name",
  "description": "This is a test description.",
  "eps_id" : "0"
}

Example Response

{
  "configs" : { 
     "mode" : "0", 
     "field_show_type" : "0", 
     "only_admin_create_datasource" : "0", 
     "works_authorized" : "0", 
     "works_public" : "1", 
     "works_view" : "0" 
   }
,
  "create_time" : 1676984980510,
  "create_user" : "xxxxxx",
  "description" : "Description workspace information",
  "domain_id" : "xxxxxxx",
  "eps_id" : "xxxxxxxxxx",
  "id" : "xxxxxxxxxxxxx",
  "instance_id" : "xxxx7d17c41c414dabaa08f47c7dxxxx",
  "is_default" : 1,
  "name" : "Example workspace name",
  "owner_name" : "xxxxxx",
  "project_id" : "xxxxxxxb4dac4055888643b3xxxxxx",
  "update_time" : 1687167926377,
  "update_user" : "xxxxxxxx"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.