Reports

Overview

This page contains the APIs for retrieving the reports available in FusionAuth. Here are the APIs:

Retrieve Daily Active Users Report

This report includes the number of daily active users for a given application or across all applications. You must specify a date range for the report. true

Request

API Key Authentication
Retrieve the daily active users report
GET /api/report/daily-active-user?start={start}&end={end}&applicationId={applicationId}

Request Parameters

applicationIdUUID

A specific application to query for. If not provided a “Global” (across all applications) daily active users report will be returned.

endLongrequired

The end of the query range. This is an instant but it is truncated to days in the report timezone (which is set in the system settings).

startLongrequired

The start of the query range. This is an instant but it is truncated to days in the report timezone (which is set in the system settings).

Response

The response for this API contains the daily active users report.

Response Codes
Code Description
200 The request was successful. The response will contain a JSON body.
400 The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid FusionAuth license is required and is not present.
401 You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.
404 The object you requested doesn't exist. The response will be empty.
500 There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.
503 The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body.

Response Body

dailyActiveUsers

The list of daily active users counts.

dailyActiveUsers[x].intervalInteger

The interval for this count. The interval values for the daily active users report are the number of days since Epoch UTC shifted to the report timezone.

dailyActiveUsers[x].countInteger

The number of daily active users for this count.

totalInteger

The total (sum) of each count across the query range.

Example Response JSON

{
  "total": 30,
  "dailyActiveUsers": [
    {
      "interval": 16739,
      "count": 10
    },
    {
      "interval": 16740,
      "count": 10
    },
    {
      "interval": 16741,
      "count": 10
    }
  ]
}

Retrieve Login Report

This report includes the number of login for a given application or across all applications. You must specify a date range for the report. The report is always calculated in hours. if you want to calculate daily logins, you'll need to roll up the results in the response.

Request

API Key Authentication
Retrieve the login report
GET /api/report/login?start={start}&end={end}&applicationId={applicationId}
API Key Authentication
Retrieve the login report for an individual user by username or email address
GET /api/report/login?start={start}&end={end}&applicationId={applicationId}&loginId={loginId}
API Key Authentication
Retrieve the login report for an individual user by unique Id
GET /api/report/login?start={start}&end={end}&applicationId={applicationId}&userId={userId}

Request Parameters

applicationIdUUID

A specific application to query for. If not provided a “Global” (across all applications) login report will be returned.

endLongrequired

The end of the query range. This is an instant but it is truncated to hours in the report timezone (which is set in the system settings).

startLongrequired

The start of the query range. This is an instant but it is truncated to hours in the report timezone (which is set in the system settings).

loginIdStringAvailable since 1.4.0

When this parameter is provided it will reduce the scope of the report to a single user with the requested email or username specified by this parameter.

This parameter is mutually exclusive with userId, if both are provided, the loginId will take precedence.

userIdUUIDAvailable since 1.4.0

When this parameter is provided it will reduce the scope of the report to a single user with the requested unique Id.

This parameter is mutually exclusive with loginId, if both are provided, the loginId will take precedence.

Response

The response for this API contains the login report.

Response Codes
Code Description
200 The request was successful. The response will contain a JSON body.
400 The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid FusionAuth license is required and is not present.
401 You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.
404 The object you requested doesn't exist. The response will be empty.
500 There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.
503 The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body.

Response Body

hourlyCounts

The list of login counts.

hourlyCounts[x].intervalInteger

The interval for this count. The interval values for the login report are the number of hours since Epoch UTC shifted to the report timezone.

hourlyCounts[x].countInteger

The number of login for this count.

totalInteger

The total (sum) of each count across the query range.

Example Response JSON

{
  "total": 100,
  "hourlyCounts": [
    {
      "interval": 401824,
      "count": 60
    },
    {
      "interval": 401825,
      "count": 40
    }
  ]
}

Retrieve Monthly Active Users Report

This report includes the number of monthly active users for a given application or across all applications. You must specify a date range for the report. The report is always calculated using months as the interval.

Request

API Key Authentication
Retrieve the monthly active users report
GET /api/report/monthly-active-user?start={start}&end={end}&applicationId={applicationId}

Request Parameters

applicationIdUUID

A specific application to query for. If not provided a “Global” (across all applications) monthly active users report will be returned.

endLongrequired

The end of the query range. This is an instant but it is truncated to months in the report timezone (which is set in the system settings).

startLongrequired

The start of the query range. This is an instant but it is truncated to months in the report timezone (which is set in the system settings).

Response

The response for this API contains the monthly active users report.

