projects.apps.assessments

Overview

The Assessments API allows you to create and retrieve lending assessments tied to existing app user accounts such as borrowers.

{
   "accountId": string,
   "assessmentType": string,
   "timestamp": string,
   "assessmentId": string,
   "status": number,
   "result": object ( AssessmentOutcome ) | null
   "appVersionId": string,
}

Fields

Field

Data Type

Description

accountId

string

Required Unique id that identifies an account type and account id. The pattern is <ACCOUNT_TYPE>:<ACCOUNT_ID>.

For example a borrower with a borrowerId 10023 will have an account id with the value borrower:10023.

Read-only after creation

assessmentId

string

Required

Used in responses only A string that uniquely identifies an assessment within the lending app.

Read-only after creation

assessmentType

string

Required The full resource name of the assessment type. You can view all the available types of assessments using the assessmentTypes.list API method.

Read-only

timestamp

string

( Timestamp format )

Required The assessment timestamp as captured on your lending app in ISO format.

This field also determines the assessment evaluation window. For example, a timestamp from today evaluates account data up to today while a timestamp from a month ago evaluates account data up to a month ago.

The evaluation window only goes as far back as 90 days for most assessments.

Example: 2019-05-12T12:00:55+03:00

Read-only after creation

status

number

Assessment status. The values are described below.

0 - not processed

1 - processed successfully

2 - processed with errors

Read-only

result

object

( AssessmentOutcome ) | null

Used in responses only The assessment outcome. It’s set to null on creation of the assessment and is populated with the outcome after the assessment it processed.

Read-only

appVersionId

string

The lending app versionId used to process this event. Read more about app versions here.

Example: v1

Read-only

List

GET https://lending.wezaapis.com/v1/projects/{projectId}/apps/{appId}/assessments

List all lending assessments for a lending app.

Path Parameters

NameTypeDescription

projectId

string

Id of the weza.io project

appId

string

Id of the lending app

Headers

NameTypeDescription

Authorization

string

Bearer token

