For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

  1. Document Not Found:

    json

  2. Customer Not Found:

    json

  3. Unauthorized:

    json

  4. Access Denied:

    json

  5. Document Locked:

    json


Notes

  • Permanent Deletion: Deleted documents cannot be recovered

  • Locked Documents: Documents with isLock: true cannot be deleted

  • Approved 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 APPROVED documents (with caution)

Best Practices:

  1. Verify Before Delete: Always check document status and metadata before deletion

  2. User Confirmation: Implement confirmation dialogs in user interfaces

  3. Error Handling: Handle all possible error responses gracefully

  4. Logging: Log deletion operations for audit purposes

  5. 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