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

# Count Cases

> Get the total count of cases matching your filter criteria.

Get the total count of cases matching your filter criteria.


## OpenAPI

````yaml GET /cases/count
openapi: 3.0.0
info:
  title: Penbox API
  version: '1.0'
  description: >-
    The Penbox API provides programmatic access to Penbox's form management,
    case management, and document processing capabilities. Authenticate using
    Bearer tokens created at https://app.penbox.io/workspace/settings/api
servers:
  - url: https://connect.penbox.io/v1
    description: Production
  - url: https://connect.aiboov.com/v1
    description: Staging
security:
  - BearerAuth: []
paths:
  /cases/count:
    get:
      summary: Count Cases
      description: Get the total count of cases matching your filter criteria.
      operationId: count-cases
      parameters:
        - $ref: '#/components/parameters/CaseTemplateId'
        - $ref: '#/components/parameters/CaseStatus'
        - $ref: '#/components/parameters/CaseParentStatus'
        - $ref: '#/components/parameters/Archived'
        - $ref: '#/components/parameters/CaseWaitingFor'
        - $ref: '#/components/parameters/CaseReference'
        - $ref: '#/components/parameters/CaseOwnerId'
        - $ref: '#/components/parameters/OwnerEmail'
        - $ref: '#/components/parameters/CaseWorkspaceId'
        - $ref: '#/components/parameters/CaseWorkspaceSlug'
        - $ref: '#/components/parameters/CaseContactGivenName'
        - $ref: '#/components/parameters/CaseContactFamilyName'
        - $ref: '#/components/parameters/CaseContactEmail'
        - $ref: '#/components/parameters/AdvancedFilter'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    description: Total number of cases
components:
  parameters:
    CaseTemplateId:
      name: template[id]
      in: query
      description: Filter by template UUID
      schema:
        type: string
        format: uuid
    CaseStatus:
      name: status
      in: query
      description: Filter by custom status
      schema:
        type: string
    CaseParentStatus:
      name: parent_status
      in: query
      description: Filter by parent status
      schema:
        type: string
        enum:
          - draft
          - pending
          - in_progress
          - closed
    Archived:
      name: archived
      in: query
      description: Filter by archived status
      schema:
        type: boolean
        default: false
    CaseWaitingFor:
      name: waiting_for
      in: query
      description: Filter by who the case is waiting for
      schema:
        type: string
        enum:
          - none
          - owner
          - contact
    CaseReference:
      name: reference
      in: query
      description: Filter by custom reference number
      schema:
        type: string
    CaseOwnerId:
      name: owner[id]
      in: query
      description: Filter by owner UUID
      schema:
        type: string
        format: uuid
    OwnerEmail:
      name: owner[email]
      in: query
      description: Filter by owner email
      schema:
        type: string
        format: email
    CaseWorkspaceId:
      name: workspace[id]
      in: query
      description: Filter by workspace UUID
      schema:
        type: string
        format: uuid
    CaseWorkspaceSlug:
      name: workspace[slug]
      in: query
      description: Filter by workspace slug
      schema:
        type: string
    CaseContactGivenName:
      name: contact[given_name]
      in: query
      description: Filter by contact first name
      schema:
        type: string
    CaseContactFamilyName:
      name: contact[family_name]
      in: query
      description: Filter by contact last name
      schema:
        type: string
    CaseContactEmail:
      name: contact[email]
      in: query
      description: Filter by contact email
      schema:
        type: string
        format: email
    AdvancedFilter:
      name: filter
      in: query
      description: >-
        Filter using advanced JSON syntax. If specified, will ignore all other
        filter parameters. See the [Advanced
        Filters](/api-reference/advanced-filters) guide for more information.
      schema:
        type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: token
      description: >-
        API token (starts with pnbx_). Create at
        https://app.penbox.io/workspace/settings/api. Include as: Authorization:
        Bearer {token}

````