Create¶
POST /api/v1/workspace/create
Overview¶
Create a workspace.
Use an existing workspace API Key to create a new workspace. The owner of the new workspace defaults to the owner of the workspace to which the API Key used in this request belongs.
When creating a paid workspace, the Billing Center account of the workspace to which the API Key used in this request belongs is bound by default.
Body Request Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Y | Name Example: supper_workspace Allow empty: False Max length: 256 |
| desc | string | Description Example: Workspace description Allow empty: True Allow empty string: True |
|
| menuStyle | string | Workspace menu bar style: Operations/Testing/Development; (Removed) Example: Operations Allow empty: False Allow empty string: True |
|
| needCreateAk | boolean | Whether to create a workspace AK Example: True Allow empty: False |
|
| createPayWsVersion | boolean | When set to true, creates a paid SaaS workspace and binds the Billing Center account of the source workspace; when set to false or omitted, uses the default workspace version configured for the site. Has no effect under the Deployment Plan. Example: True Allow empty: False |
|
| akName | string | Workspace AK name Example: My_WS_AK Allow empty: False |
|
| language | string | Workspace language Example: zh Allow empty: True Allow empty string: True Allowed values: ['zh', 'en', 'zh-hant', 'id', 'ja', 'ko'] |
Supplementary Parameter Notes¶
Data description.*
- Request Parameter Description
| Parameter | type | Description |
|---|---|---|
| name | string | The name of the new workspace |
| desc | string | The description of the new workspace |
| needCreateAk | boolean | Whether to create an API KEY in the new workspace |
| akName | string | The name of the API KEY |
| createPayWsVersion | boolean | When set to true, creates a paid SaaS workspace and binds the Billing Center account of the source workspace; when set to false or omitted, uses the default workspace version configured for the site. Has no effect under the Deployment Plan. |
- Response Parameter Description
| Parameter | type | Description |
|---|---|---|
| akInfo | dict | API KEY information of the new workspace |
| ownerInfo | dict | Owner information of the new workspace |
| wsInfo | dict | Workspace-related information |
| versionType | string | Workspace version type |
Example Request¶
curl 'https://openapi.truewatch.com/api/v1/workspace/create' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw '{"name":"ws_create_test","desc":"test","needCreateAk":true,"akName":"test_ak","createPayWsVersion":true}' \
--compressed
--insecure
Response¶
Excerpt of the response after the SaaS workspace in the example request is successfully created and bound to the Billing Center: