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

# Confirm Presigned Upload

> Confirms that a file was successfully uploaded to S3 using presigned URL



## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/storage.yaml post /api/storage/buckets/{bucketName}/objects/{objectKey}/confirm-upload
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/{bucketName}/objects/{objectKey}/confirm-upload:
    post:
      tags:
        - Client
      summary: Confirm Presigned Upload
      description: Confirms that a file was successfully uploaded to S3 using presigned URL
      parameters:
        - name: bucketName
          in: path
          required: true
          schema:
            type: string
            pattern: ^[a-zA-Z0-9_-]+$
          example: avatars
        - name: objectKey
          in: path
          required: true
          schema:
            type: string
          example: profile-photo-1234567890-abc123.jpg
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - size
              properties:
                size:
                  type: integer
                  description: File size in bytes
                  example: 102400
                contentType:
                  type: string
                  example: image/jpeg
                  description: MIME type of the file
                etag:
                  type: string
                  description: S3 ETag of the uploaded object (optional)
                  example: 9bb58f26192e4ba00f01e2e7b136bbd8
      responses:
        '201':
          description: Upload confirmed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoredFile'
        '404':
          description: Upload not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: UPLOAD_NOT_FOUND
                message: >-
                  Upload not found for key 'profile-photo.jpg' in bucket
                  'avatars'
                statusCode: 404
        '409':
          description: Already confirmed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: ALREADY_CONFIRMED
                message: File 'profile-photo.jpg' already confirmed in bucket 'avatars'
                statusCode: 409
      security:
        - apiKey: []
components:
  schemas:
    StoredFile:
      type: object
      properties:
        bucket:
          type: string
          example: avatars
          description: Name of the bucket containing the object
        key:
          type: string
          example: user123.jpg
          description: Unique key identifying the object within the bucket
        size:
          type: integer
          example: 102400
          description: Size of the file in bytes
        mimeType:
          type: string
          example: image/jpeg
          description: MIME type of the file
        uploadedAt:
          type: string
          format: date-time
          example: '2024-01-15T10:30:00Z'
          description: ISO timestamp when the file was uploaded
        url:
          type: string
          example: /api/storage/buckets/avatars/objects/user123.jpg
          description: URL to download the file
      required:
        - bucket
        - key
        - size
        - uploadedAt
        - url
    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

````