Create LCA from Excel
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': '<content-type>'
},
body: JSON.stringify({})
};
fetch('https://api.dcycle.io/lca/create-from-excel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/lca/create-from-excel"
payload = {}
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/lca/create-from-excel \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '{}'{
"acv_id": "<string>",
"summary": {}
}Create LCA from Excel
Create a complete LCA portfolio by uploading an Excel file
POST
/
lca
/
create-from-excel
Create LCA from Excel
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': '<content-type>'
},
body: JSON.stringify({})
};
fetch('https://api.dcycle.io/lca/create-from-excel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/lca/create-from-excel"
payload = {}
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/lca/create-from-excel \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '{}'{
"acv_id": "<string>",
"summary": {}
}← LCA API
Creates a complete LCA portfolio with all its components from an uploaded Excel file. The file must contain two sheets:
Sheet:
LCA metadata (single row):
Sheet:
Node definitions with parent-child relationships:
Example
process_map (defining nodes and relationships) and header (LCA metadata).
This endpoint requires API key authentication only (
x-api-key header). For JSON-based creation, see Create from JSON.Request
Authentication
string
required
Your API keyExample:
sk_live_1234567890abcdefHeaders
string
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51fastring
required
Must be
multipart/form-dataBody Parameters
file
required
Excel file (
.xlsx) containing the LCA definitionExcel File Format
The Excel file must contain two sheets:Sheet: header
LCA metadata (single row):
| Column | Type | Description |
|---|---|---|
name | string | LCA portfolio name |
description | string | Optional description |
impact_categories | string | JSON array of impact category IDs (e.g. ["gwp","ap"]) |
unit_id | string | UUID of the functional unit |
value | number | Functional unit quantity |
start_date | string | Start date (YYYY-MM-DD) |
end_date | string | End date (YYYY-MM-DD) |
start_node | string | Name of the root process node |
Sheet: process_map
Node definitions with parent-child relationships:
| Column | Type | Description |
|---|---|---|
id | string | Unique node identifier |
parent_id | string | ID of the parent node (empty for root) |
type | string | Node type: process, material, energy, waste |
name | string | Node display name |
supplier | string | Supplier name |
country | string | Country code (ISO 3166-1 alpha-2) |
transport_id | string | Transport type (e.g. truck, ship) — optional |
quantity | number | Quantity value |
unit | string | Unit of measurement |
process_map sheet:
| id | parent_id | type | name | supplier | country | transport_id | quantity | unit |
|----|-----------|----------|-------------------|-------------|---------|--------------|----------|------|
| 1 | | process | Table Assembly | Factory A | ES | | | |
| 2 | 1 | material | Sawn timber | Forest Co | FI | truck | 15 | kg |
| 3 | 1 | material | Steel bolts | Steel Inc | DE | | 0.5 | kg |
| 4 | 1 | energy | Electricity | | ES | | 2.5 | kWh |
| 5 | 1 | waste | Wood shavings | | ES | | 1.2 | kg |
Response
Returns HTTP 201 with the created LCA information.string
UUID of the created LCA portfolio
object
Summary of the created LCA structure
Example
curl -X POST "https://api.dcycle.io/lca/create-from-excel" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}" \
-F "excel_file=@my_lca.xlsx"
import requests
import os
with open("my_lca.xlsx", "rb") as f:
response = requests.post(
"https://api.dcycle.io/lca/create-from-excel",
headers={
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
},
files={"excel_file": ("my_lca.xlsx", f, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")},
)
result = response.json()
print(f"Created LCA: {result['acv_id']}")
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const form = new FormData();
form.append('excel_file', fs.createReadStream('my_lca.xlsx'));
axios.post('https://api.dcycle.io/lca/create-from-excel', form, {
headers: {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
...form.getHeaders(),
},
})
.then(({ data }) => {
console.log(`Created LCA: ${data.acv_id}`);
});
Successful Response
{
"acv_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"summary": {
"name": "Wooden Table LCA",
"nodes_created": 5,
"processes": 1,
"materials": 2,
"energy": 1,
"waste": 1
}
}
Common Errors
401 Unauthorized
Cause: Missing or invalid API key{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}
422 Unprocessable Entity
Cause: Invalid Excel structure, missing sheets, or invalid data{"detail": "Missing required sheet: 'process_map'"}
Related Endpoints
Create from JSON
Create LCA from a JSON tree structure
List LCA Portfolios
Browse all LCA portfolios
LCA routes are not versioned. Only portfolio creation is served under
/v1
(POST /v1/lca/portfolio); every other route in this module lives at /lca/....LCA Dashboard
View environmental impact results
Was this page helpful?