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

# Move Queries and Dashboards

> Move up to 100 queries and 100 dashboards into a folder, or out of folders with target_folder_id null. All or nothing: every item must belong to the API key's library and be editable through it; otherwise nothing moves.

> [!NOTE]
>
> Minimum required API key scope: `Read/Write`

# Use Cases

* **File New Work**: Move queries and dashboards an agent just created into the right folder.
* **Bulk Moves**: Move up to 100 queries and 100 dashboards in one call. The move is all or nothing.
* **Take Content Out of Folders**: Pass `target_folder_id: null` to move items out of all folders.


## OpenAPI

````yaml POST /v1/content/move
openapi: 3.0.1
info:
  contact: {}
  description: Dune API
  title: DuneAPI
  version: '1.0'
servers:
  - url: https://api.dune.com/api
security: []
paths:
  /v1/content/move:
    post:
      summary: Move queries and dashboards
      description: >-
        Move up to 100 queries and 100 dashboards into a folder, or out of
        folders with target_folder_id null. All or nothing: every item must
        belong to the API key's library and be editable through it; otherwise
        nothing moves.
      parameters:
        - description: API Key for the service
          in: header
          name: X-Dune-Api-Key
          required: true
          schema:
            type: string
        - description: API Key, alternative to using the HTTP header X-Dune-Api-Key
          in: query
          name: api_key
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/models.MoveContentRequest'
        description: Content to move and its destination
        required: true
        x-originalParamName: body
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.MoveContentResponse'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.FolderError'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.Error401'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.FolderError'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.FolderError'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.Error500'
          description: Internal Server Error
components:
  schemas:
    models.MoveContentRequest:
      properties:
        dashboard_ids:
          example:
            - 98765
          items:
            type: integer
          maxItems: 100
          type: array
        query_ids:
          example:
            - 4512345
          items:
            type: integer
          maxItems: 100
          type: array
        target_folder_id:
          description: >-
            TargetFolderID is the destination folder, or null to take the
            content out of folders.

            The field is required so that a missing value never moves content by
            accident.
          nullable: true
          type: string
      required:
        - target_folder_id
      type: object
    models.MoveContentResponse:
      properties:
        moved_dashboard_ids:
          items:
            type: integer
          type: array
        moved_query_ids:
          items:
            type: integer
          type: array
        target_folder:
          allOf:
            - $ref: '#/components/schemas/models.Folder'
          description: TargetFolder is null when the content moved to the library root.
      type: object
    models.FolderError:
      properties:
        code:
          enum:
            - invalid_argument
            - folder_not_found
            - content_not_found
            - folder_already_exists
            - folder_not_empty
            - invalid_move
            - not_authorized
            - no_acting_user
            - folder_quota_reached
            - unimplemented
          example: folder_not_found
          type: string
        details:
          allOf:
            - $ref: '#/components/schemas/models.FolderErrorDetails'
          description: >-
            Details carries the existing folder for folder_already_exists, and
            what a recursive delete

            would remove for folder_not_empty.
        error:
          example: Folder not found
          type: string
      type: object
    models.Error401:
      properties:
        error:
          example: Invalid API Key
          type: string
      type: object
    models.Error500:
      properties:
        error:
          example: Internal error
          type: string
      type: object
    models.Folder:
      properties:
        color:
          description: Color is a preset name or a hex value.
          example: blue
          type: string
        created_at:
          type: string
        description:
          type: string
        folder_id:
          example: dp180Cu3jW3L
          type: string
        icon:
          example: folder
          type: string
        name:
          example: RWA
          type: string
        parent_folder_id:
          description: ParentFolderID is null for a folder at the library root.
          example: aZ3kP0qLm9Xc
          type: string
        path:
          description: Path is the full path from the library root.
          example: /Research/RWA
          type: string
        updated_at:
          type: string
      type: object
    models.FolderErrorDetails:
      properties:
        dashboard_count:
          type: integer
        existing_folder_id:
          type: string
        query_count:
          type: integer
        subfolder_count:
          type: integer
      type: object

````

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