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

# Get Metrics

> Get execution metrics with optional filters.
- Regular users can only see metrics for their own client.
- Admins can see all metrics, or filter by a specific account_id.



## OpenAPI

````yaml /api-reference/openapi/EvoAI-Processor-Service/sessions.yaml get /api/v1/sessions/metrics
openapi: 3.1.0
info:
  title: Evolution Foundation - AI Processor Service - Sessions
  description: AI processing, integrations and sessions
  version: 1.0.0
servers:
  - url: https://api.evoai.app
    description: Production server
  - url: http://localhost:3004
    description: Development server
    variables:
      port:
        default: '3004'
  - url: '{customUrl}'
    description: Custom server
    variables:
      customUrl:
        default: https://your-instance.com
        description: Enter your server URL
security: []
paths:
  /api/v1/sessions/metrics:
    get:
      summary: Get Metrics
      description: |-
        Get execution metrics with optional filters.
        - Regular users can only see metrics for their own client.
        - Admins can see all metrics, or filter by a specific account_id.
      operationId: get_metrics_api_v1_sessions_metrics_get
      parameters:
        - name: session_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Session Id
        - name: agent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Agent Id
        - name: skip
          in: query
          required: false
          schema:
            type: integer
            default: 0
            title: Skip
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 100
            title: Limit
      responses:
        '200':
          description: Metrics retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse_SessionMetricsResponse_'
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid request parameters
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/sessions/metrics
                  method: GET
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing authentication token
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/sessions/metrics
                  method: GET
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/sessions/metrics
                  method: GET
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Resource not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/sessions/metrics
                  method: GET
        '500':
          description: Internal Server Error (server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/sessions/metrics
                  method: GET
      security:
        - ApiAccessToken: []
components:
  schemas:
    SuccessResponse_SessionMetricsResponse_:
      properties:
        success:
          type: boolean
          title: Success
          description: Success indicator
          default: true
        data:
          $ref: 1484c3c6-3e19-4532-8504-d05131c532e1
          description: Response payload
        meta:
          $ref: fa19d44c-f4ed-404a-8823-9055725c1029
          description: Metadata
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: Optional success message
      type: object
      required:
        - data
        - meta
      title: SuccessResponse[SessionMetricsResponse]
    ErrorResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Success indicator
          default: false
        error: 51da5519-eda1-49e7-a0a6-b699da9b410e
        meta:
          $ref: 644ffca8-f3ef-4e5b-9148-ce42bc96ec8e
          description: Metadata
      type: object
      required:
        - error
        - meta
      title: ErrorResponse
      description: |-
        Standard error response schema matching error_response() return format.

        This schema matches the structure returned by error_response() function,
        which always uses ErrorInfo for the error field.
  securitySchemes:
    ApiAccessToken:
      type: apiKey
      in: header
      name: api_access_token
      description: API Access Token (UUID) for authentication

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.