# Delete document

{% delete /%}
{% path text="/v1/document/delete" /%}

Delete the specific document, and it will be moved to the trash. After 30 days, the document will be permanently deleted from the BoldSign Application.

## Code snippet

{% codetab %}

cURL

```shell 
curl -X 'DELETE' \ 'https://api.boldsign.com/v1/document/delete?documentId=documentId&deletePermanently=false' \
     -H 'X-API-KEY: {your API key}' 
```

C#

```csharp
var apiClient = new ApiClient("https://api.boldsign.com", "Your_API_Key");

var documentClient = new DocumentClient(apiClient);
documentClient.DeleteDocument("YOUR_DOCUMENT_ID");
```

Python

```python
import boldsign

configuration = boldsign.Configuration(host = "https://api.boldsign.com", api_key="YOUR_API_KEY")

with boldsign.ApiClient(configuration) as api_client:

    document_api = boldsign.DocumentApi(api_client)
    document_api.delete_document(document_id="YOUR_DOCUMENT_ID")
```

PHP

```php
<?php require_once "vendor/autoload.php";

use BoldSign\Configuration;
use BoldSign\Api\DocumentApi;

$config = new Configuration();
$config->setHost('https://api.boldsign.com');
$config->setApiKey('YOUR_API_KEY');

$document_api = new DocumentApi($config);
$document_api->deleteDocument($document_id = 'YOUR_DOCUMENT_ID');
```

Java

```java
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("https://api.boldsign.com");
client.setApiKey("YOUR_API_KEY");
        
DocumentApi documentApi = new DocumentApi(client);
documentApi.deleteDocument("YOUR_DOCUMENT_ID", null);
```

NodeJS

```js
import { DocumentApi } from "boldsign";

const documentApi = new DocumentApi("https://api.boldsign.com");
documentApi.setApiKey("YOUR_API_KEY");

documentApi.deleteDocument("YOUR_DOCUMENT_ID");
```

{% /codetab %}

## Query parameters

{% nestedtable %}

- {% arguments name="documentId" /%}{% batch datatype="string" /%}{% required /%}
- The ID of an existing document.

---

- {% arguments name="deletePermanently" /%}{% batch datatype="boolean" /%}
- To permanently delete the document, you need to set this parameter to true. By default, the document is moved to the Trash, and the default value for this parameter is false.

{% /nestedtable %}

## Example responses

***204 No Content***
