User activities service


User activities

The User Activities API tracks and aggregates user-activity information on user sign on attempts, password reset attempts, and total active user counts. The service uses stream processors that listen to the users, login_attempts, and password_resets events. These events are collected and presented by time period. The service supports a query filtering parameter to request user-activity information for a specific date range and sample size.

User activities API operations

The populations service supports the following endpoint operations:

For hands-on experience with the user activities API endpoints, click the Run in Postman button below to download a Postman collection that you can import and open in your local Postman application.

User activities data model

Property Description
startDate The start date for the activity period.
endDate The end date for the activity period.
environment.id A string that specifies the environment resource’s unique identifier.
totalActiveUsers An integer that specifies the total number of active users for the activity period.
userSignOns.successes An integer that specifies the total number of successful user sign ons for the activity period.
userSignOns.failures An integer that specifies the total number of failed user sign ons for the activity period.
passwordResets An integer that specifies the total number of password resets for the activity period.

Response codes

Code Message
200 Successful operation.
201 Successfully created.
204 Successfully removed. No content.
400 The request was invalid.
401 You weren’t authenticated to perform this operation.
404 The specified object doesn’t exist.
409 Uniqueness constraint violation (e.g., duplicate name).

Endpoint examples

Get user activities

You can get all user-activity events for a selected environment. If a startDate and endDate filtering parameter is not specified, the request returns all user activity information for the past 30 days. If a sampleSize filtering parameter is not specified, the default sample size value is DAY.

The GET /environments/{environmentId}/userActivities operation returns all user-activity events for the specified environment.

curl -X "GET" "https://api.pingone.com/v1/environments/{environmentId}/userActivities" \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer jwtToken'

The response data looks like this:

{
    "_links": {
        "self": {
            "href": "https://api.pingone.com/v1/environments/0bda42bc-d54f-449f-8d46-d5b8990c43ba/userActivities"
        }
    },
    "_embedded": {
        "userActivities": [
            {
                "startDate": "2018-09-15T00:00:00Z",
                "endDate": "2018-09-16T00:00:00Z",
                "totalActiveUsers": 0,
                "userSignOns": {
                    "successes": 0,
                    "failures": 0
                },
                "passwordResets": 0
            },
            {
                "startDate": "2018-09-16T00:00:00Z",
                "endDate": "2018-09-17T00:00:00Z",
                "totalActiveUsers": 0,
                "userSignOns": {
                    "successes": 0,
                    "failures": 0
                },
                "passwordResets": 0
            },
            {
                "startDate": "2018-09-17T00:00:00Z",
                "endDate": "2018-09-18T00:00:00Z",
                "totalActiveUsers": 0,
                "userSignOns": {
                    "successes": 0,
                    "failures": 0
                },
                "passwordResets": 0
            },
            {
                "startDate": "2018-09-18T00:00:00Z",
                "endDate": "2018-09-19T00:00:00Z",
                "totalActiveUsers": 0,
                "userSignOns": {
                    "successes": 0,
                    "failures": 0
                },
                "passwordResets": 0
            },
            {
                "startDate": "2018-09-19T00:00:00Z",
                "endDate": "2018-09-20T00:00:00Z",
                "totalActiveUsers": 0,
                "userSignOns": {
                    "successes": 0,
                    "failures": 0
                },
                "passwordResets": 0
            },
            {
                "startDate": "2018-09-20T00:00:00Z",
                "endDate": "2018-09-21T00:00:00Z",
                "totalActiveUsers": 0,
                "userSignOns": {
                    "successes": 0,
                    "failures": 0
                },
                "passwordResets": 0
            },
            {
                "startDate": "2018-09-21T00:00:00Z",
                "endDate": "2018-09-22T00:00:00Z",
                "totalActiveUsers": 0,
                "userSignOns": {
                    "successes": 0,
                    "failures": 0
                },
                "passwordResets": 0
            },
            {
                "startDate": "2018-09-22T00:00:00Z",
                "endDate": "2018-09-23T00:00:00Z",
                "totalActiveUsers": 0,
                "userSignOns": {
                    "successes": 0,
                    "failures": 0
                },
                "passwordResets": 0
            },
            {
                "startDate": "2018-09-23T00:00:00Z",
                "endDate": "2018-09-24T00:00:00Z",
                "totalActiveUsers": 0,
                "userSignOns": {
                    "successes": 0,
                    "failures": 0
                },
                "passwordResets": 0
            },
            {
                "startDate": "2018-09-24T00:00:00Z",
                "endDate": "2018-09-25T00:00:00Z",
                "totalActiveUsers": 0,
                "userSignOns": {
                    "successes": 0,
                    "failures": 0
                },
                "passwordResets": 0
            },
            {
                "startDate": "2018-09-25T00:00:00Z",
                "endDate": "2018-09-26T00:00:00Z",
                "totalActiveUsers": 0,
                "userSignOns": {
                    "successes": 0,
                    "failures": 0
                },
                "passwordResets": 0
            },
            {
                "startDate": "2018-09-26T00:00:00Z",
                "endDate": "2018-09-27T00:00:00Z",
                "totalActiveUsers": 0,
                "userSignOns": {
                    "successes": 0,
                    "failures": 0
                },
                "passwordResets": 0
            },
            {
                "startDate": "2018-09-27T00:00:00Z",
                "endDate": "2018-09-28T00:00:00Z",
                "totalActiveUsers": 0,
                "userSignOns": {
                    "successes": 0,
                    "failures": 0
                },
                "passwordResets": 0
            },
            {
                "startDate": "2018-09-28T00:00:00Z",
                "endDate": "2018-09-29T00:00:00Z",
                "totalActiveUsers": 0,
                "userSignOns": {
                    "successes": 0,
                    "failures": 0
                },
                "passwordResets": 0
            },
            {
                "startDate": "2018-09-29T00:00:00Z",
                "endDate": "2018-09-30T00:00:00Z",
                "totalActiveUsers": 0,
                "userSignOns": {
                    "successes": 0,
                    "failures": 0
                },
                "passwordResets": 0
            }
        ]
    }
}

