> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upwell.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Upload Presigned Url

> Generate a presigned URL for direct S3 file upload.

**Integration notes:**
- If you provide `sourceSystem` you must also provide `sourceSystemId` (and vice versa) — the `documents_source_system_pair_nullity_chk` constraint requires both or neither.
- On the subsequent `PUT` to the returned `uploadUrl`, prefer an `ArrayBuffer` body over `Blob`. Wrapping in a `Blob` with an explicit type can cause some Node fetch implementations to add headers that aren't in `X-Amz-SignedHeaders`, breaking the SigV4 signature.

See [Integration patterns](/integration-patterns#document-upload-two-step-presigned-url).



## OpenAPI

````yaml /api-reference/openapi.json post /api/rest/generate-upload-presigned-url
openapi: 3.1.0
info:
  description: >-
    Upwell is Accounts Receivable automation software for the logistics
    industry. We serve freight brokers, carriers, factors, and anyone who needs
    to get transportation invoices paid.


    Learn more at:


    - [Upwell.com](https://upwell.com)
  title: Upwell REST API
  version: 3.30.2
  termsOfService: https://upwell.com/legal
  contact:
    name: Upwell
    url: https://upwell.com
    email: contact@upwell.com
servers:
  - url: https://api.upwell.com
    description: Production server
  - url: https://staging.api.upwell.com
    description: Staging server
security: []
tags:
  - name: Invoice Approval
    description: Endpoints for managing customer invoice approval workflow
paths:
  /api/rest/generate-upload-presigned-url:
    post:
      tags:
        - Documents
      summary: Generate Upload Presigned Url
      description: >-
        Generate a presigned URL for direct S3 file upload.


        **Integration notes:**

        - If you provide `sourceSystem` you must also provide `sourceSystemId`
        (and vice versa) — the `documents_source_system_pair_nullity_chk`
        constraint requires both or neither.

        - On the subsequent `PUT` to the returned `uploadUrl`, prefer an
        `ArrayBuffer` body over `Blob`. Wrapping in a `Blob` with an explicit
        type can cause some Node fetch implementations to add headers that
        aren't in `X-Amz-SignedHeaders`, breaking the SigV4 signature.


        See [Integration
        patterns](/integration-patterns#document-upload-two-step-presigned-url).
      parameters:
        - description: >-
            Your API key will be used for authentication of the request.
            `Authorization: YOUR_API_KEY`
          in: header
          name: authorization
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                input:
                  $ref: '#/components/schemas/GenerateUploadUrlInput'
              type: object
        description: >-
          Query parameters can also be provided in the request body as a JSON
          object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  generateUploadPresignedUrl:
                    nullable: false
                    properties:
                      documentId:
                        nullable: true
                        title: String
                        type: string
                      uploadUrl:
                        nullable: false
                        title: String
                        type: string
                    title: UploadPresignedUrlResponse
                    type: object
          description: Responses for POST /api/rest/generate-upload-presigned-url
components:
  schemas:
    GenerateUploadUrlInput:
      nullable: false
      properties:
        associationId:
          nullable: true
          title: String
          type: string
        associationType:
          $ref: '#/components/schemas/AllowedFileAssociationTypeEnum'
        documentType:
          $ref: '#/components/schemas/AllowedDocumentType'
        fileName:
          nullable: false
          title: String
          type: string
        isPod:
          nullable: true
          title: Boolean
          type: boolean
        mimeType:
          nullable: false
          title: String
          type: string
        sourceSystem:
          nullable: true
          title: String
          type: string
        sourceSystemId:
          nullable: true
          title: String
          type: string
        visibleToCarrier:
          nullable: true
          title: Boolean
          type: boolean
        visibleToCustomer:
          nullable: true
          title: Boolean
          type: boolean
      title: GenerateUploadUrlInput
      type: object
    AllowedFileAssociationTypeEnum:
      description: The type of the file association
      enum:
        - CARRIER_INVOICE
        - INVOICE
        - PURCHASE_ORDER
        - SHIPMENT
        - VENDOR_INVOICE
      nullable: false
      title: AllowedFileAssociationTypeEnum
    AllowedDocumentType:
      description: The type of the document
      enum:
        - ACCESSORIAL_RECEIPT
        - ADVANCE_REQUEST
        - AGENT_INVOICE
        - ARRIVAL_NOTICE
        - ASBESTOS_DECLARATION
        - AUSFTA
        - AUTHORITY
        - AUTH_RELEASE
        - B3_CANADIAN_ENTRY
        - BALANCE_DUE
        - BILL_OF_LADING
        - CARRIER_ACH_SETUP_FORM
        - CARRIER_BOOKING_REQUEST
        - CARRIER_INSURANCE_CERTIFICATE
        - CARRIER_INVOICE
        - CARRIER_INVOICE_SUMMARY
        - CARRIER_INVOICE_WITH_SUPPORTING_DOCUMENTATION
        - CARRIER_RATE_CONFIRMATION
        - CARRIER_W9
        - CARTAGE_ADVICE_WITH_RECEIPT
        - CERTIFICATE_OF_ORIGIN
        - CFDI
        - CLAIM
        - CLAIM_NOTICE
        - COMCHECK
        - COMMERCIAL_INVOICE
        - CONSIGNMENT_SECURITY_DECLARATION
        - CONTRACT
        - CORRECTION_NOTICE
        - COVER_SHEET
        - CREDIT_APPLICATION
        - CUSTOMER_DOCUMENTS_OTHER
        - CUSTOMER_INVOICE
        - CUSTOMER_INVOICE_WITH_SUPPORTING_DOCUMENTATION
        - CUSTOMER_RATE_CONFIRMATION
        - CUSTOMER_RELEASE
        - CUSTOMS_AUTHORITY
        - CUSTOMS_CLEARANCE_REQUEST
        - CUSTOMS_DOCUMENT
        - CUSTOMS_ENTRY_SUMMARY
        - CUSTOMS_POWER_OF_ATTORNEY
        - DANGEROUS_GOODS_DECLARATION
        - DELIVERY_ORDER
        - DELIVERY_PHOTO
        - DELIVERY_RECEIPT
        - DEMURRAGE_RECEIPT
        - DETENTION_APPROVAL
        - DOCUMENT_BUNDLE
        - DOCUMENT_PACKET
        - DRIVER_FORM
        - ELECTRONIC_INTERCHANGE_RECEIPT
        - EMAIL_APPROVAL
        - EMAIL_SIGNATURE_IMAGE
        - ESCORT_RECEIPT
        - EXIT_PASS
        - EXPORT_AUTHORITY
        - EXPORT_DECLARATION
        - FACTOR_INVOICE
        - FERRY_RECEIPT
        - FINE
        - FORM_1113_PUBLIC_VOUCHER
        - FREETIME_NOTIFICATION
        - FREIGHT_LABEL
        - FUEL_RECEIPT
        - FUMIGATION_CERTIFICATE
        - FUNDING_REQUEST_FORM
        - GATE_PASS
        - GOVERNMENT_BOL
        - HIDDEN_BOL
        - HOUSE_AIRWAY_BILL
        - HOUSE_BOL
        - HOUSE_OCEAN_BOL
        - INSPECTION_CERTIFICATE
        - INSTRUCTION_PAGE
        - INTERMODAL_IN_TRANSIT_NOTICE
        - INTERNAL_DOCUMENTS_OTHER
        - INTERNAL_PROOF_OF_DELIVERY
        - INTERNATIONAL_BOL
        - INVOICE_STATEMENT
        - ISF_FILING_INSTRUCTION
        - LAYOVER_APPROVAL
        - LETTER_OF_ASSIGNMENT
        - LETTER_OF_CREDIT
        - LUMPER_APPROVAL
        - LUMPER_RECEIPT
        - MANIFEST
        - MASTER_AIRWAY_BILL
        - MASTER_BOL
        - MASTER_OCEAN_BOL
        - MOTOR_VEHICLE_CERT
        - MSDS
        - NAFTA_CERT
        - NMFC_W_I_CERT
        - NOTICE_OF_ASSIGNMENT
        - NOTICE_OF_RELEASE
        - OTHER
        - PACKING_DECLARATION
        - PACKING_SLIP
        - PALLET_RECEIPT
        - PERMIT_TO_TRANSFER
        - PER_DIEM_RECEIPT
        - PICKUP_NUMBER
        - PRE_ALERT
        - PROFORMA_INVOICE
        - PROOF_OF_DELIVERY
        - PURCHASE_ORDER
        - REMITTANCE
        - RUN_TICKET
        - SANITARY_CERTIFICATE
        - SCALE_TICKET
        - SHIPPERS_LETTER
        - SHIPPER_SECURITY_DECLARATION
        - SOLAS_FORM
        - SPOT_QUOTE_APPROVAL
        - STEAMING_RECEIPT
        - SUPPORTING_DOCUMENTATION
        - TELEX_RELEASE
        - TOLL_RECEIPT
        - TONU_APPROVAL
        - TRACKING_STATUS
        - TRAILER_INTERCHANGE_REPORT
        - TRUCK_BOL
        - UNKNOWN
        - US_CUSTOMS_DOC
        - VENDOR_INVOICE
        - VETERINARY_CERTIFICATE
        - VGM_CONTAINER_INFO
        - VOIDED_CHECK
        - WASH_RECEIPT
        - WAYBILL
        - WEIGHT_MEASUREMENT_REPORT
        - WEIGHT_TICKET
        - WEIGHT_UNLOADED
      nullable: false
      title: AllowedDocumentType

````