{
	"assessments": [{
			"uid": "c78e30a6-3136-5762-84a0-24e8ef895e7a",
			"name": "projects/test-project/apps/testapp/assessments/826d69a1-4fc1-54b1-b17e-c6b6684dd9da",
			"status": 0,
			"createdAt": "2020-09-21T19:32:26.889Z",
			"assessmentId": "826d69a1-4fc1-54b1-b17e-c6b6684dd9da",
			"appVersionId": "v5",
			"accountId": "borrower:10023",
			"assessmentType": "projects/test-project/apps/testapp/assessmentTypes/personal_credit_standard",
			"timestamp": "2020-09-19T18:00:00.000Z",
			"result": null,
			"requestId": "cfcd029e6c"
		},
		{
			"uid": "d22bdce6-2585-5182-bcc3-ad80e6a401be",
			"name": "projects/test-project/apps/testapp/assessments/b3a760ae-21f0-5cf5-897e-ebb9e5ce51b9",
			"status": 0,
			"createdAt": "2020-09-21T19:08:26.402Z",
			"assessmentId": "b3a760ae-21f0-5cf5-897e-ebb9e5ce51b9",
			"appVersionId": "v5",
			"accountId": "borrower:10023",
			"assessmentType": "projects/test-project/apps/testapp/assessmentTypes/personal_credit_standard",
			"timestamp": "2020-09-19T18:00:00.000Z",
			"result": null,
			"requestId": "3280fa70b6"
		},
		{
			"uid": "1ca0f016-1233-5d2f-84e0-195ed77de974",
			"name": "projects/test-project/apps/testapp/assessments/af621617-151b-5933-8ae2-6538c7ab0ff8",
			"status": 0,
			"createdAt": "2020-09-21T18:57:22.946Z",
			"assessmentId": "af621617-151b-5933-8ae2-6538c7ab0ff8",
			"appVersionId": "v5",
			"accountId": "borrower:10023",
			"assessmentType": "projects/test-project/apps/testapp/assessmentTypes/personal_credit_standard",
			"timestamp": "2020-09-19T18:00:00.000Z",
			"result": null,
			"requestId": "721775eea2"
		},
		{
			"uid": "441cd582-b742-5bae-bfce-276cd0c5ecb2",
			"name": "projects/test-project/apps/testapp/assessments/7ec81719-e0b6-541c-bbe7-1dbc4bf984f8",
			"status": 0,
			"createdAt": "2020-09-21T16:00:27.230Z",
			"assessmentId": "7ec81719-e0b6-541c-bbe7-1dbc4bf984f8",
			"appVersionId": "v5",
			"accountId": "borrower:10023",
			"assessmentType": "projects/test-project/apps/testapp/assessmentTypes/personal_credit_standard",
			"timestamp": "2020-09-19T18:00:00.000Z",
			"result": null,
			"requestId": "2b18e7c83a"
		},
		{
			"uid": "11135a22-8f74-52b7-920e-ec63f7346b1c",
			"name": "projects/test-project/apps/testapp/assessments/f21962cf-929d-596e-9343-4f5c436a6cbb",
			"status": 0,
			"createdAt": "2020-09-20T20:06:54.662Z",
			"assessmentId": "f21962cf-929d-596e-9343-4f5c436a6cbb",
			"appVersionId": "v5",
			"accountId": "borrower:10023",
			"assessmentType": "projects/test-project/apps/testapp/assessmentTypes/personal_credit_standard",
			"timestamp": "2020-09-19T18:00:00.000Z",
			"result": null,
			"requestId": "c9c46ea15f"
		},
		{
			"uid": "4df0f896-db15-50e2-b821-bed8d9afba3a",
			"name": "projects/test-project/apps/testapp/assessments/5b2f4bf6-d9ce-539d-a4c2-2aba1041d764",
			"status": 2,
			"createdAt": "2020-08-07T18:28:25.743Z",
			"assessmentId": "5b2f4bf6-d9ce-539d-a4c2-2aba1041d764",
			"appVersionId": "v2",
			"accountId": "borrower:10023",
			"assessmentType": "assessmentTypes/personal_credit_standard",
			"timestamp": "2020-06-27T12:00:00.000Z",
			"result": {
				"rule": "scorecard",
				"type": "invalid",
				"reason": null,
				"message": "An unknown error occurred while processing this request."
			},
			"requestId": null
		},
		{
			"uid": "88a8f009-eb04-5f93-9bca-97cdd35b1860",
			"name": "projects/test-project/apps/testapp/assessments/762cb251-d952-52cb-9377-2e419ce71ce8",
			"status": 2,
			"createdAt": "2020-07-21T17:09:42.857Z",
			"assessmentId": "762cb251-d952-52cb-9377-2e419ce71ce8",
			"appVersionId": "v1",
			"accountId": "borrower:10023",
			"assessmentType": "assessmentTypes/personal_credit_standard",
			"timestamp": "2020-06-28T12:00:00.000Z",
			"result": {
				"rule": "lending.denyLowDataCounts",
				"type": "invalid",
				"reason": "no_data",
				"message": "There was not enough data found for this lending account. Confirm your app events are being received & processed successfully on weza.io."
			},
			"requestId": null
		}
	],
	"nextPageToken": null
}

Request Body

The request body should be empty.

Response Body

If successful, the response will contain data with the following structure.

{
  "assessments": [
    {
      object(LendingAssessment)
    }
  ],
  "nextPageToken": string,
}

Fields

Field

Data Type

Description

assessments[]

A list of lending assessment instances.

nextPageToken

string

Token to use to fetch the next page of data if any.

Authorization

Requires one of the following OAuth scopes:

  • platform.lending

  • platform.lending:read

The authenticated user must have the lending.assessments.list permission.

Create

POST https://lending.wezaapis.com/v1/projects/{projectId}/apps/{appId}/assessments

Create a lending assessment if one doesn't exist.

Path Parameters

NameTypeDescription

appId

string

Id of the lending app

projectId

string

Id of the weza.io project

Headers

NameTypeDescription

Authorization

string

Bearer token

Request Body

The request body contains an instance of LendingAssessment.

Response Body

The response body contains a new instance of LendingAssessment.

Authorization

Requires one of the following OAuth scopes:

  • platform.lending

  • platform.lending:write

The authenticated user must have the lending.assessments.create permission.

Get

GET https://lending.wezaapis.com/v1/projects/{projectId}/apps/{appId}/assessments/{assessmentId}

Retrieve a lending assessment by id.

Path Parameters

NameTypeDescription

projectId

string

Id of the weza.io project

appId

string

Id of the lending app

assessmentId

string

assessmentId or uid value

Headers

NameTypeDescription

Authorization

string

Bearer token

Response Body

The response body contains an instance of LendingAssessment.

Authorization

Requires one of the following OAuth scopes:

  • platform.lending

  • platform.lending:read

The authenticated user must have the lending.assessments.get permission.

Last updated