Create LCA Portfolio
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': '<content-type>'
},
body: JSON.stringify({
name: '<string>',
start_date: '<string>',
end_date: '<string>',
impact_categories: {},
products: {},
value: 123,
unit_id: '<string>'
})
};
fetch('https://api.dcycle.io/v1/lca/portfolio', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/lca/portfolio"
payload = {
"name": "<string>",
"start_date": "<string>",
"end_date": "<string>",
"impact_categories": {},
"products": {},
"value": 123,
"unit_id": "<string>"
}
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/portfolio \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"name": "<string>",
"start_date": "<string>",
"end_date": "<string>",
"impact_categories": {},
"products": {},
"value": 123,
"unit_id": "<string>"
}
'{
"acv_id": "<string>",
"process": {
"id": "<string>",
"name": {},
"entity_id": {},
"entity_type": "<string>",
"coordinates_x": 123,
"coordinates_y": 123,
"inputs": {},
"outputs": {},
"created_at": {},
"updated_at": {}
},
"final_product": {},
"final_products": {}
}Create LCA Portfolio
Create a new Life Cycle Assessment portfolio for your organization
POST
/
v1
/
lca
/
portfolio
Create LCA Portfolio
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': '<content-type>'
},
body: JSON.stringify({
name: '<string>',
start_date: '<string>',
end_date: '<string>',
impact_categories: {},
products: {},
value: 123,
unit_id: '<string>'
})
};
fetch('https://api.dcycle.io/v1/lca/portfolio', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/lca/portfolio"
payload = {
"name": "<string>",
"start_date": "<string>",
"end_date": "<string>",
"impact_categories": {},
"products": {},
"value": 123,
"unit_id": "<string>"
}
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/portfolio \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"name": "<string>",
"start_date": "<string>",
"end_date": "<string>",
"impact_categories": {},
"products": {},
"value": 123,
"unit_id": "<string>"
}
'{
"acv_id": "<string>",
"process": {
"id": "<string>",
"name": {},
"entity_id": {},
"entity_type": "<string>",
"coordinates_x": 123,
"coordinates_y": 123,
"inputs": {},
"outputs": {},
"created_at": {},
"updated_at": {}
},
"final_product": {},
"final_products": {}
}← LCA API
Creates a new LCA portfolio for your organization. A portfolio declares one or more output co-products with their functional units, along with the impact categories to assess and the time period for the analysis.
Request
Headers
Body Parameters
List of impact category identifiers to include in the assessmentCommon values:
gwp (Global Warming Potential), ap (Acidification), ep (Eutrophication), pocp (Photochemical Ozone Creation), adp (Abiotic Depletion)Response
Returns HTTP 201 with the created portfolio structure.The root process block (canvas node)
Show block object fields
Show block object fields
Example
curl -X POST "https://api.dcycle.io/v1/lca/portfolio" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}" \
-H "Content-Type: application/json" \
-d '{
"name": "Product A - Environmental Impact 2024",
"start_date": "2024-01-01",
"end_date": "2024-12-31",
"impact_categories": ["gwp", "ap", "ep"],
"products": [
{
"name": "Product A",
"quantity": 1.0,
"unit_id": "550e8400-e29b-41d4-a716-446655440000"
}
]
}'
import requests
import os
response = requests.post(
"https://api.dcycle.io/v1/lca/portfolio",
headers={
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
},
json={
"name": "Product A - Environmental Impact 2024",
"start_date": "2024-01-01",
"end_date": "2024-12-31",
"impact_categories": ["gwp", "ap", "ep"],
"products": [
{
"name": "Product A",
"quantity": 1.0,
"unit_id": "550e8400-e29b-41d4-a716-446655440000",
}
],
},
)
portfolio = response.json()
print(f"Created LCA portfolio: {portfolio['acv_id']}")
const axios = require('axios');
axios.post('https://api.dcycle.io/v1/lca/portfolio', {
name: 'Product A - Environmental Impact 2024',
start_date: '2024-01-01',
end_date: '2024-12-31',
impact_categories: ['gwp', 'ap', 'ep'],
products: [
{
name: 'Product A',
quantity: 1.0,
unit_id: '550e8400-e29b-41d4-a716-446655440000',
},
],
}, {
headers: {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
},
})
.then(({ data }) => {
console.log(`Created LCA portfolio: ${data.acv_id}`);
});
Successful Response
{
"acv_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"process": {
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"name": null,
"entity_id": null,
"entity_type": "process",
"coordinates_x": 0,
"coordinates_y": 0,
"inputs": [],
"outputs": [],
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:00:00Z"
},
"final_product": {
"id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
"name": "Product A",
"entity_id": null,
"entity_type": "final_product",
"coordinates_x": 400,
"coordinates_y": 0,
"inputs": [],
"outputs": [],
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:00:00Z"
},
"final_products": [
{
"id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
"name": "Product A",
"entity_id": null,
"entity_type": "final_product",
"coordinates_x": 400,
"coordinates_y": 0,
"inputs": [],
"outputs": [],
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:00:00Z"
}
]
}
Common Errors
401 Unauthorized
Cause: Missing or invalid API key{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}
403 Forbidden
Cause: The authenticated user is not a member of the organization{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}
422 Unprocessable Entity
Cause: Missing required fields or invalid product definition{
"detail": [
{
"loc": ["body", "__root__"],
"msg": "either 'products' or both 'value' and 'unit_id' must be provided",
"type": "value_error"
}
]
}
Related Endpoints
List LCA Portfolios
Browse all LCA portfolios
Get LCA Portfolio
Get portfolio details
LCA Dashboard
Get environmental impact results
Was this page helpful?