Skip to main content

Delete Parser Result

This endpoint allows you to delete a parsing result and all associated data and files. This action cannot be undone, so use it with caution.

API Endpoint#

DELETE https://api.documentpro.ai/files

Query Parameters#

  • request_id (required): The unique identifier of the parsing job you want to delete.

Headers#

  • x-api-key (required): Your API key for authentication.

Example Implementation#

Using Python#

import requests
api_key = 'YOUR_API_KEY'request_id = 'YOUR_REQUEST_ID'
url = "https://api.documentpro.ai/files"
headers = {  'x-api-key': api_key}
params = {  'request_id': request_id}
response = requests.delete(url, headers=headers, params=params)
if response.status_code == 200:    print('Result deleted successfully')    print(response.json())else:    print('Failed to delete result')    print(response.text)

Response#

Successful Response (Status Code: 200)#

{    "success": true,    "message": "File deleted successfully"}

Error Response (Status Codes: 400, 401, 403, 404, 500)#

{    "success": false,    "error": "error_code",    "message": "descriptive error message"}

Response Fields Explained#

  • success: Boolean indicating whether the operation was successful.
  • message: A descriptive message about the result of the operation (for successful deletions).
  • error: An error code (for failed deletions).
  • message: A descriptive error message (for failed deletions).

Important Notes#

  1. Deleting a result is irreversible. All associated data and files will be permanently removed.
  2. Make sure you have the correct request_id before performing a deletion.
  3. If the specified request_id doesn't exist, you'll receive a 404 error.
  4. After successful deletion, any attempts to retrieve or manipulate the deleted result will fail.

Possible Error Scenarios#

  • 400 Bad Request: If the request is malformed or missing required parameters.
  • 401 Unauthorized: If the API key is invalid or missing.
  • 403 Forbidden: If the API key doesn't have permission to delete the specified result.
  • 404 Not Found: If the specified request_id doesn't exist.
  • 500 Internal Server Error: If there's a server-side issue preventing the deletion.