Skip to main content
POST
/
v1
/
custom-kpi-datasets
Create Dataset
const options = {
  method: 'POST',
  headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    name: '<string>',
    description: '<string>',
    kpis: [
      {
        name: '<string>',
        description: '<string>',
        unit: '<string>',
        value_type: 'number',
        required: true,
        sort_order: 0
      }
    ]
  })
};

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": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "description": "<string>",
  "created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "updated_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "updated_at": "2023-11-07T05:31:56Z",
  "kpis": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "sort_order": 123,
      "created_at": "2023-11-07T05:31:56Z",
      "description": "<string>",
      "unit": "<string>",
      "value_type": "number",
      "required": true,
      "updated_at": "2023-11-07T05:31:56Z"
    }
  ]
}

Authorizations

x-api-key
string
header
required

Headers

x-organization-id
string
x-api-key
string
x-user-id
string

Body

application/json

Request schema for creating a new custom KPI dataset with optional inline KPIs.

name
string
required

The dataset name.

Required string length: 1 - 255
description
string

The dataset description.

Maximum string length: 2000
kpis
KpiInlineCreateSch · object[]
Maximum array length: 100

Response

Successful Response

Response schema for a custom KPI dataset including its nested KPI definitions.

id
string<uuid>
required

The dataset id.

organization_id
string<uuid>
required

The owning organization id.

name
string
required
created_at
string<date-time>
required
description
string
created_by
string<uuid>
updated_by
string<uuid>
updated_at
string<date-time>
kpis
KpiSch · object[]