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

# Validate query

> Checks whether a query is well-formed and likely to produce good results before submitting a job.

Returns a quality assessment with a status level, identified issues, and actionable suggestions.




## OpenAPI

````yaml catch-all-api post /catchAll/validate
openapi: 3.1.0
info:
  title: NewsCatcher CatchAll API
  version: 1.6.4
  description: >
    CatchAll is a web search API that generates unique datasets that don't exist
    anywhere else on the web. Built on NewsCatcher's proprietary real-world
    event index, it delivers state-of-the-art recall—finding all relevant
    events, not just top results.


    ### Authentication


    All endpoints except /health and /version require `x-api-key` header. If the
    key is invalid or missing, the API returns the `403 Forbidden` error.


    ### Job workflow


    1. (Optional) Get suggestions via /catchAll/initialize

    2. Submit a query via /catchAll/submit with optional date ranges and custom
    validators/enrichments

    3. Poll /catchAll/status/{job_id} until completed (10-15 minutes)

    4. Retrieve results via /catchAll/pull/{job_id}


    ### Monitor workflow


    1. Create successful job via /catchAll/submit

    2. Create monitor via /catchAll/monitors/create with schedule

    3. Retrieve aggregated results via /catchAll/monitors/pull/{monitor_id}


    ### Webhook workflow


    1. Create a webhook via `POST /catchAll/webhooks`

    2. Attach it to a job or monitor via `POST
    /catchAll/webhooks/{webhook_id}/resources`,
       or pass `webhook_ids` at job or monitor creation time
    3. Receive HTTP notifications at the configured URL when each job completes


    ### Company search workflow


    1. Create a dataset via `POST /catchAll/datasets/` or `POST
    /catchAll/datasets/upload`

    2. Wait for the dataset `latest_status` to reach `ready`

    3. Submit a job with `connected_dataset_ids` pointing to your dataset

    4. Retrieve results — each record includes a `connected_entities` array
       with relevance scores per matched company

    ### Important notes


    **Dynamic schemas**: Response schemas are generated dynamically by LLMs.
    Field names in the `enrichment` object may vary and are not deterministic
    across jobs unless explicitly specified.
  contact:
    name: NewsCatcher
    url: https://newscatcherapi.com
    email: support@newscatcherapi.com
servers:
  - url: https://catchall.newscatcherapi.com
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Jobs
    description: Operations to create, monitor, and retrieve job results.
    externalDocs:
      description: Learn about job lifecycle and status tracking
      url: >-
        https://www.newscatcherapi.com/docs/web-search-api/get-started/quickstart
  - name: Monitors
    description: Operations to create, operate and retrieve monitor results.
    externalDocs:
      description: >-
        Automate recurring queries with scheduled jobs and webhook
        notifications.
      url: >-
        https://www.newscatcherapi.com/docs/web-search-api/guides-and-concepts/monitors
  - name: Webhooks
    description: >
      Operations to create and manage reusable webhook endpoints.


      A webhook is a named HTTP endpoint that receives a POST notification

      when a job or monitor completes. Create webhooks once at the organization

      level and attach them to any number of jobs or monitors via `webhook_ids`.

      Supports Slack, Microsoft Teams, and generic HTTP targets with
      configurable

      delivery modes, authentication, and headers.
    externalDocs:
      description: Learn about centralized webhooks and notification setup
      url: >-
        https://www.newscatcherapi.com/docs/web-search-api/guides-and-concepts/webhooks
  - name: Entities
    description: >
      Operations to create, update, and delete company entities.


      Entities are the building blocks of Company Watchlist. Each entity
      represents

      a company (or person) you want to track. Add identifying information such
      as

      domain, alternative names, and key persons to improve matching quality.
    externalDocs:
      description: Learn about Company Watchlist and entities
      url: >-
        https://www.newscatcherapi.com/docs/web-search-api/guides-and-concepts/company-search
  - name: Datasets
    description: >
      Operations to create and manage datasets of entities.


      A dataset is a named collection of entities — think of it as a watchlist
      or

      portfolio. Connect a dataset to a job via `connected_dataset_ids` to
      activate

      Company Watchlist. Datasets can be reused across multiple jobs and
      monitors.
    externalDocs:
      description: Learn about datasets and Company Watchlist
      url: >-
        https://www.newscatcherapi.com/docs/web-search-api/guides-and-concepts/company-search
  - name: Projects
    description: |
      Operations to create, organize, and manage projects.

      A project is a named container for jobs, monitors, and datasets. Group
      related resources by use case, team, or client, and share them with
      teammates. Resources can be assigned at creation time or post-hoc.
    externalDocs:
      description: Learn about projects and resource organization
      url: >-
        https://www.newscatcherapi.com/docs/web-search-api/guides-and-concepts/projects
  - name: Meta
    description: Operations to check API health and version.
