admin-supplier-quotes

Upload Supplier Quote Attachment

Append an admin-uploaded attachment to a SupplierQuote (Phase 4).

The inbound agent persists supplier attachments automatically (see prepare_quote_attachment MCP tool), but two failure modes call for a manual admin upload:

  • The Anthropic Files API was down AND the local PDF fallback returned empty text (the agent escalated rather than persisted).
  • The supplier sent a follow-up document (an invoice) on a thread that was already closed at the quoted state.

Behavior:

  • Streams the file to R2 under the SAME prefix the inbound agent uses (vendors/inbound-attachments/<gmail_message_id>/<filename>) so the existing source-preview-url endpoint serves admin and agent uploads uniformly.
  • Appends the R2 key to SupplierQuote.attachment_r2_keys AND the kind tag to SupplierQuote.attachment_kinds (parallel-array invariant). When the quote was created by the inbound agent BEFORE Phase 3 shipped, attachment_kinds may be empty; the handler synthesizes ["quote"] * len(attachment_r2_keys) to backfill before appending the new tag.
  • Returns the updated :class:SupplierQuoteRead so the FE can immediately re-render the attachment list without a second GET.

Enforces a 25MB cap matching the inbound agent's ceiling.

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

Path parameters

quote_idstring uuid 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.