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

# Get a query by ID

> Returns a single query with its tags by UUID; a query belonging to another project is treated as not found.



## OpenAPI

````yaml https://api.mentionlab.io/api/docs-json get /api/queries/{id}
openapi: 3.0.0
info:
  title: MentionLab Public API v0.3.4-rc
  description: ''
  version: 0.3.4-rc
  contact: {}
servers:
  - url: https://api.mentionlab.io
security: []
tags: []
paths:
  /api/queries/{id}:
    get:
      tags:
        - Queries
      summary: Get a query by ID
      description: >-
        Returns a single query with its tags by UUID; a query belonging to
        another project is treated as not found.
      operationId: QueriesController_findOne
      parameters:
        - name: id
          required: true
          in: path
          description: The UUID of the query to retrieve.
          schema:
            type: string
            format: uuid
        - name: x-project-id
          in: header
          description: Project ID to specify the project context
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryResponse'
        '400':
          description: >-
            The request failed validation — the body, query or path parameters
            are malformed or out of range.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: The request is missing valid authentication credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '403':
          description: >-
            The authenticated principal lacks the required permission, or access
            to the requested organisation/project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
components:
  schemas:
    QueryResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier (UUID) of the query.
          example: a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6
          format: uuid
        project:
          type: object
          description: The project this query belongs to
          example: a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6
        tags:
          type: object
          example:
            - 1
            - 2
            - 3
          description: The tags IDs this query belongs to
        query:
          type: string
          description: The search query text tracked for this entry.
          example: mentionlab
        language:
          type: string
          description: ISO 639-1 language code used to scope the query results.
          example: en
        country:
          type: string
          description: ISO 3166-1 alpha-2 country code used to scope the query results.
          example: US
        type:
          description: >-
            The type of question the query asks. Null for queries that have not
            been classified.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/QueryType'
        recurrenceSetting:
          nullable: true
          description: >-
            The recurrence setting this query is linked to, or null when the
            query does not recur.
          type: object
          allOf:
            - $ref: '#/components/schemas/RecurrenceSettingRefDto'
        updatedAt:
          format: date-time
          type: string
          description: Timestamp of the last time the query was updated.
          example: '2023-08-22T10:00:00.000Z'
      required:
        - id
        - project
        - tags
        - query
        - language
        - country
        - updatedAt
    ApiErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code of the error.
          example: 400
        message:
          type: string
          description: >-
            Human-readable description of the error. Validation failures return
            an array of per-field validation errors instead of a single string.
          example: Validation failed
        error:
          type: string
          description: Short name of the HTTP error.
          example: Bad Request
      required:
        - statusCode
    QueryType:
      type: string
      enum:
        - comparative
        - informative
        - perception
      description: >-
        The type of question the query asks: "comparative" (compares options),
        "informative" (seeks facts or how-to information) or "perception"
        (probes opinions about a brand).
    RecurrenceSettingRefDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the recurrence setting
          example: 018f3a2b-7c4d-7e1a-9b2c-3d4e5f6a7b8c
        name:
          type: string
          description: Display name of the recurrence setting
          example: Daily core queries
      required:
        - id
        - name

````