Response Codes
Code Description
200 The request was successful. The response will contain a JSON body.
400 The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid FusionAuth license is required and is not present.
401 You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.
404 The object you requested doesn't exist. The response will be empty.
500 There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.
503 The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body.

Response Body

monthlyActiveUsers

The list of monthly active users counts.

monthlyActiveUsers[x].intervalInteger

The interval for this count. The interval values for the monthly active users report are the number of months since Epoch UTC shifted to the report timezone.

monthlyActiveUsers[x].countInteger

The number of monthly active users for this count.

totalInteger

The total (sum) of each count across the query range.

Example Response JSON

{
  "total": 39,
  "monthlyActiveUsers": [
    {
      "count": 10,
      "interval": 543
    },
    {
      "count": 10,
      "interval": 544
    },
    {
      "count": 10,
      "interval": 545
    },
    {
      "count": 9,
      "interval": 546
    }
  ]
}

Retrieve Registration Report

This report includes the number of registrations for a given application or across all applications. You must specify a date range for the report. The report is always calculated in hours. if you want to calculate daily registrations, you'll need to roll up the results in the response.

Request

API Key Authentication
Retrieve the registrations report
GET /api/report/registration?start={start}&end={end}&applicationId={applicationId}

Request Parameters

applicationIdUUID

A specific application to query for. If not provided a “Global” (across all applications) registrations report will be returned.

endLongrequired

The end of the query range. This is an instant but it is truncated to hours in the report timezone (which is set in the system settings).

startLongrequired

The start of the query range. This is an instant but it is truncated to hours in the report timezone (which is set in the system settings).

Response

The response for this API contains the registrations report.

Response Codes
Code Description
200 The request was successful. The response will contain a JSON body.
400 The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid FusionAuth license is required and is not present.
401 You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.
404 The object you requested doesn't exist. The response will be empty.
500 There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.
503 The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body.

Response Body

hourlyCounts

The list of registrations counts.

hourlyCounts[x].intervalInteger

The interval for this count. The interval values for the registrations report are the number of hours since Epoch UTC shifted to the report timezone.

hourlyCounts[x].countInteger

The number of registrations for this count.

totalInteger

The total (sum) of each count across the query range.

Example Response JSON

{
  "total": 100,
  "hourlyCounts": [
    {
      "interval": 401824,
      "count": 60
    },
    {
      "interval": 401825,
      "count": 40
    }
  ]
}

Retrieve Totals Report

The Report Totals API is used to retrieve the number users currently registered and how many login requests have been serviced by FusionAuth globally as well as broken down by each Application.

Request

API Key Authentication
Retrieve the Totals Report
GET /api/report/totals

Response

The response for this API contains the totals report.

Response Codes
Code Description
200 The request was successful. The response will contain a JSON body.
400 The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid FusionAuth license is required and is not present.
401 You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.
404 The object you requested doesn't exist. The response will be empty.
500 There was an internal error. A stack trace is provided and logged in the FusionAuth log files. The response will be empty.
503 The search index is not available or encountered an exception so the request cannot be completed. The response will contain a JSON body.

Response Body

applicationTotals

A map where the key is the Id of the Application and the value is an object that contains the totals for that Application.

applicationTotals[id].loginsInteger

The total number of logins (all time) for the Application.

applicationTotals[id].registrationsInteger

The current number of registrations for the Application. This doesn’t include registrations for user’s that have been deleted from FusionAuth.

applicationTotals[id].totalRegistrationsInteger

The total number of registrations (all time) for the Application.

globalRegistrationsInteger

The current number of registered users. This value is incremented each time a new user is added to FusionAuth, and this value is decremented when a user is deleted from FusionAuth.

totalGlobalRegistrationsInteger

The total number of registrations (all time). When a user is removed from FusionAuth this number is not decremented.

Example Response JSON

{
  "applicationTotals": {
    "00000000-0000-0000-0000-000000000000": {
      "logins": 20,
      "registrations": 10,
      "totalRegistrations": 10
    },
    "00000000-0000-0000-0000-000000000001": {
      "logins": 20,
      "registrations": 10,
      "totalRegistrations": 10
    },
    "00000000-0000-0000-0000-000000000002": {
      "logins": 20,
      "registrations": 10,
      "totalRegistrations": 10
    },
    "00000000-0000-0000-0000-000000000003": {
      "logins": 20,
      "registrations": 10,
      "totalRegistrations": 10
    },
    "00000000-0000-0000-0000-000000000004": {
      "logins": 20,
      "registrations": 10,
      "totalRegistrations": 10
    }
  },
  "globalRegistrations": 10,
  "totalGlobalRegistrations": 10
}