> ## 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 task statistics

> Get aggregated statistics for all tasks in the pipeline



## OpenAPI

````yaml /api-reference/openapi/EvoAI-CRM-Service/pipeline-tasks.yaml get /api/v1/pipelines/{pipeline_id}/pipeline_tasks/statistics
openapi: 3.0.4
info:
  title: Evolution Foundation - CRM Service - Pipeline Tasks
  description: Management of contacts, conversations, inboxes, labels and macros
  version: 1.1.0
servers:
  - url: https://api.evoai.app
    description: Production server
  - url: http://localhost:3000
    description: Development server
    variables:
      port:
        default: '3000'
  - url: '{customUrl}'
    description: Custom server
    variables:
      customUrl:
        default: https://your-instance.com
        description: Enter your server URL
security: []
paths:
  /api/v1/pipelines/{pipeline_id}/pipeline_tasks/statistics:
    parameters:
      - name: pipeline_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
    get:
      summary: Get task statistics
      description: Get aggregated statistics for all tasks in the pipeline
      operationId: get-tasks-statistics
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - data
                  - meta
                  - message
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      total:
                        type: integer
                        example: 50
                      pending:
                        type: integer
                        example: 30
                      completed:
                        type: integer
                        example: 15
                      overdue:
                        type: integer
                        example: 5
                      due_today:
                        type: integer
                        example: 3
                      due_this_week:
                        type: integer
                        example: 10
                      by_type:
                        type: object
                        additionalProperties:
                          type: integer
                        example:
                          call: 20
                          email: 15
                          meeting: 10
                          follow_up: 5
                      by_assignee:
                        type: object
                        additionalProperties:
                          type: integer
                        example:
                          660e8400-e29b-41d4-a716-446655440001: 25
                          770e8400-e29b-41d4-a716-446655440002: 15
                          880e8400-e29b-41d4-a716-446655440003: 10
                      by_priority:
                        type: object
                        additionalProperties:
                          type: integer
                        example:
                          low: 10
                          medium: 20
                          high: 15
                          urgent: 5
                  meta:
                    type: object
                    properties:
                      timestamp:
                        type: string
                        format: date-time
                        description: Response timestamp
                        example: '2024-01-15T10:30:00Z'
                  message:
                    type: string
                    example: Task statistics retrieved successfully
              examples:
                success:
                  value:
                    success: true
                    data:
                      total: 50
                      pending: 30
                      completed: 15
                      overdue: 5
                      due_today: 3
                      due_this_week: 10
                      by_type:
                        call: 20
                        email: 15
                        meeting: 10
                        follow_up: 5
                      by_assignee:
                        660e8400-e29b-41d4-a716-446655440001: 25
                        770e8400-e29b-41d4-a716-446655440002: 15
                        880e8400-e29b-41d4-a716-446655440003: 10
                      by_priority:
                        low: 10
                        medium: 20
                        high: 15
                        urgent: 5
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                    message: Task statistics retrieved successfully
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid pipeline ID format
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/pipelines/{pipeline_id}/pipeline_tasks/statistics
                  method: GET
        '401':
          description: Unauthorized
          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/pipelines/{pipeline_id}/pipeline_tasks/statistics
                  method: GET
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: You do not have permission to access this pipeline
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/pipelines/{pipeline_id}/pipeline_tasks/statistics
                  method: GET
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Pipeline not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/pipelines/{pipeline_id}/pipeline_tasks/statistics
                  method: GET
        '500':
          description: Internal 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/pipelines/{pipeline_id}/pipeline_tasks/statistics
                  method: GET
      security:
        - userApiKey: []
components:
  schemas:
    ErrorResponse:
      type: object
      required:
        - success
        - error
        - meta
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: VALIDATION_ERROR
            message:
              type: string
              example: Validation failed
            details:
              type: object
              additionalProperties: true
              nullable: true
        meta:
          type: object
          required:
            - timestamp
            - path
            - method
          properties:
            timestamp:
              type: string
              format: date-time
              example: '2024-01-15T10:30:00Z'
            path:
              type: string
              example: /public/api/v1/inboxes/{inbox_identifier}/contacts
            method:
              type: string
              example: POST
  securitySchemes:
    userApiKey:
      type: apiKey
      in: header
      name: api_access_token

````

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