AltScore
Borrower Central (BC)

Rules API

This API allows managing rules in the system. It provides endpoints to create, read, update, and delete rules, as well as perform specific operations such as updating alerts associated with a rule.

The Rule Object

The Rule object represents a rule in the system.

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "code": "high_risk_borrower",
  "label": "High Risk Borrower",
  "alerts": [
    {
      "level": 3,
      "message": "This borrower presents a high risk"
    }
  ],
  "createdAt": "2023-01-01T00:00:00Z",
  "updatedAt": "2023-04-01T12:00:00Z"
}

Attributes

AttributeDescriptionType
idUnique identifier of the ruleString
codeUnique code of the ruleString
labelDescriptive label of the ruleString
alertsList of alerts associated with the ruleArray of Object
createdAtDate and time of rule creationString (ISO 8601)
updatedAtDate and time of the last updateString (ISO 8601)

Available Operations

Create a New Rule

Creates a new rule in the system.

POST /v1/rules

Input Parameters:

ParameterDescriptionTypeRequired
labelDescriptive label of the ruleStringYes
codeUnique code of the ruleStringYes
alertsList of rule alertsArray of ObjectYes

Example Request:

{
  "label": "High Risk Borrower",
  "code": "high_risk_borrower",
  "alerts": [
    {
      "level": 3,
      "message": "This borrower presents a high risk"
    }
  ]
}

Successful Response:

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

Get a Rule

Retrieves information about a specific rule.

GET /v1/rules/:rule_id

Path Parameters:

ParameterDescription
rule_idID of the rule to retrieve

Successful Response:

The response will be a complete Rule object, as described above.

Update a Rule

Updates information of an existing rule.

PATCH /v1/rules/:rule_id

Path Parameters:

ParameterDescription
rule_idID of the rule to update

Input Parameters:

ParameterDescriptionType
labelNew label of the ruleString
codeNew code of the ruleString
alertsNew list of alertsArray of Object

Example Request:

{
  "label": "High Risk Borrower (Updated)",
  "alerts": [
    {
      "level": 4,
      "message": "This borrower presents a very high risk"
    }
  ]
}

Successful Response:

The response will be the updated Rule object.

Delete a Rule

Deletes a rule from the system.

DELETE /v1/rules/:rule_id

Path Parameters:

ParameterDescription
rule_idID of the rule to delete

Successful Response:

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

List Rules

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

GET /v1/rules

Query Parameters:

ParameterDescriptionType
searchText to search in rulesString
codeFilter by rule codeString
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 Rule objects.

Error Handling

The API can 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