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

# Delete Folder

> Deletes a folder. Contained snippets are orphaned (folder_id set to null). API Cost: 1 request.



## OpenAPI

````yaml DELETE /folder
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:
  /folder:
    delete:
      tags:
        - Folders
      summary: Delete a folder
      description: >-
        Deletes a folder. Contained snippets are orphaned (folder_id set to
        null). API Cost: 1 request.
      operationId: deleteFolder
      parameters:
        - name: folderId
          in: query
          required: true
          description: The ID of the folder to delete
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Folder deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteFolderResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
components:
  schemas:
    DeleteFolderResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          properties:
            message:
              type: string
        usage:
          $ref: '#/components/schemas/UsageInfo'
        metadata:
          type: object
          properties:
            deletedFolderId:
              type: string
              format: uuid
            snippetsOrphaned:
              type: integer
    UsageInfo:
      type: object
      properties:
        remainingRequests:
          type: integer
          description: Number of API requests remaining in your quota
    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
    NotFound:
      description: Not Found - Requested resource does not exist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: Snippet not found
    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.

````