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

List Campaign Values

Retrieve a paginated, cross-recipient view of all submitted KPI values in a campaign. Each row is enriched with the KPI name, data owner email, organization, and facility.

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 parent dataset
campaign_id
string
required
UUID of the campaign

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 display context:
FieldTypeDescription
idstringValue UUID
kpi_idstringKPI definition UUID
kpi_namestringKPI display name
kpi_unitstringMeasurement unit (nullable)
value_numericnumberNumeric answer (nullable)
submitted_atstringISO 8601 timestamp
submitter_emailstringWho submitted
data_owner_emailstringAssigned data owner
organization_namestringOrganization name
facility_namestringFacility name (nullable)
total
integer
Total number of value rows across all pages

Example

curl -X GET "https://api.dcycle.io/v1/custom-kpi-datasets/${DATASET_ID}/campaigns/${CAMPAIGN_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_assignment_id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
      "assignment_id": "d4e5f6a7-b8c9-0123-defa-234567890123",
      "response_set_id": null,
      "kpi_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
      "value_numeric": 1250.5,
      "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"
    },
    {
      "id": "a2b3c4d5-e6f7-8901-bcde-f23456789012",
      "campaign_assignment_id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
      "assignment_id": "d4e5f6a7-b8c9-0123-defa-234567890123",
      "response_set_id": null,
      "kpi_id": "d4e5f6a7-b8c9-0123-defa-234567890124",
      "value_numeric": 85.0,
      "submitted_at": "2025-06-20T14:30:00Z",
      "submitter_email": "supplier@example.com",
      "submitter_user_id": null,
      "kpi_name": "Recycled water percentage",
      "kpi_unit": "%",
      "data_owner_email": "supplier@example.com",
      "organization_name": "Acme Corp",
      "facility_name": "Madrid Office"
    }
  ],
  "total": 12
}

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

Get Assignment Values

View one recipient’s values

Edit Values

Submit or update values