Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v2.0/wiki/workspaces |
| HTTP Method | POST |
| Supported app types | appType-Internal app appType-Third-party enterprise app |
| Required permissions | permission-Wiki.Workspace.Write-Knowledge Base write permission |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
| x-acs-dingtalk-access-token | String | Yes | The access credential used to call this API. Obtain it as follows: - For an internal app, call Get the access token of an internal app. - For a third-party enterprise app, call Get the access token of an organization authorized to a third-party app. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| operatorId | String | Yes | The unionId of the operator. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | The Knowledge Base name. |
| option | Object | No | Optional parameters. |
| description | String | No | The Knowledge Base description. |
| teamId | String | No | The Knowledge Group ID. |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| workspace | Object | The Knowledge Base. |
| workspaceId | String | The Knowledge Base ID (spaceUuid). |
| corpId | String | The organization ID that the Knowledge Base belongs to. |
| teamId | String | The ID of the Knowledge Group that the Knowledge Base belongs to. Returns empty if the Knowledge Base does not belong to any Knowledge Group. |
| rootNodeId | String | The root node ID (root dentryUuid). |
| name | String | The Knowledge Base name. |
| type | String | The Knowledge Base type. Enum values: - TEAM: Knowledge Base - PERSONAL: My Docs |
| description | String | The Knowledge Base description. |
| url | String | The URL for accessing the Knowledge Base. |
| icon | Object | The Knowledge Base icon. |
| type | String | The icon type. Enum values: - URL: link - EMOJI: emoji icon |
| value | String | The icon value: - When type is URL, returns the icon link. - When type is EMOJI, returns the Unicode value of the emoji icon. |
| cover | String | The Knowledge Base cover URL. |
| creatorId | String | The userId of the Knowledge Base creator. |
| modifierId | String | The userId of the Knowledge Base modifier. |
| createTime | String | The Knowledge Base created time. |
| modifiedTime | String | The Knowledge Base modified time. |
| permissionRole | String | The permission role of the requester on the Knowledge Base. Enum values: - OWNER: Owner - MANAGER: Manager - EDITOR: Editor - DOWNLOADER: Viewer with download permission - READER: View-only - NONE: No permission |
Response body example
Error codes
If the API call returns an error, refer to the global error codes document to find a solution based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | paramError | %s | Parameter error |
| 400 | paramError.name | %s | Parameter error - name |
| 400 | paramError.description | %s | Parameter error - description |
| 403 | permissionDenied | %s | The current user does not have permission for this action |
| 500 | systemError | %s | Service is busy. Try again later |
| 500 | unknownError | Unknown Error | Unknown error |
| 503 | operationTimeout | %s | Request timed out |