Get Source Preview Url
Return a presigned R2 URL for one of the quote's attachments (PRO-113).
Powers the V2 Quote Correction View's left-side source preview when the supplier replied with a file attachment (PDF / CSV / XLSX). The URL has a 24h TTL — long enough for an admin review session, short enough to limit replay if leaked.
Phase 4: accepts an optional attachment_index query parameter so the admin UI can preview ANY attachment on the quote, not just the first. The agent's prepare_quote_attachment flow persists attachments in upload order; the admin UI now lets users page through them (and any admin-uploaded follow-up attachments).
Returns 404 when the quote has no attachments, or when attachment_index is out of range (frontend falls back to the inline-body source via source_email_body on the read schema, or shows the empty state).
MIME type is inferred from the R2 key's filename extension — sufficient for the V2 UI to pick between iframe (PDF), HTML table (CSV), or generic download (XLSX or unknown). Server-side parsing of CSV / XLSX content for inline highlighting is deferred to a future iteration; V1 fetches the URL client-side and parses there.
Path parameters
Query parameters
0-based index into the quote's attachment_r2_keys array. Defaults to 0 (the first / primary source). Use higher indices to preview follow-up attachments (e.g. an invoice alongside the original quote).
0-based index into the quote's attachment_r2_keys array. Defaults to 0 (the first / primary source). Use higher indices to preview follow-up attachments (e.g. an invoice alongside the original quote).
Response
Successful Response
Changes
No recorded changes to this endpoint across all 1 revision of this API.