Skip to content

Delete Document

Delete a specific document using the Docstron API. This endpoint allows you to permanently remove a document from your account.

DELETE https://api.docstron.com/v1/documents/{document_id}

This endpoint requires authentication using a Bearer token. Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Path Parameters

ParameterTypeRequiredDescription
document_idstringYesThe unique identifier of the document (e.g., document-49da9cea-b1b9-4216-aa21-7690850d2f4c)
Terminal window
curl --location --request DELETE 'https://api.docstron.com/v1/documents/document-49da9cea-b1b9-4216-aa21-7690850d2f4c' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data ''

200 - Success Response

{
"success": true,
"message": "Document successfully deleted.",
"data": []
}
FieldTypeDescription
successbooleanIndicates if the request was successful
messagestringA message describing the response
dataarrayEmpty array for delete operations

404 - Document Not Found

Returned when the provided document_id does not exist or is invalid.

{
"success": false,
"message": "Document not found.",
"data": []
}

Common causes:

  • Invalid or mistyped document_id
  • Document has already been deleted
  • The document belongs to a different account

Solution: Verify the document_id is correct. Check if the document still exists before attempting deletion.


500 - Internal Server Error

Returned when an unexpected server error occurs while deleting the document.

{
"success": false,
"message": "Failed to delete the document.",
"data": []
}

Common causes:

  • Temporary server issue
  • Database connectivity problem
  • Service maintenance

Solution: Wait a few moments and retry the request. If the problem persists, contact support@docstron.com.

If you have questions about applications or need assistance:

  • 📧 Email: support@docstron.com
  • 💬 Live Chat: Available in your dashboard
  • 📚 Documentation: You’re reading it!