Categories API
This API allows managing categories and their values in the system. It provides endpoints to create, read, update and delete categories, as well as to manage the values associated with each category.
The Category Object
The Category object represents a category in the system.
A category is an extension of lender fields, which allows assigning predetermined values to any entity in the system.
Attributes
| Attribute | Description | Type | Required |
|---|---|---|---|
| id | Unique identifier of the category | String | Yes |
| categoryKey | Unique key of the category | String | Yes |
| label | Descriptive label of the category | String | Yes |
| createdAt | Creation date and time | String | Yes |
| updatedAt | Last update date and time | String | No |
The CategoryValue Object
The CategoryValue object represents a value within a category.
Attributes
| Attribute | Description | Type | Required |
|---|---|---|---|
| id | Unique identifier of the value | String | Yes |
| categoryId | ID of the category it belongs to | String | Yes |
| categoryKey | Key of the category it belongs to | String | Yes |
| value | Descriptive value | String | Yes |
| createdAt | Creation date and time | String | Yes |
| updatedAt | Last update date and time | String | No |
Available Operations
Create a New Category
Creates a new category in the system.
Input Parameters:
| Parameter | Description | Type | Required |
|---|---|---|---|
| categoryKey | Unique key of the category | String | Yes |
| label | Descriptive label of the category | String | Yes |
Request Example:
Successful Response:
The response will be the UUID of the newly created Category object.
Get All Categories
Gets a list of all available categories.
Successful Response:
The response will be a list of Category objects.
Get a Category
Gets information for a specific category.
Path Parameters:
| Parameter | Description |
|---|---|
| category_id | ID of the category to get |
Successful Response:
The response will be a complete Category object.
Delete a Category
Deletes a category from the system.
Path Parameters:
| Parameter | Description |
|---|---|
| category_id | ID of the category to delete |
Successful Response:
Status code 204 (No Content) if deletion was successful.
Error response:
Status code 419 (Conflict) if the deletion failed due to it having CategoryValues attached.
Create a Category Value
Creates a new value within a specific category.
Path Parameters:
| Parameter | Description |
|---|---|
| category_id | ID of the category where to create the value |
Input Parameters:
| Parameter | Description | Type | Required |
|---|---|---|---|
| id | Optional ID for the value | String | No |
| value | Descriptive value | String | Yes |
Request Example:
Successful Response:
The response will be the complete created CategoryValue object. Note that if no ID is provided, one will be created based on the value (example: "identity_card").
Get All Values of a Category
Gets all values associated with a specific category.
Path Parameters:
| Parameter | Description |
|---|---|
| category_id | ID of the category whose values are queried |
Successful Response:
The response will be a list of CategoryValue objects.
Update a Category Value
Updates the value of a specific element within a category.
Path Parameters:
| Parameter | Description |
|---|---|
| category_id | ID of the category |
| category_value_id | ID of the value to update |
Input Parameters:
| Parameter | Description | Type | Required |
|---|---|---|---|
| value | New value | String | Yes |
Request Example:
Successful Response:
The response will be the updated CategoryValue object.
Delete a Category Value
Deletes a specific value from a category.
Path Parameters:
| Parameter | Description |
|---|---|
| category_id | ID of the category |
| category_value_id | ID of the value to delete |
Successful Response:
Status code 204 (No Content) if deletion was successful.
Error Response:
Status code 419 (Conflict) if deletion failed due to a entity having this CategoryValue.
Required Permissions
All operations in this API require specific permissions:
- Read operations (GET): Require the
borrowers.readpermission - Write operations (POST, PATCH, DELETE): Require the
borrowers.writepermission
Category Commands
This section describes the available commands for special operations with categories.
Categorize an Entity
Associates a specific entity with a category value. The supported entities are:
borrowersorborrowers_ds(useborrowers_dsif you intend to inherit the category to all debts of the categorized borrower)debtsflows(in case of unfolded information)
Input Parameters:
| Parameter | Description | Type | Required |
|---|---|---|---|
| categoryKey | Key of the category | String | Yes |
| categoryValueId | ID of the category value | String | Yes |
| entityId | ID of the entity to categorize | String | Yes |
| entityType | Type of the entity | String | Yes |
Request Example:
Successful Response:
The response will confirm the successful association between the entity and the category value.
Delete All Values of a Category
Deletes all values associated with a specific category.
Input Parameters:
| Parameter | Description | Type | Required |
|---|---|---|---|
| categoryKey | Key of the category | String | Yes |
Request Example:
Successful Response:
Status code 200 confirming that all values were successfully deleted.
Delete Entity Categorization
Removes the association between a specific entity and a category value.
Input Parameters:
| Parameter | Description | Type | Required |
|---|---|---|---|
| categoryKey | Key of the category | String | Yes |
| categoryValueId | ID of the category value | String | Yes |
| entityId | ID of the entity | String | Yes |
| entityType | Type of the entity | String | Yes |
Request Example:
Successful Response:
The response will confirm that the association was successfully deleted.
Permissions for Commands
All category commands require the borrowers.write permission for execution.
Category Queries
This section describes the specialized queries available to get information about categories.
Get Categories of an Entity
Gets all categories associated with a specific entity.
Path Parameters:
| Parameter | Description |
|---|---|
| entity_type | Type of the entity to query |
| entity_id | ID of the entity to query |
Request Example:
Successful Response:
The response will be a list of categories associated with the specified entity.
Permissions for Queries
Category queries require the borrowers.read permission for execution.
Error Handling
The API may return the following error codes:
| Code | Description |
|---|---|
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 409 | Conflict - Duplicate key |
| 500 | Internal Server Error |
Errors will include a descriptive message in the response body.