Skip to main content
GET
/
v1
/
custom-kpi-datasets
List Datasets
const options = {
  method: 'GET',
  headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};

fetch('https://api.dcycle.io/v1/custom-kpi-datasets', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "id": "<string>",
  "organization_id": "<string>",
  "name": "<string>",
  "description": "<string>",
  "created_by": "<string>",
  "created_at": {},
  "updated_at": {}
}

List Datasets

Retrieve all custom KPI datasets belonging to your organization. Each dataset defines a collection of KPI questions that can be assigned to data owners via campaigns.

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

Response

Returns an array of dataset objects with HTTP 200.
id
string
UUID of the dataset
organization_id
string
UUID of the owning organization
name
string
Dataset name
description
string
Dataset description (nullable)
created_by
string
UUID of the user who created the dataset (nullable)
created_at
datetime
ISO 8601 timestamp
updated_at
datetime | null
ISO 8601 timestamp (nullable)

Example

curl -X GET "https://api.dcycle.io/v1/custom-kpi-datasets" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}"

Successful Response

[
  {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "organization_id": "a8315ef3-dd50-43f8-b7ce-d839e68d51fa",
    "name": "Water Usage Survey",
    "description": "Monthly water consumption across facilities",
    "created_by": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "updated_by": null,
    "created_at": "2025-01-15T10:30:00Z",
    "updated_at": null
  },
  {
    "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "organization_id": "a8315ef3-dd50-43f8-b7ce-d839e68d51fa",
    "name": "Waste Tracking",
    "description": null,
    "created_by": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "updated_by": null,
    "created_at": "2025-02-01T09:00:00Z",
    "updated_at": null
  }
]

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"}

Create Dataset

Create a new dataset with KPI definitions

Get Dataset

View a dataset with its KPIs