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 space to which the API Key of this request belongs.
When creating a paid workspace, it will be bound to the Billing Center account of the space to which the API Key of this request belongs by default.
Body Request Parameters¶
| Parameter Name | 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 style, operation/test/development; (deprecated) Example: Operation Allow empty: False Allow empty string: True |
|
| needCreateAk | boolean | Whether to create a workspace AK Example: True Allow empty: False |
|
| createPayWsVersion | boolean | Set to true to create a paid SaaS workspace and bind it to the source workspace's Billing Center account. If false or omitted, use the site's default workspace version. Ignored under Deployment Plan Example: True Allow empty: False |
|
| akName | string | Workspace AK name Example: True Allow empty: False |
|
| language | string | Workspace language Allow empty: True Allow empty string: True Options: ['zh', 'en'] |
Parameter Additional Notes¶
Data description.*
- Request parameter description
| Parameter Name | Type | Description |
|---|---|---|
| name | string | Name of the new workspace |
| desc | string | Description of the new workspace |
| needCreateAk | boolean | Whether to create an API KEY in the new workspace |
| akName | string | Name of the API KEY |
| createPayWsVersion | boolean | Set to true to create a paid SaaS workspace and bind it to the source workspace's Billing Center account. If false or omitted, use the site's default workspace version. Ignored under Deployment Plan |
- Response parameter description
| Parameter Name | 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 |
Request Example¶
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¶
Response excerpt after the SaaS workspace in the request example is successfully created and bound to the Billing Center: