Delete Document
Permanently deletes a specific document associated with a customer.
Permanently deletes a specific document associated with a customer. This operation removes both the document metadata and the actual file content from storage. Use with caution as deleted documents cannot be recovered.
Endpoint
DELETE/v2/customer/{customerId}/file/{id}
Link
Request
Path Parameters
Parameter
Type
Description
Required
Example
customerId
string
Customer ID that owns the document.
Yes
"cust_12345"
id
string
Document unique ID to delete.
Yes
"doc_abc123"
Headers
Key
Value
Required
Authorization
123
Yes
Accept
application/json
Yes
Response (200 OK)
Returns a success confirmation message indicating the document was successfully deleted.
Response Fields
Field
Type
Description
Example
success
boolean
Operation success status.
true
message
string
Descriptive success message.
"Document deleted successfully"
Example Response:
json
Examples
Request
bash
Successful Deletion Example
Request:
bash
Response:
json
Programming Language Examples
Python Delete Example
python
JavaScript/Node.js Delete Example
javascript
Java Delete Example
java
PHP Delete Example
php
Common Delete Scenarios
1. Delete Rejected Document
Scenario: Remove a document that was rejected during verification to allow re-upload.
Request:
bash
Response:
json
2. Delete Temporary Document
Scenario: Remove a temporary or test document that is no longer needed.
Request:
bash
Response:
json
3. Bulk Delete Script
Python script for deleting multiple documents:
python
Error Responses
Document Not Found:
json
Customer Not Found:
json
Unauthorized:
json
Access Denied:
json
Document Locked:
json
Notes
Permanent Deletion: Deleted documents cannot be recovered
Locked Documents: Documents with
isLock: truecannot be deletedApproved Documents: Consider implications before deleting approved documents
Audit Trail: Deletion may be logged for compliance purposes
Permissions: Ensure proper authorization before deletion
Restrictions:
❌ Cannot delete locked documents (
isLock: true)❌ Cannot delete documents that are part of active verification processes
❌ Cannot delete documents referenced in pending transactions
✅ Can delete documents with status:
SUBMITTED,REJECTED,CHANGES_REQUESTED✅ Can delete
APPROVEDdocuments (with caution)
Best Practices:
Verify Before Delete: Always check document status and metadata before deletion
User Confirmation: Implement confirmation dialogs in user interfaces
Error Handling: Handle all possible error responses gracefully
Logging: Log deletion operations for audit purposes
Backup Consideration: Ensure important documents are backed up if needed
Pre-deletion Checklist:
Confirm document is not locked
Verify document is not required for active processes
Check if document needs to be archived instead of deleted
Ensure proper user authorization
Consider compliance and retention requirements
Last updated

