> For the complete documentation index, see [llms.txt](https://docs.we360.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.we360.ai/deployment-and-it-ops/integrations-and-api-access/integrations/oauth-for-direct-api-access/dynamic-report-api.md).

# Dynamic Report API

Fetch employee activity and attendance analytics in JSON format with explicit field selection.

Use the Dynamic Report API to fetch employee activity and attendance analytics in JSON format.

It supports explicit field selection. It also supports pagination and filters.

## Overview

* Base URL: `https://api.in.we360.ai`
* Base path: `/query/external/reports/dynamic_report`
* Method: `POST`
* Response type: `application/json`

## Authentication

Send this header with every request:

* `Authorization: Bearer ${access_token}`

Get the token from [OAuth for Direct API Access](/deployment-and-it-ops/integrations-and-api-access/integrations/oauth-for-direct-api-access.md).

## Request body

```json
{
  "start_date": "2026-04-01T00:00:00",
  "end_date": "2026-04-07T23:59:59",
  "mode": "detailed",
  "columns": [
    "attendance_date",
    "identity_id",
    "employee_id",
    "first_name",
    "last_name",
    "email",
    "group_name",
    "active_duration",
    "productive_percent"
  ],
  "page": 1,
  "limit": 50,
  "group_id": "",
  "user_id": "",
  "shift": []
}
```

### Parameters

| Parameter    | Required | Description                              |
| ------------ | -------- | ---------------------------------------- |
| `start_date` | Yes      | Start of the ISO datetime range.         |
| `end_date`   | Yes      | End of the ISO datetime range.           |
| `mode`       | Yes      | `summary` or `detailed`.                 |
| `columns`    | Yes      | Explicit list of fields to return.       |
| `page`       | No       | Page number. Default is `1`.             |
| `limit`      | No       | Page size. Use `0` to fetch all records. |
| `group_id`   | No       | Comma-separated group UUID list.         |
| `user_id`    | No       | Comma-separated user UUID list.          |
| `shift`      | No       | List of shift UUIDs.                     |

## Select report data with `columns`

The `columns` array controls the fields returned in each row. Include only the supported fields your integration needs. This lets one endpoint power attendance exports, productivity dashboards, utilization checks, and employee-level drill-downs.

For example, request `identity_id`, `employee_id`, and `online_duration` for working-time reporting. Add `productive_duration` and `productive_percent` for productivity reporting. Add the utilization and goal fields for workforce-goal reporting.

{% hint style="info" %}
`columns` selects supported report fields. It cannot return arbitrary data that is not listed below.
{% endhint %}

### Available columns

The following columns are available in both modes.

#### User and organization

* `identity_id` — User's unique identity UUID.
* `employee_id` — Employee identifier.
* `first_name`, `last_name` — User's name.
* `email`, `secondary_email` — User's email addresses.
* `gender`, `phone_number`, `date_of_birth` — User profile details.
* `designation` — User's job title.
* `date_of_joining`, `created_date` — Employment and account dates.
* `manager` — User's reporting manager.
* `group_name` — User's group or team.
* `c_bool1`, `c_bool2` — Configured boolean custom user fields.
* `c_int1`, `c_int2`, `c_int3` — Configured numeric custom user fields.
* `c_string1`, `c_string2`, `c_string3` — Configured text custom user fields.

#### Attendance and shift

* `attendance_date`, `punch_date` — Attendance and punch dates.
* `punch_in`, `punch_out` — First punch-in and last punch-out time.
* `punch_in_location`, `punch_out_location` — Recorded punch locations.
* `shift_name` — Assigned shift name.
* `shift_start_dt`, `shift_end_dt` — Shift start and end datetime.
* `punch_duration` — Time between punch-in and punch-out.
* `online_duration` — Total logged-in time.

#### Activity and productivity

* `active_duration`, `active_percent` — Active time and its percentage.
* `idle_duration`, `idle_percent` — Idle time and its percentage.
* `break_duration` — Recorded break time.
* `mouse_clicks`, `key_presses` — Input-activity counts.
* `productive_duration`, `productive_percent` — Productive time and its percentage.
* `unproductive_duration` — Time in unproductive applications and URLs.
* `neutral_duration` — Time in neutral applications and URLs.
* `top_application_used`, `top_application_duration` — Most-used application and duration.
* `top_url_used`, `top_url_duration` — Most-used URL and duration.

#### Utilization and goals

* `healthy` — `1` when online time is within configured working hours; otherwise `0`.
* `underutilized` — `1` when online time is below configured working hours; otherwise `0`.
* `overburden` — `1` when online time is above configured working hours; otherwise `0`.
* `productivity_goals_percentage` — Productive time as a percentage of the productivity goal.
* `goals_percentage` — Combined activity-goal and productivity-goal achievement percentage.

The utilization fields are mutually exclusive. Each row has exactly one value of `1`. The other two values are `0`.

Classification uses the organization's minimum and maximum punch-duration settings. Defaults are four hours minimum and nine hours maximum.

In `detailed` mode, each flag describes that user and day. In `summary` mode, it describes the user's average online time per working day across the selected range. Users without recorded activity are `underutilized`.

Goal percentages use the configured daily minimum active minutes and productive minutes. `productivity_goals_percentage` is productive time divided by the productivity goal, multiplied by 100.

`goals_percentage` combines activity and productivity achievement. When both goals are met, or both are missed, it averages both percentages. When only one goal is met, it returns the lower percentage. Values can exceed `100`. Users without matching activity return `0`.

### Example: utilization and goals

```json
{
  "start_date": "2026-04-01T00:00:00",
  "end_date": "2026-04-07T23:59:59",
  "mode": "detailed",
  "columns": [
    "identity_id",
    "employee_id",
    "online_duration",
    "healthy",
    "underutilized",
    "overburden",
    "productivity_goals_percentage",
    "goals_percentage"
  ]
}
```

Example response row:

```json
{
  "identity_id": "f9c8f8f8-1111-2222-3333-444455556666",
  "employee_id": "EMP-1024",
  "online_duration": "07:42:15",
  "healthy": 1,
  "underutilized": 0,
  "overburden": 0,
  "productivity_goals_percentage": 92.5,
  "goals_percentage": 88.3
}
```

## Response format

```json
{
  "data": [
    {
      "attendance_date": "2026-04-02",
      "identity_id": "f9c8f8f8-1111-2222-3333-444455556666",
      "employee_id": "EMP-1024",
      "first_name": "Ava",
      "last_name": "Sharma",
      "email": "ava@example.com",
      "group_name": "Engineering",
      "active_duration": "07:42:15",
      "productive_percent": 78.45
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 50,
    "total_records": 312,
    "total_pages": 7,
    "has_next": true,
    "has_previous": false
  },
  "meta": {
    "mode": "detailed",
    "selected_columns": [
      "attendance_date",
      "identity_id",
      "employee_id",
      "first_name",
      "last_name",
      "email",
      "group_name",
      "active_duration",
      "productive_percent"
    ]
  }
}
```

## Quick cURL example

```bash
curl -X POST "https://api.in.we360.ai/query/external/reports/dynamic_report" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${access_token}" \
  -d '{
    "start_date": "2026-04-01T00:00:00",
    "end_date": "2026-04-07T23:59:59",
    "mode": "summary",
    "columns": [
      "identity_id",
      "employee_id",
      "first_name",
      "last_name",
      "email",
      "group_name",
      "online_duration",
      "active_duration",
      "productive_percent"
    ],
    "page": 1,
    "limit": 25
  }'
```

## All columns cURL example

```bash
curl -X POST "https://api.in.we360.ai/query/external/reports/dynamic_report" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${access_token}" \
  -d '{
    "start_date": "2026-04-01T00:00:00",
    "end_date": "2026-04-07T23:59:59",
    "mode": "detailed",
    "columns": [
      "attendance_date","identity_id","employee_id","first_name","last_name","email","secondary_email",
      "gender","designation","phone_number","date_of_joining","date_of_birth","created_date","c_bool1",
      "c_bool2","c_int1","c_int2","c_int3","c_string1","c_string2","c_string3","punch_in","punch_out",
      "punch_in_location","punch_out_location","shift_name","shift_start_dt","shift_end_dt","punch_date",
      "punch_duration","online_duration","active_duration","active_percent","idle_duration","mouse_clicks",
      "key_presses","break_duration","productive_duration","unproductive_duration","neutral_duration",
      "manager","group_name","idle_percent","productive_percent","top_application_used",
      "top_application_duration","top_url_used","top_url_duration","healthy","underutilized",
      "overburden","productivity_goals_percentage","goals_percentage"
    ],
    "page": 1,
    "limit": 50
  }'
```

## Error handling

* Invalid `columns` returns a validation error.
* Empty access scope returns success with empty `data` and pagination metadata.
* Invalid filter IDs in `group_id`, `user_id`, or `shift` return a filter validation error.

## Best practices

* Request only the `columns` you need.
* Use `page` and `limit` for large date ranges.
* Use `summary` mode for dashboards.
* Use `detailed` mode for drill-down and export workflows.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.we360.ai/deployment-and-it-ops/integrations-and-api-access/integrations/oauth-for-direct-api-access/dynamic-report-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
