Light APIv1.0.0

API / Reference / Expenses

Create upload URL

POST https://api.light.inc/v1/expenses/upload-url

Creates a pre-signed URL for uploading an expense receipt document

Authorization

Send one of these on every request. See Authentication for how to get credentials.

  • API key

    Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.

  • Bearer token

Request body

application/json;charset=UTF-8

  • filename stringrequired

    Name of the file being uploaded; kept as the receipt's file name

  • contentType stringrequired

    MIME type of the file: application/pdf, image/jpeg, image/png, image/heic, image/heif or image/tiff

  • shouldAutoCreateExpense boolean

    When true (default), the uploaded receipt is converted to PDF, an expense is created automatically and its fields are extracted by OCR. When false, the receipt is only stored: no expense is created and nothing is parsed; the caller creates the expense itself from the returned key.

Response

  • uploadUrl string · url

  • key string

  • metadata object