---
category: [Administration & Integrations, Administration & Integrations/Workday API, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
nav: wcp_docs
parent_url: /wcp_docs/
title: User Activity Logging REST API
layout: subsection
---

The User Activity Logging REST API enables developers and administrators to retrieve log entries that contain information about Workday user activities. This REST API provides access to the <b>User Activity</b> report data source.

Before submitting User Activity Logging REST API requests, begin logging the user activity in the tenant:

1.  Access the <b>Edit Tenant Setup - System</b> task.
2.  Select the <b>Enable User Activity Logging</b> option.


For reference information about the User Activity Logging REST API, see the `activityLogging` resource in the <i>Privacy</i> REST web service documentation.

## <a id="section_urlBasePath"></a>URL Base Path

<b>Workday API Gateway Base Path</b>

For REST API calls in Workday Extend and Orchestrate for Integrations, use the regional API Gateway base URL for your account. See [Reference: Workday Extend API Gateways and Authorization Base URLs](https://developer.workday.com/documentation/dlh1653340161856) on the Developer Site. Note that the API Gateway base URL doesn’t include the tenant name.

<b>Tenant Base Path</b>

For traditional Integrations using tenanted REST APIs calls:

```
https://<hostname>/api/privacy/<version>/<tenant>
```

Example:

```
https://yourTenantHostName.com/api/privacy/v1/gms
```

## <a id="section_securityConsiderations"></a>Security Considerations

Workday secures the User Activity Logging REST API to the <i>System Auditing</i> domain in the System functional area.

When you submit the User Activity Logging REST API, you can view the activity logs for all users. However, if your security profile doesn't permit you to access the reported tasks in the activity logs, you don't have access to the tasks in Workday.

Review your internal security and privacy (GDPR) procedures to determine how you want to use the User Activity Logging REST API.

## <a id="section_countUserActivity"></a>Getting the Count of User Activity Instances

To estimate the size of the user activity records efficiently without actually fetching the data, you can get the count of the records using the `returnUserActivityEntryCount` parameter.

To get the count of user activity instances in a given time frame, use this endpoint and parameters:

```
GET /activityLogging?from={fromDateTime}&to={toDateTime}&returnUserActivityEntryCount=true
```

Where:

-   <b>{fromDateTime}</b>

    The required date and time of the earliest log entry. Use the UTC time zone.

-   <b>{toDateTime}</b>

    The required date and time of the latest log entry. Use the UTC time zone.

-   <b>returnUserActivityEntryCount=true</b>

    If true, the endpoint returns only the count of user activity instances in the specified time frame.



The response data contains a `userActivityEntryCount` value.

Sample request:

Get the count of the user activity instances from May 15, 2022 to June 3, 2022.

```
GET /activityLogging?from=2022-05-15T00:00:00Z&to=2022-06-02T23:59:59Z&returnUserActivityEntryCount=true
```

Sample response:

```
{
    "total": 1,
    "data": [
        {
            "userActivityEntryCount": 10219
        }
    ]
} 
```

## <a id="section_retrieveUserActivity"></a>Retrieving User Activity Instances

To retrieve user activity instances within a given time frame, use this endpoint:

```
GET /activityLogging?from={fromDateTime}&to={toDateTime}&instancesReturned={instancesReturned}
```

Where:

-   <b>{fromDateTime}</b>

    The required date and time of the earliest log entry. Use the UTC time zone.

-   <b>{toDateTime}</b>

    The required date and time of the latest log entry. Use the UTC time zone.

-   <b>{instancesReturned}</b>

    A number between 1 and 25 for fine-tuning the retrieval mechanism. Workday recommends a value of `1`, which gives the best performance.

    `instancesReturned=1` retrieves 10,000 instances. If there are more than 10,000 instances, iteratively call the endpoint using the datetime of the last record as the `{fromDateTime}` parameter. For details about the iterative calls, see [Retrieve All User Activities in a Time Period](/wcp_docs/bwx1650304612133.html).



The `GET /activityLogging` endpoint also provides the `limit` and `offset` pagination parameters. The default `limit` is 20 (maximum is 1000), and the default `offset` is `0`.

<b>Note:</b> To ensure that you retrieve the complete set of data, iteratively call the `GET /activityLogging` endpoint with the `limit` and `offset` parameters. Set `limit=1000`. Initially set `offset=0`, then increment it by 1000 in subsequent calls. For details about the iterative calls, see [Retrieve All User Activities in a Time Period](/wcp_docs/bwx1650304612133.html).

Sample request:

Get the user activity instances from May 15, 2022 to June 3, 2022.

```
GET /activityLogging?from=2022-05-15T00:00:00Z&to=2022-06-02T23:59:59Z
```

<b>Note:</b> This example uses the minimum required parameters. For best practice, see the [Best Practices](/wcp_docs/mhr1626995534900.html#section_bestPractices) section.

Sample response:

```
{
    "total": 10219,
    "data": [
        {
            "sessionId": "f3f7eb",
            "target": {
                "descriptor": "wd-environments / Workday Production Automation",
                "id": "2e89495897384ea9b2eab4341dc24dca"
            },
            "taskDisplayName": "Start New Session (Web Service)",
            "requestTime": "2022-05-16T11:55:38.338Z",
            "taskId": "03f043df676e40cfad46bc576f89b07f",
            "ipAddress": "64.124.173.190",
            "deviceType": "Desktop",
            "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64
             Safari/537.36",
            "activityAction": "READ",
            "systemAccount": "wd-environments"
        },
        ...
        ...
        {
            "sessionId": "f3f7eb",
            "target": {
                "descriptor": "Test",
                "id": "921606317e300154c4558ae0995d0000"
            },
            "taskDisplayName": "View Workbook",
            "requestTime": "2022-05-16T14:17:13.649Z",
            "taskId": "fb47dca0a89210001e2115c2bb6c0257",
            "ipAddress": "64.124.173.190",
            "deviceType": "Desktop",
            "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64
             Safari/537.36",
            "activityAction": "READ",
            "systemAccount": "wd-environments"
        }
    ]
}

 
```

The sample `data[]` array contains only 20 records because the default `limit` is 20. To retrieve all 10,219 records, iteratively call the `GET /activityLogging` endpoint with the `limit` and `offset` parameters. For details about how to call the `GET /activityLogging` endpoint iteratively, see [Retrieve All User Activities in a Time Period](/wcp_docs/bwx1650304612133.html).

## <a id="section_filterUserActivity"></a>Filtering the User Activity Instances

You can filter the log entries by users and tasks. To get the log entries for specific users and tasks, specify 1 or more `systemAccount` or `taskId` query parameters, respectively.

Sample request:

Return all user activity instances from May 15, 2022 to June 3, 2022, where Logan McNeil or Teresa Serrano accessed the <b>My Reports</b> or <b>Request Time Off</b> reports.

1.  Send the `GET /activityLogging` endpoint with the specified timeframe:

    ```
    GET /activityLogging?from=2022-05-15T00:00:00Z&to=2022-06-02T23:59:59Z&limit=1000
    ```

2.  Search the response to find an entry where Logan McNeil or Teresa Serrano accessed the <b>My Reports</b> and <b>Request Time Off</b> reports. Then, copy the taskIds associated with those reports:

    ```
    {
      "total": 10219,
      "data": [
    ...
    ...
    {
                "deviceType": "Desktop",
                "taskId": "<b>a2b801281b5f100013d6f884ceb50047</b>",
                "requestTime": "2022-06-02T20:48:57.693Z",
                "taskDisplayName": "My Reports",
                "systemAccount": "lmcneil",
                "ipAddress": "173.226.103.218",
                "sessionId": "56dc20",
                "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63
                 Safari/537.36",
                "activityAction": "READ"
            },
    ...
    ...
            {
                "deviceType": "Desktop",
                "taskId": "<b>eb0bf32f15b1498c9d7d213523811770</b>",
                "requestTime": "2022-06-02T21:28:21.341Z",
                "taskDisplayName": "Request Time Off",
                "systemAccount": "lmcneil",
                "ipAddress": "173.226.103.218",
                "target": {
                    "descriptor": "Logan McNeil (CHRO, HRExe, Mgr 4000, MatMgr, ProMgr,TalMgr,VPRept)",
                    "id": "3aa5550b7fe348b98d7b5741afc65534"
                },
                "sessionId": "57b83f",
                "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63
                 Safari/537.36",
                "activityAction": "READ"
            },
    ...
    ...
       ],
    }
     
    ```

3.  Send the `GET /activityLogging` endpoint again with these additional query parameters:

    -   `systemAccount`: lmcneil
    -   `systemAccount`: tserrano
    -   `taskId`: a2b801281b5f100013d6f884ceb50047
    -   `taskId`: eb0bf32f15b1498c9d7d213523811770

    ```
    GET /activityLogging?from=2022-05-15T00:00:00Z&to=2022-06-02T23:59:59Z&systemAccount=tserrano&systemAccount=lmcneil&taskId=a2b801281b5f100013d6f884ceb50047&taskId=eb0bf32f15b1498c9d7d213523811770&limit=1000
    ```



## <a id="section_bestPractices"></a>Best Practices

To tune the performance and to ensure that you retrieve the complete set of records in a time period, iteratively call the `GET /activityLogging` endpoint with these recommended parameter values:

<table><thead><tr><th>Parameter</th><th>Recommended Value</th></tr></thead><tbody><tr><td><code>limit</code></td><td><code>1000</code></td></tr><tr><td><code>offset</code></td><td>Initially set to <code>0</code>, then increment by <code>1000</code> in subsequent calls.</td></tr><tr><td><code>instancesReturned</code></td><td><code>1</code></td></tr></tbody></table><br/>

Examples of iterative calls:

```
GET /activityLogging?from=2022-05-15T00:00:00Z&to=2022-06-02T23:59:59Z&limit=1000&instancesReturned=1&offset=0
```

```
GET /activityLogging?from=2022-05-15T00:00:00Z&to=2022-06-02T23:59:59Z&limit=1000&instancesReturned=1&offset=1000
```

```
GET /activityLogging?from=2022-05-15T00:00:00Z&to=2022-06-02T23:59:59Z&limit=1000&instancesReturned=1&offset=2000
```

