AltScore
Borrower Central (BC)/Information storage

Sources API

This API allows managing sources in the system. It provides endpoints to create, read, update, and delete sources, as well as perform specific operations such as creating alternative data sources.

The base URL for this API is /v1/stores/sources.

The Source Object

The Source object represents a data source in the system.

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "label": "Main data source",
  "tags": ["finance", "sales"],
  "transformerConfig": {
    "url": "https://api.example.com/transform",
    "headers": {
      "Authorization": "Bearer token123"
    }
  },
  "createdAt": "2023-01-01T00:00:00Z",
  "updatedAt": "2023-04-01T12:00:00Z"
}

Attributes

AttributeDescriptionType
idUnique identifier of the sourceString
labelLabel or name of the sourceString
tagsList of tags associated with the sourceArray of String
transformerConfigData transformer configurationObject
createdAtDate and time of source creationString (ISO 8601)
updatedAtDate and time of the last source updateString (ISO 8601)

Endpoints

Create a New Source

Creates a new source in the system.

POST /v1/stores/sources

Input Parameters:

ParameterDescriptionTypeRequired
idSource identifierStringYes
labelLabel or name of the sourceStringNo
tagsList of tags associated with the sourceArray of StringNo
transformerConfigData transformer configurationObjectNo

Example Request:

{
  "id": "source123",
  "label": "Main data source",
  "tags": ["finance", "sales"],
  "transformerConfig": {
    "url": "https://api.example.com/transform",
    "headers": {
      "Authorization": "Bearer token123"
    }
  }
}

Successful Response:

{
  "id": "source123"
}

Create an Alternative Data Source

Creates a new alternative data source in the system.

POST /v1/stores/sources/altdata

Input Parameters:

ParameterDescriptionTypeRequired
labelLabel or name of the sourceStringNo
altdataSourceIdID of the alternative data sourceStringYes
altdataSourceVersionVersion of the alternative data sourceStringYes

Example Request:

{
  "label": "Alternative data source",
  "altdataSourceId": "ECU-PUB-0002",
  "altdataSourceVersion": "v1"
}

Successful Response:

{
  "id": "AD_ECU-PUB-0002_v1"
}

Retrieve a Source

Retrieves information about a specific source.

GET /v1/stores/sources/:source_id

Path Parameters:

ParameterDescription
source_idID of the source to retrieve

Successful Response:

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

Update a Source

Updates information for an existing source.

PATCH /v1/stores/sources/:source_id

Path Parameters:

ParameterDescription
source_idID of the source to update

Input Parameters:

The same as for creating a source.

Example Request:

{
  "label": "Updated data source",
  "tags": ["finance", "sales", "updated"]
}

Successful Response:

The response will be the updated Source object.

Delete a Source

Deletes a source from the system.

DELETE /v1/stores/sources/:source_id

Path Parameters:

ParameterDescription
source_idID of the source to delete

Successful Response:

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

List Sources

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

GET /v1/stores/sources

Query Parameters:

ParameterDescriptionType
searchText to search within sourcesString
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 Source 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