---
title: "Get SOP violation distribution stats"
method: POST
path: "/dashboard/api/sop-stats"
tags: ["SOPs"]
---

# Get SOP violation distribution stats

`POST /dashboard/api/sop-stats`

## Request

- Base URL: `https://api.agnost.ai`
- URL: `https://api.agnost.ai/dashboard/api/sop-stats`
- Auth: one of:
  - HTTP bearer and API key in header `x-org-id`
  - API key in header `x-api-key`

Mirrors `/sentiment-stats`. Returns total analyzed events, total events
in the time range, top violating SOPs, and the full SOP distribution.

## Request body

- QueryFilters
  - `time_range` '1min' | '1h' | '1d' | '1w' | '1m' | 'all'
  - `connection_type` union
    - string
    - string[]
  - `agent_name` union
    - string
    - string[]
  - `metadata_filters` object[]
    - `key` string
    - `value` string
  - `page` integer
  - `page_size` integer

## Response `200`

SOP distribution with counts per SOP title

- AnalyticsTagStats
  - `total_analyzed` integer, required
  - `total_messages` integer, required
  - `top_tags` AnalyticsTagCount[], nullable, required
    - `tag` string, required
    - `count` integer, required
  - `tag_distribution` AnalyticsTagCount[], nullable, required
    - `tag` string, required
    - `count` integer, required

## Changes

- **2026-11-03** `a61431b48f36`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/agnost/apis/agnost-ai-api/changes/dashboard/api/sop-stats/post.md)

---

[API](https://skmtc.dev/agnost/apis/agnost-ai-api.md) - [All operations](https://skmtc.dev/agnost/apis/agnost-ai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agnost/apis/agnost-ai-api/revisions/a61431b48f36?raw)
