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

# Finalize

> Step 3: client tells the server "S3 PUT done, please verify and proceed".

Server HeadObject's the bucket, asserts size matches the declared size from
intent, transitions row pending → uploaded, and returns the current state.
Idempotent: re-calling on a non-pending row returns the current state.



## OpenAPI

````yaml /openapi.json post /api/v1/shared/uploads/{upload_id}/finalize
openapi: 3.1.0
info:
  title: Seamind Backend
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/shared/uploads/{upload_id}/finalize:
    post:
      tags:
        - shared-uploads
      summary: Finalize
      description: >-
        Step 3: client tells the server "S3 PUT done, please verify and
        proceed".


        Server HeadObject's the bucket, asserts size matches the declared size
        from

        intent, transitions row pending → uploaded, and returns the current
        state.

        Idempotent: re-calling on a non-pending row returns the current state.
      operationId: finalize_api_v1_shared_uploads__upload_id__finalize_post
      parameters:
        - name: upload_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Upload Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResponseDTO'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    UploadResponseDTO:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        status:
          type: string
          title: Status
        kind:
          type: string
          title: Kind
        originalFilename:
          type: string
          title: Originalfilename
        sizeBytes:
          type: integer
          title: Sizebytes
        createdAt:
          type: string
          format: date-time
          title: Createdat
        downloadUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Downloadurl
        derivatives:
          anyOf:
            - $ref: '#/components/schemas/UploadDerivativesDTO'
            - type: 'null'
        width:
          anyOf:
            - type: integer
            - type: 'null'
          title: Width
        height:
          anyOf:
            - type: integer
            - type: 'null'
          title: Height
        pageCount:
          anyOf:
            - type: integer
            - type: 'null'
          title: Pagecount
        threatName:
          anyOf:
            - type: string
            - type: 'null'
          title: Threatname
      type: object
      required:
        - id
        - status
        - kind
        - originalFilename
        - sizeBytes
        - createdAt
      title: UploadResponseDTO
      description: Outbound API shape for the client — used by finalize + status endpoints.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UploadDerivativesDTO:
      properties:
        thumb:
          anyOf:
            - type: string
            - type: 'null'
          title: Thumb
        medium:
          anyOf:
            - type: string
            - type: 'null'
          title: Medium
        large:
          anyOf:
            - type: string
            - type: 'null'
          title: Large
        preview:
          anyOf:
            - type: string
            - type: 'null'
          title: Preview
      type: object
      title: UploadDerivativesDTO
      description: >-
        URLs for the worker-generated variants. Populated only when
        status=ready.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````