Skip to main content
POST
Create KPI
← Custom KPI Add a new KPI (question) definition to a dataset. Each KPI defines what data owners will be asked during campaigns.

Request

Headers

string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Path Parameters

string
required
UUID of the parent datasetExample: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"

Body Parameters

string
required
KPI name (1–255 characters)Example: "Monthly electricity consumption"
string
KPI description (max 2000 characters)Example: "Total kWh consumed from all sources"
string
Measurement unit (max 50 characters)Example: "kWh", "m³", "tonnes"
string
default:"number"
Expected answer type. One of: number, text, percentage, date, boolean, select, number_breakdown.A number_breakdown KPI asks for one amount per category (its options) — litres of diesel, of petrol… — and its value is the sum of those amounts.
boolean
default:"true"
Whether a response value is mandatory
integer
default:"0"
Display order within the dataset (0-based)
array[object]
Required for select and number_breakdown types. List of options (2–100): the choices of a select, the categories of a number_breakdown. Each object has:Options are forbidden for every other type.

Response

Returns the created KPI definition (HTTP 201).
string
KPI UUID.
string
Parent dataset UUID.
string
KPI display name.
string | null
KPI description.
string | null
Measurement unit (e.g. m³, kWh).
string
Data type: number, text, percentage, date, boolean, select, or number_breakdown.
boolean
Whether a response value is mandatory.
integer
Display order within the dataset.
array[object]
The choices of a select KPI or the categories of a number_breakdown KPI. Each has id, label, and sort_order. Empty array for other types.
datetime
Timestamp when the KPI was created
datetime | null
Timestamp when the KPI was last updated

Example

Successful Response

Select Type Example

Number Breakdown Type Example

Respondents then answer with one amount per category: see Submit Response.

Common Errors

401 Unauthorized

Cause: Missing or invalid API key

403 Forbidden

Cause: The authenticated user is not a member of the organization

422 Validation Error

Cause: select or number_breakdown KPI missing options (the message names the type: A number_breakdown KPI must define options. for a breakdown)
Cause: Options provided for a type other than select or number_breakdown

404 Not Found

Cause: Dataset not found

Update KPI

Modify a KPI definition

Delete KPI

Remove a KPI from the dataset