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

# Get Assignment

> Get an assignment by ID.

`load_assignment_for_user` enforces org-scope plus the ownership rule:
admin / office-admin see any assignment in their org; other roles see
only assignments belonging to their own user record. Cross-org and
cross-user accesses both return 404 without disclosing existence.



## OpenAPI

````yaml /openapi.json get /api/v1/learn/assignments/{assignment_id}
openapi: 3.1.0
info:
  title: Seamind Backend
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/learn/assignments/{assignment_id}:
    get:
      tags:
        - learn-assignments
      summary: Get Assignment
      description: |-
        Get an assignment by ID.

        `load_assignment_for_user` enforces org-scope plus the ownership rule:
        admin / office-admin see any assignment in their org; other roles see
        only assignments belonging to their own user record. Cross-org and
        cross-user accesses both return 404 without disclosing existence.
      operationId: get_assignment_api_v1_learn_assignments__assignment_id__get
      parameters:
        - name: assignment_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Assignment Id
        - name: expand
          in: query
          required: false
          schema:
            type: boolean
            description: Include enriched data (user/ship names)
            default: false
            title: Expand
          description: Include enriched data (user/ship names)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/AssignmentDTO'
                  - $ref: '#/components/schemas/AssignmentDetailDTO'
                title: >-
                  Response Get Assignment Api V1 Learn Assignments  Assignment
                  Id  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    AssignmentDTO:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        organization_id:
          type: string
          format: uuid
          title: Organization Id
        user_id:
          type: string
          format: uuid
          title: User Id
        ship_id:
          type: string
          format: uuid
          title: Ship Id
        role:
          type: string
          title: Role
        start_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Start Date
        end_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: End Date
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - organization_id
        - user_id
        - ship_id
        - role
        - created_at
        - updated_at
      title: AssignmentDTO
      description: |-
        Assignment data transfer object - returned from repositories.
        Represents a user's assignment to a ship.
    AssignmentDetailDTO:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        userId:
          type: string
          format: uuid
          title: Userid
        userName:
          type: string
          title: Username
        userEmail:
          type: string
          title: Useremail
        shipId:
          type: string
          format: uuid
          title: Shipid
        shipName:
          type: string
          title: Shipname
        shipImoNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Shipimonumber
        role:
          type: string
          title: Role
        startDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Startdate
        endDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Enddate
        isActive:
          type: boolean
          title: Isactive
      type: object
      required:
        - id
        - userId
        - userName
        - userEmail
        - shipId
        - shipName
        - role
        - startDate
        - endDate
        - isActive
      title: AssignmentDetailDTO
      description: Assignment with denormalized user/ship names for API responses.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````