Merged in feature/add-deletes (pull request #214)
support delete for client, document and folder * support delete for client, document and folder * remove batch cancel conflict not used Approved-by: Jacob Mathison
This commit is contained in:
@@ -13,18 +13,18 @@ This document provides a comprehensive summary of all REST API endpoints availab
|
||||
| /identity | GET | AuthService |
|
||||
| /client | POST | ClientService |
|
||||
| /clients | GET | ClientService |
|
||||
| /client/{id} | GET, PATCH | ClientService |
|
||||
| /client/{id} | GET, PATCH, DELETE | ClientService |
|
||||
| /client/{id}/status | GET | ClientService |
|
||||
| /client/{id}/collector | GET, PATCH | CollectorService |
|
||||
| /client/{id}/folders | GET | FolderService |
|
||||
| /folders | POST | FolderService |
|
||||
| /folders/{folderId} | PATCH | FolderService |
|
||||
| /folders/{folderId} | PATCH, DELETE | FolderService |
|
||||
| /folders/{folderId}/documents | GET | FolderService |
|
||||
| /folders/{folderId}/metrics | GET | FolderService |
|
||||
| /client/{id}/document | GET, POST | DocumentsService |
|
||||
| /client/{id}/document/batch | GET, POST | DocumentsService |
|
||||
| /client/{id}/document/batch/{batch_id} | GET, DELETE | DocumentsService |
|
||||
| /document/{id} | GET | DocumentsService |
|
||||
| /client/{id}/document/batch/{batch_id} | GET | DocumentsService |
|
||||
| /document/{id} | GET, DELETE | DocumentsService |
|
||||
| /documents/{documentId}/labels | GET, POST | LabelService |
|
||||
| /labels/{labelName}/documents | GET | LabelService |
|
||||
| /field-extractions | GET, POST | FieldExtractionService |
|
||||
@@ -90,6 +90,14 @@ This document provides a comprehensive summary of all REST API endpoints availab
|
||||
- Request Body: `{name?, can_sync?}` (optional fields)
|
||||
- Returns: 200 OK on success
|
||||
|
||||
- **DELETE /client/{id}** - Hard-delete a client and all associated data (super_admin only)
|
||||
- Query Parameters:
|
||||
- `confirm=true` (required) - Must be set to confirm deletion
|
||||
- `verbose` (optional, default: false) - When true, returns S3 paths of orphaned source documents
|
||||
- Deletes all documents, folders, collector configs, batch uploads, and clientCanSync records
|
||||
- S3 source files are NOT deleted; their paths are logged
|
||||
- Returns: 204 No Content (or 200 with S3 paths when verbose=true)
|
||||
|
||||
- **GET /client/{id}/status** - Retrieve the sync status for a client
|
||||
- Returns: `{status}` where status is one of: `IN_SYNC`, `NOT_SYNCED`, `NOT_SYNCING`
|
||||
|
||||
@@ -120,6 +128,15 @@ This document provides a comprehensive summary of all REST API endpoints availab
|
||||
- Request Body: `{path}`
|
||||
- Returns: `{id, client_id, path, parent_id}` (200 OK)
|
||||
|
||||
- **DELETE /folders/{folderId}** - Hard-delete a folder tree (super_admin only)
|
||||
- Query Parameters:
|
||||
- `include_documents` (optional, default: false) - When true, also deletes all documents in the folder tree
|
||||
- `verbose` (optional, default: false) - When true, returns S3 paths of orphaned source documents
|
||||
- Root folder (`/`) cannot be deleted (returns 409 Conflict)
|
||||
- If folder tree contains documents and include_documents is false, returns 409 Conflict
|
||||
- S3 source files are NOT deleted; their paths are logged
|
||||
- Returns: 204 No Content (or 200 with S3 paths when verbose=true)
|
||||
|
||||
- **GET /folders/{folderId}/documents** - Get documents in a folder
|
||||
- Query Parameters:
|
||||
- `textRecord` (optional, default: false) - When true, includes full text extraction record
|
||||
@@ -146,6 +163,13 @@ This document provides a comprehensive summary of all REST API endpoints availab
|
||||
- `textRecord` (optional, default: false) - When true, includes full text extraction record
|
||||
- Returns: `{id, client_id, hash, folder_id, filename, labels[], fields{}, text_record?}`
|
||||
|
||||
- **DELETE /document/{id}** - Hard-delete a document and all dependent data (super_admin only)
|
||||
- Query Parameters:
|
||||
- `verbose` (optional, default: false) - When true, returns S3 paths of orphaned source documents
|
||||
- Deletes all dependent rows: entries, cleans, text extractions, field extractions, labels, results
|
||||
- S3 source files are NOT deleted; their paths are logged
|
||||
- Returns: 204 No Content (or 200 with S3 paths when verbose=true)
|
||||
|
||||
### Batch Document Processing
|
||||
- **POST /client/{id}/document/batch** - Upload multiple PDFs as ZIP archive for batch processing
|
||||
- Content-Type: `multipart/form-data`
|
||||
@@ -162,9 +186,6 @@ This document provides a comprehensive summary of all REST API endpoints availab
|
||||
- **GET /client/{id}/document/batch/{batch_id}** - Get detailed status of a specific batch upload
|
||||
- Returns: `{batch_id, client_id, original_filename, status, total_documents, processed_documents, failed_documents, invalid_type_documents, progress_percent, created_at, completed_at?, failed_filenames[]}`
|
||||
|
||||
- **DELETE /client/{id}/document/batch/{batch_id}** - Cancel a batch upload currently processing
|
||||
- Returns: 204 No Content on successful cancellation
|
||||
|
||||
## Label Service
|
||||
|
||||
### Document Label Management
|
||||
|
||||
Reference in New Issue
Block a user