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

# Complete Upload

> Complete upload through SoluDesks APIs.

Tenant API keys operate inside the tenant LearnHub workspace. Service-provider API keys use the same endpoint family for service-provider-owned admin training content where supported. Upload sessions return presigned storage URLs; upload the file to the returned URL and complete the session before referencing the upload ID in course or lesson payloads.



## OpenAPI

````yaml api-reference/openapi.json POST /v1/external/learnhub/uploads/{id}/complete
openapi: 3.0.3
info:
  title: SoluDesks APIs
  version: 1.0.0
  description: >-
    REST API reference for documented SoluDesks API families. This generated
    file currently includes the LearnHub external endpoints.
servers:
  - url: https://staging.api.soludesks.com
    description: SoluDesks staging API
security:
  - apiKeyAuth: []
tags:
  - name: Categories
  - name: Courses
  - name: Sections
  - name: Lessons
  - name: Assessments
  - name: Assignments
  - name: Quizzes
  - name: Uploads
paths:
  /v1/external/learnhub/uploads/{id}/complete:
    post:
      tags:
        - Uploads
      summary: Complete upload
      description: >-
        Complete upload through SoluDesks APIs.


        Tenant API keys operate inside the tenant LearnHub workspace.
        Service-provider API keys use the same endpoint family for
        service-provider-owned admin training content where supported. Upload
        sessions return presigned storage URLs; upload the file to the returned
        URL and complete the session before referencing the upload ID in course
        or lesson payloads.
      operationId: v1_external_learnhub_uploads_complete_create
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this upload session.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExternalLearnHubUploadCompleteRequest'
            examples:
              complete_single_part:
                summary: Complete single-part upload
                value: {}
              complete_multipart:
                summary: Complete multipart upload
                value:
                  parts:
                    - part_number: 1
                      etag: '"etag-from-storage"'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ExternalLearnHubUploadCompleteExternalLearnHubAPIResponse
          description: ''
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalLearnHubErrorResponse'
              examples:
                error:
                  summary: Bad request.
                  value:
                    status: 400
                    success: false
                    code: REQUEST_FAILED
                    message: Bad request.
                    data: null
                    errors: []
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalLearnHubErrorResponse'
              examples:
                error:
                  summary: Missing or invalid API key.
                  value:
                    status: 401
                    success: false
                    code: REQUEST_FAILED
                    message: Missing or invalid API key.
                    data: null
                    errors: []
        '403':
          description: >-
            Permission denied, inactive service provider, or unsupported key
            mode.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalLearnHubErrorResponse'
              examples:
                error:
                  summary: >-
                    Permission denied, inactive service provider, or unsupported
                    key mode.
                  value:
                    status: 403
                    success: false
                    code: REQUEST_FAILED
                    message: >-
                      Permission denied, inactive service provider, or
                      unsupported key mode.
                    data: null
                    errors: []
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalLearnHubErrorResponse'
              examples:
                error:
                  summary: Resource not found.
                  value:
                    status: 404
                    success: false
                    code: REQUEST_FAILED
                    message: Resource not found.
                    data: null
                    errors: []
        '409':
          description: Idempotency conflict or request already in progress.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalLearnHubErrorResponse'
              examples:
                error:
                  summary: Idempotency conflict or request already in progress.
                  value:
                    status: 409
                    success: false
                    code: REQUEST_FAILED
                    message: Idempotency conflict or request already in progress.
                    data: null
                    errors: []
        '422':
          description: Validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalLearnHubErrorResponse'
              examples:
                error:
                  summary: Validation failed.
                  value:
                    status: 422
                    success: false
                    code: REQUEST_FAILED
                    message: Validation failed.
                    data: null
                    errors: []
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalLearnHubErrorResponse'
              examples:
                error:
                  summary: Rate limit exceeded.
                  value:
                    status: 429
                    success: false
                    code: REQUEST_FAILED
                    message: Rate limit exceeded.
                    data: null
                    errors: []
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalLearnHubErrorResponse'
              examples:
                error:
                  summary: Internal server error.
                  value:
                    status: 500
                    success: false
                    code: REQUEST_FAILED
                    message: Internal server error.
                    data: null
                    errors: []
      security:
        - apiKeyAuth: []
