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

# Count lawsuits

> Returns the number of lawsuits in our datalake that match the provided criteria.



## OpenAPI

````yaml openapi/lawsuits.json POST /lawsuits/count
openapi: 3.0.0
info:
  title: JUDIT - Lawsuits API
  version: v1.28.8
servers:
  - url: https://lawsuits.production.judit.io
    description: Production server
security: []
paths:
  /lawsuits/count:
    post:
      tags:
        - Processos
      summary: Contagem de processos
      description: >-
        Retorna o total de processos que correspondem aos critérios de busca
        informados.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LawsuitsCount.Body.Post'
            example:
              search:
                search_type: cpf
                search_key: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LawsuitsCount.Response.Post'
        '401':
          description: Unauthorized - Missing or invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpUnauthorizedError'
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpForbiddenError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpInternalServerError'
      security:
        - jwtAuth: []
        - apiKeyAuth: []
components:
  schemas:
    LawsuitsCount.Body.Post:
      type: object
      properties:
        search:
          type: object
          properties:
            search_type:
              type: string
              enum:
                - cpf
                - cnpj
                - oab
                - name
                - rji
                - lawsuit_cnj
                - lawsuit_attachment
                - execution_attachment
                - custom
            search_key:
              type: string
            search_name:
              type: string
            response_type:
              default: lawsuits
              anyOf:
                - type: string
                  enum:
                    - application_error
                    - application_warning
                    - application_info
                - type: string
                  enum:
                    - lawsuits
                - type: string
                  enum:
                    - lawsuit
                - type: string
                  enum:
                    - warrant
                    - execution
                - type: string
                  enum:
                    - entity
                - type: string
                  enum:
                    - summary
                - type: string
                  enum:
                    - sanction
                - type: string
                  enum:
                    - synthetic_lawsuits
                - type: string
                  enum:
                    - communication
            search_params:
              type: object
              properties:
                with_inferred_parties:
                  type: boolean
                with_unique_name_search:
                  type: boolean
                lawsuit_instance:
                  type: number
                filter:
                  type: object
                  properties:
                    side:
                      type: string
                      enum:
                        - Passive
                        - Active
                        - Interested
                        - Unknown
                    party_names:
                      type: array
                      items:
                        type: string
                    party_documents:
                      type: array
                      items:
                        type: string
                    distribution_date_gte:
                      type: string
                      format: date-time
                    distribution_date_lte:
                      type: string
                      format: date-time
                    last_step_date_gte:
                      type: string
                      format: date-time
                    last_step_date_lte:
                      type: string
                      format: date-time
                    tribunals:
                      type: object
                      properties:
                        keys:
                          type: array
                          items:
                            type: string
                        not_equal:
                          type: boolean
                      required:
                        - keys
                        - not_equal
                    classification_codes:
                      type: object
                      properties:
                        keys:
                          type: array
                          items:
                            type: string
                        not_equal:
                          type: boolean
                      required:
                        - keys
                        - not_equal
                    classification_names:
                      type: object
                      properties:
                        keys:
                          type: array
                          items:
                            type: string
                        not_equal:
                          type: boolean
                      required:
                        - keys
                        - not_equal
                    subject_codes:
                      type: object
                      properties:
                        contains:
                          type: array
                          items:
                            type: string
                        not_contains:
                          type: array
                          items:
                            type: string
                      required:
                        - contains
                        - not_contains
                    subject_names:
                      type: object
                      properties:
                        contains:
                          type: array
                          items:
                            type: string
                        not_contains:
                          type: array
                          items:
                            type: string
                      required:
                        - contains
                        - not_contains
                    amount_lte:
                      type: number
                    amount_gte:
                      type: number
            lawsuit_list:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  instance:
                    type: number
                required:
                  - code
                  - instance
          required:
            - search_type
            - search_key
      required:
        - search
    LawsuitsCount.Response.Post:
      type: object
      properties:
        total:
          type: number
      required:
        - total
    HttpUnauthorizedError:
      type: object
      properties:
        error:
          type: object
          properties:
            name:
              type: string
              example: HttpUnauthorizedError
            message:
              type: string
              example: UNAUTHORIZED
            stack:
              type: string
            data:
              type: string
              example: User must be authenticated
    HttpForbiddenError:
      type: object
      properties:
        error:
          type: object
          properties:
            name:
              type: string
              example: HttpForbiddenError
            message:
              type: string
              example: FORBIDDEN
            stack:
              type: string
            data:
              type: string
              example: Authenticated user is not authorized
    HttpInternalServerError:
      type: object
      properties:
        error:
          type: object
          properties:
            name:
              type: string
              example: HttpInternalServerError
            message:
              type: string
              example: INTERNAL_SERVER_ERROR
            stack:
              type: string
            data:
              type: object
              example:
                message: Database connection failed
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT Bearer token for authentication
    apiKeyAuth:
      type: apiKey
      in: header
      name: api-key
      description: API key for authentication

````