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

# Update Multiple Folders

> Updates multiple folders in a single request. API Cost: N requests (one per folder).



## OpenAPI

````yaml PUT /folders
openapi: 3.1.0
info:
  title: Snippets AI API
  description: >-
    A comprehensive API for managing snippets, folders, tags, and variations
    programmatically
  version: 1.0.0
  contact:
    name: Snippets AI Support
    email: team@getsnippets.ai
servers:
  - url: https://www.getsnippets.ai/api/prompts
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: Snippets
    description: Operations for managing code snippets and text snippets
  - name: Variations
    description: Operations for managing snippet variations and version history
  - name: Folders
    description: Operations for organizing snippets into folders
  - name: Tags
    description: Operations for tagging and categorizing snippets
paths:
  /folders:
    put:
      tags:
        - Folders
      summary: Update multiple folders
      description: >-
        Updates multiple folders in a single request. API Cost: N requests (one
        per folder).
      operationId: updateFolders
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchUpdateFoldersRequest'
      responses:
        '200':
          description: Folders updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchUpdateFoldersResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
components:
  schemas:
    BatchUpdateFoldersRequest:
      type: object
      required:
        - folders
      properties:
        folders:
          type: array
          items:
            type: object
            required:
              - id
            properties:
              id:
                type: string
                format: uuid
              folderName:
                type: string
              folderColor:
                type: string
              parentFolderId:
                type: string
                format: uuid
                nullable: true
    BatchUpdateFoldersResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          properties:
            updatedFolders:
              type: array
              items:
                type: object
            errors:
              type: array
              items:
                type: object
        usage:
          $ref: '#/components/schemas/BatchUsageInfo'
    BatchUsageInfo:
      type: object
      properties:
        remainingRequests:
          type: integer
          description: Number of API requests remaining
        usageDeducted:
          type: integer
          description: Number of requests deducted for this operation
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          description: Error message describing what went wrong
        error:
          type: string
          description: Additional error details
  responses:
    BadRequest:
      description: Bad request - Invalid parameters or malformed JSON
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: Snippet ID is required
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: Invalid or inactive API key
    Forbidden:
      description: Forbidden - Insufficient permissions or quota exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficient_quota:
              value:
                success: false
                message: >-
                  Insufficient API requests. This operation requires 5 requests
                  but you have 0 remaining.
                usage:
                  remainingRequests: 0
                  requiredRequests: 5
            no_access:
              value:
                success: false
                message: API key does not have access to this team
    RateLimitExceeded:
      description: Too Many Requests - Rate limit exceeded (20 requests per minute)
      headers:
        Retry-After:
          description: Number of seconds to wait before making another request
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: >-
              Rate limit exceeded. Too many requests from this API key. Try
              again in 120 seconds.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication using Bearer token. Include your API key in the
        Authorization header.

````