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

# Count tasks by status

> Counts tasks per status over a time window.

All five statuses — queued, processing, pending, success, failed — are always present, 0 when absent, so a dashboard gets a stable shape. The response echoes the window actually used after server-side clamping.

Results are scoped to the caller's tenant, resolved from the request context.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v2/tasks/stats
openapi: 3.1.0
info:
  title: EverOS Cloud Memory API
  version: 2.0.0
  license:
    name: Apache-2.0
    identifier: Apache-2.0
  contact:
    name: EverMind AI
    email: service@evermind.ai
    url: https://github.com/EverMind-AI/everos-cloud-sdk-python
  description: >-
    Official Python client for the EverOS Cloud Memory API. Add, search,
    retrieve, and manage long-term memory for your AI applications over a typed
    interface (pydantic v2, with full type hints). Install and usage guides:
    https://github.com/EverMind-AI/everos-cloud-sdk-python
servers:
  - url: https://api.evermind.ai
    description: Production
security:
  - BearerAuth: []
paths:
  /api/v2/tasks/stats:
    get:
      tags:
        - Tasks
      summary: Count tasks by status
      description: >-
        Counts tasks per status over a time window.


        All five statuses — queued, processing, pending, success, failed — are
        always present, 0 when absent, so a dashboard gets a stable shape. The
        response echoes the window actually used after server-side clamping.


        Results are scoped to the caller's tenant, resolved from the request
        context.
      operationId: getTaskStats
      parameters:
        - in: query
          name: start
          required: false
          schema:
            description: Window start (RFC3339 or epoch milliseconds)
            type: string
        - in: query
          name: end
          required: false
          schema:
            description: Window end
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskStatsResponse'
          description: Aggregated counts
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
          description: Invalid query parameter, or missing tenant scope
        '401':
          description: Missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
        '403':
          description: >-
            Authenticated but not permitted — either rejected by the auth
            service, or the account's memory API version does not match the
            interface version implied by the path (a v1 account calling an
            /api/v2 route).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
        '429':
          description: Rate limit or quota exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrorResponse'
          description: Stats require the database-backed store, which is not configured
components:
  schemas:
    TaskStatsResponse:
      properties:
        data:
          properties:
            by_status:
              properties:
                failed:
                  type: integer
                pending:
                  type: integer
                processing:
                  type: integer
                queued:
                  type: integer
                success:
                  type: integer
              required:
                - queued
                - processing
                - pending
                - success
                - failed
              type: object
            end:
              description: End of the window actually aggregated
              format: date-time
              type: string
            start:
              description: >-
                Start of the window actually aggregated, after server-side
                clamping
              format: date-time
              type: string
            total:
              type: integer
          required:
            - total
            - by_status
            - start
            - end
          type: object
          description: The per-status counts and the window they cover.
        request_id:
          type: string
          description: Id of this request — quote it when reporting a problem.
      required:
        - data
      title: TaskStatsResponse
      type: object
    TaskErrorResponse:
      properties:
        error:
          properties:
            code:
              description: Error code, e.g. invalid_request, not_found, unavailable
              type: string
            message:
              type: string
            type:
              description: >-
                Error class, carrying the HTTP status text (BadRequest,
                NotFound, ...)
              type: string
          required:
            - code
            - message
            - type
          type: object
          description: What went wrong, with a machine-readable code and a message.
      required:
        - error
      title: TaskErrorResponse
      type: object
    GatewayError:
      type: object
      additionalProperties: true
      description: >-
        Gateway error body. NOTE: shape is not yet uniform across auth/quota/
        rate-limit paths — treat fields as best-effort. Commonly includes a
        `code`/`message` (flat) or an `error` object/string with a `message`.
      title: GatewayError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'API key issued by EverOS, sent as `Authorization: Bearer <api_key>`.'

````