> ## Documentation Index
> Fetch the complete documentation index at: https://code.dcycle.io/llms.txt
> Use this file to discover all available pages before exploring further.

# List Available Datasets

> Enumerate the dataset keys this organization can query, native and custom

Return the catalogue of dataset keys available to the authenticated organization. This is the discovery step for [Query datasets](/api-reference/datasets/query): 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

<ParamField header="x-api-key" type="string" required>
  Your API key for authentication

  **Example:** `sk_live_1234567890abcdef`
</ParamField>

<ParamField header="x-organization-id" type="string" required>
  Your organization UUID

  **Example:** `a8315ef3-dd50-43f8-b7ce-d839e68d51fa`
</ParamField>

## Response

A bare JSON array, not paginated.

<ResponseField name="key" type="string">
  Stable dataset key. Pass it to the query and schema endpoints. Custom datasets carry the `elastic:` prefix.
</ResponseField>

<ResponseField name="label_key" type="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.
</ResponseField>

<ResponseField name="kind" type="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)
</ResponseField>

<Note>
  **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.
</Note>

## 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](/api-reference/own-workforce/overview) 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

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X GET "https://api.dcycle.io/v1/datasets" \
    -H "x-api-key: ${DCYCLE_API_KEY}" \
    -H "x-organization-id: ${DCYCLE_ORG_ID}"
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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"])
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  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));
  ```
</CodeGroup>

### Successful Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
[
  { "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 in `x-organization-id` — the two are looked up as a pair. A request carrying no credentials at all answers `AUTH_REQUIRED` instead.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": "Invalid API key for organization",
  "code": "INVALID_API_KEY"
}
```

### 400 Bad Request

**Cause:** `x-organization-id` absent while authenticating with an API key.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": "x-organization-id header required when using API key authentication",
  "code": "ORGANIZATION_ID_REQUIRED"
}
```

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Get dataset schema" icon="table-list" href="/api-reference/datasets/schema">
    The dimensions and metrics of one key
  </Card>

  <Card title="Query datasets" icon="chart-simple" href="/api-reference/datasets/query">
    Aggregate a dataset
  </Card>
</CardGroup>
