> ## 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.

# Update a query's type or tag associations

> Updates a query by UUID to change its type and/or replace its tag associations; the supplied tag IDs are validated against the project.



## OpenAPI

````yaml https://api.mentionlab.io/api/docs-json patch /api/queries/{id}
openapi: 3.0.0
info:
  title: MentionLab Public API v0.6.30-rc
  description: ''
  version: 0.6.30-rc
  contact: {}
servers:
  - url: https://api.mentionlab.io
security: []
tags: []
paths:
  /api/queries/{id}:
    patch:
      tags:
        - Queries
      summary: Update a query's type or tag associations
      description: >-
        Updates a query by UUID to change its type and/or replace its tag
        associations; the supplied tag IDs are validated against the project.
      operationId: QueriesController_update
      parameters:
        - name: id
          required: true
          in: path
          description: The UUID of the query to update.
          schema:
            type: string
            format: uuid
        - name: x-project-id
          in: header
          description: Project ID to specify the project context
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateQueryDto'
      responses:
        '204':
          description: The query was updated successfully.
        '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:
    UpdateQueryDto:
      type: object
      properties:
        tagIds:
          description: List of tag IDs to associate with this query
          example:
            - 1
            - 2
            - 3
          type: array
          items:
            type: number
        type:
          description: The type of question the query asks. Pass null to clear the type.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/QueryType'
    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).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.