Skip to main content
GET
/
v1
/
custom-kpi-datasets
/
{dataset_id}
/
values
List Dataset Values
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/{dataset_id}/values', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "items": {},
  "total": 123,
  "response_count": 123
}

List Dataset Values

Retrieve a paginated, cross-campaign view of all submitted KPI values in a dataset. Each row is enriched with campaign context, KPI metadata, data owner, organization, and facility names — useful for building aggregate dashboards.

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

Query Parameters

page
integer
default:"1"
Page number (1-based)
size
integer
default:"20"
Page size (1–100)
sort
string
default:"-submitted_at"
Sort field. Prefix with - for descending.

Response

items
array[object]
Value rows enriched with campaign and display context:
FieldTypeDescription
idstringValue UUID
campaign_idstringCampaign UUID
campaign_namestringCampaign display name
campaign_period_startstringCampaign period start (ISO date)
campaign_period_endstringCampaign period end (ISO date)
campaign_assignment_idstringCampaign-assignment UUID
assignment_idstringDataset assignment UUID
kpi_idstringKPI definition UUID
kpi_namestringKPI display name
kpi_unitstringMeasurement unit (nullable)
value_numericnumberNumeric answer (nullable)
value_textstringText answer (nullable)
value_datestringDate answer (nullable)
option_idstringSelected option UUID (nullable)
submitted_atstringISO 8601 timestamp
submitter_emailstringWho submitted (nullable)
data_owner_emailstringAssigned data owner
organization_namestringOrganization name
facility_namestringFacility name (nullable)
attachmentsarrayEvidence files (file_id, file_name, file_url)
total
integer
Total number of value rows across all pages
response_count
integer
Total number of distinct response submissions

Example

curl -X GET "https://api.dcycle.io/v1/custom-kpi-datasets/${DATASET_ID}/values?page=1&size=10" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}"

Successful Response

{
  "items": [
    {
      "id": "e1f2a3b4-c5d6-7890-abcd-ef1234567890",
      "campaign_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "campaign_name": "Q1 2025 Water Survey",
      "campaign_period_start": "2025-01-01",
      "campaign_period_end": "2025-03-31",
      "campaign_assignment_id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
      "assignment_id": "d4e5f6a7-b8c9-0123-defa-234567890123",
      "kpi_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
      "value_numeric": 1250.5,
      "value_text": null,
      "value_date": null,
      "option_id": null,
      "submitted_at": "2025-06-20T14:30:00Z",
      "submitter_email": "supplier@example.com",
      "submitter_user_id": null,
      "kpi_name": "Total water consumption",
      "kpi_unit": "m³",
      "data_owner_email": "supplier@example.com",
      "organization_name": "Acme Corp",
      "facility_name": "Madrid Office",
      "attachments": [
        {
          "file_id": "a1b2c3d4-0000-0000-0000-000000000001",
          "file_name": "water-bill-q1.pdf",
          "file_url": "https://storage.dcycle.io/..."
        }
      ]
    }
  ],
  "total": 24,
  "response_count": 8
}

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: The dataset does not exist or belongs to another organization
{"detail": "Not Found"}

Campaign Values

View values scoped to a single campaign

Submit Response

Submit new KPI values