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

# Move a form between folders

> Moves a form into (or out of) a folder for the current user's own view. Folder
placement is per-user: any direct collaborator on the form (including a
`data_viewer`) may move it into a folder they manage, independent of their role
on the form itself.

**Required scope:** `form:write`.




## OpenAPI

````yaml /api-reference/openapi.yaml put /api/v1/forms/{form_token}/folder
openapi: 3.0.1
info:
  title: FormHug API V1
  version: v1
  description: |
    FormHug public REST API. All request/response keys are snake_case.

    Successful response:

    ```json
    {
      "data": { ... }
    }
    ```

    Paginated response:

    ```json
    {
      "data": [ ... ],
      "pagination": {
        "total": 123,
        "next_cursor": "NQ=="
      }
    }
    ```

    Error response:

    ```json
    {
      "error": "Human-readable message",
      "error_details": [
        { "attribute": "field_name", "message": "specific error" }
      ]
    }
    ```

    `error_details` only appears for model validation failures.
servers:
  - url: https://formhug.ai
security: []
tags:
  - name: Forms
    description: Form CRUD
  - name: Attachments
    description: >-
      2-step upload for form-element images (theme, rich-text, or field-element
      images). Prepare returns an `upload_id`; consume it in a theme update,
      attachment_commitments, or the form `fields` payload depending on purpose.
  - name: Entries
    description: Entries collected by a form owned by the current user
  - name: Folders
    description: Folder CRUD
  - name: Participated Forms
    description: Forms the current user has submitted to (does not own)
  - name: Published Form Entries
    description: Submit entries to a published form
  - name: Published Forms
    description: Read a published form's public structure for filling
  - name: Linked Form Options
    description: >-
      Discover candidate entries (and their `entry_token`s) for a `linked_form`
      field while filling a published form
  - name: Entry Attachments
    description: >-
      2-step upload for `attachment` field submissions. Prepare returns an
      `upload_id`; submit it under the attachment field in `field_values` when
      creating the entry.
  - name: Me
    description: Current authenticated user
  - name: Webhooks
    description: Webhook integrations attached to a form
  - name: Form Themes
    description: Read and update a form's visual theme
  - name: Form Settings
    description: >-
      Per-form settings — submission flow, availability, access control,
      presentation
  - name: Field Rules
    description: >-
      Read and replace a form's conditional field-display and post-submission
      redirect rules.
  - name: Form Folder
    description: Per-user folder placement for a shared form
  - name: OAuth
    description: OAuth 2.0 PKCE token issuance and revocation
paths:
  /api/v1/forms/{form_token}/folder:
    parameters:
      - name: form_token
        in: path
        description: Form token
        required: true
        schema:
          type: string
    put:
      tags:
        - Form Folder
      summary: Move a form between folders
      description: >
        Moves a form into (or out of) a folder for the current user's own view.
        Folder

        placement is per-user: any direct collaborator on the form (including a

        `data_viewer`) may move it into a folder they manage, independent of
        their role

        on the form itself.


        **Required scope:** `form:write`.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FormFolderMoveRequest'
      responses:
        '200':
          description: Moved to the desktop (folder_token omitted)
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - token
                      - folder
                    properties:
                      token:
                        type: string
                        example: Wabc12
                      folder:
                        $ref: '#/components/schemas/FormFolderRef'
        '403':
          description: Current user cannot manage the target folder
          content:
            application/json:
              examples:
                forbidden:
                  value:
                    error: Forbidden
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: Non-collaborator gets a 404, not 403
          content:
            application/json:
              examples:
                not_found:
                  value:
                    error: Form not found
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - PersonalAccessToken:
            - form:write
components:
  schemas:
    FormFolderMoveRequest:
      type: object
      description: >-
        Moves a form into (or out of) a folder for the current user's view. All
        attributes optional.
      properties:
        folder_token:
          type: string
          description: >-
            Target folder token; omit or pass an empty string to move the form
            to the desktop (root).
        original_folder_token:
          type: string
          description: >-
            Original folder token; required to authorize a cross-folder move
            when the current folder is not managed by the current user.
    FormFolderRef:
      type: object
      nullable: true
      required:
        - token
        - name
      properties:
        token:
          type: string
          example: KaB2c1
        name:
          type: string
          example: Work
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message
  securitySchemes:
    PersonalAccessToken:
      type: http
      scheme: bearer
      bearerFormat: PAT
      description: >
        Personal Access Token prefixed with `fh_`. Sent as `Authorization:
        Bearer fh_xxx`.

        The scope required by each endpoint is listed in that endpoint's
        description.

````