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

# Get Agent Stats

> Returns aggregated conversation statistics for the specified agent,
including total conversations, qualified leads, qualification rate,
and response rate.
Requires `agent_config:view` permission.




## OpenAPI

````yaml GET /api/agent-config/{id}/stats
openapi: 3.1.0
info:
  title: Naturalead Agent Config API
  version: 1.0.0
  description: >
    API for managing AI agent configurations in the Naturalead platform.

    Agent configs define how the AI converses with leads, including the system
    prompt,

    conversation stages, guardrails, and attached knowledge bases.


    All endpoints require API key authentication and are scoped to the caller's
    account.
servers:
  - url: '{baseUrl}'
    description: API server
    variables:
      baseUrl:
        default: http://localhost:3001
security:
  - BearerAuth: []
tags:
  - name: Agent Config
    description: AI agent configuration CRUD, templates, and knowledge base assignment
  - name: Templates
    description: Pre-built agent configuration templates
  - name: Knowledge Bases
    description: Attach and detach knowledge bases from agents
paths:
  /api/agent-config/{id}/stats:
    get:
      tags:
        - Agent Config
      summary: Get agent stats
      description: |
        Returns aggregated conversation statistics for the specified agent,
        including total conversations, qualified leads, qualification rate,
        and response rate.
        Requires `agent_config:view` permission.
      operationId: getAgentStats
      parameters:
        - $ref: '#/components/parameters/AgentId'
      responses:
        '200':
          description: Agent statistics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentStats'
        '400':
          description: Invalid agent ID
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Invalid ID
                required:
                  - error
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    AgentId:
      name: id
      in: path
      required: true
      description: Agent configuration ObjectId
      schema:
        type: string
  schemas:
    AgentStats:
      type: object
      properties:
        totalConversations:
          type: integer
          description: Total number of conversations using this agent
        qualifiedLeads:
          type: integer
          description: Number of leads qualified by this agent
        qualificationRate:
          type: integer
          description: Percentage of conversations that resulted in qualification (0-100)
        responseRate:
          type: integer
          description: Percentage of conversations where the lead responded (0-100)
      required:
        - totalConversations
        - qualifiedLeads
        - qualificationRate
        - responseRate
  responses:
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
            required:
              - error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token using an API key (format nl_live_* or nl_test_*)

````