curl -X POST \
"https://api.incentives.leap.energy/alpha/applications/attachments/commit?application_id=123" \
-H "x-api-key: leap_live_..." \
-H "Content-Type: application/json" \
-d '{
"attachment_type": "INVOICE_EQUIPMENT",
"path": "app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf",
"makePublic": true
}'import requests
url = "https://api.incentives.leap.energy/alpha/applications/attachments/commit?application_id=123"
payload = {
"attachment_type": "INVOICE_EQUIPMENT",
"path": "app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf",
"makePublic": True
}
headers = {
"x-api-key": "leap_live_...",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())const response = await fetch(
'https://api.incentives.leap.energy/alpha/applications/attachments/commit?application_id=123',
{
method: 'POST',
headers: {
'x-api-key': 'leap_live_...',
'Content-Type': 'application/json'
},
body: JSON.stringify({
attachment_type: 'INVOICE_EQUIPMENT',
path: 'app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf',
makePublic: true
})
}
);
const data = await response.json();
console.log(data);<?php
$url = 'https://api.incentives.leap.energy/alpha/applications/attachments/commit?application_id=123';
$payload = [
'attachment_type' => 'INVOICE_EQUIPMENT',
'path' => 'app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf',
'makePublic' => true
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: leap_live_...',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
print_r(json_decode($response, true));import java.net.http.*;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
String json = """{
"attachment_type": "INVOICE_EQUIPMENT",
"path": "app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf",
"makePublic": true
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.incentives.leap.energy/alpha/applications/attachments/commit?application_id=123"))
.header("x-api-key", "leap_live_...")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());require 'net/http'
require 'json'
uri = URI('https://api.incentives.leap.energy/alpha/applications/attachments/commit?application_id=123')
payload = {
attachment_type: 'INVOICE_EQUIPMENT',
path: 'app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf',
makePublic: true
}
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['x-api-key'] = 'leap_live_...'
request['Content-Type'] = 'application/json'
request.body = payload.to_json
response = http.request(request)
puts JSON.parse(response.body)package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.incentives.leap.energy/alpha/applications/attachments/commit?application_id=123"
payload := map[string]interface{}{
"attachment_type": "INVOICE_EQUIPMENT",
"path": "app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf",
"makePublic": true,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("x-api-key", "leap_live_...")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}{
"ok": true,
"requestId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"id": 789,
"file_url": "https://<storage-host>/attachments/app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf",
"bucket": "attachments",
"path": "app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf"
}{
"code": "not_found",
"message": "Application 123 not found",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"details": "Additional context about the error"
}{
"code": "not_found",
"message": "Application 123 not found",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"details": "Additional context about the error"
}{
"code": "not_found",
"message": "Application 123 not found",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"details": "Additional context about the error"
}{
"code": "not_found",
"message": "Application 123 not found",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"details": "Additional context about the error"
}{
"code": "not_found",
"message": "Application 123 not found",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"details": "Additional context about the error"
}Commit attachment upload
Confirm an attachment after the file has been uploaded to its signed URL. This finalizes the attachment on the application.
curl -X POST \
"https://api.incentives.leap.energy/alpha/applications/attachments/commit?application_id=123" \
-H "x-api-key: leap_live_..." \
-H "Content-Type: application/json" \
-d '{
"attachment_type": "INVOICE_EQUIPMENT",
"path": "app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf",
"makePublic": true
}'import requests
url = "https://api.incentives.leap.energy/alpha/applications/attachments/commit?application_id=123"
payload = {
"attachment_type": "INVOICE_EQUIPMENT",
"path": "app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf",
"makePublic": True
}
headers = {
"x-api-key": "leap_live_...",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())const response = await fetch(
'https://api.incentives.leap.energy/alpha/applications/attachments/commit?application_id=123',
{
method: 'POST',
headers: {
'x-api-key': 'leap_live_...',
'Content-Type': 'application/json'
},
body: JSON.stringify({
attachment_type: 'INVOICE_EQUIPMENT',
path: 'app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf',
makePublic: true
})
}
);
const data = await response.json();
console.log(data);<?php
$url = 'https://api.incentives.leap.energy/alpha/applications/attachments/commit?application_id=123';
$payload = [
'attachment_type' => 'INVOICE_EQUIPMENT',
'path' => 'app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf',
'makePublic' => true
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: leap_live_...',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
print_r(json_decode($response, true));import java.net.http.*;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
String json = """{
"attachment_type": "INVOICE_EQUIPMENT",
"path": "app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf",
"makePublic": true
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.incentives.leap.energy/alpha/applications/attachments/commit?application_id=123"))
.header("x-api-key", "leap_live_...")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());require 'net/http'
require 'json'
uri = URI('https://api.incentives.leap.energy/alpha/applications/attachments/commit?application_id=123')
payload = {
attachment_type: 'INVOICE_EQUIPMENT',
path: 'app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf',
makePublic: true
}
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['x-api-key'] = 'leap_live_...'
request['Content-Type'] = 'application/json'
request.body = payload.to_json
response = http.request(request)
puts JSON.parse(response.body)package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.incentives.leap.energy/alpha/applications/attachments/commit?application_id=123"
payload := map[string]interface{}{
"attachment_type": "INVOICE_EQUIPMENT",
"path": "app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf",
"makePublic": true,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("x-api-key", "leap_live_...")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}{
"ok": true,
"requestId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"id": 789,
"file_url": "https://<storage-host>/attachments/app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf",
"bucket": "attachments",
"path": "app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf"
}{
"code": "not_found",
"message": "Application 123 not found",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"details": "Additional context about the error"
}{
"code": "not_found",
"message": "Application 123 not found",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"details": "Additional context about the error"
}{
"code": "not_found",
"message": "Application 123 not found",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"details": "Additional context about the error"
}{
"code": "not_found",
"message": "Application 123 not found",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"details": "Additional context about the error"
}{
"code": "not_found",
"message": "Application 123 not found",
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"details": "Additional context about the error"
}Authorizations
Your Leap API key. Send it in the x-api-key header: x-api-key: leap_live_....
Query Parameters
Application ID that the attachment belongs to. The application must belong to your organization.
Body
Attachment commit request. Note: application_id comes from query parameter, not body.
Type of attachment
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"
Object path returned from the create step (uses app-{application_id}/ prefix)
"app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf"
If true, generates a public URL (default: false)
Response
Successfully committed attachment
true
"c3d4e5f6-a7b8-9012-cdef-123456789012"
Database record ID of the attachment
789
Storage URL (storage://... or public HTTP URL if makePublic=true)
"https://<storage-host>/attachments/app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf"
"attachments"
Object path
"app-123/a1b2c3d4-e5f6-7890-abcd-ef1234567890-invoice.pdf"
Was this page helpful?