Delete
Permanently deletes a document and all associated data that was created by the v2 parse, extract, or split endpoints. This includes the document record, the uploaded PDF file in storage, and the cached parse results.
POST https://pdf.ai/api/v2/delete
This endpoint only works for documents created via v2 parse, extract, or split endpoints.
Deletion is permanent and cannot be undone.
Sample Code
Below are examples of how to use the delete endpoint with different programming languages.
curl -X POST https://pdf.ai/api/v2/delete \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"docId": "your-document-id"}'import requests
url = "https://pdf.ai/api/v2/delete"
headers = {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {"docId": "your-document-id"}
response = requests.post(url, headers=headers, json=data)
print(response.json())const axios = require('axios');
axios.post('https://pdf.ai/api/v2/delete',
{ docId: 'your-document-id' },
{
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
).then(response => {
console.log(response.data);
});Please replace placeholders like <YOUR_API_Key> with actual values.
Headers
X-API-Key*
string
<API-Key>
Request Format
Content-Type: application/json
Request Parameters
docId
string
Yes
Document ID returned from Parse, Extract, or Split
Response format
{ "error": "Invalid API key" }
Credit Usage
Free - no API credits are charged for delete operations.
Last updated
Was this helpful?