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

# Time Series Analytics

> Time-bucketed analytics for workspace, link, lead, and sales views

# Time Series Analytics

Use these endpoints to render trend charts with consistent date-range controls.

## Endpoints

### Workspace-level trends

* `GET /api/analytics/workspace/timeseries`

### Link-level trends

* `GET /api/analytics/:linkId/timeseries`

### Conversion-specific trends

* `GET /api/analytics/leads/timeseries`
* `GET /api/analytics/sales/timeseries`

## Common query parameters

<ParamField query="days" type="number" default="30">
  Rolling lookback window. Server validates and caps range.
</ParamField>

<ParamField query="start" type="string">
  Explicit start date/time (overrides inferred start from `days` when provided with `end`).
</ParamField>

<ParamField query="end" type="string">
  Explicit end date/time.
</ParamField>

<ParamField query="granularity" type="string" default="day">
  Bucket size for supported endpoints. Accepted values include `hour`, `day`, `month` (invalid values are normalized server-side).
</ParamField>

<ParamField query="timezone" type="string" default="workspace timezone or UTC">
  IANA timezone used for bucket boundaries.
</ParamField>

<ParamField query="currency" type="string">
  Optional display currency for monetary metrics. Unsupported values fall back to workspace/default currency behavior.
</ParamField>

## Request example

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.linquid.io/api/analytics/workspace/timeseries?days=30&granularity=day&timezone=America/New_York&currency=USD" \
    -H "Authorization: Bearer <session_or_api_key>" \
    -H "X-Workspace-Id: ws_123"
  ```
</RequestExample>

## Response shape

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "timeseries": [
        {
          "timestamp": "2026-02-20T00:00:00.000",
          "clicks": 182,
          "uniqueVisitors": 149,
          "conversions": 23,
          "revenue": 1164.25
        }
      ],
      "granularity": "day",
      "currency": "USD"
    }
  }
  ```
</ResponseExample>

## Notes

* Workspace timeseries combines click and unified conversion streams.
* Lead and sales timeseries endpoints are conversion-domain specific and should be used for tab-specific analytics views.
* Cached responses may be briefly stale by design; use refresh/live surfaces for near-real-time monitoring.
