Upload documentation attachments for applications (invoices, permits, photos, etc.). This covers the two-step upload process: creating an upload URL and committing the upload.
application_id comes from the query parameter, not the request bodypath in commit must match the path from create upload URL responseAPI key for authentication. Include your Leap API key in the x-api-key header: x-api-key: leap_live_...
Application ID to attach the file to. The application must belong to your organization.
Attachment metadata for creating the upload URL. Note: application_id comes from query parameter, not body.
Type of attachment being uploaded
INVOICE_EQUIPMENT, INVOICE_INSTALL, PERMIT, PHOTO_NAMEPLATE, PHOTO_INSTALL, PHOTO_METER, AHRI_CERT, NEAT_REPORT, INCOME_FORM, W9, OTHER, MODEL_TECH_SPECS, VEHICLE_PURCHASE, UTILITY_BILL, VEHICLE_REGISTRATION, TARIFF_CONFIRMATION "INVOICE_EQUIPMENT"
Name of the file being uploaded
"invoice.pdf"
MIME type of the file
"application/pdf"
Successfully created upload URL
true
"b2c3d4e5-f6a7-8901-bcde-f12345678901"
Signed URL for uploading the file (PUT file bytes here)
"https://your-project.supabase.co/storage/v1/object/sign/attachments/app-123/uuid-invoice.pdf?token=..."
Object path to use in commit step
"app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf"
"attachments"
"PUT bytes to uploadUrl with the file content-type, then call POST /applications/attachments/commit to finalize."