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

# Assign learning

> Assign published courses and pathways to learners, the same as publishing a new assignment with **Specific people** in Learning admin. One assignment is created per material; every learner gets each one with the same reviewers, due date and reminders, and is emailed that it was assigned.

Get course and pathway IDs from [courses](/api-reference/endpoint/courses/retrieve-a-list-of-courses) and [pathways](/api-reference/endpoint/pathways/retrieve-a-list-of-pathways), or **Copy ID** in Dock. Only published materials can be assigned.

Only an admin's API key can assign learning; a key whose creator is no longer an admin gets 403. Each request can make at most 500 enrollments (`materials` × `learners`); split larger ones.

The request is checked before anything is created: an unknown, unpublished or archived material, or a learner or reviewer that is not a Dock user in your company (client users included), returns 400 naming each one, and nothing is assigned.

A learner who already has a pathway in progress is skipped. A learner who already has a course in progress is skipped too, so retrying a request does not enroll anyone twice; set `allowDuplicates` to give them a second enrollment of the course instead.

> [!NOTE]
>
> This endpoint is rate limited to **30 requests per minute** per
> company. See [Rate limits](https://developers.dock.us/api-reference/rate-limits.md) for details.


## OpenAPI

````yaml post /learning-assignments
openapi: 3.1.0
info:
  title: Dock API
  description: >-
    The Dock API is a RESTful API that allows you to interact with Dock in a
    programmatic way
  termsOfService: https://www.dock.us/legal/terms
  contact:
    name: API Support
    email: developers@dock.us
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
  - url: https://api.dock.us/{version}
    description: Production server
    variables:
      version:
        default: v1
        enum:
          - v1
security:
  - bearerAuth: []
tags:
  - name: Status check
    description: API to check if the API is up
  - name: Accounts
    description: API to manage accounts
  - name: Assets
    description: API to manage assets
  - name: Asset share links
    description: API to retrieve asset share links
  - name: Courses
    description: API to retrieve courses and their content
  - name: Files
    description: API to manage files
  - name: Forms
    description: API to retrieve forms and their responses
  - name: Learning assignments
    description: API to assign courses and pathways to learners
  - name: Meetings
    description: API to manage meetings and call transcripts
  - name: Pathways
    description: API to retrieve learning pathways
  - name: Playbooks
    description: API to retrieve playbooks and their content
  - name: Tags
    description: API to manage tags
  - name: Users
    description: API to manage users
  - name: Workspaces
    description: API to manage workspaces
  - name: Templates
    description: API to manage templates
  - name: Workspace pages
    description: API to manage workspace pages
  - name: Workspace plans
    description: API to manage workspace plans
  - name: Workspace plan tasks
    description: API to manage workspace plan tasks
  - name: Workspace sections
    description: API to manage workspace sections
paths:
  /learning-assignments:
    post:
      tags:
        - Learning assignments
      description: >-
        Assign published courses and pathways to learners, the same as
        publishing a new assignment with **Specific people** in Learning admin.
        One assignment is created per material; every learner gets each one with
        the same reviewers, due date and reminders, and is emailed that it was
        assigned.


        Get course and pathway IDs from
        [courses](/api-reference/endpoint/courses/retrieve-a-list-of-courses)
        and
        [pathways](/api-reference/endpoint/pathways/retrieve-a-list-of-pathways),
        or **Copy ID** in Dock. Only published materials can be assigned.


        Only an admin's API key can assign learning; a key whose creator is no
        longer an admin gets 403. Each request can make at most 500 enrollments
        (`materials` × `learners`); split larger ones.


        The request is checked before anything is created: an unknown,
        unpublished or archived material, or a learner or reviewer that is not a
        Dock user in your company (client users included), returns 400 naming
        each one, and nothing is assigned.


        A learner who already has a pathway in progress is skipped. A learner
        who already has a course in progress is skipped too, so retrying a
        request does not enroll anyone twice; set `allowDuplicates` to give them
        a second enrollment of the course instead.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - materials
                - learners
              properties:
                materials:
                  type: array
                  description: >-
                    Courses and pathways to assign, 1 to 20. `materials` ×
                    `learners` can be at most 500 per request
                  minItems: 1
                  maxItems: 20
                  items:
                    type: object
                    required:
                      - type
                      - id
                    properties:
                      type:
                        type: string
                        enum:
                          - course
                          - pathway
                      id:
                        type: string
                        description: ID of the course or pathway
                        example: RiHO4e0Ju3DS
                    additionalProperties: false
                learners:
                  type: array
                  description: People to assign, 1 to 500, each by user `id` or `email`
                  minItems: 1
                  maxItems: 500
                  items:
                    type: object
                    oneOf:
                      - required:
                          - id
                        properties:
                          id:
                            type: string
                            description: ID of the user
                            example: vKLoKUiy3Rbp
                        additionalProperties: false
                      - required:
                          - email
                        properties:
                          email:
                            type: string
                            format: email
                            example: jane@acme.com
                        additionalProperties: false
                reviewers:
                  type: array
                  description: >-
                    Who reviews (up to 20) each learner's course submissions.
                    Empty (the default) means no review. Reviews apply to
                    courses, including the courses inside a pathway. Nobody
                    reviews their own work
                  items:
                    type: object
                    required:
                      - type
                    properties:
                      type:
                        type: string
                        enum:
                          - manager
                          - teamLead
                          - user
                        description: >-
                          `manager`: the learner's manager. `teamLead`: the lead
                          of the learner's team. `user`: a specific person,
                          given by `id` or `email`
                      id:
                        type: string
                        description: >-
                          ID of the reviewer. Only with `type: user`, instead of
                          `email`
                      email:
                        type: string
                        format: email
                        description: >-
                          Email of the reviewer. Only with `type: user`, instead
                          of `id`
                    additionalProperties: false
                  example:
                    - type: manager
                    - type: user
                      email: lead@acme.com
                  maxItems: 20
                approvalPolicy:
                  type: string
                  enum:
                    - all
                    - any
                  default: all
                  description: >-
                    With several reviewers: whether all of them or any one must
                    approve
                dueDate:
                  type: string
                  format: date
                  description: >-
                    Due date in `YYYY-MM-DD` format, today or later. Provide at
                    most one of `dueDate` or `dueInDays`; with neither there is
                    no due date
                  example: '2026-11-30'
                dueInDays:
                  type: integer
                  minimum: 1
                  description: Due this many days after the assignment, 1 to 3650
                  example: 30
                  maximum: 3650
                reminders:
                  type: object
                  description: >-
                    Reminder emails to learners who haven't finished. Both are
                    off by default
                  properties:
                    weekly:
                      type: boolean
                      default: false
                      description: Remind every week
                    onDueDate:
                      type: boolean
                      default: false
                      description: Remind on the due date. Needs `dueDate` or `dueInDays`
                  additionalProperties: false
                allowDuplicates:
                  type: boolean
                  default: false
                  description: >-
                    Give learners who already have a course in progress a second
                    enrollment of it, instead of skipping them. Pathways are
                    never assigned twice
              additionalProperties: false
      responses:
        '201':
          description: The assignments created, one per material, in request order
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      assignments:
                        type: array
                        items:
                          $ref: '#/components/schemas/LearningAssignment'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: The API key's creator is not an admin
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
components:
  schemas:
    LearningAssignment:
      type: object
      properties:
        object:
          type: string
          description: Type of the object
          enum:
            - learning-assignment
          example: learning-assignment
          readOnly: true
        id:
          type: string
          description: ID of the assignment
          example: As5gNm3Kq0Zp
          readOnly: true
        material:
          type: object
          description: The course or pathway assigned
          readOnly: true
          properties:
            object:
              type: string
              enum:
                - course
                - pathway
              example: course
            id:
              type: string
              description: ID of the course or pathway, as given in the request
              example: RiHO4e0Ju3DS
            url:
              type: string
              description: URL to the course or pathway resource
              example: https://api.dock.us/v1/courses/RiHO4e0Ju3DS
            name:
              type: string
              description: Name of the published course or pathway
              example: Sales onboarding
        learners:
          type: array
          description: Each learner in the request, once
          readOnly: true
          items:
            type: object
            properties:
              user:
                description: >-
                  The learner, as a
                  [user](/api-reference/endpoint/users/retrieve-a-user) object
                  with `id`, `object`, `url` and `email`
                allOf:
                  - $ref: '#/components/schemas/User'
              status:
                type: string
                enum:
                  - assigned
                  - alreadyAssigned
                description: >-
                  `assigned`: the learner was enrolled and emailed.
                  `alreadyAssigned`: the learner already has this pathway, or
                  this course (unless `allowDuplicates`), in progress, so
                  nothing changed for them
                example: assigned
              dueDate:
                type: string
                format: date-time
                nullable: true
                description: >-
                  The learner's due date. `null` when no due date was set or the
                  learner was not assigned
                example: '2026-11-30T00:00:00.000Z'
              warnings:
                type: array
                description: >-
                  `noManager` / `noTeamLead`: a `manager` or `teamLead` reviewer
                  was requested but the learner has none. `hasCourseActive`:
                  with `allowDuplicates`, the learner now has this course twice
                items:
                  type: string
                  enum:
                    - noManager
                    - noTeamLead
                    - hasCourseActive
                example: []
    User:
      allOf:
        - $ref: '#/components/schemas/BaseObject'
        - type: object
          properties:
            object:
              type: string
              description: Type of the object
              enum:
                - user
              example: user
              readOnly: true
            url:
              type: string
              example: https://api.dock.us/v1/users/RiHO4e0Ju3DS
              description: URL to the resource
              readOnly: true
            firstName:
              type: string
              description: First name of the user
              example: John
              nullable: true
            lastName:
              type: string
              description: Last name of the user
              example: Doe
              nullable: true
            avatar:
              type: string
              format: uri
              description: Avatar of the user
              example: https://dock.us/avatar.png
              nullable: true
            email:
              type: string
              description: Email of the user
              example: john.doe@example.com
            name:
              type: string
              description: Name of the user
              example: John Doe
    BaseObject:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/Id'
        updatedAt:
          type: string
          format: date-time
          description: Last updated date
          example: '2021-01-01T00:00:00.000Z'
          readOnly: true
        createdAt:
          type: string
          format: date-time
          description: Created at date
          example: '2021-01-01T00:00:00.000Z'
          readOnly: true
    Id:
      type: string
      description: Id of the object
      example: RiHO4e0Ju3DS
      readOnly: true
  responses:
    '400':
      description: >-
        The server cannot or will not process the request due to something that
        is perceived to be a client error (e.g., malformed request syntax,
        invalid request message framing, or deceptive request routing)
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - BAD_REQUEST
                    description: A short code indicating the error code returned
                    example: BAD_REQUEST
                  message:
                    type: string
                    description: A human readable explanation of what went wrong
                    example: >-
                      The request could not be understood or was missing
                      required parameters
                required:
                  - code
                  - message
            required:
              - error
    '401':
      description: >-
        Although the HTTP standard specifies "unauthorized", semantically this
        response means "unauthenticated". That is, the client must authenticate
        itself to get the requested response
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - UNAUTHORIZED
                    description: A short code indicating the error code returned
                    example: UNAUTHORIZED
                  message:
                    type: string
                    description: A human readable explanation of what went wrong
                    example: >-
                      Access denied. You are not authorized to access this
                      resource
                required:
                  - code
                  - message
            required:
              - error
    '429':
      description: >-
        The user has sent too many requests in a given amount of time ("rate
        limiting")
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - RATE_LIMIT_EXCEEDED
                    description: A short code indicating the error code returned
                    example: RATE_LIMIT_EXCEEDED
                  message:
                    type: string
                    description: A human readable explanation of what went wrong
                    example: Rate limit exceeded. Please try again later
                required:
                  - code
                  - message
            required:
              - error
    '500':
      description: The server has encountered a situation it does not know how to handle
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - INTERNAL_SERVER_ERROR
                    description: A short code indicating the error code returned
                    example: INTERNAL_SERVER_ERROR
                  message:
                    type: string
                    description: A human readable explanation of what went wrong
                    example: >-
                      The server has encountered a situation it does not know
                      how to handle
                required:
                  - code
                  - message
            required:
              - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.