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

# Create User Completion

> Create a completed learning record for a user. 

This is the record of a user completing a learning object.



## OpenAPI

````yaml post /unified/lms/users/{id}/completions
openapi: 3.1.0
info:
  title: LMS
  description: The documentation for the StackOne Unified API - LMS
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.stackone.com
security: []
tags:
  - name: Courses
    description: Collections of learning content.
  - name: Content
    description: Granular learning content items.
  - name: External Linking Learning Objects
    description: External linking learning objects.
  - name: Categories
    description: Categories for organizing learning content.
  - name: Users
    description: People enrolled in or using the LMS.
  - name: Skills
    description: Skills or competencies taught or tracked.
  - name: Assignments
    description: Tasks or assignments for learners.
  - name: Completions
    description: Records of completed assignments or courses.
  - name: Collections
    description: Groups of courses or learning resources.
paths:
  /unified/lms/users/{id}/completions:
    post:
      tags:
        - Users
        - Completions
      summary: Create User Completion
      description: |-
        Create a completed learning record for a user. 

        This is the record of a user completing a learning object.
      operationId: lms_create_user_completion
      parameters:
        - name: x-account-id
          in: header
          description: The account identifier
          required: true
          schema:
            type: string
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: Prefer
          in: header
          required: false
          description: >-
            Set to "heartbeat" to enable keep-alive newline heartbeats during
            long-running requests. Response includes Preference-Applied:
            heartbeat header when honored. (RFC 7240)
          schema:
            type: string
            example: heartbeat
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LmsCreateCompletionRequestDto'
      responses:
        '201':
          description: The completion was created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateResult'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
        '401':
          description: Unauthorized access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenResponse'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '408':
          description: The request has timed out.
          headers:
            Retry-After:
              description: A time in seconds after which the request can be retried.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestTimedOutResponse'
        '409':
          description: Conflict with current state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConflictResponse'
        '412':
          description: >-
            Precondition failed: linked account belongs to a disabled
            integration.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreconditionFailedResponse'
        '422':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestsResponse'
        '500':
          description: Server error while executing the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
        '501':
          description: This functionality is not implemented.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotImplementedResponse'
        '502':
          description: Bad gateway error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadGatewayResponse'
      security:
        - basic: []
components:
  schemas:
    LmsCreateCompletionRequestDto:
      type: object
      properties:
        passthrough:
          type: object
          description: Value to pass through to the provider
          example:
            other_known_names: John Doe
          additionalProperties: true
          nullable: true
        result:
          description: The result of the completion
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ResultStatusEnum'
        completed_at:
          type: string
          description: The date the content was completed
          example: '2021-07-21T14:00:00.000Z'
          format: date-time
          nullable: true
        learning_object_id:
          type: string
          description: >-
            The id of the learning object associated with this completion. This
            is not required unless specified in an integration.
          example: e3gd34-23tr21-er234-345er56
          nullable: true
        time_spent:
          type: string
          description: >-
            ISO 8601 duration format representing the time spent on completing
            the learning object
          example: PT1H30M45S
          format: string
          nullable: true
        content_external_reference:
          type: string
          description: The external reference associated with this content
          example: SOFTWARE-ENG-LV1-TRAINING-VIDEO-1-CONTENT
          deprecated: true
          nullable: true
        content_id:
          type: string
          description: The content ID associated with this completion
          example: 16873-ENG-VIDEO-1
          deprecated: true
          nullable: true
        score:
          description: The score associated with this completion
          example:
            percentage: 87
            raw_value: 87 / 100
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ScoreModel'
        learning_object_external_reference:
          type: string
          description: >-
            The external reference of the learning object associated with this
            completion, this is the main identifier for creating completions.
          example: learning-content-123
      required:
        - learning_object_external_reference
    CreateResult:
      type: object
      properties:
        statusCode:
          type: number
          example: 201
        message:
          type: string
          example: Record created successfully.
        timestamp:
          type: string
          example: '2021-01-01T01:01:01.000Z'
          format: date-time
        data:
          $ref: '#/components/schemas/CreateResultDataApiModel'
      required:
        - statusCode
        - message
        - timestamp
        - data
    BadRequestResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 400
        message:
          type: string
          description: Error message
          example: Bad Request
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
        data:
          description: Error details
          nullable: true
          allOf:
            - $ref: '#/components/schemas/UnifiedError'
        provider_errors:
          description: List of provider-specific errors
          nullable: true
          type: array
          items:
            $ref: '#/components/schemas/ProviderError'
      required:
        - statusCode
        - message
        - timestamp
    UnauthorizedResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 401
        message:
          type: string
          description: Error message
          example: Unauthorized
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    ForbiddenResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 403
        message:
          type: string
          description: Error message
          example: Forbidden resource
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    NotFoundResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 404
        message:
          type: string
          description: Error message
          example: Not Found
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    RequestTimedOutResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 408
        message:
          type: string
          description: Error message
          example: Request timed out
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    ConflictResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 409
        message:
          type: string
          description: Error message
          example: Conflict
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    PreconditionFailedResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 412
        message:
          type: string
          description: Error message
          example: Precondition failed
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    UnprocessableEntityResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 422
        message:
          type: string
          description: Error message
          example: Unprocessable Entity
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    TooManyRequestsResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 429
        message:
          type: string
          description: Error message
          example: Too many requests
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    InternalServerErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 500
        message:
          type: string
          description: Error message
          example: Internal server error
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    NotImplementedResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 501
        message:
          type: string
          description: Error message
          example: Not Implemented
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    BadGatewayResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 502
        message:
          type: string
          description: Error message
          example: Bad Gateway
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    ResultStatusEnum:
      type: object
      properties:
        value:
          type: string
          enum:
            - Pass
            - Fail
            - unmapped_value
            - null
          description: The StackOne unified result status.
          x-speakeasy-unknown-values: allow
          nullable: true
        source_value:
          oneOf:
            - type: string
            - type: number
            - type: boolean
            - type: object
            - type: array
              items: {}
          description: The original result status from the provider before normalization.
          nullable: true
    ScoreModel:
      type: object
      properties:
        percentage:
          type: number
          description: The score percentage
          example: 87.5
          nullable: true
        raw_value:
          type: string
          description: The raw string score value
          example: 87 / 100
          nullable: true
    CreateResultDataApiModel:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier
          example: 8187e5da-dc77-475e-9949-af0f1fa4e4e3
          nullable: true
        remote_id:
          type: string
          description: Provider's unique identifier
          example: 8187e5da-dc77-475e-9949-af0f1fa4e4e3
          nullable: true
    UnifiedError:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 400
          nullable: true
        message:
          type: string
          description: Error message
          example: Bad Request
          nullable: true
        headers:
          type: object
          description: Response headers
          example:
            content-type: application/json
            x-request-id: 5678c28b211dace4e0a0f9171e6b88c5
          nullable: true
    ProviderError:
      type: object
      properties:
        status:
          type: number
          description: HTTP status code of the provider error
          example: 400
          nullable: true
        url:
          type: string
          description: URL that caused the error
          example: https://api.provider.com/v1/resource
          nullable: true
        raw:
          type: object
          description: Raw error response from the provider
          example:
            message: Invalid input parameters
          nullable: true
        headers:
          type: object
          description: Response headers
          example:
            content-type: application/json
            x-request-id: 5678c28b211dace4e0a0f9171e6b88c5
          nullable: true
  securitySchemes:
    basic:
      type: http
      scheme: basic

````