Skip to main content
POST
cURL

Authorizations

x-api-key
string
header
required

Your Leap API key. Send it in the x-api-key header: x-api-key: leap_live_....

Query Parameters

application_id
integer
required

Application ID to attach the file to. The application must belong to your organization.

Body

application/json

Attachment metadata for creating the upload URL. Note: application_id comes from query parameter, not body.

attachment_type
enum<string>
required

Type of attachment being uploaded

Available options:
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
Example:

"INVOICE_EQUIPMENT"

filename
string
required

Name of the file being uploaded

Example:

"invoice.pdf"

contentType
string
required

MIME type of the file

Example:

"application/pdf"

Response

Successfully created upload URL

ok
boolean
Example:

true

requestId
string
Example:

"b2c3d4e5-f6a7-8901-bcde-f12345678901"

uploadUrl
string<uri>

Signed URL for uploading the file (PUT file bytes here)

Example:

"https://<storage-host>/attachments/app-123/<uuid>-invoice.pdf?token=..."

path
string

Object path to use in commit step

Example:

"app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf"

bucket
string
Example:

"attachments"

instructions
string
Example:

"PUT bytes to uploadUrl with the file content-type, then call POST /applications/attachments/commit to finalize."