AltScore
Borrower Central (BC)

Data Models API

This API allows managing data models in the system. It provides endpoints to create, read, update, and delete data models, as well as to perform queries with filtering and pagination options.

The DataModel Object

The DataModel object represents a data model in the system.

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "path": "/ruta/ejemplo",
  "key": "modelo_ejemplo",
  "label": "Modelo de Ejemplo",
  "entityType": "identity",
  "priority": 1,
  "order": null,
  "allowedValues": null,
  "createdAt": "2023-05-01T12:00:00Z",
  "updatedAt": "2023-05-02T14:30:00Z",
  "isSensitive": false,
  "metadata": {
    "descripcion": "Este es un modelo de ejemplo"
  }
}

Attributes

AttributeDescriptionTypeRequired
idUnique identifier of the data modelStringYes
pathPath of the data modelStringYes
keyUnique key of the data modelStringYes
labelDescriptive label of the modelStringYes
entityTypeEntity type of the modelStringYes
priorityPriority of the modelIntegerNo
orderOrder of the modelIntegerNo
allowedValuesAllowed values for the fieldArrayNo
createdAtCreation date and timeStringYes
updatedAtLast update date and timeStringNo
isSensitiveMarks an identity DataModel as sensitive (PII)BooleanNo
metadataAdditional metadata of the modelObjectNo

Valid Entity Types

The entityType field must be one of the following values:

Entity TypeDescription
identityIdentity records (national ID, passport, etc.)
contactContact information fields
documentDocument type definitions
borrowerBorrower entity configuration
borrower_fieldCustom fields for borrowers
point_of_contactPoint of contact fields
authorizationAuthorization type definitions
stepWorkflow step definitions
metricMetric definitions
deal_fieldCustom fields for deals
deal_stepDeal workflow step definitions
deal_roleDeal role definitions
decisionDecision type definitions
accounting_documentAccounting document type definitions
asset_fieldCustom fields for assets
asset_groupAsset group definitions for categorizing assets

Available Operations

Create a New Data Model

Creates a new data model in the system.

POST /v1/data-models

Input Parameters:

ParameterDescriptionTypeRequired
pathPath of the data modelStringYes
keyUnique key of the modelStringYes
labelDescriptive label of the modelStringYes
entityTypeEntity type of the modelStringYes
priorityPriority of the modelIntegerNo*
orderOrder of the modelIntegerNo
allowedValuesAllowed values for the modelArrayNo
metadataAdditional metadata of the modelObjectNo
isSensitiveMarks an identity DataModel as sensitive (PII)BooleanNo

*For entityType: "identity", priority is required and must be greater than or equal to -1.

Request Example:

{
  "path": "/ruta/ejemplo",
  "key": "modelo_ejemplo",
  "label": "Modelo de Ejemplo",
  "entityType": "identity",
  "priority": 1,
  "isSensitive": false,
  "metadata": {
    "descripcion": "Este es un modelo de ejemplo"
  }
}

Successful Response:

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

Update a Data Model

Updates an existing data model.

PATCH /v1/data-models/:data_model_id

Path Parameters:

ParameterDescription
:data_model_idID of the data model to update

Input Parameters:

ParameterDescriptionTypeRequired
pathNew path of the data modelStringNo
keyNew key of the modelStringNo
labelNew label of the modelStringNo
orderNew order of the modelIntegerNo
priorityNew priority of the modelIntegerNo
allowedValuesAllowed values for the modelArrayNo
metadataNew metadata of the modelObjectNo

Note: isSensitive cannot be updated via PATCH. Use the dedicated make-sensitive endpoint below.

Request Example:

{
  "label": "Updated Example Model",
  "priority": 2
}

Successful Response:

The response will be the updated DataModel object.

Make an Identity Data Model Sensitive

Marks an existing identity DataModel as sensitive and encrypts existing identities for that key.

PUT /v1/data-models/:data_model_id/make-sensitive

Path Parameters:

ParameterDescription
:data_model_idID of the data model to update

Successful Response:

The response will be the updated DataModel object (with isSensitive: true).

Get a Data Model

Retrieves the information of a specific data model.

GET /v1/data-models/:data_model_id

Path Parameters:

ParameterDescription
:data_model_idID of the data model to retrieve

Successful Response:

The response will be a complete DataModel object.

Delete a Data Model

Deletes a data model from the system.

DELETE /v1/data-models/:data_model_id

Path Parameters:

ParameterDescription
:data_model_idID of the data model to delete

Successful Response:

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

List Data Models

Retrieves a paginated list of data models with filtering and sorting options.

GET /v1/data-models

Query Parameters:

ParameterDescriptionType
searchText to search in data modelsString
pagePage number (default: 1)Integer
per-pageItems per page (default: 10)Integer
entity-typeFilter by entity typeString
sort-byField to sort byString
sort-directionSorting direction (asc or desc)String

Successful Response:

The response will be a paginated list of DataModel 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