Upload attachment
Create a signed URL for uploading an attachment. Upload the file to that URL with a PUT request, then confirm it with the commit endpoint.
Authorizations
Your Leap API key. Send it in the x-api-key header: x-api-key: leap_live_....
Query Parameters
Application ID to attach the file to. The application must belong to your organization.
Body
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, SIGNATURE, TARIFF_CONFIRMATION "INVOICE_EQUIPMENT"
Name of the file being uploaded
"invoice.pdf"
MIME type of the file
"application/pdf"
Response
Successfully created upload URL
true
"b2c3d4e5-f6a7-8901-bcde-f12345678901"
Signed URL for uploading the file (PUT file bytes here)
"https://<storage-host>/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."