Skip to main content
Version: 1.8.0 (latest)

Report control

This section of the API allows you to manage reports that reflect the system's performance.

A report is created with a specified time interval for collecting metrics and then put into processing. Once processed, the metrics can be retrieved via the API.

You can view the status of the report in the “status” field. The possible report statuses are:

  • 0: Pending – The report has just been created and processing has not started.
  • 1: Processing – The report is being processed. The time to process may vary depending on the database size and the reporting period.
  • 2: Completed – The report has been successfully processed. If the data for the check period has been updated, a new report must be created to retrieve it.
  • 3: Error – An error occurred while generating the report.
  • 4: Canceled – Report processing has been canceled. Resuming report processing will only affect metrics that were not calculated for the previous processing.
  • 5: Unexpectedly stopped – Report generation was unexpectedly interrupted, such as if the service was restarted during report processing.

The report contains the following metrics:

  • failRate. The percentage of applicants who have a status of "Fail" or "Failed Attempt" relative to the total number of applicants.
  • passRate. The percentage of applicants who have a "Success" status relative to the total number of applicants.
  • completion. The average time taken from the creation of an applicant to their registration.
  • suspectedFraud. The percentage of attempts with risks relative to the total number of attempts.
  • abandonmentRate. The percentage of applicants in a "Pending" status relative to the total number of applicants.
  • fraudProofing. The total number of applicants who have been "Cancelled" combined with the number of registration attempts with risks.
  • fraudAuthentication. The total number of applicants with a "Cancelled" status combined with the number of authentication attempts with risks.
  • authenticationFailures. The average proportion of failed attempts relative to the total number of attempts for each applicant.

Creating a report

When creating a report, specify the time period for receiving metrics. The time must be specified in the UTC time zone.

Endpoint: POST /publicapi/api/v2/private/Report

Request body:

{
"startDate": "2024-11-19T11:09:44.530Z",
"endDate": "2024-11-19T11:09:44.530Z"
}

Request example:

curl -X 'POST' \
'http://baf.ai/publicapi/api/v2/private/Report' \
-H 'accept: text/plain' \
-H 'Content-Type: application/json-patch+json' \
-d '{
"startDate": "2024-11-19T11:09:44.530Z",
"endDate": "2024-11-19T11:09:44.530Z"
}'

Response example:

Status Code200
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"reportInfo": null,
"status": 0,
"accountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"startDate": "2024-11-20T05:18:45.353Z",
"endDate": "2024-11-20T05:18:45.353Z",
"creationDate": "2024-11-20T05:18:45.353Z",
"lastModified": "2024-11-20T05:18:45.353Z"
}

Receiving reports

To receive reports page by page, you need to specify the page number and page size.

Endpoint: GET /publicapi/api/v2/private/Report

Parameters:

Field nameDescriptionValue
PagePage numberFrom 1 to 2147483647
PageSizeMaximum number of reports listed on the pageFrom 1 to 400

Request example:

curl -X 'GET' \
'http://baf.ai/publicapi/api/v2/private/Report?Page=1&PageSize=10' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer sk_1d2ca11d-125a-416c-8fdc-e9661ebecb9a'

Response example:

Status Code200
{
"totalCount": 2,
"reports": [
{
"id": "a86b6b35-cf6b-462d-9f64-d706cd2490ce",
"reportInfo": null,
"status": 0,
"accountId": "28608d66-a571-44ec-94db-04a00143ff51",
"startDate": "2024-11-15T06:27:42.706Z",
"endDate": "2024-11-15T06:27:42.706Z",
"creationDate": "2024-11-15T06:27:42.231705Z",
"lastModified": "2024-11-15T06:27:42.231705Z"
},
{
"id": "0200ca81-0020-4de9-96f1-9d24bf8d92ae",
"reportInfo": {
"nist": {
"failRate": 0,
"passRate": 0,
"completion": 0,
"fraudProofing": 0,
"suspectedFraud": 0,
"abandonmentRate": 0,
"fraudAuthentication": 0,
"authenticationFailures": 0
}
},
"status": 2,
"accountId": "28608d66-a571-44ec-94db-04a00143ff51",
"startDate": "2025-11-14T15:27:17.69Z",
"endDate": "2026-11-14T15:27:17.69Z",
"creationDate": "2024-11-14T15:27:20.874582Z",
"lastModified": "2024-11-14T15:27:28.552245Z"
}
]
}

Deleting a report

Endpoint: DELETE /publicapi/api/v2/private/Report

Request example:

curl -X 'DELETE' \
'http://baf.ai/publicapi/api/v2/private/Report/3fa85f64-5717-4562-b3fc-2c963f66afa6' \
-H 'accept: */*' \
-H 'Authorization: Bearer sk_1d2ca11d-125a-416c-8fdc-e9661ebecb9a'

Response example:

Status Code200

Possible errors:

HTTP CodeMessageDescriptionError code
404Report not foundReport not found for deletion.120024

Receiving report information

Endpoint: GET /publicapi/api/v2/private/Report/{report_id}

Request example:

curl -X 'GET' \
'http://baf.ai/publicapi/api/v2/private/Report/3fa85f64-5717-4562-b3fc-2c963f66afa6' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer sk_1d2ca11d-125a-416c-8fdc-e9661ebecb9a'curl -X 'GET'

Response example:

Status Code200

Possible errors:

HTTP CodeMessageDescriptionError code
404Report not foundReport not found.120024

Starting building a report

Endpoint: GET /publicapi/api/v2/private/Report/process/{report_id}

Request example:

curl -X 'POST' \
'http://baf.ai/publicapi/api/v2/private/Report/Process/3fa85f64-5717-4562-b3fc-2c963f66afa6' \
-H 'accept: */*' \
-H 'Authorization: Bearer sk_1d2ca11d-125a-416c-8fdc-e9661ebecb9a' \
-d ''

Response example:

Status Code200

Possible errors:

HTTP CodeMessageDescriptionError code
404Report not foundReport not found.120024
400Report already processingReport already processing120024
400Too many simultaneously processed reportsThe number of simultaneously processed reports has reached the limit.120024

Canceling report generation

Endpoint: DELETE /publicapi/api/v2/private/Report/process/{report_id}

Request example:

curl -X 'DELETE' \
'http://baf.ai/publicapi/api/v2/private/Report/Process/3fa85f64-5717-4562-b3fc-2c963f66afa7' \
-H 'accept: */*' \
-H 'Authorization: Bearer sk_1d2ca11d-125a-416c-8fdc-e9661ebecb9a'

Response example:

Status Code200

Possible errors:

HTTP CodeMessageDescriptionError code
400This report not processing at this momentThe report is not in the processing state120024