AltScore
Borrower Central (BC)

Policies API

This API allows managing policies in the system. It provides endpoints to create, read, update, and delete policies, as well as to perform searches and queries on them.

The Policy Object

The Policy object represents a policy in the system.

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "label": "Privacy Policy",
  "language": "es",
  "key": "privacy_policy",
  "version": 1,
  "shortText": "Privacy policy summary",
  "longText": "Full text of the privacy policy...",
  "policyUrl": "https://example.com/privacy-policy",
  "versionHistory": [
    {
      "version": 1,
      "shortText": "Initial summary",
      "longText": "Initial text...",
      "policyUrl": "https://example.com/privacy-policy-v1",
      "updatedAt": "2023-01-01T00:00:00Z"
    }
  ],
  "createdAt": "2023-01-01T00:00:00Z",
  "updatedAt": "2023-01-01T00:00:00Z",
  "tags": ["privacy", "GDPR"]
}

Attributes

AttributeDescriptionType
idUnique identifier of the policyString
labelLabel or name of the policyString
languageLanguage of the policyString
keyUnique key of the policyString
versionCurrent version of the policyInteger
shortTextShort summary of the policyString
longTextFull text of the policyString
policyUrlURL of the policyString
versionHistoryVersion history of the policyArray of Object
createdAtCreation date of the policyString (ISO 8601)
updatedAtLast update date of the policyString (ISO 8601)
tagsTags associated with the policyArray of String

Endpoints

Create a New Policy

Creates a new policy in the system.

POST /v1/policies

Input Parameters:

ParameterDescriptionTypeRequired
keyUnique key of the policyStringYes
shortTextShort summary of the policyStringNo
longTextFull text of the policyStringNo
policyUrlURL of the policyStringNo
tagsTags associated with the policyArray of StringNo

Request Example:

{
  "key": "privacy_policy",
  "shortText": "Privacy policy summary",
  "longText": "Full text of the privacy policy...",
  "policyUrl": "https://example.com/privacy-policy",
  "tags": ["privacy", "GDPR"]
}

Successful Response:

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

Note: The longText field can contain templates as values.

{
  "longText": "For the client ${borrowerName}"
}

Update a Policy

Updates an existing policy.

PATCH /v1/policies/:policy_id

Path Parameters:

ParameterDescription
policy_idID of the policy to update

Input Parameters:

ParameterDescriptionTypeRequired
shortTextNew short summary of the policyStringNo
longTextNew full text of the policyStringNo
policyUrlNew URL of the policyStringNo
tagsNew tags of the policyArray of StringNo

Request Example:

{
  "shortText": "New summary of the privacy policy",
  "tags": ["privacy", "GDPR", "updated"]
}

Successful Response:

The response will be the updated Policy object.

Get a Policy

Retrieves the information of a specific policy.

GET /v1/policies/:policy_id

Path Parameters:

ParameterDescription
policy_idID of the policy to retrieve

Successful Response:

The response will be the complete Policy object.

Delete a Policy

Deletes a policy from the system.

DELETE /v1/policies/:policy_id

Path Parameters:

ParameterDescription
policy_idID of the policy to delete

Successful Response:

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

List Policies

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

GET /v1/policies

Query Parameters:

ParameterDescriptionType
searchText to search within policiesString
keyFilter by policy keyString
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 Policy objects.

Fill a Policy as a Template

Takes a policy and replaces placeholders with the provided values

POST /v1/policies/commands/:policy_id/fill-policy

Path Parameters:

ParameterDescription
policy_idID of the policy to fill

Input Parameters:

ParameterDescriptionTypeRequired
fieldsDictionary with field names and their valuesJSONYes

Request Example

{
  "fields": {
    "borrowerName": "AltScore"
  }
}

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