components:
  schemas:
    ExternalLearnHubUploadCompleteRequest:
      type: object
      properties:
        parts:
          type: array
          items:
            $ref: '#/components/schemas/ExternalLearnHubUploadCompletePartRequest'
    ExternalLearnHubUploadCompleteExternalLearnHubAPIResponse:
      type: object
      properties:
        status:
          type: integer
        success:
          type: boolean
        code:
          type: string
        message:
          type: string
        data:
          $ref: '#/components/schemas/ExternalLearnHubUploadSessionResponse'
        errors:
          type: array
          items:
            type: object
            additionalProperties: {}
      required:
        - code
        - data
        - errors
        - message
        - status
        - success
    ExternalLearnHubErrorResponse:
      type: object
      required:
        - status
        - success
        - code
        - message
        - data
        - errors
      properties:
        status:
          type: integer
          example: 422
        success:
          type: boolean
          example: false
        code:
          type: string
          example: VALIDATION_ERROR
        message:
          type: string
          example: Some fields contain invalid values.
        data:
          nullable: true
          example: null
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ExternalLearnHubErrorItem'
    ExternalLearnHubUploadCompletePartRequest:
      type: object
      properties:
        part_number:
          type: integer
          minimum: 1
        etag:
          type: string
          minLength: 1
      required:
        - etag
        - part_number
    ExternalLearnHubUploadSessionResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        upload_type:
          allOf:
            - $ref: '#/components/schemas/UploadType670Enum'
          readOnly: true
        file_name:
          type: string
          readOnly: true
        content_type:
          type: string
          readOnly: true
        file_size:
          type: integer
          readOnly: true
        status:
          allOf:
            - $ref: '#/components/schemas/Status81cEnum'
          readOnly: true
        part_size:
          type: integer
          readOnly: true
        total_parts:
          type: integer
          readOnly: true
        is_multipart:
          type: string
          readOnly: true
        multipart_upload_id:
          type: string
          nullable: true
        expires_datetime:
          type: string
          format: date-time
          readOnly: true
        completed_datetime:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        created_datetime:
          type: string
          format: date-time
          readOnly: true
          description: datetime of object creation
        updated_datetime:
          type: string
          format: date-time
          readOnly: true
          description: datetime of object update
        asset_url:
          type: string
          format: uri
          nullable: true
          readOnly: true
        asset_url_expires_in:
          type: string
          readOnly: true
      required:
        - asset_url
        - asset_url_expires_in
        - completed_datetime
        - content_type
        - created_datetime
        - expires_datetime
        - file_name
        - file_size
        - id
        - is_multipart
        - multipart_upload_id
        - part_size
        - status
        - total_parts
        - updated_datetime
        - upload_type
    ExternalLearnHubErrorItem:
      type: object
      properties:
        field:
          type: string
          example: title
        code:
          type: string
          example: required
        message:
          type: string
          example: This field is required.
    UploadType670Enum:
      enum:
        - VIDEO
        - PROCTORING_VIDEO
        - DOCUMENT
        - IMAGE
      type: string
      description: |-
        * `VIDEO` - Video
        * `PROCTORING_VIDEO` - Proctoring Video
        * `DOCUMENT` - Document
        * `IMAGE` - Image
    Status81cEnum:
      enum:
        - INITIATED
        - COMPLETED
        - ABORTED
        - FAILED
      type: string
      description: |-
        * `INITIATED` - Initiated
        * `COMPLETED` - Completed
        * `ABORTED` - Aborted
        * `FAILED` - Failed
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'External API key. Format: Bearer <API_KEY>'

````