curl -X POST "https://api.dcycle.io/v1/emission-factors/custom-databases/5f1c2e7a-3b4d-4e8f-9a01-2c3d4e5f6a7b/versions" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}" \
-H "Content-Type: application/json" \
-d '{
"version": "2024 measured",
"reference_year": 2024
}'
import os
import requests
response = requests.post(
"https://api.dcycle.io/v1/emission-factors/custom-databases/5f1c2e7a-3b4d-4e8f-9a01-2c3d4e5f6a7b/versions",
headers={
"x-api-key": os.environ["DCYCLE_API_KEY"],
"x-organization-id": os.environ["DCYCLE_ORG_ID"],
},
json={
"version": "2024 measured",
"reference_year": 2024
},
timeout=30,
)
response.raise_for_status()
print(response.json())
const axios = require('axios');
const response = await axios.post('https://api.dcycle.io/v1/emission-factors/custom-databases/5f1c2e7a-3b4d-4e8f-9a01-2c3d4e5f6a7b/versions', {
"version": "2024 measured",
"reference_year": 2024
}, {
headers: {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
},
});
console.log(response.status, response.data);
{
"id": "7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d",
"name": "custom:5f1c2e7a-3b4d-4e8f-9a01-2c3d4e5f6a7b:acme-measured-factors",
"version": "2024 measured",
"internal_incremental_version": 1,
"reference_year": 2024,
"url": null,
"record_count": 0,
"matching_record_count": null
}
Create Custom Database Version
Create a version in a custom emission factor database
POST
/
v1
/
emission-factors
/
custom-databases
/
{database_id}
/
versions
curl -X POST "https://api.dcycle.io/v1/emission-factors/custom-databases/5f1c2e7a-3b4d-4e8f-9a01-2c3d4e5f6a7b/versions" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}" \
-H "Content-Type: application/json" \
-d '{
"version": "2024 measured",
"reference_year": 2024
}'
import os
import requests
response = requests.post(
"https://api.dcycle.io/v1/emission-factors/custom-databases/5f1c2e7a-3b4d-4e8f-9a01-2c3d4e5f6a7b/versions",
headers={
"x-api-key": os.environ["DCYCLE_API_KEY"],
"x-organization-id": os.environ["DCYCLE_ORG_ID"],
},
json={
"version": "2024 measured",
"reference_year": 2024
},
timeout=30,
)
response.raise_for_status()
print(response.json())
const axios = require('axios');
const response = await axios.post('https://api.dcycle.io/v1/emission-factors/custom-databases/5f1c2e7a-3b4d-4e8f-9a01-2c3d4e5f6a7b/versions', {
"version": "2024 measured",
"reference_year": 2024
}, {
headers: {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
},
});
console.log(response.status, response.data);
{
"id": "7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d",
"name": "custom:5f1c2e7a-3b4d-4e8f-9a01-2c3d4e5f6a7b:acme-measured-factors",
"version": "2024 measured",
"internal_incremental_version": 1,
"reference_year": 2024,
"url": null,
"record_count": 0,
"matching_record_count": null
}
← Custom Emission Factors
A version is a release of the database’s factors, typically one per reference year. Its
id is the source_id of the record endpoints.
Beta. Part of the custom emission factors API, currently in beta. The contract may still change before general
availability.
curl -X POST "https://api.dcycle.io/v1/emission-factors/custom-databases/5f1c2e7a-3b4d-4e8f-9a01-2c3d4e5f6a7b/versions" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}" \
-H "Content-Type: application/json" \
-d '{
"version": "2024 measured",
"reference_year": 2024
}'
import os
import requests
response = requests.post(
"https://api.dcycle.io/v1/emission-factors/custom-databases/5f1c2e7a-3b4d-4e8f-9a01-2c3d4e5f6a7b/versions",
headers={
"x-api-key": os.environ["DCYCLE_API_KEY"],
"x-organization-id": os.environ["DCYCLE_ORG_ID"],
},
json={
"version": "2024 measured",
"reference_year": 2024
},
timeout=30,
)
response.raise_for_status()
print(response.json())
const axios = require('axios');
const response = await axios.post('https://api.dcycle.io/v1/emission-factors/custom-databases/5f1c2e7a-3b4d-4e8f-9a01-2c3d4e5f6a7b/versions', {
"version": "2024 measured",
"reference_year": 2024
}, {
headers: {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
},
});
console.log(response.status, response.data);
{
"id": "7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d",
"name": "custom:5f1c2e7a-3b4d-4e8f-9a01-2c3d4e5f6a7b:acme-measured-factors",
"version": "2024 measured",
"internal_incremental_version": 1,
"reference_year": 2024,
"url": null,
"record_count": 0,
"matching_record_count": null
}
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51fastring
required
Must be
application/jsonuuid
required
The database id.Example:
5f1c2e7a-3b4d-4e8f-9a01-2c3d4e5f6a7bBody Parameters
string
required
Version label, 1 to 255 characters.Example:
"2024 measured"integer | null
Year the factors refer to, between 1900 and 2200.Example:
2024string | null
Reference URL (e.g. the report the factors come from), up to 2,048 characters.
Response
The created version (201 Created):
uuid
Version id: the
source_id used in record paths.string
Internal name, generated from the database.
string
The version label you set.
integer
1 for the first version of the database, then 2, 3…
integer | null
Year the factors refer to.
string | null
Reference URL.
integer
Number of records.
integer | null
Records linked to the
activity_category you filtered by; null without the filter.Common Errors
401 Unauthorized
Missing or invalid API key.403 Forbidden
LOGGED_USER_NOT_MEMBER: the API key’s user is not a member of the organization in x-organization-id.
404 CUSTOM_DATABASE_NOT_FOUND
The database does not exist or is not visible to your organization.403 CUSTOM_DATABASE_NOT_OWNER
Only the organization that owns the database can add versions.Related Endpoints
Create Record
Next step: a factor in the version
List Versions
Versions of a database
Was this page helpful?