Skip to main content

Delete User Document API

Overview

Delete/remove a specific user document by its document ID. This API permanently removes the document record from the system.

API Details

Endpoint

DELETE https://api.gafapay.com:8443/gafapay/v3/user/user_document/{id}

Path Parameters

  • id (String, required): The unique identifier of the document to delete
    • Example: 3e14e8ea518b4d64a9970c9b35723173

Headers

authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIyNDc3N2I5ZDA3MmY0OWJiOGQzNjY0MjE2Mjg4MDVkMCIsInJvbGVzIjpbIlJPTEVfQUdFTlQiXSwiZXhwIjoxNzU3NTI1MjQxfQ.KlzfPocW-sPvxprUqwwiX5laJkQO-a4MAfrZo-1XqgA
companyid: 59388167894b4d10a04fe5da3b8a2104
requestid: b35d332f-131e-44c1-892f-8322e022da74
Content-Type: application/json

Response

{
"success": 1,
"error": [],
"data": {
"message": "USER_REMOVE_DOCUMENTS_SUCCESSFULLY"
}
}

Response Fields

  • success (integer): Response status indicator
    • 1 = Success
    • 0 = Failure
  • error (array): Array of error messages (empty on success)
  • data (object): Response data object
    • message (string): Success message

Example Usage

Basic Document Deletion

curl --location --request DELETE 'https://api.gafapay.com:8443/gafapay/v3/user/user_document/3e14e8ea518b4d64a9970c9b35723173' \
--header 'authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIyNDc3N2I5ZDA3MmY0OWJiOGQzNjY0MjE2Mjg4MDVkMCIsInJvbGVzIjpbIlJPTEVfQUdFTlQiXSwiZXhwIjoxNzU3NTI1MjQxfQ.KlzfPocW-sPvxprUqwwiX5laJkQO-a4MAfrZo-1XqgA' \
--header 'companyid: 59388167894b4d10a04fe5da3b8a2104' \
--header 'requestid: b35d332f-131e-44c1-892f-8322e022da74' \
--header 'Content-Type: application/json'

Important Considerations

1. Permanent Deletion

  • This operation permanently removes the document record from the database
  • The action cannot be undone
  • Consider archiving instead of deleting if data retention is required

2. S3 File Cleanup

  • This API only removes the document record from the database
  • S3 files are NOT automatically deleted
  • You may need to implement separate cleanup processes for S3 files

3. KYC Impact

  • Deleting documents may affect ongoing KYC verification processes
  • Ensure proper workflow management before deletion

4. Audit Trail

  • Document deletion is logged in the system
  • Consider implementing soft delete for audit purposes

Process Flow

  1. Validate Document ID: Ensure the document ID is valid and exists
  2. Check Permissions: Verify user has permission to delete the document
  3. Delete Record: Remove document record from database
  4. Log Action: Record deletion action in audit logs
  5. Return Response: Confirm successful deletion

Notes

  • Permanent Action: Document deletion is permanent and cannot be undone
  • S3 Files: S3 files are not automatically deleted - implement separate cleanup
  • Authentication: Requires valid authorization token and company ID