> For the complete documentation index, see [llms.txt](https://docs.visualsentinel.com/llms.txt)

# Analytics API

Analytics, journeys, and subscription events. This page lists all 4 endpoints in the Analytics area of the Visual Sentinel REST API.

Base URL: `https://visualsentinel.com`. Unless an endpoint says otherwise it accepts an API key or a session cookie, see [Authentication](https://docs.visualsentinel.com/guides/authentication.md). Most error responses use the [ErrorResponse](https://docs.visualsentinel.com/reference/models/error-response.md) shape, see [Errors](https://docs.visualsentinel.com/guides/errors.md) and [Rate limits](https://docs.visualsentinel.com/guides/rate-limits.md).

## Endpoints

- [Get analytics overview](#get-analytics): `GET /api/analytics`
- [Get subscription events](#get-subscription-events): `GET /api/analytics/subscription-events`
- [Track subscription event](#track-subscription-event): `POST /api/analytics/subscription-events`
- [Get AI insights](#get-ai-insights): `GET /api/ai/insights`

## Get analytics overview

`GET /api/analytics`

Get monitoring analytics and statistics for the organization.

**Responses**

- `200`: Analytics data.

## Get subscription events

`GET /api/analytics/subscription-events`

Get subscription lifecycle events for analytics.

**Responses**

- `200`: Subscription events.

## Track subscription event

`POST /api/analytics/subscription-events`

Record a plan-change funnel event (UPGRADED, DOWNGRADED or REACTIVATED) from the signed-in app. Session only: API keys cannot use it. Payment, revenue and refund events and fields are recorded from billing and are refused here.

Authentication: session cookie only. API keys are refused.

**Responses**

- `200`: Event tracked.

## Get AI insights

`GET /api/ai/insights`

Get AI-generated insights about monitoring data and trends.

Authentication: session cookie only. API keys are refused.

**Responses**

- `200`: AI insights.

Generated from the OpenAPI 3.1 specification at [https://docs.visualsentinel.com/openapi.json](https://docs.visualsentinel.com/openapi.json), the same file the interactive reference reads.
