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

# List the current user folders

> Returns all folders owned by the current user, ordered by created_at desc. Not paginated.

**Required scope:** `form:read`.




## OpenAPI

````yaml /api-reference/openapi.yaml get /api/v1/folders
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: 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: OAuth
    description: OAuth 2.0 PKCE token issuance and revocation
paths:
  /api/v1/folders:
    get:
      tags:
        - Folders
      summary: List the current user folders
      description: >
        Returns all folders owned by the current user, ordered by created_at
        desc. Not paginated.


        **Required scope:** `form:read`.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Folder'
        '401':
          description: Missing or invalid credentials
          content:
            application/json:
              examples:
                unauthenticated:
                  value:
                    error: Authentication failed
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '403':
          description: PAT scope is insufficient
          content:
            application/json:
              examples:
                insufficient_scope:
                  value:
                    error: Insufficient scope
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - PersonalAccessToken:
            - form:read
components:
  schemas:
    Folder:
      type: object
      required:
        - token
        - name
        - parent_folder_token
        - child_folder_count
        - child_form_count
        - created_at
      properties:
        token:
          type: string
          description: Folder token
          example: KaB2c1
        name:
          type: string
          description: Folder name
          example: Work
        parent_folder_token:
          type: string
          nullable: true
          description: Parent folder token; null at the root
        child_folder_count:
          type: integer
          description: Number of subfolders
          example: 0
        child_form_count:
          type: integer
          description: Number of forms inside this folder
          example: 3
        created_at:
          type: string
          format: date-time
          example: '2026-05-12T08:00:00Z'
    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.

````