To fine-tune the result data, you can specify a SCIM filtering expression to designate specific date ranges and sample sizes. In the following sample, the SCIM filter (URL-encoded) returns data showing the user-activities that occurred from a startDate of 2/17/2018, an endDate of 2/23/2018.

The GET environments/{environmentId}/userActivities?{filter} operation returns the user activities for the time period starting on 2/17/2018 ending on 2/23/2018.

curl -X GET "https://api.pingone.com/v1/environments/{environmentId}/userActivities?filter=startDate%20eq%20%222018-02-17T09:10:12-04:00%22%20and%20endDate%20eq%20%222018-02-23T09:10:12-04:00%22" \
-H "Content-type: application/json" \
-H "Authorization: Bearer jwtToken"

If your startDate and endDate filter values are less than or equal to five days, then the result data defaults to a sampleSize value of HOURS.

curl -X GET "https://api.pingone.com/v1/environments/{environmentId}/userActivities?filter=startDate%20eq%20%222018-02-17T09:10:12-04:00%22%20and%20endDate%20eq%20%222018-02-23T09:10:12-04:00%22" \
-H "Content-type: application/json" \
-H "Authorization: Bearer jwtToken"

The response data shows the collected user-activities event list for each hour interval.

{
  ...

                "startDate": "2018-02-18T10:00:00-04:00",
                "endDate": "2018-02-18T11:00:00-04:00",
                "totalActiveUsers": 0,
                "userSignOns": {
                    "successes": 4978,
                    "failures": 0
                },
                "passwordResets": 0
            },
            {
                "startDate": "2018-02-18T11:00:00-04:00",
                "endDate": "2018-02-18T12:00:00-04:00",
                "totalActiveUsers": 0,
                "userSignOns": {
                    "successes": 4969,
                    "failures": 0
                },
                "passwordResets": 0
            }
  ...