Skip to content
View as Markdown

Kpi settings ​

Employee KPI configuration

INFO

Every response arrives in the shared envelope — code, message, messages, status_code, time — with the payload in data. The tables below describe what is inside data.

POST /kpi-settings/create ​

Create a new KPI settings record for a given period and set of employees.

Required permission: kpi_settings_create · how permissions work

Example request

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/create' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "organization_id": "string",
  "user_ids": [
    "string"
  ],
  "period": "week",
  "calculation_method": "progressive",
  "date_from": "2025-05-01T12:00:00Z",
  "conditions": [
    {
      "logical_operator": false,
      "source_metric_code": "net_sales",
      "tiers": []
    }
  ],
  "bonus_metric_code": "percent_of_net_sales",
  "bonuses": [
    0
  ],
  "filter_enabled": false,
  "state": "draft"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/create', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "organization_id": "string",
    "user_ids": [
      "string"
    ],
    "period": "week",
    "calculation_method": "progressive",
    "date_from": "2025-05-01T12:00:00Z",
    "conditions": [
      {
        "logical_operator": false,
        "source_metric_code": "net_sales",
        "tiers": []
      }
    ],
    "bonus_metric_code": "percent_of_net_sales",
    "bonuses": [
      0
    ],
    "filter_enabled": false,
    "state": "draft"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/create",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "organization_id": "string",
        "user_ids": [
            "string",
        ],
        "period": "week",
        "calculation_method": "progressive",
        "date_from": "2025-05-01T12:00:00Z",
        "conditions": [
            {
                "logical_operator": False,
                "source_metric_code": "net_sales",
                "tiers": [],
            },
        ],
        "bonus_metric_code": "percent_of_net_sales",
        "bonuses": [
            0,
        ],
        "filter_enabled": False,
        "state": "draft",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "organization_id": "string",
  "user_ids": [
    "string"
  ],
  "period": "week",
  "calculation_method": "progressive",
  "date_from": "2025-05-01T12:00:00Z",
  "conditions": [
    {
      "logical_operator": false,
      "source_metric_code": "net_sales",
      "tiers": []
    }
  ],
  "bonus_metric_code": "percent_of_net_sales",
  "bonuses": [
    0
  ],
  "filter_enabled": false,
  "state": "draft"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/create');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Request body

FieldTypeRequiredDescription
organization_idstringYesOrganization ObjectId this KPI setting belongs to
namestringNoOptional display name for the KPI setting
user_idsstring[]YesObjectIds of the employees this KPI setting applies to
periodstringYesKPI evaluation period. One of: week, month, quarter, year
calculation_methodstringYesHow the bonus is calculated across tiers: progressive (each tier adds to the previous) or threshold (only the matched tier applies). One of: progressive, threshold
date_fromstring (date-time)YesStart date of the KPI period
filter_enabledbooleanYesWhether product/customer filters are active for this KPI setting. Default: false
filterobjectNoOptional product and customer scope filters
filter.is_all_categoriesbooleanNo
filter.customer_category_idsstring[]NoCustomer category ObjectIds to include
filter.customer_idsstring[]NoSpecific customer ObjectIds to include
filter.product_category_idsstring[]No
filter.product_idsstring[]NoSpecific product ObjectIds to include
conditionsobject[]YesOne or more KPI plan conditions defining the performance metric and tier thresholds
conditions[].logical_operatorbooleanYestrue = AND with the next condition, false = OR
conditions[].source_metric_codestringYesThe performance metric used to evaluate this condition. One of: net_sales, sales_count, avg_net_sales, profit, paid, paid_percent, items_sold
conditions[].tiersobject[]YesThreshold tiers for this condition
conditions[].tiers[].min_valuenumberYesMinimum metric value for this tier to activate
conditions[].tiers[].max_valuenumberNoMaximum metric value for this tier (omit for the top tier)
bonus_metric_codestringYesHow the bonus amount is computed from the employee's results. One of: percent_of_net_sales, percent_of_payment, percent_of_profit, per_sale, fixed_amount, per_item_sold
bonusesnumber[]YesBonus amounts or percentages, one entry per tier in the conditions
responsible_idstringNo
statestringYesOne of: draft, active
attachmentsobject[]No
attachments[].namestringNo
attachments[].pathstringYes
attachments[].sizenumberNo
attachments[].notestringNo
json
{
  "organization_id": "string",
  "name": "string",
  "user_ids": [
    "string"
  ],
  "period": "week",
  "calculation_method": "progressive",
  "date_from": "2025-05-01T12:00:00Z",
  "filter_enabled": false,
  "filter": {
    "is_all_categories": false,
    "customer_category_ids": [
      "string"
    ],
    "customer_ids": [
      "string"
    ],
    "product_category_ids": [
      "string"
    ],
    "product_ids": [
      "string"
    ]
  },
  "conditions": [
    {
      "logical_operator": false,
      "source_metric_code": "net_sales",
      "tiers": []
    }
  ],
  "bonus_metric_code": "percent_of_net_sales",
  "bonuses": [
    0
  ],
  "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "state": "draft",
  "attachments": [
    {
      "name": "string",
      "path": "string",
      "size": 0,
      "note": "string"
    }
  ]
}

