Skip to main content
POST
/
applications
/
attachments
cURL
curl -X POST \
  "https://api.incentives.leap.energy/alpha/applications/attachments?application_id=123" \
  -H "x-api-key: leap_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "attachment_type": "INVOICE_EQUIPMENT",
    "filename": "invoice.pdf",
    "contentType": "application/pdf"
  }'
{
  "ok": true,
  "requestId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "uploadUrl": "https://your-project.supabase.co/storage/v1/object/sign/attachments/app-123/uuid-invoice.pdf?token=...",
  "path": "app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf",
  "bucket": "attachments",
  "instructions": "PUT bytes to uploadUrl with the file content-type, then call POST /applications/attachments/commit to finalize."
}

Overview

Upload documentation attachments for applications using a three-step process:
  1. Create Upload URL: Request a signed URL
  2. Upload File: PUT file to the signed URL
  3. Commit Upload: Finalize the attachment
  • application_id comes from the query parameter, not the request body
  • The signed upload URL expires quickly (typically 60 seconds)
  • The path in commit must match the path from create upload URL response
Make sure to upload and commit the file before the signed URL expires, or request a new upload URL.
For detailed workflow explanation, storage paths, attachment types, and best practices, see the Attachments Workflow section in the API Guide.

Authorizations

x-api-key
string
header
required

API key for authentication. Include your Leap API key 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,
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://your-project.supabase.co/storage/v1/object/sign/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."