# Delete a document

This API is used to delete a specified document from Docs based on a docToken.

**Notice**：This API has been upgraded to enhance its security. We recommend that you migrate to the [new version](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/delete) as soon as possible.

**Notice**：A document can be deleted only by the owner of the document. Once deleted, the document is moved to Trash.
This API doesn't support concurrent calls, and supports up to 5 queries per second (QPS).

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/drive/explorer/v2/file/docs/:docToken
HTTP Method | DELETE
Required scopes<br>**The scopes required to call this API. You can call the API with any of the scopes.**<br>Enable any scope from the list | View, comment, edit, and manage all files in My Space<br>View, comment, edit, and manage Docs

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `tenant_access_token`<br>or<br>`user_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer u-7f1bcd13fc57d46bac21793a18e560"<br>[Learn more about how to access and use access_token](https://open.feishu.cn/document/ukTMukTMukTM/uMTNz4yM1MjLzUzM)

Before using the `tenant_access_token`, make sure that the app is the owner of the document. Otherwise, an error indicating no permissions will occur.

<br>

### Path parameters

Parameter | Type | Description
---|---|---
docToken | string | Token of the document. For more information about how to obtain the token, see [Overview](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/files/guide/introduction).

## Response
### Response body
|Parameter|Description|
|--|--|
|id|Document ID, which is a "string"|
|result|Deletion result|

### Response body example
```json
{
    "code":0,
    "msg":"Success",
    "data":
    {
        "id":"id string",
        "result":true
    }
}
```
### Error code

Error code | Description | Troubleshooting suggestions
---|---|---
91201 | FAILED | Failed to process, try again later.
91202 | PARAMERR | parameter error, check whether the parameters are correct, such as: `type`, `fileToken`, `dstFolderToken`.
91203 | NOTEXIST | Please check whether the request parameters are correct, such as: `type` and `fileToken` match.
91204 | FORBIDDEN | Check the permissions of the current account to documents and folders. Refer to [Access Process Authorization](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/docs-overview#6d744fe3)
91205 | DELETED | The source file has been deleted, check if it still exists.
91206 | OUT_OF_LIMIT | Limit exceeded.
91207 | DUPLICATE | Duplicate record.
91208 | REVIEW | Content review failed.

For details, refer to [Server-side error codes](https://open.feishu.cn/document/ukTMukTMukTM/ugjM14COyUjL4ITN).

