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

# Get document counts

> Returns total document count and count of documents that have an active version.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/avido/openapi.documented.yml get /v0/documents/count
openapi: 3.1.1
info:
  title: Avido API
  description: >-
    Avido's API for LLM usage events, tool calls, trace management, webhook
    validation, and more. See each endpoint's request/response schema for
    details.
  version: 0.1.0
  contact:
    name: Avido Support
    email: support@avidoai.com
    url: https://avidoai.com/support
servers:
  - url: https://api.avidoai.com
    description: Production API
security:
  - ApiKey: []
    ApplicationId: []
paths:
  /v0/documents/count:
    get:
      tags:
        - Documents
      summary: Get document counts
      description: >-
        Returns total document count and count of documents that have an active
        version.
      operationId: getDocumentCount
      parameters:
        - in: query
          name: type
          schema:
            default: KNOWLEDGE
            description: Filter by document type. Defaults to `KNOWLEDGE`.
            example: KNOWLEDGE
            type: string
            enum:
              - KNOWLEDGE
              - POLICY
          description: Filter by document type. Defaults to `KNOWLEDGE`.
        - in: query
          name: documentStatus
          schema:
            description: >-
              Filter by document-level status (`DocumentV2.status`). When
              omitted, the API defaults to `ACTIVE`.
            example: ACTIVE
            type: string
            enum:
              - DRAFT
              - ACTIVE
          description: >-
            Filter by document-level status (`DocumentV2.status`). When omitted,
            the API defaults to `ACTIVE`.
      responses:
        '200':
          description: Successfully retrieved document counts
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentCountResponse'
              examples:
                success:
                  summary: Document counts
                  value:
                    totalCount: 42
                    activeVersionCount: 37
        '400':
          description: bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '500':
          description: internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    DocumentCountResponse:
      type: object
      properties:
        totalCount:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: Total number of documents in the organization
          example: 42
        activeVersionCount:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: Number of documents that currently have an active version
          example: 37
      required:
        - totalCount
        - activeVersionCount
      additionalProperties: false
      title: Document Count Response
      description: Response containing total and active document counts
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: A human-readable error message explaining the error.
          example: Resource not found
      required:
        - message
      additionalProperties: false
      title: ErrorResponse
      description: Standard error format for failed API operations.
    ValidationErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: A human-readable error message indicating what went wrong.
          example: Invalid request data
        issues:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              message:
                type: string
              path:
                type: array
                items:
                  type: string
            required:
              - code
              - message
              - path
            additionalProperties: false
          description: Array of detailed validation error objects.
          example:
            - code: invalid_string
              message: Invalid UUID
              path:
                - id
      required:
        - message
        - issues
      additionalProperties: false
      title: ValidationErrorResponse
      description: Details about validation errors in incoming requests.
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your unique Avido API key
    ApplicationId:
      type: apiKey
      in: header
      name: x-application-id
      description: Your unique Avido Application ID

````