Skip to main content
POST
/
v1
/
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/v1/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/v1/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/v1/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

Creates a complete LCA portfolio with all its components from an uploaded Excel file. The file must contain two sheets: 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

x-api-key
string
required
Your API keyExample: sk_live_1234567890abcdef

Headers

x-organization-id
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa
Content-Type
string
required
Must be multipart/form-data

Body Parameters

excel_file
file
required
Excel file (.xlsx) containing the LCA definition

Excel File Format

The Excel file must contain two sheets:

Sheet: header

LCA metadata (single row):
ColumnTypeDescription
namestringLCA portfolio name
descriptionstringOptional description
impact_categoriesstringJSON array of impact category IDs (e.g. ["gwp","ap"])
unit_idstringUUID of the functional unit
valuenumberFunctional unit quantity
start_datestringStart date (YYYY-MM-DD)
end_datestringEnd date (YYYY-MM-DD)
start_nodestringName of the root process node

Sheet: process_map

Node definitions with parent-child relationships:
ColumnTypeDescription
idstringUnique node identifier
parent_idstringID of the parent node (empty for root)
typestringNode type: process, material, energy, waste
namestringNode display name
supplierstringSupplier name
countrystringCountry code (ISO 3166-1 alpha-2)
transport_idstringTransport type (e.g. truck, ship) — optional
quantitynumberQuantity value
unitstringUnit of measurement
Example 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.
acv_id
string
UUID of the created LCA portfolio
summary
object
Summary of the created LCA structure

Example

curl -X POST "https://api.dcycle.io/v1/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/v1/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/v1/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'"}

Create from JSON

Create LCA from a JSON tree structure

List LCA Portfolios

Browse all LCA portfolios

LCA Dashboard

View environmental impact results