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

# Get top targeted entities

> Returns a list of the top 5 targeted entities (users or groups) based on threat count within the specified time period.



## OpenAPI

````yaml get /api/v1/metrics/top_targeted_entities
openapi: 3.0.0
info:
  contact: {}
  title: Ocean Security API
  version: 1.0.0
  description: Ocean Security API for threat detection and security metrics
servers:
  - url: https://api.ocean.security
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Threats
    description: Operations for retrieving threat information
  - name: Metrics
    description: Security metrics and analytics endpoints
paths:
  /api/v1/metrics/top_targeted_entities:
    get:
      tags:
        - Metrics
      summary: Get top targeted entities
      description: >-
        Returns a list of the top 5 targeted entities (users or groups) based on
        threat count within the specified time period.
      parameters:
        - description: Authentication API Key
          in: header
          name: X-Api-Key
          required: true
          schema:
            type: string
        - description: Number of days to look back (default 7)
          in: query
          name: days_ago
          schema:
            type: integer
        - description: Type of entity to query ('user' or 'group', default 'user')
          in: query
          name: type
          schema:
            type: string
      responses:
        '200':
          description: List of top targeted entities and their threat counts
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ocean_api_common.BaseResponse-controllers_metrics_TopTargetedEntitiesResult
        '400':
          description: Invalid input parameters (e.g., invalid days_ago, type, or limit)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/types.ErrorResponse'
        '401':
          description: Unauthorized (invalid or missing API Key)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/types.ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/types.ErrorResponse'
components:
  schemas:
    ocean_api_common.BaseResponse-controllers_metrics_TopTargetedEntitiesResult:
      properties:
        results:
          $ref: '#/components/schemas/controllers_metrics.TopTargetedEntitiesResult'
        status:
          type: integer
      type: object
    types.ErrorResponse:
      properties:
        error:
          type: string
      type: object
    controllers_metrics.TopTargetedEntitiesResult:
      properties:
        items:
          items:
            $ref: '#/components/schemas/controllers_metrics.TopTargetedEntityRow'
          type: array
      type: object
    controllers_metrics.TopTargetedEntityRow:
      properties:
        count_threats:
          type: number
        full_name:
          type: string
        job_title:
          type: string
      type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: API key for authentication

````