Overview
Deletes a document family from the store using its file system path. This operation removes the document and all its associated content objects and metadata.
Endpoint
DELETE /api/stores/{orgSlug}/{slug}/fs/**
DELETE /api/stores/{orgSlug}/{slug}/{version}/fs/**
Path Parameters
Parameter | Type | Required | Description |
---|
orgSlug | string | Yes | Organization slug |
slug | string | Yes | Store slug |
version | string | No | Store version (uses current version if not specified) |
** | string | Yes | File path within the store |
Query Parameters
Parameter | Type | Required | Description |
---|
path | string | No | Alternative way to specify the path (overrides URL path) |
Example Usage
Delete by URL path
curl -X DELETE "https://platform.kodexa.com/api/stores/my-org/invoices/fs/2024/january/invoice-001.pdf" \
-H "x-api-key: your-api-key-here"
Delete using path parameter
curl -X DELETE "https://platform.kodexa.com/api/stores/my-org/invoices/fs?path=2024/january/invoice-001.pdf" \
-H "x-api-key: your-api-key-here"
Delete from specific version
curl -X DELETE "https://platform.kodexa.com/api/stores/my-org/invoices/v2.0/fs/contracts/contract-001.pdf" \
-H "x-api-key: your-api-key-here"
Using Python SDK
from kodexa import KodexaPlatform
platform = KodexaPlatform(url="https://platform.kodexa.com", api_key="your-api-key")
# Delete a document
success = platform.delete_document_by_path(
org_slug="my-org",
slug="invoices",
path="2024/january/invoice-001.pdf"
)
if success:
print("Document deleted successfully")
else:
print("Delete failed")
Response
Returns a boolean value:
true
- Document was successfully deleted
false
- Delete failed (document not found or other error)
Deletion Behavior
When you delete a document family:
- Document Family - The document family record is removed
- Content Objects - All associated content objects are deleted
- Metadata - All custom metadata is removed
- Data Objects - Extracted data linked to this document is deleted
- Exceptions - Any data exceptions for this document are removed
- History - Audit trail and version history is preserved in system logs
Important Notes
This operation is permanent and cannot be undone. The document and all its content will be deleted from the store.
Best Practices
- Lock Check: Documents that are locked cannot be deleted
- Backup First: Consider exporting the document family before deletion if you might need it later
- Verify Path: Double-check the path to ensure you’re deleting the correct document
- Use Soft Delete: For production systems, consider marking documents as archived rather than deleting
Alternative: Soft Delete
Instead of permanent deletion, you can:
- Move documents to an “archived” folder path
- Add a label like
archived
or deleted
- Set a custom metadata flag
# Soft delete by moving to archive
platform.rename_document(
org_slug="my-org",
slug="invoices",
current_path="invoice-001.pdf",
new_path="archive/2024/invoice-001.pdf"
)
Error Responses
- 404 Not Found: Document family does not exist at the specified path
- 403 Forbidden: Document is locked or insufficient permissions
- 400 Bad Request: Invalid path format