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

# Task statistics

> Get counts of tasks grouped by state (pending, running, finished, errored).



## OpenAPI

````yaml get /api/v2/tasks/stats
openapi: 3.0.0
info:
  version: 2.0.0
  title: Vida API
  description: Vida API Documentation
servers:
  - url: https://api.vida.dev
    description: Vida Production
    variables:
      baseUrl:
        default: api.vida.dev
        description: Production API Root
security: []
paths:
  /api/v2/tasks/stats:
    get:
      tags:
        - Tasks
      summary: Task statistics
      description: >-
        Get counts of tasks grouped by state (pending, running, finished,
        errored).
      responses:
        '200':
          description: Stats
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  total:
                    type: number
                    example: 10
                  byState:
                    type: object
                    properties:
                      pending:
                        type: number
                        example: 2
                      running:
                        type: number
                        example: 3
                      finished:
                        type: number
                        example: 5
                xml:
                  name: main
            application/xml:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  total:
                    type: number
                    example: 10
                  byState:
                    type: object
                    properties:
                      pending:
                        type: number
                        example: 2
                      running:
                        type: number
                        example: 3
                      finished:
                        type: number
                        example: 5
                xml:
                  name: main
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error

````