externalDocs:
  description: Find out more about NewsCatcher CatchAll API
  url: https://www.newscatcherapi.com/docs/web-search-api/get-started/introduction
paths:
  /catchAll/validate:
    post:
      tags:
        - Jobs
      summary: Validate query
      description: >
        Checks whether a query is well-formed and likely to produce good results
        before submitting a job.


        Returns a quality assessment with a status level, identified issues, and
        actionable suggestions.
      operationId: validateQuery
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateQueryRequestDto'
            example:
              query: Series B funding rounds for SaaS startups
      responses:
        '200':
          $ref: '#/components/responses/ValidateQueryResponse'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    ValidateQueryRequestDto:
      type: object
      required:
        - query
      properties:
        query:
          type: string
          description: Plain text query to validate.
          example: Series B funding rounds for SaaS startups
      example:
        query: Series B funding rounds for SaaS startups
    ValidateQueryResponseDto:
      type: object
      description: Query quality assessment returned by the validate endpoint.
      required:
        - status
        - title
        - confidence
      properties:
        status:
          $ref: '#/components/schemas/QueryStatus'
          description: Overall quality level of the query.
        title:
          type: string
          description: Short headline summarising the assessment.
          example: Specific event type clear
        description:
          type: string
          description: Plain-language explanation of the assessment result.
          example: >-
            Clear event type and focus; no timeframe needed for a default recent
            search.
        issues:
          type: array
          items:
            $ref: '#/components/schemas/IssueType'
          description: Issues identified in the query. Empty when `status` is `good`.
          example: []
        suggestions:
          type: array
          items:
            $ref: '#/components/schemas/Suggestion'
          description: >
            Actionable recommendations for each identified issue. Empty when
            `status` is `good`. Each suggestion corresponds to one entry in
            `issues`.
          example: []
        confidence:
          type: number
          minimum: 0
          maximum: 1
          description: Confidence score for this assessment.
          example: 0.98
    Error:
      type: object
      properties:
        detail:
          type: string
          description: Error message.
          example: Invalid API key
    ValidationErrorResponse:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorDetail'
    QueryStatus:
      type: string
      enum:
        - good
        - needs_work
        - critical
      description: >
        Quality level assigned to a query by the validation endpoint.


        - `good`: Query is well-formed and likely to produce relevant results.

        - `needs_work`: Query has issues that may reduce result quality. Review
        `suggestions` for improvements.

        - `critical`: Query is unlikely to produce useful results as written.
        Address all `issues` before submitting.
    IssueType:
      type: string
      enum:
        - missing_event_type
        - too_vague
        - too_specific
        - wrong_timeframe
        - static_content
        - article_request
        - multiple_event_types
        - too_short
        - too_long
      description: >
        Category of a query issue identified during validation.


        - `missing_event_type`: Query does not specify a type of event to find.

        - `too_vague`: Query lacks sufficient focus to return targeted results.

        - `too_specific`: Query is overly constrained and may return no results.

        - `wrong_timeframe`: Requested timeframe exceeds the 30-day maximum
        window or references a historical period outside the supported range.

        - `static_content`: Query targets static or reference content such as
        specifications, how-to guides, or historical data rather than events.

        - `article_request`: Query requests articles or news content rather than
        describing an event to search for.

        - `multiple_event_types`: Query mixes unrelated event types; results may
        be unfocused.

        - `too_short`: Query is too short to resolve meaningful search intent.

        - `too_long`: Query is excessively long and may confuse the pipeline.
    Suggestion:
      type: object
      description: Actionable recommendation for improving a query.
      required:
        - issue
        - message
      properties:
        issue:
          $ref: '#/components/schemas/IssueType'
          description: The issue this suggestion addresses.
        message:
          type: string
          description: Specific guidance for improving the query.
          example: Add a target sector or geography to narrow the results.
        example:
          type: string
          description: Revised query demonstrating the suggested improvement.
          example: Series A fundraising for AI startups in healthcare
    ValidationErrorDetail:
      type: object
      properties:
        loc:
          type: array
          items:
            oneOf:
              - type: string
              - type: integer
          description: Location of the validation error
        msg:
          type: string
          description: Error message
        type:
          type: string
          description: Error type
  responses:
    ValidateQueryResponse:
      description: Query validation result.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidateQueryResponseDto'
          example:
            status: good
            title: Specific event type clear
            description: >-
              Clear event type and focus; no timeframe needed for a default
              recent search.
            issues: []
            suggestions: []
            confidence: 0.98
    ForbiddenError:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication.

````