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

# Complete Multipart Upload

> Finalize an SNS upload, or queue client-driven finalization and processing.

When ``APPLE_XML_UPLOAD_COMPLETION_MODE`` is ``"sns"`` the import task is instead
triggered by the S3 bucket event, so this endpoint only finalizes the object.



## OpenAPI

````yaml https://api.openwearables.io/openapi.json post /api/v1/users/{user_id}/import/apple/xml/s3/multipart/complete
openapi: 3.1.0
info:
  title: Open Wearables API
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/users/{user_id}/import/apple/xml/s3/multipart/complete:
    post:
      tags:
        - 'External: Apple Health Import'
      summary: Complete Multipart Upload
      description: >-
        Finalize an SNS upload, or queue client-driven finalization and
        processing.


        When ``APPLE_XML_UPLOAD_COMPLETION_MODE`` is ``"sns"`` the import task
        is instead

        triggered by the S3 bucket event, so this endpoint only finalizes the
        object.
      operationId: >-
        complete_multipart_upload_api_v1_users__user_id__import_apple_xml_s3_multipart_complete_post
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            title: User Id
        - name: X-Open-Wearables-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Open-Wearables-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MultipartCompleteRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MultipartCompleteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    MultipartCompleteRequest:
      properties:
        key:
          type: string
          maxLength: 1024
          title: Key
        upload_id:
          type: string
          maxLength: 1024
          title: Upload Id
        parts:
          items:
            $ref: '#/components/schemas/CompletedPart'
          type: array
          maxItems: 10000
          minItems: 1
          title: Parts
      type: object
      required:
        - key
        - upload_id
        - parts
      title: MultipartCompleteRequest
    MultipartCompleteResponse:
      properties:
        status:
          type: string
          title: Status
        key:
          type: string
          title: Key
        bucket:
          type: string
          title: Bucket
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
      type: object
      required:
        - status
        - key
        - bucket
      title: MultipartCompleteResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CompletedPart:
      properties:
        part_number:
          type: integer
          maximum: 10000
          minimum: 1
          title: Part Number
        etag:
          type: string
          maxLength: 256
          title: Etag
          description: ETag returned by S3 for the uploaded part
      type: object
      required:
        - part_number
        - etag
      title: CompletedPart
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /api/v1/auth/login

````