Skip to main content
PATCH
/
v1
/
lca
/
portfolio
/
{lca_id}
Update LCA Portfolio
const options = {
  method: 'PATCH',
  headers: {
    'x-api-key': '<x-api-key>',
    'x-organization-id': '<x-organization-id>',
    'Content-Type': '<content-type>'
  },
  body: JSON.stringify({
    name: '<string>',
    description: '<string>',
    start_date: '<string>',
    end_date: '<string>',
    value: 123,
    unit_id: '<string>',
    impact_categories: {}
  })
};

fetch('https://api.dcycle.io/v1/lca/portfolio/{lca_id}', 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/{lca_id}"

payload = {
    "name": "<string>",
    "description": "<string>",
    "start_date": "<string>",
    "end_date": "<string>",
    "value": 123,
    "unit_id": "<string>",
    "impact_categories": {}
}
headers = {
    "x-api-key": "<x-api-key>",
    "x-organization-id": "<x-organization-id>",
    "Content-Type": "<content-type>"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
curl --request PATCH \
  --url https://api.dcycle.io/v1/lca/portfolio/{lca_id} \
  --header 'Content-Type: <content-type>' \
  --header 'x-api-key: <x-api-key>' \
  --header 'x-organization-id: <x-organization-id>' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "start_date": "<string>",
  "end_date": "<string>",
  "value": 123,
  "unit_id": "<string>",
  "impact_categories": {}
}
'
{
  "id": "<string>",
  "organization_id": "<string>",
  "name": "<string>",
  "description": {},
  "impact_categories": {},
  "final_product_id": {},
  "unit_id": "<string>",
  "value": 123,
  "start_date": "<string>",
  "end_date": "<string>",
  "status": "<string>",
  "created_at": {},
  "updated_at": {}
}

Update LCA Portfolio

Updates an existing LCA portfolio. Only the fields you include in the request body will be modified — all other fields remain unchanged.

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

Path Parameters

lca_id
string
required
UUID of the LCA portfolio to updateExample: 550e8400-e29b-41d4-a716-446655440000

Body Parameters

All fields are optional — include only the fields you want to change.
name
string
Updated nameExample: "Product A - LCA 2025"
description
string
Updated description
start_date
string
Updated start date (YYYY-MM-DD)
end_date
string
Updated end date (YYYY-MM-DD)
value
number
Updated functional unit quantity
unit_id
string
Updated functional unit identifier
impact_categories
array[string]
Updated list of impact category identifiersCommon values: gwp, ap, ep, pocp, adp

Response

Returns the updated portfolio (HTTP 200).
id
string
UUID of the LCA portfolio
organization_id
string
UUID of the organization
name
string
Portfolio name
description
string | null
Portfolio description
impact_categories
array[string]
Impact category identifiers
final_product_id
string | null
UUID of the primary output product
unit_id
string
Functional unit identifier
value
number
Functional unit quantity
start_date
date
Assessment period start date
end_date
date
Assessment period end date
status
string
Current portfolio status
created_at
datetime
When the portfolio was created
updated_at
datetime | null
When the portfolio was last updated

Example

curl -X PATCH "https://api.dcycle.io/v1/lca/portfolio/${LCA_ID}" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Product A - LCA 2025",
    "description": "Updated cradle-to-gate assessment",
    "start_date": "2025-01-01",
    "end_date": "2025-12-31"
  }'
import requests
import os

lca_id = "550e8400-e29b-41d4-a716-446655440000"

response = requests.patch(
    f"https://api.dcycle.io/v1/lca/portfolio/{lca_id}",
    headers={
        "x-api-key": os.getenv("DCYCLE_API_KEY"),
        "x-organization-id": os.getenv("DCYCLE_ORG_ID"),
    },
    json={
        "name": "Product A - LCA 2025",
        "description": "Updated cradle-to-gate assessment",
        "start_date": "2025-01-01",
        "end_date": "2025-12-31",
    },
)

portfolio = response.json()
print(f"Updated: {portfolio['name']} ({portfolio['start_date']} to {portfolio['end_date']})")
const axios = require('axios');

const lcaId = '550e8400-e29b-41d4-a716-446655440000';

axios.patch(`https://api.dcycle.io/v1/lca/portfolio/${lcaId}`, {
  name: 'Product A - LCA 2025',
  description: 'Updated cradle-to-gate assessment',
  start_date: '2025-01-01',
  end_date: '2025-12-31',
}, {
  headers: {
    'x-api-key': process.env.DCYCLE_API_KEY,
    'x-organization-id': process.env.DCYCLE_ORG_ID,
  },
})
.then(({ data }) => {
  console.log(`Updated: ${data.name} (${data.start_date} to ${data.end_date})`);
});

Successful Response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "organization_id": "a8315ef3-dd50-43f8-b7ce-d839e68d51fa",
  "name": "Product A - LCA 2025",
  "description": "Updated cradle-to-gate assessment",
  "impact_categories": ["gwp", "ap", "ep"],
  "final_product_id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
  "unit_id": "kg",
  "value": 1.0,
  "start_date": "2025-01-01",
  "end_date": "2025-12-31",
  "status": "active",
  "created_at": "2024-01-15T10:00:00Z",
  "updated_at": "2025-07-02T13: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"}

404 Not Found

Cause: LCA portfolio not found or doesn’t belong to your organization
{"detail": "LCA Portfolio not found"}

Get LCA Portfolio

View portfolio details

Delete LCA Portfolio

Remove a portfolio

LCA Dashboard

View environmental impact results