> ## 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.

# Syteca API Reference

> The Syteca Data Connector REST API reference — base URL, ApiKey authentication, time-parameter conventions, pagination, status codes, and the nine available endpoints.

The Syteca Data Connector exposes nine REST endpoints under a single base URL, authenticated with a per-user API key. This page covers the conventions shared by all endpoints — base URL, authentication, time parameter format, pagination, and status codes. Per-endpoint detail (parameters, response shape, examples) lives on each [endpoint page](#endpoints).

<Warning>
  **NOT AVAILABLE IN SAAS.** The Data Connector is on-premises only.
</Warning>

## Base URL

All endpoints share the same base URL:

```text theme={"system"}
https://<hostname>/ekranapi
```

Replace `<hostname>` with the computer name where the Data Connector is installed — specifically, the value in the **Issued To** field of the [HTTPS certificate](/docs/api/data-connector/install#3-set-up-an-https-certificate) you set up during installation.

## Authentication

Every API call must include an `ApiKey` request header.

<ParamField header="ApiKey" type="string" required>
  The Active API Key from your Management Tool account. See [Manage → Get an API key](/docs/api/data-connector/manage#get-an-api-key) for how to obtain it.
</ParamField>

Example header value:

```text theme={"system"}
ApiKey: xJ)tsCNcpj)l+]}(@_|lt!t………
```

<Note>
  The API key inherits the underlying Management Tool user's permissions. API calls only return data the user would be able to see in the Management Tool — Client permissions, [administrative permissions](/docs/administration/users/administrative-permissions), and User-to-User access scope all apply.
</Note>

## Time parameter conventions

Five of the nine endpoints accept optional `start` and `end` time parameters to filter results by date/time range:

* [List Clients](/docs/api/data-connector/endpoints/get-clients) — *no time parameters*
* [List sessions (GET)](/docs/api/data-connector/endpoints/get-sessions) — `start`, `end`
* [List sessions with productivity (POST)](/docs/api/data-connector/endpoints/post-sessions) — `start`, `end`
* [Application statistics](/docs/api/data-connector/endpoints/get-application-statistics) — `start`, `end`
* [URL statistics](/docs/api/data-connector/endpoints/get-url-statistics) — `start`, `end`
* [List users](/docs/api/data-connector/endpoints/get-users) — *no time parameters*
* [User productivity](/docs/api/data-connector/endpoints/get-user-productivity) — `start`, `end`
* [List alerts](/docs/api/data-connector/endpoints/get-alerts) — `start`, `end`
* [List endpoint access requests](/docs/api/data-connector/endpoints/get-endpoint-access-requests) — `start`, `end`

### Accepted formats

All time parameters accept ISO 8601-style strings in three precision levels:

| Format                    | Example               |
| ------------------------- | --------------------- |
| Date only                 | `2021-04-01`          |
| Date + time *(to minute)* | `2021-04-01T12:00`    |
| Date + time *(to second)* | `2021-04-01T12:00:00` |

### Rules when parameters are omitted

* **Both `start` and `end` omitted** → all sessions in the database are included.
* **`start` omitted, `end` provided** → all sessions started **before** `end`.
* **`end` omitted, `start` provided** → all sessions started or finished **after** `start`.

### Session boundary clipping

For endpoints that work over sessions:

* If a session started **before** the `start` date/time, the **first activity after `start`** is considered the session start in the response.
* If a session finished **after** the `end` date/time, the **last activity before `end`** is considered the session end in the response.

## Pagination

Three endpoints support pagination because their result sets can exceed the 1000-record cap:

| Endpoint                                                                                    | Page-size parameter              | Cursor parameter                     |
| ------------------------------------------------------------------------------------------- | -------------------------------- | ------------------------------------ |
| [List sessions with productivity (POST)](/docs/api/data-connector/endpoints/post-sessions)       | `sessionCount` *(int, max 1000)* | `pageIndex` *(int, page number)*     |
| [List alerts](/docs/api/data-connector/endpoints/get-alerts)                                     | `alertCount` *(int, max 1000)*   | `afterActivityId` *(int, ID cursor)* |
| [List endpoint access requests](/docs/api/data-connector/endpoints/get-endpoint-access-requests) | `count` *(int, max 1000)*        | `afterId` *(int, ID cursor)*         |

<Warning>
  **Requesting more than 1000 records in a single call returns HTTP 400 Bad Request.** The maximum page size is 1000 across all three paginated endpoints.
</Warning>

<Note>
  The parameter naming is inconsistent across the three paginated endpoints — `sessionCount` / `alertCount` / `count` for page size, and `pageIndex` / `afterActivityId` / `afterId` for the cursor. This is the API's actual behavior; per-endpoint pages document each endpoint's exact parameter names.
</Note>

## Status codes

| Code    | Name                  | Description                                                                                                                                                                                                      |
| ------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **200** | OK                    | Successful.                                                                                                                                                                                                      |
| **400** | Bad request           | Bad input parameter. The error message indicates which one and why. *(Includes requesting more than 1000 records in a paginated endpoint.)*                                                                      |
| **403** | Forbidden             | The application is not registered on the Syteca Application Server. This happens when the Data Connector has been [removed from the Applications tab](/docs/api/data-connector/manage#deactivate-the-data-connector). |
| **404** | Not Found             | The requested resource does not exist.                                                                                                                                                                           |
| **405** | Method Not Allowed    | The application does not support the specified HTTP verb (e.g. a POST to a GET-only endpoint).                                                                                                                   |
| **500** | Internal Server Error | The Application Server is not working as expected. The request is probably valid — try again later.                                                                                                              |
| **503** | Service Unavailable   | The Application Server is probably stopped.                                                                                                                                                                      |

## Endpoints

| Endpoint                                                                                                           | Method | Returns                                                                                       |
| ------------------------------------------------------------------------------------------------------------------ | ------ | --------------------------------------------------------------------------------------------- |
| [`/ekranapi/client`](/docs/api/data-connector/endpoints/get-clients)                                                    | GET    | List of Clients (GUID + name)                                                                 |
| [`/ekranapi/sessions`](/docs/api/data-connector/endpoints/get-sessions)                                                 | GET    | List of sessions (basic info — GUID, dates, IDs)                                              |
| [`/ekranapi/sessions`](/docs/api/data-connector/endpoints/post-sessions)                                                | POST   | List of sessions with productivity details (duration, idle time, productive time) — paginated |
| [`/ekranapi/statistics/getapp`](/docs/api/data-connector/endpoints/get-application-statistics)                          | GET    | Total time spent in each application, per hour per session                                    |
| [`/ekranapi/statistics/geturl`](/docs/api/data-connector/endpoints/get-url-statistics)                                  | GET    | Total time spent on each URL, per hour per session                                            |
| [`/ekranapi/user`](/docs/api/data-connector/endpoints/get-users)                                                        | GET    | List of users (ID + name)                                                                     |
| [`/ekranapi/user/getproductivity`](/docs/api/data-connector/endpoints/get-user-productivity)                            | GET    | Total active time per user, per hour per day                                                  |
| [`/ekranapi/alerts`](/docs/api/data-connector/endpoints/get-alerts)                                                     | GET    | List of alert events (with player link) — paginated                                           |
| [`/ekranapi/AccessRequests/GetEndpointAccessRequests`](/docs/api/data-connector/endpoints/get-endpoint-access-requests) | GET    | List of Endpoint Access Control access requests — paginated                                   |

## Related

<CardGroup cols={2}>
  <Card title="Overview" icon="plug-2" href="/docs/api/data-connector/overview">
    What the Data Connector is and when to use it.
  </Card>

  <Card title="Install" icon="download" href="/docs/api/data-connector/overview">
    Prerequisites, MSI install, certificate setup.
  </Card>

  <Card title="Power BI example" icon="chart-pie" href="/docs/api/data-connector/power-bi-example">
    End-to-end use case calling these endpoints from Power BI.
  </Card>

  <Card title="Manage" icon="settings" href="/docs/api/data-connector/manage">
    Applications tab, get your API key, deactivate.
  </Card>
</CardGroup>
