Delete RFP Document
Unique identifier for the proposal
Name of the file to delete
Indicates if deletion was successful
Confirmation message
What Gets Deleted
- S3 File:
{proposal_code}/documents/rfp/{filename} - DynamoDB Metadata:
- Removes file from
uploaded_files.rfp-documentarray - Clears RFP analysis data:
rfp_analysisanalysis_status_rfprfp_analysis_started_atrfp_analysis_completed_atrfp_analysis_error
- Removes file from
- Updates: Sets
updated_attimestamp
Deleting an RFP document also removes all associated analysis results. You’ll need to re-upload and re-analyze the RFP to restore this data.
Delete Concept Document
Unique identifier for the proposal
Name of the concept file to delete
What Gets Deleted
- S3 File:
{proposal_code}/documents/initial_concept/{filename} - No vector cleanup needed (concept files are not vectorized)
Delete Concept Text
Unique identifier for the proposal
What Gets Deleted
- S3 File:
{proposal_code}/documents/initial_concept/concept_text.txt - No DynamoDB update (text is stored in S3 only)
Delete Reference Proposal
Unique identifier for the proposal
Name of the reference file to delete
Deletion success indicator
Confirmation message
What Gets Deleted
- S3 File:
{proposal_code}/documents/references/{filename} - Vector Embeddings:
- Deletes all vectors from
reference-proposals-index - Searches by
document_namein vector keys - Key format:
*|*|*|*|{filename}|*|*
- Deletes all vectors from
- DynamoDB:
- Removes filename from
uploaded_files.reference-proposalsarray - Updates
updated_attimestamp
- Removes filename from
Vector Deletion Process
Deletion Flow
Delete Supporting Document
Unique identifier for the proposal
Name of the supporting file to delete
Deletion success indicator
Confirmation message
What Gets Deleted
- S3 File:
{proposal_code}/documents/supporting/{filename} - Vector Embeddings:
- Deletes all vectors from
existing-work-index - Searches by
document_namein vector keys
- Deletes all vectors from
- DynamoDB:
- Removes filename from
uploaded_files.supporting-docsarray - Updates
updated_attimestamp
- Removes filename from
Delete Work Text
Unique identifier for the proposal
Deletion success indicator
Confirmation message
What Gets Deleted
- S3 File:
{proposal_code}/documents/supporting/existing_work_text.txt - Vector Embeddings:
- Deletes all vectors from
existing-work-index - Searches for
document_name = "existing_work_text" - Removes all chunks (may be multiple vectors)
- Deletes all vectors from
- DynamoDB:
- Removes
text_inputs.existing-workfield - Updates
updated_attimestamp
- Removes
Work text is chunked during upload, so deleting it removes multiple vector entries from the index.
Error Handling
Common Error Codes
| Code | Error | Reason |
|---|---|---|
404 | Proposal not found | Invalid proposal ID or user doesn’t own it |
500 | S3 Delete Error | Failed to delete file from S3 |
500 | Failed to delete vectors | Vector service error (non-critical) |
500 | DynamoDB update failed | Database update error |
Non-Critical Failures
Vector deletion failures are logged but don’t fail the request:Example
Error Response Examples
Best Practices
1. Confirm Before Deleting
Always show a confirmation dialog before deleting documents, especially reference proposals:Confirmation Example
2. Handle Partial Failures
Vector deletion may fail silently. Check logs if you suspect incomplete cleanup:Check Logs
3. Refresh UI After Deletion
Refresh Pattern
4. Bulk Deletion
For deleting multiple files, use Promise.all but handle individual failures:Bulk Delete
5. Vector Index Cleanup
If vectors aren’t deleted properly (e.g., network error), you may need to manually clean up:Manual Cleanup
Cascade Deletion Summary
| Document Type | S3 | Vectors | DynamoDB | Analysis Data |
|---|---|---|---|---|
| RFP Document | ✅ | ❌ | ✅ | ✅ Clears analysis |
| Concept File | ✅ | ❌ | ❌ | ❌ |
| Concept Text | ✅ | ❌ | ❌ | ❌ |
| Reference Proposal | ✅ | ✅ reference-proposals-index | ✅ | ❌ |
| Supporting File | ✅ | ✅ existing-work-index | ✅ | ❌ |
| Work Text | ✅ | ✅ existing-work-index (all chunks) | ✅ | ❌ |