> ## Documentation Index
> Fetch the complete documentation index at: https://syteca.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# User Productivity

> Syteca Data Connector REST API endpoint returning total active time per user per hour per day — the canonical endpoint for productivity dashboards.

Returns total active time (in minutes) for each user during each hour of each day. This is the canonical endpoint for user productivity dashboards — it aggregates across sessions and produces a clean `(date, hour, user) → minutes` shape ready for time-series visualizations.

```http theme={"system"}
GET https://<hostname>/ekranapi/user/getproductivity
```

## Authentication

<ParamField header="ApiKey" type="string" required>
  Your Active API Key from the Management Tool.
</ParamField>

## Query parameters

<ParamField query="start" type="string">
  Sessions that were started or finished **after this time** are included in the productivity calculation.

  Accepted formats: `2021-04-01`, `2021-04-01T12:00`, `2021-04-01T12:00:00`.
</ParamField>

<ParamField query="end" type="string">
  Sessions that were started or finished **before this time** are included.
</ParamField>

<Note>
  If both `start` and `end` are omitted, productivity for all sessions in the database is returned. See [Time parameter conventions](/docs/api/data-connector/api-reference#time-parameter-conventions) for full rules and boundary clipping.
</Note>

## Response (200 OK)

<ResponseField name="date" type="date-time">
  The date (date portion is significant; time portion encodes UTC offset).
</ResponseField>

<ResponseField name="totalMinutes" type="double">
  Total number of minutes the user was active during this hour of the day.
</ResponseField>

<ResponseField name="userName" type="string">
  The user name.
</ResponseField>

<ResponseField name="timeOfDay" type="int32">
  The hour of the day (`0`–`23`).
</ResponseField>

## Example

<RequestExample>
  ```bash cURL theme={"system"}
  curl -X GET "https://<hostname>/ekranapi/user/getproductivity?start=2021-09-01&end=2021-09-30" \
    -H "ApiKey: xJ)tsCNcpj)l+]}(@_|lt!t………"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={"system"}
  [
    {
      "date": "2021-09-03T00:00:00+05:00",
      "totalMinutes": 25.816666666666666,
      "userName": "userName1",
      "timeOfDay": 18
    },
    {
      "date": "2020-02-03T00:00:00+03:00",
      "totalMinutes": 6,
      "userName": "userName2",
      "timeOfDay": 4
    }
  ]
  ```
</ResponseExample>

<Tip>
  **For productivity heatmaps**, group results by `(userName, timeOfDay)` across all dates in your range — the resulting matrix shows when each user is most active throughout the day. This is exactly the shape Power BI uses for the **User Productivity** report — see the [Power BI example](/docs/api/data-connector/power-bi-example).
</Tip>

## Errors

See [Status codes](/docs/api/data-connector/api-reference#status-codes). Common errors:

* **400 Bad Request** — invalid `start` or `end` format.
* **403 Forbidden** — Data Connector not registered.

## Related

<CardGroup cols={2}>
  <Card title="List users" icon="users" href="/docs/api/data-connector/endpoints/get-users">
    Get the full user list (use for filtering or display).
  </Card>

  <Card title="List sessions with productivity" icon="bar-chart-3" href="/docs/api/data-connector/endpoints/post-sessions">
    Session-level productivity — duration, idle, productive time.
  </Card>

  <Card title="Application statistics" icon="app-window" href="/docs/api/data-connector/endpoints/get-application-statistics">
    Per-application breakdown of where active time went.
  </Card>

  <Card title="Power BI example" icon="bar-chart" href="/docs/api/data-connector/power-bi-example">
    The Power BI User Productivity report uses this endpoint.
  </Card>
</CardGroup>
