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

# Move a selection of tags to a group

> Files every tag in the selection (either explicit ids, or all tags matching a filter except the excluded ids) under the given tag group node, or ungroups them when groupId is null. Never triggers tag re-matching.



## OpenAPI

````yaml https://api.mentionlab.io/api/docs-json post /api/tags/bulk/group
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/tags/bulk/group:
    post:
      tags:
        - Tags
      summary: Move a selection of tags to a group
      description: >-
        Files every tag in the selection (either explicit ids, or all tags
        matching a filter except the excluded ids) under the given tag group
        node, or ungroups them when groupId is null. Never triggers tag
        re-matching.
      operationId: TagsController_bulkMoveToGroup
      parameters:
        - 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/BulkGroupTagsDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkActionResponse'
        '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:
    BulkGroupTagsDto:
      type: object
      properties:
        selection:
          description: The tags to move.
          allOf:
            - $ref: '#/components/schemas/TagSelectionDto'
        groupId:
          type: string
          description: >-
            Target query-taxonomy tag group to file the tags under, or null to
            ungroup them.
          format: uuid
          nullable: true
          example: 018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42
      required:
        - selection
        - groupId
    BulkActionResponse:
      type: object
      properties:
        affected:
          type: number
          description: Number of rows affected by the action.
          example: 42
      required:
        - affected
    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
    TagSelectionDto:
      type: object
      properties:
        mode:
          type: string
          enum:
            - include
            - all
          description: >-
            How the target set is defined. "include" acts on the given ids;
            "all" acts on everything matching the filter except the excluded
            ids.
        ids:
          description: Ids to act on. Required when mode is "include".
          example:
            - 018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42
          type: array
          items:
            type: string
        excludedIds:
          description: Ids to subtract from the matched set. Only used when mode is "all".
          example:
            - 018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42
          type: array
          items:
            type: string
        filter:
          description: Filters identifying the matched tags. Used when mode is "all".
          allOf:
            - $ref: '#/components/schemas/ListTagDto'
      required:
        - mode
    ListTagDto:
      type: object
      properties:
        name:
          type: string
          description: Filter tags by name using a case-insensitive partial match.
          example: branding
        with_queries_count:
          type: boolean
          description: Include the count of queries associated with each tag
          example: true
        sort:
          description: >-
            Sorting options for the tag list. Currently only the "name" field is
            sortable. Defaults to ascending order by name.
          example:
            - field: name
              direction: ASC
          type: array
          items:
            $ref: '#/components/schemas/SortOptions'
    SortOptions:
      type: object
      properties:
        field:
          type: string
          description: Field name to sort by
        direction:
          type: string
          enum:
            - ASC
            - DESC
          description: Sort direction
      required:
        - field
        - direction

````