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

# Security Metrics

> Get security-specific metrics. Requires admin role.

Get security-specific metrics. Requires admin role.

### Response

`object`

<ResponseField name="timestamp" type="string (date-time)" required />

<ResponseField name="statistics" type="object" required>
  Counters from the security monitor
</ResponseField>

<ResponseField name="recent_events" type="object[]" required>
  <Expandable title="recent_events">
    <ResponseField name="type" type="string" />

    <ResponseField name="threat_level" type="string" />

    <ResponseField name="blocked" type="boolean" />

    <ResponseField name="path" type="string" />

    <ResponseField name="timestamp" type="string (date-time)" />
  </Expandable>
</ResponseField>

### Status codes

| Code  | Meaning                  |
| ----- | ------------------------ |
| `200` | Successful response      |
| `401` | Authentication required  |
| `403` | Insufficient permissions |
| `422` | Validation error         |
| `429` | Rate limit exceeded      |

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'http://localhost:8000/metrics/security' \
    --header 'Authorization: Bearer YOUR_API_KEY'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "timestamp": "2026-08-31T14:22:05Z",
    "statistics": {},
    "recent_events": [
      {
        "type": "standard",
        "threat_level": "string",
        "blocked": false,
        "path": "string",
        "timestamp": "2026-08-31T14:22:05Z"
      }
    ]
  }
  ```
</ResponseExample>
