> ## 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.

# Assign Courses

> Assign courses to an assignment.

Options:
- course_ids only: Assign specific courses as standalone
- curriculum_id only: Assign ALL courses from that curriculum with the curriculum link
- Both: Assign specific courses WITH the curriculum association

Requires admin role. Assignment is loaded org-scoped via `load_assignment`.



## OpenAPI

````yaml /openapi.json post /api/v1/learn/assignments/{assignment_id}/courses
openapi: 3.1.0
info:
  title: Seamind Backend
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/learn/assignments/{assignment_id}/courses:
    post:
      tags:
        - learn-assignments
      summary: Assign Courses
      description: >-
        Assign courses to an assignment.


        Options:

        - course_ids only: Assign specific courses as standalone

        - curriculum_id only: Assign ALL courses from that curriculum with the
        curriculum link

        - Both: Assign specific courses WITH the curriculum association


        Requires admin role. Assignment is loaded org-scoped via
        `load_assignment`.
      operationId: assign_courses_api_v1_learn_assignments__assignment_id__courses_post
      parameters:
        - name: assignment_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Assignment Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssignCoursesRequestDTO'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssignmentCoursesResponseDTO'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    AssignCoursesRequestDTO:
      properties:
        courseIds:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Courseids
        curriculumId:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Curriculumid
        dueDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Duedate
      type: object
      title: AssignCoursesRequestDTO
      description: Request to assign courses to an assignment.
    AssignmentCoursesResponseDTO:
      properties:
        assignmentId:
          type: string
          format: uuid
          title: Assignmentid
        courses:
          items:
            $ref: '#/components/schemas/AssignmentCourseDetailDTO'
          type: array
          title: Courses
      type: object
      required:
        - assignmentId
        - courses
      title: AssignmentCoursesResponseDTO
      description: Response for listing courses assigned to an assignment.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AssignmentCourseDetailDTO:
      properties:
        courseId:
          type: string
          format: uuid
          title: Courseid
        title:
          type: string
          title: Title
        curriculumId:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Curriculumid
        curriculumTitle:
          anyOf:
            - type: string
            - type: 'null'
          title: Curriculumtitle
        dueDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Duedate
        assignedAt:
          type: string
          format: date-time
          title: Assignedat
      type: object
      required:
        - courseId
        - title
        - assignedAt
      title: AssignmentCourseDetailDTO
      description: Course assigned to an assignment for API responses.
    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

````