Response

FieldTypeDescription
_idstringKPI settings ObjectId
organization_idstring
namestring
currency_idstring
user_idsstring[]
periodstringOne of: week, month, quarter, year
calculation_methodstringOne of: progressive, threshold
statestringOne of: draft, active, locked, approved, canceled
date_fromstring (date-time)
date_tostring (date-time)
yearnumber
quarterstring
monthstring
weekstring
filter_enabledboolean
filterobject
filter.is_all_categoriesboolean
filter.customer_category_idsstring[]
filter.customer_nested_category_idsstring[]
filter.customer_idsstring[]
filter.product_category_idsstring[]
filter.product_nested_category_idsstring[]
filter.product_idsstring[]
conditionsobject[]
conditions[].logical_operatorboolean
conditions[].source_metric_codestringOne of: net_sales, sales_count, avg_net_sales, profit, paid, paid_percent, items_sold
conditions[].tiersobject[]
conditions[].tiers[].min_valuenumber
conditions[].tiers[].max_valuenumber
bonus_metric_codestringOne of: percent_of_net_sales, percent_of_payment, percent_of_profit, per_sale, fixed_amount, per_item_sold
bonusesnumber[]
created_atstring (date-time)
updated_atstring (date-time)
is_deletedboolean
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "string",
    "organization_id": "string",
    "name": "string",
    "currency_id": "string",
    "user_ids": [
      "string"
    ],
    "period": "week",
    "calculation_method": "progressive",
    "state": "draft",
    "date_from": "2025-05-01T12:00:00Z",
    "date_to": "2025-05-01T12:00:00Z",
    "year": 0,
    "quarter": "string",
    "month": "string",
    "week": "string",
    "filter_enabled": false,
    "filter": {
      "is_all_categories": false,
      "customer_category_ids": [
        "string"
      ],
      "customer_nested_category_ids": [
        "string"
      ],
      "customer_ids": [
        "string"
      ],
      "product_category_ids": [
        "string"
      ],
      "product_nested_category_ids": [
        "string"
      ],
      "product_ids": [
        "string"
      ]
    },
    "conditions": [
      {
        "logical_operator": false,
        "source_metric_code": "net_sales",
        "tiers": []
      }
    ],
    "bonus_metric_code": "percent_of_net_sales",
    "bonuses": [
      0
    ],
    "created_at": "2025-05-01T12:00:00Z",
    "updated_at": "2025-05-01T12:00:00Z",
    "is_deleted": false
  },
  "time": "2025-05-01T12:00:00Z"
}

GET /kpi-settings/get-by-id/{id} ​

Fetch a single KPI settings record by ObjectId.

Required permission: kpi_settings · how permissions work

Example request

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/get-by-id/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/get-by-id/6712f0a9c4d1e87b3a0f9911', {
  method: 'GET',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "GET",
    "https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/get-by-id/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
php
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/get-by-id/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Path parameters

ParameterTypeRequiredDescription
idstringYesKPI settings ObjectId

Request body

No request body.

Response

Same response shape as POST /kpi-settings/create.

POST /kpi-settings/get-paging ​

Paginated list of KPI settings records, optionally filtered by organization or period.

Required permission: kpi_settings · how permissions work

Example request

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/get-paging' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 1,
  "limit": 20
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/get-paging', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "page": 1,
    "limit": 20
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/get-paging",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 1,
        "limit": 20,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "page": 1,
  "limit": 20
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/get-paging');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Request body

FieldTypeRequiredDescription
pagenumberYesDefault: 1
limitnumberYesDefault: 20
organization_idstringNoFilter by organization ObjectId
periodstringNoFilter by KPI period. One of: week, month, quarter, year
statestringNoFilter by KPI settings state. One of: draft, active, locked, approved, canceled
bonus_metric_codestringNoOne of: percent_of_net_sales, percent_of_payment, percent_of_profit, per_sale, fixed_amount, per_item_sold, per_item_produced
searchstringNoFree-text search.
updated_atstring (date-time)NoOnly records updated at or after this time.
date_fromstring (date-time)NoStart of the date range.
date_tostring (date-time)NoEnd of the date range.
json
{
  "page": 1,
  "limit": 20,
  "organization_id": "string",
  "period": "week",
  "state": "draft",
  "bonus_metric_code": "percent_of_net_sales",
  "search": "string",
  "updated_at": "2025-05-01T12:00:00Z",
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z"
}

