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

# Create New Bucket



## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/storage.yaml post /api/storage/buckets
openapi: 3.0.3
info:
  title: Insforge Storage API
  version: 2.0.0
  description: Bucket-based storage system similar to S3
servers: []
security: []
paths:
  /api/storage/buckets:
    post:
      tags:
        - Admin
      summary: Create New Bucket
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - bucketName
              properties:
                bucketName:
                  type: string
                  pattern: ^[a-zA-Z0-9_-]+$
                  description: Bucket name (alphanumeric, underscore, and hyphen only)
                  example: avatars
                isPublic:
                  type: boolean
                  description: Whether the bucket is publicly accessible
                  default: true
                  example: true
      responses:
        '201':
          description: Bucket created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Bucket created successfully
                  bucketName:
                    type: string
                    example: avatars
              example:
                message: Bucket created successfully
                bucket: avatars
        '400':
          description: Invalid bucket name
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: INVALID_BUCKET_NAME
                message: >-
                  Bucket name must contain only alphanumeric characters,
                  underscores, and hyphens
                statusCode: 400
                nextActions: Use a valid bucket name format
        '409':
          description: Bucket already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: BUCKET_EXISTS
                message: Bucket 'avatars' already exists
                statusCode: 409
                nextActions: Choose a different bucket name
      security:
        - apiKey: []
components:
  schemas:
    ErrorResponse:
      type: object
      required:
        - error
        - message
        - statusCode
      properties:
        error:
          type: string
          description: Error code for programmatic handling
          example: VALIDATION_ERROR
        message:
          type: string
          description: Human-readable error message
          example: Invalid request
        statusCode:
          type: integer
          description: HTTP status code
          example: 400
        nextActions:
          type: string
          description: Suggested action to resolve the error
          example: Check your request parameters
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````