admin-supplier-quotes

Delete Supplier Quote Attachment

Soft-delete an attachment from a SupplierQuote (Phase 4 follow-up).

Removes the given r2_key from :attr:SupplierQuote.attachment_r2_keys AND the parallel kind tag from :attr:SupplierQuote.attachment_kinds. The actual R2 object is left in place — the codebase's existing R2 retention posture is "everything is forever" (no lifecycle rules) and the audit-trail principle (plan decision D3) prefers append-only writes. An engineer can manually re-link the orphaned R2 key if a delete needs reversing.

Key-based addressing (vs index-based) makes the operation robust against racing admins: two admins viewing the same quote can each delete a different attachment without colliding on shifting indices. If the requested r2_key is not in the row's array, returns 404 — idempotent treatment (a retry after success is a no-op from the caller's POV).

Legacy rows where attachment_kinds is empty (pre-Phase-3) get the parallel array synthesized as ["quote"] * N BEFORE the delete, so the post-write parallel-array invariant holds.

delete/api/v1/admin/supplier-quotes/{quote_id}/attachments

Path parameters

quote_idstring uuid required

Query parameters

r2_keystring required

Response

Successful Response

idstring uuid required
project_idstring uuid required
supplier_contact_idstring uuid required
supplier_contact_namestring required
supplier_contact_emailstring required
gmail_thread_idstring nullable
sourcestring
total_amount_centsinteger nullable required
currencystring required
lead_time_daysinteger nullable required
valid_untilstring date-time nullable required
line_itemsobject[] required
notesstring nullable required
source_email_bodystring nullable
attachment_r2_keysstring[]
attachment_kindsstring[]
document_kindstring nullable
extraction_confidencenumber nullable
needs_human_reviewboolean required
reviewed_atstring date-time nullable required
reviewed_bystring uuid nullable required
accepted_atstring date-time nullable
created_atstring date-time required
updated_atstring date-time required

Changes

No recorded changes to this endpoint across all 1 revision of this API.