List Available Datasets
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/datasets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/datasets"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v1/datasets \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"key": "<string>",
"label_key": "<string>",
"kind": "<string>"
}List Available Datasets
Enumerate the dataset keys this organization can query, native and custom
GET
/
v1
/
datasets
List Available Datasets
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/datasets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/datasets"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v1/datasets \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"key": "<string>",
"label_key": "<string>",
"kind": "<string>"
}Return the catalogue of dataset keys available to the authenticated organization. This is the discovery step for Query datasets: without it, the keys are not enumerable from the API at all.
The response is two halves concatenated. First the native datasets, defined in code and identical for every organization. Then the organization’s own custom (elastic) datasets, keyed as
elastic:<uuid>.
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faResponse
A bare JSON array, not paginated.string
Stable dataset key. Pass it to the query and schema endpoints. Custom datasets carry the
elastic: prefix.string
For native datasets, an i18n key such as
datasets.own_workforce_contracts.label — translate it against your locale bundle.For custom datasets this is not an i18n key: it is the literal name a user typed. Do not run it through translation.string
kpi, activity, master (native master-data tables such as facilities and vehicles), custom (a user-created elastic dataset) or custom_kpi (a custom-KPI group, one column per KPI)The native half is not filtered by permissions, feature flags or data volume. Every organization sees the same native keys, including ones it has no rows for. A key appearing here does not mean the organization has data behind it — query it and read the result. Only the custom half is organization-specific.
Own workforce datasets
Seven of the native keys cover the social pillar, and they are the cheap way to get aggregates that the Own Workforce API would otherwise make you compute client-side:| Key | What it aggregates |
|---|---|
own_workforce_contracts | Headcount, FTE and contract composition |
own_workforce_remuneration | Average remuneration and the gender pay gap |
own_workforce_trainings | Training hours |
own_workforce_absenteeism | Absence hours |
own_workforce_accidents | Accidents, split by whether they caused sick leave |
own_workforce_hires | Contracts that started in the window, on the contract start date |
own_workforce_layoffs | Contract terminations, on the contract end date |
Example
curl -X GET "https://api.dcycle.io/v1/datasets" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import os
import requests
headers = {
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
}
datasets = requests.get("https://api.dcycle.io/v1/datasets", headers=headers).json()
social = [d for d in datasets if d["key"].startswith("own_workforce")]
for dataset in social:
print(dataset["key"], dataset["kind"])
const axios = require('axios');
const headers = {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID
};
axios.get('https://api.dcycle.io/v1/datasets', { headers })
.then(({ data }) => {
data
.filter(dataset => dataset.key.startsWith('own_workforce'))
.forEach(dataset => console.log(dataset.key, dataset.kind));
})
.catch(error => console.error(error));
Successful Response
[
{ "key": "emissions", "label_key": "datasets.emissions.label", "kind": "kpi" },
{ "key": "own_workforce_contracts", "label_key": "datasets.own_workforce_contracts.label", "kind": "activity" },
{ "key": "own_workforce_remuneration", "label_key": "datasets.own_workforce_remuneration.label", "kind": "activity" },
{ "key": "facilities", "label_key": "datasets.facilities.label", "kind": "master" },
{ "key": "elastic:3f0c8d21-5b4a-4e6f-9c8d-1a2b3c4d5e6f", "label_key": "Critical suppliers", "kind": "custom" }
]
Common Errors
401 Unauthorized
Cause: the key is invalid, or it does not belong to the organization inx-organization-id — the two are looked up as a pair. A request carrying no credentials at all answers AUTH_REQUIRED instead.
{
"detail": "Invalid API key for organization",
"code": "INVALID_API_KEY"
}
400 Bad Request
Cause:x-organization-id absent while authenticating with an API key.
{
"detail": "x-organization-id header required when using API key authentication",
"code": "ORGANIZATION_ID_REQUIRED"
}
Related Endpoints
Get dataset schema
The dimensions and metrics of one key
Query datasets
Aggregate a dataset
Was this page helpful?