Skip to main content

Mint a signed URL to upload a supporting document

POST 

/documents/upload-url

Two URLs, two requests. POST /documents/upload-url (this endpoint) returns a short-lived (15 min) signed upload_url; you then PUT the file bytes to that upload_url (a Google Cloud Storage URL, not a Garfield endpoint). This endpoint never receives the file itself.

The storage path is scoped to the entity and to a key derived deterministically from (partner_id, partner_claim_id). Upload BEFORE calling POST /claims with the same partner_claim_id; then reference each returned storage_path in the claim's document_refs.

Uploading to the returned upload_url

PUT the file with the exact headers from required_headers (the x-goog-content-length-range header caps the size: default 50 MB, or your max_bytes). The URL is PUT-only and its Content-Type is signed in, so opening it in a browser returns MalformedSecurityHeader, which is expected.

curl -X PUT "<upload_url>" \
-H "Content-Type: application/pdf" \
-H "x-goog-content-length-range: 0,52428800" \
--data-binary @invoice.pdf

Full walkthrough: Upload supporting documents

Request

Responses

A signed upload URL was created.