AltScore
Borrower Central (BC)

KPIs API

This API allows managing Key Performance Indicators (KPIs) in the system. It provides endpoints to create, read, update, and delete KPIs, as well as to perform queries and filtering.

The KPI Object

The KPI object represents a key performance indicator in the system.

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "key": "revenue_growth",
  "persona": "business",
  "label": "Revenue Growth",
  "description": "Measures the percentage increase in revenue",
  "value": {
    "target": 10.5,
    "redRange": [0, 5],
    "yellowRange": [5, 8],
    "greenRange": [8, 15]
  },
  "history": [
    {
      "referenceId": "ref123",
      "executionId": "exec456",
      "value": {
        "target": 10.0,
        "redRange": [0, 4],
        "yellowRange": [4, 7],
        "greenRange": [7, 12]
      },
      "updatedAt": "2023-04-01T12:00:00Z"
    }
  ],
  "createdAt": "2023-01-01T00:00:00Z",
  "updatedAt": "2023-04-01T12:00:00Z"
}

Attributes

AttributeDescriptionType
idUnique identifier of the KPIString
keyUnique key of the KPIString
personaType of entity associated with the KPIString
labelLabel or name of the KPIString
descriptionDetailed description of the KPIString
valueCurrent value and ranges of the KPIObject
historyChange history of the KPIArray of Object
createdAtCreation date and time of the KPIString (ISO 8601)
updatedAtDate and time of the last updateString (ISO 8601)

Available Operations

Create a New KPI

Creates a new KPI in the system.

POST /v1/kpis

Input Parameters:

ParameterDescriptionTypeRequired
referenceIdReference IDStringNo
executionIdExecution IDStringNo
labelLabel or name of the KPIStringYes
descriptionDetailed description of the KPIStringYes
keyUnique key of the KPIStringYes
personaType of entity associated with the KPIStringNo
valueValue and ranges of the KPIObjectYes

Example Request:

{
  "label": "Revenue Growth",
  "description": "Measures the percentage increase in revenue",
  "key": "revenue_growth",
  "persona": "business",
  "value": {
    "target": 10.5,
    "redRange": [0, 5],
    "yellowRange": [5, 8],
    "greenRange": [8, 15]
  }
}

Successful Response:

{
  "id": "123e4567-e89b-12d3-a456-426614174000"
}

Update an Existing KPI

Updates the information of an existing KPI.

PATCH /v1/kpis/:kpi_id

Path Parameters:

ParameterDescription
kpi_idID of the KPI to update

Input Parameters:

ParameterDescriptionTypeRequired
referenceIdReference IDStringNo
executionIdExecution IDStringNo
labelNew label or name of the KPIStringNo
descriptionNew description of the KPIStringNo
valueNew value and ranges of the KPIObjectNo
dateUpdate dateStringNo

Example Request:

{
  "label": "Annual Revenue Growth",
  "value": {
    "target": 12.0,
    "redRange": [0, 6],
    "yellowRange": [6, 10],
    "greenRange": [10, 18]
  }
}

Successful Response:

The response will be the updated KPI object.

Retrieve a KPI

Retrieves the information of a specific KPI.

GET /v1/kpis/:kpi_id

Path Parameters:

ParameterDescription
kpi_idID of the KPI to retrieve

Successful Response:

The response will be the complete KPI object, as described above.

Delete a KPI

Deletes a KPI from the system.

DELETE /v1/kpis/:kpi_id

Path Parameters:

ParameterDescription
kpi_idID of the KPI to delete

Successful Response:

Status code 204 (No Content) if the deletion was successful.

List KPIs

Retrieves a paginated list of KPIs with filtering and sorting options.

GET /v1/kpis

Query Parameters:

ParameterDescriptionType
keyFilter by KPI keyString
personaFilter by entity typeString
searchText to search in the KPIsString
pagePage number (default: 1)Integer
per-pageItems per page (default: 10)Integer
sort-byField to sort byString
sort-directionSorting direction (asc or desc)String

Successful Response:

The response will be a paginated list of KPI objects.

Error Handling

The API may return the following error codes:

CodeDescription
400Bad Request
401Unauthorized
403Forbidden
404Not Found
500Internal Server Error

Errors will include a descriptive message in the response body.

On this page