Skip to main content
PATCH
/
v1
/
custom-kpi-datasets
/
{dataset_id}
Update Dataset
const options = {
  method: 'PATCH',
  headers: {
    'x-api-key': '<x-api-key>',
    'x-organization-id': '<x-organization-id>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({name: '<string>', description: '<string>'})
};

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

Update Dataset

Update the name or description of an existing custom KPI dataset. Only send the fields you want to change.
To manage the KPIs within a dataset, use the KPI endpoints (create, update, delete KPIs individually).

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

Path Parameters

dataset_id
string
required
UUID of the dataset to updateExample: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"

Body Parameters

All fields are optional — only send what you want to change.
name
string
New dataset name (1–255 characters)
description
string
New dataset description (max 2000 characters)

Response

Returns the updated dataset with its KPI definitions (HTTP 200). See Get Dataset for the full response shape.
id
string
Dataset UUID.
name
string
Dataset display name.
description
string | null
Dataset description.
kpis
array[object]
KPI definitions. See Get Dataset for the nested KPI object shape.
created_at
datetime
Creation timestamp (ISO 8601).
updated_at
string | null
Last update timestamp (ISO 8601).

Example

curl -X PATCH "https://api.dcycle.io/v1/custom-kpi-datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}" \
  -H "Content-Type: application/json" \
  -d '{"name": "Water & Waste Survey 2025", "description": "Updated to include waste metrics"}'

Successful Response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "organization_id": "a8315ef3-dd50-43f8-b7ce-d839e68d51fa",
  "name": "Water & Waste Survey 2025",
  "description": "Updated to include waste metrics",
  "created_by": "c3d4e5f6-a7b8-9012-cdef-345678901234",
  "updated_by": "c3d4e5f6-a7b8-9012-cdef-345678901234",
  "created_at": "2025-05-01T09:00:00Z",
  "updated_at": "2025-06-18T14:30:00Z"
}

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

404 Not Found

Cause: Dataset not found
{
  "detail": "Dataset not found"
}

Get Dataset

View current dataset details

List Datasets

View all datasets