Update Custom Emission Group
const options = {
method: 'PATCH',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'x-user-id': '<x-user-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: '<string>', description: '<string>'})
};
fetch('https://api.dcycle.io/api/v1/custom_emission_groups/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/api/v1/custom_emission_groups/{id}"
payload = {
"name": "<string>",
"description": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"x-user-id": "<x-user-id>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)curl --request PATCH \
--url https://api.dcycle.io/api/v1/custom_emission_groups/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--header 'x-user-id: <x-user-id>' \
--data '
{
"name": "<string>",
"description": "<string>"
}
'Update Custom Emission Group
Update metadata of an existing custom emission group
PATCH
/
api
/
v1
/
custom_emission_groups
/
{id}
Update Custom Emission Group
const options = {
method: 'PATCH',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'x-user-id': '<x-user-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: '<string>', description: '<string>'})
};
fetch('https://api.dcycle.io/api/v1/custom_emission_groups/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/api/v1/custom_emission_groups/{id}"
payload = {
"name": "<string>",
"description": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"x-user-id": "<x-user-id>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)curl --request PATCH \
--url https://api.dcycle.io/api/v1/custom_emission_groups/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--header 'x-user-id: <x-user-id>' \
--data '
{
"name": "<string>",
"description": "<string>"
}
'Update Custom Emission Group
Update the name and description of an existing custom emission group.You can only update the
name and description fields. To change category or ghg_type, delete the group and create a new one.Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
ff4adcc7-8172-45fe-9cf1-e90a6de53aa9string
required
Your user UUIDExample:
a1b2c3d4-e5f6-7890-abcd-ef1234567890Path Parameters
string
required
UUID of the Custom Emission Group to update
Body Parameters
All fields are optional - only include the fields you want to update.string
Updated name for the groupExample:
"Supplier ABC Materials 2024 (Updated)"string
Updated descriptionExample:
"EPD-verified emission factors, updated Q2 2024"Response
Returns the complete updated group object.{
"id": "group-uuid",
"name": "Supplier ABC Materials 2024 (Updated)",
"category": "purchases",
"description": "EPD-verified emission factors, updated Q2 2024",
"ghg_type": 1
}
Example
curl -X PATCH "https://api.dcycle.io/api/v1/custom_emission_groups/group-uuid" \
-H "Authorization: Bearer ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}" \
-H "x-user-id: ${DCYCLE_USER_ID}" \
-H "Content-Type: application/json" \
-d '{
"name": "Supplier ABC Materials 2024 (Updated)",
"description": "EPD-verified emission factors, updated Q2 2024"
}'
import requests
import os
headers = {
"Authorization": f"Bearer {os.getenv('DCYCLE_API_KEY')}",
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
"x-user-id": os.getenv("DCYCLE_USER_ID"),
"Content-Type": "application/json"
}
group_id = "group-uuid"
update_data = {
"name": "Supplier ABC Materials 2024 (Updated)",
"description": "EPD-verified emission factors, updated Q2 2024"
}
response = requests.patch(
f"https://api.dcycle.io/api/v1/custom_emission_groups/{group_id}",
headers=headers,
json=update_data
)
updated_group = response.json()
print(f"✅ Updated: {updated_group['name']}")
const axios = require('axios');
const headers = {
'Authorization': `Bearer ${process.env.DCYCLE_API_KEY}`,
'x-organization-id': process.env.DCYCLE_ORG_ID,
'x-user-id': process.env.DCYCLE_USER_ID,
'Content-Type': 'application/json'
};
const groupId = 'group-uuid';
const updateData = {
name: 'Supplier ABC Materials 2024 (Updated)',
description: 'EPD-verified emission factors, updated Q2 2024'
};
axios.patch(
`https://api.dcycle.io/api/v1/custom_emission_groups/${groupId}`,
updateData,
{ headers }
)
.then(response => {
const updatedGroup = response.data;
console.log(`✅ Updated: ${updatedGroup.name}`);
})
.catch(error => console.error(error));
Use Cases
Update Description with Audit Trail
Add documentation updates to description:group = requests.get(
f"https://api.dcycle.io/api/v1/custom_emission_groups/{group_id}",
headers=headers
).json()
from datetime import date
updated_description = f"{group['description']} | Updated {date.today().isoformat()} by procurement team"
requests.patch(
f"https://api.dcycle.io/api/v1/custom_emission_groups/{group_id}",
headers=headers,
json={"description": updated_description}
)
Rename Group
Update group name to reflect changes:requests.patch(
f"https://api.dcycle.io/api/v1/custom_emission_groups/{group_id}",
headers=headers,
json={
"name": "Supplier ABC Materials 2024-2025",
"description": "Extended validity period for 2024-2025"
}
)
Common Errors
404 Not Found
Cause: Custom emission group not found{
"detail": "Custom emission group not found",
"code": "NOT_FOUND"
}
Related Endpoints
Get Group
View current values
Delete Group
Remove group
Was this page helpful?