Skip to main content
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));
{
  "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

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

x-api-key
string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa
Content-Type
string
required
Must be application/json

Body Parameters

name
string
required
Name of the LCA portfolioExample: "Product A - Environmental Impact 2024"
start_date
string
required
Start date of the assessment periodFormat: YYYY-MM-DD
end_date
string
required
End date of the assessment periodFormat: YYYY-MM-DD
impact_categories
array[string]
required
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)
products
array[object]
Output co-products with their functional units. Either products or both value + unit_id must be provided.
value
number
Legacy single-product functional unit quantity. Use products instead for new integrations.
unit_id
string
Legacy functional unit identifier. Required when using value instead of products.

Response

Returns HTTP 201 with the created portfolio structure.
acv_id
string
UUID of the created LCA portfolio
process
object
The root process block (canvas node)
final_product
object
Primary output product block (same structure as process)
final_products
array[object]
All output co-product blocks (same structure as process)

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"
      }
    ]
  }'

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"
    }
  ]
}

List LCA Portfolios

Browse all LCA portfolios

Get LCA Portfolio

Get portfolio details

LCA Dashboard

Get environmental impact results