Response

FieldTypeDescription
totalnumber
listobject[]
list[]._idstringKPI settings ObjectId
list[].organization_idstring
list[].namestring
list[].currency_idstring
list[].user_idsstring[]
list[].periodstringOne of: week, month, quarter, year
list[].calculation_methodstringOne of: progressive, threshold
list[].statestringOne of: draft, active, locked, approved, canceled
list[].date_fromstring (date-time)
list[].date_tostring (date-time)
list[].yearnumber
list[].quarterstring
list[].monthstring
list[].weekstring
list[].filter_enabledboolean
list[].filterobject
list[].filter.is_all_categoriesboolean
list[].filter.customer_category_idsstring[]
list[].filter.customer_nested_category_idsstring[]
list[].filter.customer_idsstring[]
list[].filter.product_category_idsstring[]
list[].filter.product_nested_category_idsstring[]
list[].filter.product_idsstring[]
list[].conditionsobject[]
list[].conditions[].logical_operatorboolean
list[].conditions[].source_metric_codestringOne of: net_sales, sales_count, avg_net_sales, profit, paid, paid_percent, items_sold
list[].conditions[].tiersobject[]
list[].bonus_metric_codestringOne of: percent_of_net_sales, percent_of_payment, percent_of_profit, per_sale, fixed_amount, per_item_sold
list[].bonusesnumber[]
list[].created_atstring (date-time)
list[].updated_atstring (date-time)
list[].is_deletedboolean
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "list": [
      {
        "_id": "string",
        "organization_id": "string",
        "name": "string",
        "currency_id": "string",
        "user_ids": [],
        "period": "week",
        "calculation_method": "progressive",
        "state": "draft",
        "date_from": "2025-05-01T12:00:00Z",
        "date_to": "2025-05-01T12:00:00Z",
        "year": 0,
        "quarter": "string",
        "month": "string",
        "week": "string",
        "filter_enabled": false,
        "filter": {
          "is_all_categories": null,
          "customer_category_ids": null,
          "customer_nested_category_ids": null,
          "customer_ids": null,
          "product_category_ids": null,
          "product_nested_category_ids": null,
          "product_ids": null
        },
        "conditions": [],
        "bonus_metric_code": "percent_of_net_sales",
        "bonuses": [],
        "created_at": "2025-05-01T12:00:00Z",
        "updated_at": "2025-05-01T12:00:00Z",
        "is_deleted": false
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /kpi-settings/update/{id} ​

Update an existing KPI settings record.

Required permission: kpi_settings_update · how permissions work

Example request

bash
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/update/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "organization_id": "string",
  "user_ids": [
    "string"
  ],
  "period": "week",
  "calculation_method": "progressive",
  "date_from": "2025-05-01T12:00:00Z",
  "conditions": [
    {
      "logical_operator": false,
      "source_metric_code": "net_sales",
      "tiers": []
    }
  ],
  "bonus_metric_code": "percent_of_net_sales",
  "bonuses": [
    0
  ],
  "filter_enabled": false,
  "state": "draft"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/update/6712f0a9c4d1e87b3a0f9911', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "organization_id": "string",
    "user_ids": [
      "string"
    ],
    "period": "week",
    "calculation_method": "progressive",
    "date_from": "2025-05-01T12:00:00Z",
    "conditions": [
      {
        "logical_operator": false,
        "source_metric_code": "net_sales",
        "tiers": []
      }
    ],
    "bonus_metric_code": "percent_of_net_sales",
    "bonuses": [
      0
    ],
    "filter_enabled": false,
    "state": "draft"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/update/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "organization_id": "string",
        "user_ids": [
            "string",
        ],
        "period": "week",
        "calculation_method": "progressive",
        "date_from": "2025-05-01T12:00:00Z",
        "conditions": [
            {
                "logical_operator": False,
                "source_metric_code": "net_sales",
                "tiers": [],
            },
        ],
        "bonus_metric_code": "percent_of_net_sales",
        "bonuses": [
            0,
        ],
        "filter_enabled": False,
        "state": "draft",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "organization_id": "string",
  "user_ids": [
    "string"
  ],
  "period": "week",
  "calculation_method": "progressive",
  "date_from": "2025-05-01T12:00:00Z",
  "conditions": [
    {
      "logical_operator": false,
      "source_metric_code": "net_sales",
      "tiers": []
    }
  ],
  "bonus_metric_code": "percent_of_net_sales",
  "bonuses": [
    0
  ],
  "filter_enabled": false,
  "state": "draft"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/update/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Path parameters

ParameterTypeRequiredDescription
idstringYesKPI settings ObjectId

Request body

FieldTypeRequiredDescription
organization_idstringYesOrganization ObjectId this KPI setting belongs to
namestringNoOptional display name for the KPI setting
user_idsstring[]YesObjectIds of the employees this KPI setting applies to
periodstringYesKPI evaluation period. One of: week, month, quarter, year
calculation_methodstringYesHow the bonus is calculated across tiers: progressive (each tier adds to the previous) or threshold (only the matched tier applies). One of: progressive, threshold
date_fromstring (date-time)YesStart date of the KPI period
filter_enabledbooleanYesWhether product/customer filters are active for this KPI setting. Default: false
filterobjectNoOptional product and customer scope filters
filter.is_all_categoriesbooleanNo
filter.customer_category_idsstring[]NoCustomer category ObjectIds to include
filter.customer_idsstring[]NoSpecific customer ObjectIds to include
filter.product_category_idsstring[]No
filter.product_idsstring[]NoSpecific product ObjectIds to include
conditionsobject[]YesOne or more KPI plan conditions defining the performance metric and tier thresholds
conditions[].logical_operatorbooleanYestrue = AND with the next condition, false = OR
conditions[].source_metric_codestringYesThe performance metric used to evaluate this condition. One of: net_sales, sales_count, avg_net_sales, profit, paid, paid_percent, items_sold
conditions[].tiersobject[]YesThreshold tiers for this condition
conditions[].tiers[].min_valuenumberYesMinimum metric value for this tier to activate
conditions[].tiers[].max_valuenumberNoMaximum metric value for this tier (omit for the top tier)
bonus_metric_codestringYesHow the bonus amount is computed from the employee's results. One of: percent_of_net_sales, percent_of_payment, percent_of_profit, per_sale, fixed_amount, per_item_sold
bonusesnumber[]YesBonus amounts or percentages, one entry per tier in the conditions
responsible_idstringNo
statestringYesOne of: draft, active
attachmentsobject[]No
attachments[].namestringNo
attachments[].pathstringYes
attachments[].sizenumberNo
attachments[].notestringNo
json
{
  "organization_id": "string",
  "name": "string",
  "user_ids": [
    "string"
  ],
  "period": "week",
  "calculation_method": "progressive",
  "date_from": "2025-05-01T12:00:00Z",
  "filter_enabled": false,
  "filter": {
    "is_all_categories": false,
    "customer_category_ids": [
      "string"
    ],
    "customer_ids": [
      "string"
    ],
    "product_category_ids": [
      "string"
    ],
    "product_ids": [
      "string"
    ]
  },
  "conditions": [
    {
      "logical_operator": false,
      "source_metric_code": "net_sales",
      "tiers": []
    }
  ],
  "bonus_metric_code": "percent_of_net_sales",
  "bonuses": [
    0
  ],
  "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "state": "draft",
  "attachments": [
    {
      "name": "string",
      "path": "string",
      "size": 0,
      "note": "string"
    }
  ]
}

Response

Same response shape as POST /kpi-settings/create.

DELETE /kpi-settings/delete/{id} ​

Soft-delete a KPI settings record by ObjectId.

Required permission: kpi_settings_delete · how permissions work

Example request

bash
curl -X DELETE 'https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/delete/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/delete/6712f0a9c4d1e87b3a0f9911', {
  method: 'DELETE',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "DELETE",
    "https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/delete/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
php
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/delete/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Path parameters

ParameterTypeRequiredDescription
idstringYesKPI settings ObjectId

Request body

No request body.

Response

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": "ok",
  "time": "2025-05-01T12:00:00Z"
}

PUT /kpi-settings/set-status/{id} ​

Change the status (state) of a KPI settings record. Allowed transitions: locked, approved, canceled.

Required permission: kpi_settings_update · how permissions work

Example request

bash
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/set-status/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "status": "locked"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/set-status/6712f0a9c4d1e87b3a0f9911', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "status": "locked"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/set-status/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "status": "locked",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "status": "locked"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/kpi-settings/set-status/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Path parameters

ParameterTypeRequiredDescription
idstringYesKPI settings ObjectId

Request body

FieldTypeRequiredDescription
statusstringYesNew status for the KPI settings record. One of: locked, approved, canceled
json
{
  "status": "locked"
}

Response

Same response shape as POST /kpi-settings/create.


This page is generated from the OpenAPI spec.

Bito 2.0 Integration API