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

# Get FAQs

> Retrieve FAQs based on a query

Retrieves frequently asked questions (FAQs) based on a query. This endpoint searches for relevant FAQ items that match the provided query text and returns them sorted by relevance.

## Request

The request requires:

* `query`: The text to search for relevant FAQs

Optional parameters:

* `category`: Filter FAQs by a specific category
* `limit`: Maximum number of FAQ items to return (default: 5)

## Response

The response includes:

* `status`: Operation status
* `items`: Array of FAQ items, each containing:
  * `question`: The frequently asked question
  * `answer`: The answer to the question
  * `category`: Category of the FAQ item
  * `relevance_score`: A score indicating how relevant this FAQ is to the query

This endpoint is useful for providing self-service support to users by suggesting relevant FAQs based on their grievance text or specific queries.


## OpenAPI

````yaml POST /category/faq
openapi: 3.1.0
info:
  title: CPGRAMS Simulation API
  description: >-
    An API that simulates the Centralized Public Grievance Redress and
    Monitoring System (CPGRAMS) in India
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://grm-api.vercel.app
security:
  - bearerAuth: []
externalDocs:
  description: API Documentation
  url: https://grm-api.vercel.app/docs
paths:
  /category/faq:
    post:
      tags:
        - category
      description: Retrieve FAQs based on a query
      requestBody:
        description: Query to search for relevant FAQs
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FAQRequest'
        required: true
      responses:
        '200':
          description: FAQ search results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FAQResponse'
        '400':
          description: Bad request - Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    FAQRequest:
      required:
        - query
      type: object
      properties:
        query:
          type: string
          description: The query text to search for relevant FAQs
        category:
          type: string
          description: Optional category to filter FAQs
        limit:
          type: integer
          description: Maximum number of FAQ items to return
          default: 5
    FAQResponse:
      type: object
      properties:
        status:
          type: string
          description: Status of the operation
        items:
          type: array
          items:
            $ref: '#/components/schemas/FAQItem'
          description: List of FAQ items relevant to the query
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    FAQItem:
      type: object
      properties:
        question:
          type: string
          description: The frequently asked question
        answer:
          type: string
          description: The answer to the question
        category:
          type: string
          description: Category of the FAQ item
        relevance_score:
          type: number
          format: float
          description: Relevance score of this FAQ to the query
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````