openapi: 3.1.0
info:
  title: Edubridge API
  version: 1.0.0
  description: >
    # EduBridge API Overview


    The Edubridge API provides simplified interfaces for digital schools to
    manage their digital courses and student enrollments,

    abstracting away the complexities of the OneRoster standard while
    maintaining compatibility.


    It offers streamlined endpoints to enroll students in courses without the
    need to understand the underlying academic hierarchy.


    This API significantly reduces integration complexity for third-party
    systems by handling

    the background creation and management of academic sessions (per year),
    classes (per course), and enrollment relationships,

    allowing consumers to focus on educational experiences rather than data
    management.


    Entities involved in the Edubridge API:


    - Year academic session (per school)

    - Term academic session (spans the whole year)

    - Class (per course + term)

    - Enrollment (per student per class)


    ## Auto-managed entities


    The Edubridge API automatically manages the following entities:


    - Year academic session

    - Term academic session (spans the whole year)

    - Class (per course + term)


    ## Course-centric enrollment


    This API offers a course-centric view of enrollments, allowing consumers to
    focus on what courses the student is enrolled in rather than details about
    the underlying academic hierarchy.


    You as an API consumer do not need to understand the underlying academic
    hierarchy to use this API, if you are only interested in what courses a
    student is enrolled in.


    Consumers that need to interact with the underlying academic hierarchy
    through flows not covered by this API can do so by using the raw OneRoster
    API.


    ## Pre-requisites


    Before you can enroll a user in a course, you need the following entities
    created:


    - A school or equivalent organization

    - A course (linked to the organization via orgSourcedId)

    - A user (that will be enrolled in the course)


    ## Analytics API


    The Edubridge Analytics API provides student activity data and metrics
    across enrollments.


    ### Available Endpoints


    **Weekly Facts** - Get facts for a specific week by student email or ID

    - Returns: List of individual facts grouped by date


    **Activity (Date Range)** - Get facts for a custom date range by student
    email or ID

    - Returns: Aggregated metrics grouped by date → subject and date → subject →
    app


    **Enrollment Facts** - Get facts for a specific enrollment

    - Returns: Aggregated metrics for all activity within an enrollment

    - Supports optional date range filtering via `startDate` and `endDate` query
    parameters

    - Supports timezone conversion via `timezone` query parameter


    **Highest Grade Mastered** - Get the highest grade a student has mastered
    for a subject

    - Returns: Grade data from multiple sources (Edulastic, placement tests,
    test-out)


    ### Metrics Included


    - **Activity Metrics**: Questions answered (total/correct), XP earned, units
    mastered

    - **Time Metrics**: Active seconds, inactive seconds, waste seconds

    - **Grouping**: Subject, application/platform, course, campus, date


    ### Authorization


    All analytics endpoints require the `analytics.readOnly` OAuth scope.
servers:
  - url: https://api.alpha-1edtech.ai
    description: Edubridge API
tags:
  - name: Edubridge - Analytics
    description: >-
      Analytics endpoints for retrieving and aggregating student activity data,
      including weekly facts and activity reports across date ranges.
  - name: Edubridge - Application Metrics
    description: Track and manage application metrics for monitoring and analytics purposes
  - name: Edubridge - Applications
    description: >-
      Manage and retrieve applications available in the system. Applications
      represent different learning platforms or educational software that can be
      integrated.
  - name: Edubridge - Enrollments
    description: >-
      Simplified, course-centric enrollment management that abstracts away the
      complex OneRoster academic hierarchy
  - name: Edubridge - Learning Reports
    description: >-
      Learning reports endpoints for retrieving and aggregating student activity
      data, including weekly facts and activity reports.
  - name: Edubridge - Subject Track
    description: >-
      Subject tracks determine the target course for each subject and grade
      level. For example, for subject 'Math' grade level '9', the target course
      can be 'Math Academy 9th Grade' (this is the course that students will be
      enrolled in when they get placed to Math Grade 9). There can be only one
      target course per subject and grade level.
  - name: Edubridge - Users
    description: >-
      User management endpoints that provide simplified access to user data with
      enhanced filtering and querying capabilities beyond the standard OneRoster
      API.
security:
  - OAuth2: []
paths:
  /edubridge/users/:
    get:
      operationId: getUsersByRole
      summary: Get users by exclusive role
      description: >

        Returns all users who have exclusively the specified role.


        This endpoint filters users to only return those who have one or more
        instances of the specified role 

        but no other types of roles. For example, if a user has both "student"
        and "guide" roles, 

        they will not be returned when filtering for "student".


        The response uses the same format as the OneRoster users endpoint.
      tags:
        - Edubridge - Users
      parameters:
        - in: query
          name: fields
          description: Comma-separated list of fields to include in the response
          schema:
            type: string
            description: Comma-separated list of fields to include in the response
            example: sourcedId,name
        - in: query
          name: limit
          description: >-
            The maximum number of items to return in the paginated response.
            While the OneRoster specification does not define a maximum limit,
            this implementation enforces a maximum of 3000 to prevent abuse and
            ensure optimal performance.
          schema:
            type: integer
            minimum: 1
            maximum: 3000
            default: 100
            description: >-
              The maximum number of items to return in the paginated response.
              While the OneRoster specification does not define a maximum limit,
              this implementation enforces a maximum of 3000 to prevent abuse
              and ensure optimal performance.
            example: 100
        - in: query
          name: offset
          description: The number of items to skip in the paginated response
          schema:
            type: integer
            minimum: 0
            default: 0
            description: The number of items to skip in the paginated response
            example: 0
        - in: query
          name: sort
          description: The field to sort the response by
          schema:
            type: string
            description: The field to sort the response by
        - in: query
          name: orderBy
          description: The order to sort the response by
          schema:
            type: string
            enum:
              - asc
              - desc
            description: The order to sort the response by
        - in: query
          name: filter
          description: The filter to apply to the response
          schema:
            type: string
            description: The filter to apply to the response
            example: status='active'
        - in: query
          name: search
          description: >-
            PROPRIETARY EXTENSION: Free-text search across multiple fields.
            Provides convenient text-based querying beyond the standard
            OneRoster filter parameter.
          schema:
            type: string
            description: >-
              PROPRIETARY EXTENSION: Free-text search across multiple fields.
              Provides convenient text-based querying beyond the standard
              OneRoster filter parameter.
            example: john
        - in: query
          name: roles
          schema:
            type: array
            items:
              type: string
              enum: &ref_0
                - administrator
                - aide
                - guardian
                - parent
                - proctor
                - relative
                - student
                - teacher
            minItems: 1
          required: true
        - in: query
          name: orgSourcedIds
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: Successful response containing a collection of users
          content:
            application/json:
              schema:
                type: object
                properties:
                  users:
                    type: array
                    items:
                      type: object
                      properties:
                        sourcedId:
                          type: string
                        status:
                          type: string
                          enum: &ref_2
                            - active
                            - tobedeleted
                        dateLastModified:
                          type: string
                          format: date-time
                        metadata:
                          type: object
                          additionalProperties: true
                          nullable: true
                          description: Additional metadata for the object
                        userMasterIdentifier:
                          type:
                            - string
                            - 'null'
                        username:
                          type:
                            - string
                            - 'null'
                        userIds:
                          type: array
                          items:
                            type: object
                            properties:
                              type:
                                type: string
                              identifier:
                                type: string
                            required:
                              - type
                              - identifier
                        enabledUser:
                          type: string
                          enum:
                            - 'true'
                            - 'false'
                        givenName:
                          type: string
                        familyName:
                          type: string
                        middleName:
                          type:
                            - string
                            - 'null'
                        roles:
                          type: array
                          items:
                            type: object
                            properties:
                              roleType:
                                type: string
                                enum:
                                  - primary
                                  - secondary
                              role:
                                type: string
                                enum: *ref_0
                              org:
                                type: object
                                properties:
                                  href:
                                    type: string
                                    format: uri
                                  sourcedId:
                                    type: string
                                  type:
                                    type: string
                                required:
                                  - href
                                  - sourcedId
                                  - type
                              userProfile:
                                type: string
                              metadata:
                                type:
                                  - object
                                  - 'null'
                                additionalProperties: {}
                              beginDate:
                                type:
                                  - string
                                  - 'null'
                              endDate:
                                type:
                                  - string
                                  - 'null'
                            required:
                              - roleType
                              - role
                              - org
                          default: []
                        agents:
                          type: array
                          items:
                            type: object
                            properties:
                              href:
                                type: string
                                format: uri
                              sourcedId:
                                type: string
                              type:
                                type: string
                                enum:
                                  - academicSession
                                  - assessmentLineItem
                                  - category
                                  - class
                                  - course
                                  - demographics
                                  - enrollment
                                  - gradingPeriod
                                  - lineItem
                                  - org
                                  - resource
                                  - result
                                  - scoreScale
                                  - student
                                  - teacher
                                  - term
                                  - user
                                  - componentResource
                                  - courseComponent
                            required:
                              - href
                              - sourcedId
                              - type
                          default: []
                        userProfiles:
                          type: array
                          items:
                            type: object
                            properties:
                              profileId:
                                type: string
                              profileType:
                                type: string
                              vendorId:
                                type: string
                              applicationId:
                                type: string
                              description:
                                type:
                                  - string
                                  - 'null'
                              app:
                                type: object
                                properties:
                                  sourcedId:
                                    type: string
                                  name:
                                    type: string
                                  description:
                                    type:
                                      - string
                                      - 'null'
                                  domain:
                                    type: array
                                    items:
                                      type: string
                                  metadata:
                                    type:
                                      - object
                                      - 'null'
                                    additionalProperties: {}
                                required:
                                  - sourcedId
                                  - name
                                  - domain
                              credentials:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    id:
                                      type: string
                                    type:
                                      type: string
                                    username:
                                      type: string
                                    password:
                                      type:
                                        - string
                                        - 'null'
                                  required:
                                    - id
                                    - type
                                    - username
                                default: []
                            required:
                              - profileId
                              - profileType
                              - vendorId
                              - applicationId
                              - app
                              - credentials
                          default: []
                        primaryOrg:
                          type: object
                          properties:
                            href:
                              type: string
                              format: uri
                            sourcedId:
                              type: string
                            type:
                              type: string
                            name:
                              type:
                                - string
                                - 'null'
                          required:
                            - href
                            - sourcedId
                            - type
                        identifier:
                          type:
                            - string
                            - 'null'
                        email:
                          type: string
                          format: email
                          description: Must be unique across all users.
                        preferredFirstName:
                          type:
                            - string
                            - 'null'
                        preferredMiddleName:
                          type:
                            - string
                            - 'null'
                        preferredLastName:
                          type:
                            - string
                            - 'null'
                        pronouns:
                          type:
                            - string
                            - 'null'
                        grades:
                          type: array
                          items:
                            allOf:
                              - $ref: '#/components/schemas/GradeEnum'
                            description: The grades of the course
                            enum: &ref_3
                              - '-1'
                              - '0'
                              - '1'
                              - '2'
                              - '3'
                              - '4'
                              - '5'
                              - '6'
                              - '7'
                              - '8'
                              - '9'
                              - '10'
                              - '11'
                              - '12'
                              - '13'
                        password:
                          type:
                            - string
                            - 'null'
                        sms:
                          type:
                            - string
                            - 'null'
                        phone:
                          type:
                            - string
                            - 'null'
                        demographics:
                          oneOf:
                            - $ref: '#/components/schemas/Demographics'
                            - type: 'null'
                      required:
                        - sourcedId
                        - status
                        - enabledUser
                        - givenName
                        - familyName
                        - roles
                        - agents
                        - userProfiles
                        - email
                      description: >-
                        Represents a user of the system. Can be a student,
                        teacher, guide, parent etc.
                  totalCount:
                    type: number
                  pageCount:
                    type: number
                  pageNumber:
                    type: number
                  offset:
                    type: number
                  limit:
                    type: number
                required:
                  - users
                  - totalCount
                  - pageCount
                  - pageNumber
                  - offset
                  - limit
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedRequestResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '422':
          description: Unprocessable Entity / 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: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
  /edubridge/learning-reports/map-profile/{userId}:
    get:
      operationId: getMapProfile
      summary: Get the MAP profile for a given student
      description: Return the MAP profile for a given student
      tags:
        - Edubridge - Learning Reports
      parameters:
        - name: userId
          description: The unique identifier for the student
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        title:
                          type: string
                        pdfUrl:
                          type:
                            - string
                            - 'null'
                        tests:
                          type: array
                          items:
                            type: string
                        grade:
                          type: string
                        schoolname:
                          type: string
                        assessmentResultProviderSystem:
                          type: string
                      required:
                        - title
                        - pdfUrl
                        - tests
                required:
                  - data
        '404':
          description: No MAP profile found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
  /edubridge/analytics/activity:
    get:
      operationId: listFactsDateRange
      summary: List all facts for a given date range by email or studentId
      description: >-
        Return a list of processed facts for a given date range by email or
        studentId
      tags: &ref_1
        - Edubridge - Analytics
      parameters:
        - in: query
          name: email
          schema:
            type: string
            format: email
        - in: query
          name: studentId
          schema:
            type: string
        - in: query
          name: startDate
          schema:
            type: string
            format: date-time
          required: true
        - in: query
          name: endDate
          schema:
            type: string
            format: date-time
          required: true
        - in: query
          name: timezone
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  startDate:
                    type: string
                    format: date-time
                  endDate:
                    type: string
                    format: date-time
                  facts:
                    type: object
                    additionalProperties:
                      type: object
                      additionalProperties:
                        type: object
                        properties:
                          activityMetrics:
                            type: object
                            properties:
                              xpEarned:
                                type: number
                              totalQuestions:
                                type: number
                              correctQuestions:
                                type: number
                              masteredUnits:
                                type: number
                            required:
                              - xpEarned
                              - totalQuestions
                              - correctQuestions
                              - masteredUnits
                          timeSpentMetrics:
                            type: object
                            properties:
                              activeSeconds:
                                type: number
                              inactiveSeconds:
                                type: number
                              wasteSeconds:
                                type: number
                            required:
                              - activeSeconds
                              - inactiveSeconds
                              - wasteSeconds
                          apps:
                            type: array
                            items:
                              type: string
                        required:
                          - activityMetrics
                          - timeSpentMetrics
                          - apps
                  factsByApp:
                    type: object
                    additionalProperties:
                      type: object
                      additionalProperties:
                        type: object
                        additionalProperties:
                          type: object
                          properties:
                            activityMetrics:
                              type: object
                              properties:
                                xpEarned:
                                  type: number
                                totalQuestions:
                                  type: number
                                correctQuestions:
                                  type: number
                                masteredUnits:
                                  type: number
                              required:
                                - xpEarned
                                - totalQuestions
                                - correctQuestions
                                - masteredUnits
                            timeSpentMetrics:
                              type: object
                              properties:
                                activeSeconds:
                                  type: number
                                inactiveSeconds:
                                  type: number
                                wasteSeconds:
                                  type: number
                              required:
                                - activeSeconds
                                - inactiveSeconds
                                - wasteSeconds
                            apps:
                              type: array
                              items:
                                type: string
                          required:
                            - activityMetrics
                            - timeSpentMetrics
                            - apps
                required:
                  - message
                  - startDate
                  - endDate
                  - facts
                  - factsByApp
  /edubridge/analytics/enrollment/:enrollmentId:
    get:
      operationId: listFactsByEnrollment
      summary: List all facts for a given enrollment
      description: >-
        Return a list of processed facts for a given enrollment with optional
        date range filtering
      tags: *ref_1
      parameters:
        - in: path
          name: enrollmentId
          schema:
            type: string
          required: true
        - in: query
          name: startDate
          schema:
            type: string
            format: date-time
        - in: query
          name: endDate
          schema:
            type: string
            format: date-time
        - in: query
          name: timezone
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  enrollmentId:
                    type: string
                  startDate:
                    type: string
                    format: date-time
                  endDate:
                    type: string
                    format: date-time
                  facts:
                    type: object
                    additionalProperties:
                      type: object
                      additionalProperties:
                        type: object
                        properties:
                          activityMetrics:
                            type: object
                            properties:
                              xpEarned:
                                type: number
                              totalQuestions:
                                type: number
                              correctQuestions:
                                type: number
                              masteredUnits:
                                type: number
                            required:
                              - xpEarned
                              - totalQuestions
                              - correctQuestions
                              - masteredUnits
                          timeSpentMetrics:
                            type: object
                            properties:
                              activeSeconds:
                                type: number
                              inactiveSeconds:
                                type: number
                              wasteSeconds:
                                type: number
                            required:
                              - activeSeconds
                              - inactiveSeconds
                              - wasteSeconds
                          apps:
                            type: array
                            items:
                              type: string
                        required:
                          - activityMetrics
                          - timeSpentMetrics
                          - apps
                  factsByApp:
                    type: object
                    additionalProperties:
                      type: object
                      additionalProperties:
                        type: object
                        additionalProperties:
                          type: object
                          properties:
                            activityMetrics:
                              type: object
                              properties:
                                xpEarned:
                                  type: number
                                totalQuestions:
                                  type: number
                                correctQuestions:
                                  type: number
                                masteredUnits:
                                  type: number
                              required:
                                - xpEarned
                                - totalQuestions
                                - correctQuestions
                                - masteredUnits
                            timeSpentMetrics:
                              type: object
                              properties:
                                activeSeconds:
                                  type: number
                                inactiveSeconds:
                                  type: number
                                wasteSeconds:
                                  type: number
                              required:
                                - activeSeconds
                                - inactiveSeconds
                                - wasteSeconds
                            apps:
                              type: array
                              items:
                                type: string
                          required:
                            - activityMetrics
                            - timeSpentMetrics
                            - apps
                required:
                  - message
                  - enrollmentId
                  - facts
                  - factsByApp
  /edubridge/analytics/facts/weekly:
    get:
      operationId: listFactsWeekly
      summary: List all facts for a given week by email or studentId
      description: Return a list of processed facts for a given week by email or studentId
      tags: *ref_1
      parameters:
        - in: query
          name: email
          schema:
            type: string
            format: email
        - in: query
          name: studentId
          schema:
            type: string
        - in: query
          name: weekDate
          schema:
            type: string
          required: true
        - in: query
          name: timezone
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  startDate:
                    type: string
                    format: date-time
                  endDate:
                    type: string
                    format: date-time
                  facts:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                        email:
                          type: string
                        date:
                          type: string
                        datetime:
                          type: string
                        username:
                          type:
                            - string
                            - 'null'
                        userGrade:
                          type:
                            - string
                            - 'null'
                        userFamilyName:
                          type:
                            - string
                            - 'null'
                        userGivenName:
                          type:
                            - string
                            - 'null'
                        userId:
                          type:
                            - string
                            - 'null'
                        subject:
                          type:
                            - string
                            - 'null'
                        app:
                          type:
                            - string
                            - 'null'
                        courseId:
                          type:
                            - string
                            - 'null'
                        courseName:
                          type:
                            - string
                            - 'null'
                        campusId:
                          type:
                            - string
                            - 'null'
                        campusName:
                          type:
                            - string
                            - 'null'
                        enrollmentId:
                          type:
                            - string
                            - 'null'
                        activityId:
                          type:
                            - string
                            - 'null'
                        activityName:
                          type:
                            - string
                            - 'null'
                        totalQuestions:
                          type:
                            - number
                            - 'null'
                        correctQuestions:
                          type:
                            - number
                            - 'null'
                        xpEarned:
                          type:
                            - number
                            - 'null'
                        masteredUnits:
                          type:
                            - number
                            - 'null'
                        activeSeconds:
                          type:
                            - string
                            - 'null'
                        inactiveSeconds:
                          type:
                            - string
                            - 'null'
                        wasteSeconds:
                          type:
                            - string
                            - 'null'
                        source:
                          type: string
                        alphaLevel:
                          type:
                            - string
                            - 'null'
                        generatedAt:
                          type:
                            - string
                            - 'null'
                        sendTime:
                          type:
                            - string
                            - 'null'
                        sensor:
                          type:
                            - string
                            - 'null'
                        eventType:
                          type:
                            - string
                            - 'null'
                        year:
                          type: number
                        month:
                          type: number
                        day:
                          type: number
                        dayOfWeek:
                          type: number
                      required:
                        - id
                        - email
                        - date
                        - datetime
                        - username
                        - userGrade
                        - userFamilyName
                        - userGivenName
                        - userId
                        - subject
                        - app
                        - courseId
                        - courseName
                        - campusId
                        - campusName
                        - enrollmentId
                        - activityId
                        - activityName
                        - totalQuestions
                        - correctQuestions
                        - masteredUnits
                        - activeSeconds
                        - inactiveSeconds
                        - wasteSeconds
                        - source
                        - alphaLevel
                        - generatedAt
                        - sendTime
                        - sensor
                        - eventType
                        - year
                        - month
                        - day
                        - dayOfWeek
                required:
                  - message
                  - startDate
                  - endDate
                  - facts
  /edubridge/analytics/highestGradeMastered/:studentId/:subject:
    get:
      operationId: getHighestGradeMastered
      summary: Gets the highest grade mastered by a student for a given subject
      description: >-
        Gets the highest grade mastered by a student for a given subject across
        different data sources (currently edulastic, placement and test out
        datasets)
      tags: *ref_1
      parameters:
        - in: path
          name: studentId
          description: >-
            The sourced_id of the student for which to get the highest grade
            mastered
          schema:
            type: string
            description: >-
              The sourced_id of the student for which to get the highest grade
              mastered
          required: true
        - in: path
          name: subject
          description: The subject for which to get the highest grade mastered
          schema:
            type: string
            description: The subject for which to get the highest grade mastered
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  studentId:
                    type: string
                    description: >-
                      The sourced_id of the student for which to get the highest
                      grade mastered
                  subject:
                    type: string
                    description: The subject for which to get the highest grade mastered
                  grades:
                    type: object
                    properties:
                      ritGrade:
                        oneOf:
                          - $ref: '#/components/schemas/GradeEnum'
                          - type: 'null'
                      edulasticGrade:
                        oneOf:
                          - $ref: '#/components/schemas/GradeEnum'
                          - type: 'null'
                      placementGrade:
                        oneOf:
                          - $ref: '#/components/schemas/GradeEnum'
                          - type: 'null'
                      testOutGrade:
                        oneOf:
                          - $ref: '#/components/schemas/GradeEnum'
                          - type: 'null'
                      highestGradeOverall:
                        oneOf:
                          - $ref: '#/components/schemas/GradeEnum'
                          - type: 'null'
                    required:
                      - ritGrade
                      - edulasticGrade
                      - placementGrade
                      - testOutGrade
                      - highestGradeOverall
                required:
                  - studentId
                  - subject
                  - grades
  /edubridge/subject-track/:
    get:
      operationId: getSubjectTracks
      summary: Get all subject tracks
      description: >-
        List all subject tracks: the target course for each organization
        (school/campus), subject and grade level combination. Includes both
        organization-specific tracks and global tracks that apply to all
        organizations.
      tags: &ref_4
        - Edubridge - Subject Track
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  subjectTrack:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        grade:
                          $ref: '#/components/schemas/GradeEnum'
                        subject:
                          $ref: '#/components/schemas/SubjectEnum'
                        course:
                          type: object
                          properties:
                            sourcedId:
                              type: string
                              minLength: 1
                            status:
                              type: string
                              enum: *ref_2
                            dateLastModified:
                              type: string
                              format: date-time
                            metadata:
                              type: object
                              additionalProperties: true
                              nullable: true
                              description: Additional metadata for the object
                            title:
                              type: string
                            courseCode:
                              type:
                                - string
                                - 'null'
                            grades:
                              type:
                                - array
                                - 'null'
                              items:
                                allOf:
                                  - $ref: '#/components/schemas/GradeEnum'
                                description: The grades of the course
                                enum: *ref_3
                            subjects:
                              type:
                                - array
                                - 'null'
                              items:
                                allOf:
                                  - $ref: '#/components/schemas/SubjectEnum'
                                description: The subjects of the course
                                enum: &ref_5
                                  - Reading
                                  - Language
                                  - Vocabulary
                                  - Social Studies
                                  - Writing
                                  - Science
                                  - FastMath
                                  - Math
                                  - None
                                  - Other
                            subjectCodes:
                              type:
                                - array
                                - 'null'
                              items:
                                type: string
                            org:
                              type: object
                              properties:
                                sourcedId:
                                  type: string
                              required:
                                - sourcedId
                            level:
                              type:
                                - string
                                - 'null'
                          required:
                            - status
                            - title
                            - org
                          description: Represents a course.
                        org:
                          oneOf:
                            - $ref: '#/components/schemas/Org'
                            - type: 'null'
                      required:
                        - id
                        - grade
                        - subject
                        - course
                        - org
                required:
                  - subjectTrack
    put:
      operationId: putSubjectTrack
      summary: Create or update a subject track
      description: >-
        Creates a new subject track or updates an existing one for the given
        organization, subject and grade with upsert behavior. If orgSourcedId is
        provided, creates an organization-specific track. If omitted, creates a
        global track that applies to all organizations. There can be only one
        target course per organization, subject and grade level combination.
      tags: *ref_4
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                subject:
                  $ref: '#/components/schemas/SubjectEnum'
                  description: The subject for the track (required)
                grade:
                  $ref: '#/components/schemas/GradeEnum'
                  description: The grade level for the track (required)
                courseId:
                  type: string
                  minLength: 1
                  description: The course ID to associate with this track (required)
                orgSourcedId:
                  type: string
                  description: >-
                    Optional organization/school ID. If not provided, creates a
                    global track that applies to all organizations
              required:
                - subject
                - grade
                - courseId
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  subjectTrack:
                    type: object
                    properties:
                      id:
                        type: string
                      grade:
                        $ref: '#/components/schemas/GradeEnum'
                      subject:
                        $ref: '#/components/schemas/SubjectEnum'
                      course:
                        type: object
                        properties:
                          sourcedId:
                            type: string
                            minLength: 1
                          status:
                            type: string
                            enum: *ref_2
                          dateLastModified:
                            type: string
                            format: date-time
                          metadata:
                            type: object
                            additionalProperties: true
                            nullable: true
                            description: Additional metadata for the object
                          title:
                            type: string
                          courseCode:
                            type:
                              - string
                              - 'null'
                          grades:
                            type:
                              - array
                              - 'null'
                            items:
                              allOf:
                                - $ref: '#/components/schemas/GradeEnum'
                              description: The grades of the course
                              enum: *ref_3
                          subjects:
                            type:
                              - array
                              - 'null'
                            items:
                              allOf:
                                - $ref: '#/components/schemas/SubjectEnum'
                              description: The subjects of the course
                              enum: *ref_5
                          subjectCodes:
                            type:
                              - array
                              - 'null'
                            items:
                              type: string
                          org:
                            type: object
                            properties:
                              sourcedId:
                                type: string
                            required:
                              - sourcedId
                          level:
                            type:
                              - string
                              - 'null'
                        required:
                          - status
                          - title
                          - org
                        description: Represents a course.
                      org:
                        oneOf:
                          - $ref: '#/components/schemas/Org'
                          - type: 'null'
                    required:
                      - id
                      - grade
                      - subject
                      - course
                      - org
                required:
                  - subjectTrack
  /edubridge/subject-track/{id}:
    delete:
      operationId: deleteSubjectTrack
      summary: Delete a subject track
      description: Deletes a subject track by its ID
      tags: *ref_4
      parameters:
        - name: id
          description: The ID of the subject track to delete
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Subject track deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: 'null'
                required:
                  - data
  /edubridge/subject-track/groups:
    get:
      operationId: listSubjectTrackGroups
      summary: List all subject track groups
      description: >-
        Returns all subject tracks organized into logical groups. Groups are
        defined by subject, grade, course, and type (global vs campus-specific).
        Global groups contain a single track that applies to all organizations.
        Campus groups contain multiple tracks for specific organizations sharing
        the same subject, grade, and course.
      tags: *ref_4
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  groups:
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          type: object
                          properties:
                            subject:
                              $ref: '#/components/schemas/SubjectEnum'
                            grade:
                              $ref: '#/components/schemas/GradeEnum'
                            courseId:
                              type: string
                            isGlobal:
                              type: boolean
                          required:
                            - subject
                            - grade
                            - courseId
                            - isGlobal
                        tracks:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                              grade:
                                $ref: '#/components/schemas/GradeEnum'
                              subject:
                                $ref: '#/components/schemas/SubjectEnum'
                              course:
                                type: object
                                properties:
                                  sourcedId:
                                    type: string
                                    minLength: 1
                                  status:
                                    type: string
                                    enum: *ref_2
                                  dateLastModified:
                                    type: string
                                    format: date-time
                                  metadata:
                                    type: object
                                    additionalProperties: true
                                    nullable: true
                                    description: Additional metadata for the object
                                  title:
                                    type: string
                                  courseCode:
                                    type:
                                      - string
                                      - 'null'
                                  grades:
                                    type:
                                      - array
                                      - 'null'
                                    items:
                                      allOf:
                                        - $ref: '#/components/schemas/GradeEnum'
                                      description: The grades of the course
                                      enum: *ref_3
                                  subjects:
                                    type:
                                      - array
                                      - 'null'
                                    items:
                                      allOf:
                                        - $ref: '#/components/schemas/SubjectEnum'
                                      description: The subjects of the course
                                      enum: *ref_5
                                  subjectCodes:
                                    type:
                                      - array
                                      - 'null'
                                    items:
                                      type: string
                                  org:
                                    type: object
                                    properties:
                                      sourcedId:
                                        type: string
                                    required:
                                      - sourcedId
                                  level:
                                    type:
                                      - string
                                      - 'null'
                                required:
                                  - status
                                  - title
                                  - org
                                description: Represents a course.
                              org:
                                oneOf:
                                  - $ref: '#/components/schemas/Org'
                                  - type: 'null'
                            required:
                              - id
                              - grade
                              - subject
                              - course
                              - org
                      required:
                        - key
                        - tracks
                required:
                  - groups
    post:
      operationId: createSubjectTrackGroup
      summary: Create a subject track group
      description: >-
        Creates a new subject track group. If orgSourcedIds is empty, creates a
        global track that applies to all organizations. If orgSourcedIds
        contains organization IDs, creates campus-specific tracks for each
        organization. All tracks in the group will have the same subject, grade,
        and course.
      tags: *ref_4
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                subject:
                  $ref: '#/components/schemas/SubjectEnum'
                  description: The subject for the track group (required)
                grade:
                  $ref: '#/components/schemas/GradeEnum'
                  description: The grade level for the track group (required)
                courseId:
                  type: string
                  minLength: 1
                  description: >-
                    The course ID to associate with all tracks in this group
                    (required)
                orgSourcedIds:
                  type: array
                  items:
                    type: string
                  default: []
                  description: >-
                    Array of organization IDs for campus-specific tracks. Empty
                    array creates a global track that applies to all
                    organizations
              required:
                - subject
                - grade
                - courseId
      responses:
        '204':
          description: Group created successfully
          content: {}
    put:
      operationId: updateSubjectTrackGroup
      summary: Update a subject track group
      description: >-
        Updates an existing subject track group by replacing all tracks in the
        group. The group is identified by subject, grade, currentCourseId, and
        isGlobal. All existing tracks in the group will be deleted and new
        tracks created with the specified configuration. Supports changing the
        course and organization list for the group.
      tags: *ref_4
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                subject:
                  $ref: '#/components/schemas/SubjectEnum'
                  description: The subject for the track group (required)
                grade:
                  $ref: '#/components/schemas/GradeEnum'
                  description: The grade level for the track group (required)
                currentCourseId:
                  type: string
                  minLength: 1
                  description: The current course ID to identify the existing group
                courseId:
                  type: string
                  minLength: 1
                  description: The new course ID to associate with all tracks in this group
                isGlobal:
                  type: boolean
                  description: >-
                    Whether this is a global group (true) or campus group
                    (false)
                orgSourcedIds:
                  type: array
                  items:
                    type: string
                  default: []
                  description: >-
                    Array of organization IDs for the updated group. Empty array
                    converts to global track
                strategy:
                  type: string
                  enum:
                    - replace
                    - fail
                  default: replace
                  description: >-
                    Conflict resolution strategy: replace existing tracks or
                    fail on conflicts
              required:
                - subject
                - grade
                - currentCourseId
                - courseId
                - isGlobal
      responses:
        '204':
          description: Group updated successfully
          content: {}
    delete:
      operationId: deleteSubjectTrackGroup
      summary: Delete a subject track group
      description: >-
        Deletes all subject tracks in a group. The group is identified by
        subject, grade, courseId, and isGlobal. All tracks belonging to this
        group will be permanently removed.
      tags: *ref_4
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                subject:
                  $ref: '#/components/schemas/SubjectEnum'
                  description: The subject for the track group (required)
                grade:
                  $ref: '#/components/schemas/GradeEnum'
                  description: The grade level for the track group (required)
                courseId:
                  type: string
                  minLength: 1
                  description: The course ID to identify the group to delete
                isGlobal:
                  type: boolean
                  description: >-
                    Whether this is a global group (true) or campus group
                    (false)
              required:
                - subject
                - grade
                - courseId
                - isGlobal
      responses:
        '204':
          description: Group deleted successfully
          content: {}
  /edubridge/applications/:
    get:
      operationId: getApplications
      summary: Get all applications
      description: List all applications available in the system
      tags:
        - Edubridge - Applications
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  applications:
                    type: array
                    items:
                      type: object
                      properties:
                        sourcedId:
                          type: string
                        name:
                          type: string
                        description:
                          type:
                            - string
                            - 'null'
                        domain:
                          type: array
                          items:
                            type: string
                        tenantId:
                          type:
                            - string
                            - 'null'
                        clientAppId:
                          type:
                            - string
                            - 'null'
                        status:
                          type: string
                        dateLastModified:
                          type: string
                        metadata:
                          type: 'null'
                      required:
                        - sourcedId
                        - name
                        - description
                        - domain
                        - tenantId
                        - clientAppId
                        - status
                        - dateLastModified
                required:
                  - applications
  /edubridge/applicationMetrics/{applicationSourcedId}:
    get:
      operationId: getApplicationMetrics
      summary: Get all metrics for an application
      description: >

        Returns all application metrics for a given application.


        This endpoint provides a way to retrieve all tracked metrics associated
        with an application,

        including the metric type and source information.
      tags: &ref_6
        - Edubridge - Application Metrics
      parameters:
        - name: applicationSourcedId
          description: The unique identifier for the application
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        applicationSourcedId:
                          type: string
                          description: The application sourced id
                        metric:
                          type: string
                          enum: &ref_7
                            - xp
                            - spent_minutes
                            - waste_minutes
                            - accuracy
                            - lessons
                            - quizzes
                            - unit_tests
                          description: The metric
                        metricSource:
                          type: string
                          enum: &ref_8
                            - timeback_app
                            - timeback_direct_integration
                            - timeback_adapter
                            - powerpath
                            - manual_entry
                          description: The metric source
                      required:
                        - applicationSourcedId
                        - metric
                        - metricSource
                required:
                  - data
    post:
      operationId: createApplicationMetric
      summary: Create a new application metric
      description: >

        Creates a new application metric for tracking.


        This endpoint allows you to record metrics associated with an
        application,

        specifying the metric type and source for proper categorization.
      tags: *ref_6
      parameters:
        - name: applicationSourcedId
          description: The unique identifier for the application
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                applicationMetric:
                  type: object
                  properties:
                    metric:
                      type: string
                      enum: *ref_7
                      description: The metric
                    metricSource:
                      type: string
                      enum: *ref_8
                      description: The metric source
                  required:
                    - metric
                    - metricSource
              required:
                - applicationMetric
      responses:
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      applicationSourcedId:
                        type: string
                        description: The application sourced id
                      metric:
                        type: string
                        enum: *ref_7
                        description: The metric
                      metricSource:
                        type: string
                        enum: *ref_8
                        description: The metric source
                    required:
                      - applicationSourcedId
                      - metric
                      - metricSource
                required:
                  - data
    delete:
      operationId: deleteApplicationMetric
      summary: Delete an application metric
      description: >

        Deletes a specific application metric.


        This endpoint removes a specific metric record identified by the
        application ID,

        metric type, and metric source.
      tags: *ref_6
      parameters:
        - name: applicationSourcedId
          description: The unique identifier for the application
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                applicationMetric:
                  type: object
                  properties:
                    metric:
                      type: string
                      enum: *ref_7
                      description: The metric
                    metricSource:
                      type: string
                      enum: *ref_8
                      description: The metric source
                  required:
                    - metric
                    - metricSource
              required:
                - applicationMetric
      responses:
        '204':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: 'null'
                required:
                  - data
  /edubridge/enrollments/defaultClass/{courseId}/{schoolId}?:
    get:
      operationId: getDefaultCourseClass
      summary: Get the default class for a course
      description: >

        Retrieves and automatically creates a default class (and other necessary
        academic entities) for the specified course. 


        This endpoint simplifies the management of digital learning by
        abstracting away the need to manually create class structures. 


        For digital-only courses, this endpoint ensures that the necessary
        academic structure (school year, term, class) exists 

        without requiring the consumer to understand or manage this complex
        hierarchy.

        The class is created with appropriate digital-friendly settings.


        You do not need to call this endpoint unless you have a use case where
        you want to manage the underlying academic structure (school year, term,
        class) for a course.
      tags: &ref_9
        - Edubridge - Enrollments
      parameters:
        - name: courseId
          description: The unique identifier for the course
          in: path
          required: true
          schema:
            type: string
        - name: schoolId
          description: The unique identifier for the school
          in: path
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: '123'
                      title:
                        type: string
                      classCode:
                        type:
                          - string
                          - 'null'
                      subjectCodes:
                        type: array
                        items:
                          type: string
                      subjects:
                        type: array
                        items:
                          allOf:
                            - $ref: '#/components/schemas/SubjectEnum'
                          description: The subjects of the course
                          enum: *ref_5
                      grades:
                        type: array
                        items:
                          allOf:
                            - $ref: '#/components/schemas/GradeEnum'
                          description: The grades of the course
                          enum: *ref_3
                      periods:
                        type: array
                        items:
                          type: string
                      course:
                        type: object
                        properties:
                          id:
                            type: string
                          title:
                            type: string
                          metadata:
                            type: object
                            additionalProperties: {}
                          subjects:
                            type:
                              - array
                              - 'null'
                            items:
                              type: string
                          grades:
                            type:
                              - array
                              - 'null'
                            items:
                              type: string
                          primaryApp:
                            type:
                              - object
                              - 'null'
                            properties:
                              id:
                                type: string
                              name:
                                type: string
                              domains:
                                type: array
                                items:
                                  type: string
                            required:
                              - id
                              - name
                              - domains
                        required:
                          - id
                          - title
                          - metadata
                    required:
                      - id
                      - title
                      - classCode
                      - subjectCodes
                      - subjects
                      - grades
                      - periods
                      - course
                required:
                  - data
  /edubridge/enrollments/enroll/{userId}/{courseId}/{schoolId}?:
    post:
      operationId: enrollUserInCourse
      summary: Enroll user in a course
      description: >

        Enrolls a user in a course with a single API call. 


        This endpoint handles all necessary background operations: locating or
        creating a default class for the course, 

        establishing appropriate academic sessions (school year and term), and
        creating the enrollment record. 


        Consumers can simply specify the user, course, and role (default is
        'student') without 

        needing to understand or manage the underlying academic structure that
        OneRoster requires.
      tags: *ref_9
      parameters:
        - name: userId
          description: The unique identifier for the user
          in: path
          required: true
          schema:
            type: string
        - name: courseId
          description: The unique identifier for the course
          in: path
          required: true
          schema:
            type: string
        - name: schoolId
          description: The unique identifier for the school
          in: path
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                sourcedId:
                  type: string
                  description: Optional client-provided ID for the enrollment
                role:
                  type: string
                  enum: &ref_10
                    - administrator
                    - proctor
                    - student
                    - teacher
                  default: student
                beginDate:
                  type: string
                  format: date-time
                  description: >-
                    The date the user is enrolled in the course, defaults to
                    today
                metadata:
                  type: object
                  properties:
                    goals:
                      type: object
                      properties:
                        dailyXp:
                          type: number
                        dailyLessons:
                          type: number
                        dailyActiveMinutes:
                          type: number
                        dailyAccuracy:
                          type: number
                        dailyMasteredUnits:
                          type: number
                      additionalProperties: false
                    metrics:
                      type: object
                      properties:
                        totalXp:
                          type: number
                        totalLessons:
                          type: number
                        totalGrades:
                          type: number
                          description: Total number of grade levels covered by this course
                        courseType:
                          type: string
                          description: >-
                            The type of course (e.g. 'optional', 'hole-filling',
                            'base')
                        isSupplemental:
                          type: boolean
                          description: Indicates whether the course is supplemental content
                      additionalProperties: false
                  additionalProperties: true
              additionalProperties: false
      responses:
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: '123'
                      role:
                        type: string
                        enum: *ref_10
                      beginDate:
                        type:
                          - string
                          - 'null'
                      endDate:
                        type:
                          - string
                          - 'null'
                      metadata:
                        type: object
                        properties:
                          goals:
                            type: object
                            properties:
                              dailyXp:
                                type: number
                              dailyLessons:
                                type: number
                              dailyActiveMinutes:
                                type: number
                              dailyAccuracy:
                                type: number
                              dailyMasteredUnits:
                                type: number
                            additionalProperties: false
                          metrics:
                            type: object
                            properties:
                              totalXp:
                                type: number
                              totalLessons:
                                type: number
                              totalGrades:
                                type: number
                                description: >-
                                  Total number of grade levels covered by this
                                  course
                              courseType:
                                type: string
                                description: >-
                                  The type of course (e.g. 'optional',
                                  'hole-filling', 'base')
                              isSupplemental:
                                type: boolean
                                description: >-
                                  Indicates whether the course is supplemental
                                  content
                            additionalProperties: false
                        additionalProperties: true
                      course:
                        type: object
                        properties:
                          id:
                            type: string
                          title:
                            type: string
                          metadata:
                            type: object
                            additionalProperties: {}
                          subjects:
                            type:
                              - array
                              - 'null'
                            items:
                              type: string
                          grades:
                            type:
                              - array
                              - 'null'
                            items:
                              type: string
                          primaryApp:
                            type:
                              - object
                              - 'null'
                            properties:
                              id:
                                type: string
                              name:
                                type: string
                              domains:
                                type: array
                                items:
                                  type: string
                            required:
                              - id
                              - name
                              - domains
                        required:
                          - id
                          - title
                          - metadata
                      school:
                        type: object
                        properties:
                          id:
                            type: string
                          name:
                            type: string
                        required:
                          - id
                          - name
                      testOutSupported:
                        type: boolean
                        description: >-
                          Whether the course has at least one subject that
                          supports self-elected test-out assessments
                      testOutEligible:
                        type: boolean
                        description: >-
                          Whether the student is currently eligible to request a
                          test-out for this enrollment. Always false when
                          testOutSupported is false.
                    required:
                      - id
                      - role
                      - beginDate
                      - endDate
                      - course
                      - school
                      - testOutSupported
                      - testOutEligible
                required:
                  - data
  /edubridge/enrollments/resetGoals/{courseId}:
    post:
      operationId: resetEnrollmentGoals
      summary: Reset enrollment goals to current course goals
      description: >-
        Resets the goals for all enrollments in a course to the course's current
        goals.
      tags: *ref_9
      parameters:
        - name: courseId
          description: The unique identifier for the course
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Goals successfully reset
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      updated:
                        type: number
                        description: Number of enrollments successfully updated
                      errors:
                        type: array
                        items:
                          type: string
                        description: List of errors encountered during propagation
                    required:
                      - updated
                      - errors
                required:
                  - data
        '404':
          description: Course not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '422':
          description: Course has no goals defined
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
  /edubridge/enrollments/resetProgress/{userId}/{courseId}:
    delete:
      operationId: resetUserCourseProgress
      summary: Resets an user's progress in a given course
      description: >

        Reset the progress an user has made in a given course.


        This endpoint finds all assessment results to associated a given course
        and user and marks them as 'tobedeleted'. 


        This endpoint is not responsible for deleting results and progress in
        third party apps.
      tags: *ref_9
      parameters:
        - name: userId
          description: The unique identifier for the user
          in: path
          required: true
          schema:
            type: string
        - name: courseId
          description: The unique identifier for the course
          in: path
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: 'null'
                required:
                  - data
  /edubridge/enrollments/unenroll/{userId}/{courseId}/{schoolId}?:
    delete:
      operationId: unenrollUserFromCourse
      summary: Unenroll a user from a course
      description: >

        Unenrolls a user from a course with a single API call. 


        This endpoint automatically handles finding the appropriate class
        enrollment(s) for the course and marking them as 'tobedeleted'. 


        Consumers don't need to know which specific class the user is enrolled
        in or manage the enrollment status transitions required by OneRoster.
      tags: *ref_9
      parameters:
        - name: userId
          description: The unique identifier for the user
          in: path
          required: true
          schema:
            type: string
        - name: courseId
          description: The unique identifier for the course
          in: path
          required: true
          schema:
            type: string
        - name: schoolId
          description: The unique identifier for the school
          in: path
          required: false
          schema:
            type: string
      responses:
        '204':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: 'null'
                required:
                  - data
  /edubridge/enrollments/user/{userId}:
    get:
      operationId: getUserEnrollments
      summary: Get all active enrollments for a user
      description: >

        Returns a simplified, course-centric view of all active enrollments for
        a user. 


        This endpoint abstracts away the complex OneRoster academic hierarchy, 

        providing a streamlined representation that focuses on what courses the
        user is enrolled in rather than details about classes, sections, and
        academic sessions.


        The response includes essential course information without the need to
        navigate multiple relationship levels.
      tags: *ref_9
      parameters:
        - name: userId
          description: The unique identifier for the user
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: '123'
                        role:
                          type: string
                          enum: *ref_10
                        beginDate:
                          type:
                            - string
                            - 'null'
                        endDate:
                          type:
                            - string
                            - 'null'
                        metadata:
                          type: object
                          properties:
                            goals:
                              type: object
                              properties:
                                dailyXp:
                                  type: number
                                dailyLessons:
                                  type: number
                                dailyActiveMinutes:
                                  type: number
                                dailyAccuracy:
                                  type: number
                                dailyMasteredUnits:
                                  type: number
                              additionalProperties: false
                            metrics:
                              type: object
                              properties:
                                totalXp:
                                  type: number
                                totalLessons:
                                  type: number
                                totalGrades:
                                  type: number
                                  description: >-
                                    Total number of grade levels covered by this
                                    course
                                courseType:
                                  type: string
                                  description: >-
                                    The type of course (e.g. 'optional',
                                    'hole-filling', 'base')
                                isSupplemental:
                                  type: boolean
                                  description: >-
                                    Indicates whether the course is supplemental
                                    content
                              additionalProperties: false
                          additionalProperties: true
                        course:
                          type: object
                          properties:
                            id:
                              type: string
                            title:
                              type: string
                            metadata:
                              type: object
                              additionalProperties: {}
                            subjects:
                              type:
                                - array
                                - 'null'
                              items:
                                type: string
                            grades:
                              type:
                                - array
                                - 'null'
                              items:
                                type: string
                            primaryApp:
                              type:
                                - object
                                - 'null'
                              properties:
                                id:
                                  type: string
                                name:
                                  type: string
                                domains:
                                  type: array
                                  items:
                                    type: string
                              required:
                                - id
                                - name
                                - domains
                          required:
                            - id
                            - title
                            - metadata
                        school:
                          type: object
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                          required:
                            - id
                            - name
                        testOutSupported:
                          type: boolean
                          description: >-
                            Whether the course has at least one subject that
                            supports self-elected test-out assessments
                        testOutEligible:
                          type: boolean
                          description: >-
                            Whether the student is currently eligible to request
                            a test-out for this enrollment. Always false when
                            testOutSupported is false.
                      required:
                        - id
                        - role
                        - beginDate
                        - endDate
                        - course
                        - school
                        - testOutSupported
                        - testOutEligible
                required:
                  - data
  /edubridge/time-saved/user/{userId}:
    get:
      operationId: getStudentTimeSaved
      summary: Get total time saved for a student this school year
      description: >

        Calculates the total time a student has "got back" during the current
        school year.


        This endpoint compares the personalized learning system's efficient
        2-hour daily study time against 

        traditional school schedules (6 hours class + 1 hour homework = 7 hours
        total), 

        resulting in 5 hours saved per school day.


        The calculation starts from the student's earliest valid enrollment date
        within the current school year 

        (or the school year start date if they enrolled earlier) and counts only
        actual school days 

        (excluding weekends, holidays, breaks, and MAP testing days).


        **Formula:** Number of school days elapsed × 5 hours saved per day =
        Total hours saved


        The response includes both the total hours saved and equivalent full
        days saved (hours ÷ 24).
      tags:
        - Edubridge - Enrollments
      parameters:
        - name: userId
          description: The unique identifier for the student
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      totalHoursSaved:
                        type: number
                        example: 600
                        description: Total hours saved during the current school year
                      totalDaysSaved:
                        type: number
                        example: 25
                        description: Total full days saved (totalHoursSaved / 24)
                      schoolDaysElapsed:
                        type: number
                        example: 120
                        description: >-
                          Number of school days elapsed since earliest
                          enrollment
                      earliestStartDate:
                        type: string
                        format: date-time
                        example: '2024-08-25T00:00:00.000Z'
                        description: >-
                          Earliest valid enrollment date for the student or
                          school year start date
                      schoolYearStartDate:
                        type: string
                        format: date-time
                        example: '2024-08-15T00:00:00.000Z'
                        description: Start date of the current school year
                      calculation:
                        type: object
                        properties:
                          standardSchoolHoursPerDay:
                            type: number
                            example: 7
                            description: >-
                              Standard school hours per day (6 hours class + 1
                              hour homework)
                          timebackHoursPerDay:
                            type: number
                            example: 2
                            description: Personalized learning hours per day
                          hoursSavedPerDay:
                            type: number
                            example: 5
                            description: >-
                              Hours saved per day (standard - personalized
                              learning)
                          formula:
                            type: string
                            example: >-
                              120 school days × 5 hours saved per day = 600
                              hours
                            description: Human-readable calculation formula
                        required:
                          - standardSchoolHoursPerDay
                          - timebackHoursPerDay
                          - hoursSavedPerDay
                          - formula
                    required:
                      - totalHoursSaved
                      - totalDaysSaved
                      - schoolDaysElapsed
                      - earliestStartDate
                      - schoolYearStartDate
                      - calculation
                    description: >-
                      Time saved calculation for the student during the current
                      school year
                required:
                  - data
        '404':
          description: Student not found or no enrollments found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
components:
  securitySchemes:
    MCP:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: >-
            https://prod-beyond-timeback-api-2-idp.auth.us-east-1.amazoncognito.com/oauth2/authorize
          tokenUrl: >-
            https://prod-beyond-timeback-api-2-idp.auth.us-east-1.amazoncognito.com/oauth2/token
          scopes:
            https://purl.imsglobal.org/spec/or/v1p1/scope/roster-core.readonly: Read access to roster core
            https://purl.imsglobal.org/spec/or/v1p1/scope/roster.readonly: Read access to roster
            https://purl.imsglobal.org/spec/or/v1p1/scope/roster-demographics.readonly: Read access to roster demographics
            https://purl.imsglobal.org/spec/or/v1p1/scope/resource.readonly: Read access to resource
            https://purl.imsglobal.org/spec/or/v1p1/scope/gradebook.readonly: Read access to gradebook
            https://purl.imsglobal.org/spec/powerpath/v1p1/scope/powerpath.readonly: Read access to powerpath
            https://purl.imsglobal.org/spec/ob/v3p0/scope/credential.readonly: Read your issued badges
            https://purl.imsglobal.org/spec/clr/v2p0/scope/credential.readonly: Read access to CLR
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          scopes:
            https://purl.imsglobal.org/spec/or/v1p1/scope/admin: Admin access to the API
            https://purl.imsglobal.org/spec/or/v1p1/scope/roster-core.readonly: Read access to roster core
            https://purl.imsglobal.org/spec/or/v1p1/scope/roster.readonly: Read access to roster
            https://purl.imsglobal.org/spec/or/v1p1/scope/roster.createput: Create and update access to roster
            https://purl.imsglobal.org/spec/or/v1p1/scope/roster.delete: Delete access to roster
            https://purl.imsglobal.org/spec/or/v1p1/scope/roster-demographics.readonly: Read access to roster demographics
            https://purl.imsglobal.org/spec/or/v1p1/scope/roster-demographics.createput: Create and update access to roster demographics
            https://purl.imsglobal.org/spec/or/v1p1/scope/roster-demographics.delete: Delete access to roster demographics
            https://purl.imsglobal.org/spec/or/v1p1/scope/resource.readonly: Read access to resource
            https://purl.imsglobal.org/spec/or/v1p1/scope/resource.createput: Create and update access to resource
            https://purl.imsglobal.org/spec/or/v1p1/scope/resource.delete: Delete access to resource
            https://purl.imsglobal.org/spec/or/v1p1/scope/gradebook.readonly: Read access to gradebook
            https://purl.imsglobal.org/spec/or/v1p1/scope/gradebook.createput: Create and update access to gradebook
            https://purl.imsglobal.org/spec/or/v1p1/scope/gradebook.delete: Delete access to gradebook
            https://purl.imsglobal.org/spec/powerpath/v1p1/scope/powerpath.readonly: Read access to powerpath
            https://purl.imsglobal.org/spec/powerpath/v1p1/scope/powerpath.createput: Create and update access to powerpath
            https://purl.imsglobal.org/spec/powerpath/v1p1/scope/powerpath.delete: Delete access to powerpath
            https://purl.imsglobal.org/spec/powerpath/v1p1/scope/powerpath.admin: Admin access to powerpath
            https://purl.imsglobal.org/spec/ob/v3p0/scope/credential.readonly: Read your issued badges
            https://purl.imsglobal.org/spec/ob/v3p0/scope/credential.upsert: Store new badges in your account
            https://purl.imsglobal.org/spec/ob/v3p0/scope/credential.delete: Delete access to open badges
            https://purl.imsglobal.org/spec/ob/v3p0/scope/credential.admin: Administrative access to open badges
            https://purl.imsglobal.org/spec/clr/v2p0/scope/credential.readonly: Read access to CLR
            https://purl.imsglobal.org/spec/clr/v2p0/scope/credential.upsert: Create and update access to CLR
            https://purl.imsglobal.org/spec/clr/v2p0/scope/credential.admin: Administrative access to CLR
          tokenUrl: >-
            https://prod-beyond-timeback-api-2-idp.auth.us-east-1.amazoncognito.com/oauth2/token
  schemas:
    GradeEnum:
      type: string
      enum: *ref_3
      description: >-
        Grade levels. -1 is Pre-K, 0 is Kindergarten, 1-12 are grades 1-12, 13
        is AP.
      example: '3'
    Demographics:
      type: object
      properties:
        sourcedId:
          type: string
        status:
          type: string
          enum: *ref_2
        dateLastModified:
          type: string
          format: date-time
        metadata:
          type: object
          additionalProperties: true
          nullable: true
          description: Additional metadata for the object
        birthDate:
          type:
            - string
            - 'null'
          pattern: ^\d{4}-\d{2}-\d{2}$
        sex:
          type:
            - string
            - 'null'
          enum:
            - male
            - female
            - other
            - unspecified
            - null
        americanIndianOrAlaskaNative:
          type:
            - string
            - 'null'
        asian:
          type:
            - string
            - 'null'
        blackOrAfricanAmerican:
          type:
            - string
            - 'null'
        nativeHawaiianOrOtherPacificIslander:
          type:
            - string
            - 'null'
        white:
          type:
            - string
            - 'null'
        demographicRaceTwoOrMoreRaces:
          type:
            - string
            - 'null'
        hispanicOrLatinoEthnicity:
          type:
            - string
            - 'null'
        countryOfBirthCode:
          type:
            - string
            - 'null'
        stateOfBirthAbbreviation:
          type:
            - string
            - 'null'
        cityOfBirth:
          type:
            - string
            - 'null'
        publicSchoolResidenceStatus:
          type:
            - string
            - 'null'
      required:
        - sourcedId
        - status
        - birthDate
        - sex
        - americanIndianOrAlaskaNative
        - asian
        - blackOrAfricanAmerican
        - nativeHawaiianOrOtherPacificIslander
        - white
        - demographicRaceTwoOrMoreRaces
        - hispanicOrLatinoEthnicity
        - countryOfBirthCode
        - stateOfBirthAbbreviation
        - cityOfBirth
        - publicSchoolResidenceStatus
      description: Represents a student's demographics information.
    BadRequestResponse:
      type: object
      properties:
        imsx_codeMajor:
          type: string
          default: failure
          description: The major response code
          example: failure
        imsx_severity:
          type: string
          default: error
          description: The severity of the response
          example: error
        imsx_description:
          type: string
        imsx_CodeMinor:
          type: object
          properties:
            imsx_codeMinorField:
              type: array
              items:
                type: object
                properties:
                  imsx_codeMinorFieldName:
                    type: string
                    default: TargetEndSystem
                    description: The field name for the minor code
                    example: TargetEndSystem
                  imsx_codeMinorFieldValue:
                    type: string
                    default: invaliddata
                    description: The field value for the minor code
                    example: invaliddata
                required:
                  - imsx_codeMinorFieldName
                  - imsx_codeMinorFieldValue
          required:
            - imsx_codeMinorField
        imsx_error_details:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
      required:
        - imsx_codeMajor
        - imsx_severity
        - imsx_description
        - imsx_CodeMinor
    UnauthorizedRequestResponse:
      type: object
      properties:
        imsx_codeMajor:
          type: string
          default: failure
          description: The major response code
          example: failure
        imsx_severity:
          type: string
          default: error
          description: The severity of the response
          example: error
        imsx_description:
          type: string
        imsx_CodeMinor:
          type: object
          properties:
            imsx_codeMinorField:
              type: array
              items:
                type: object
                properties:
                  imsx_codeMinorFieldName:
                    type: string
                    default: TargetEndSystem
                    description: The field name for the minor code
                    example: TargetEndSystem
                  imsx_codeMinorFieldValue:
                    type: string
                    default: unauthorisedrequest
                    description: The field value for the minor code
                    example: unauthorisedrequest
                required:
                  - imsx_codeMinorFieldName
                  - imsx_codeMinorFieldValue
          required:
            - imsx_codeMinorField
        imsx_error_details:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
      required:
        - imsx_codeMajor
        - imsx_severity
        - imsx_description
        - imsx_CodeMinor
    ForbiddenResponse:
      type: object
      properties:
        imsx_codeMajor:
          type: string
          default: failure
          description: The major response code
          example: failure
        imsx_severity:
          type: string
          default: error
          description: The severity of the response
          example: error
        imsx_description:
          type: string
        imsx_CodeMinor:
          type: object
          properties:
            imsx_codeMinorField:
              type: array
              items:
                type: object
                properties:
                  imsx_codeMinorFieldName:
                    type: string
                    default: TargetEndSystem
                    description: The field name for the minor code
                    example: TargetEndSystem
                  imsx_codeMinorFieldValue:
                    type: string
                    default: forbidden
                    description: The field value for the minor code
                    example: forbidden
                required:
                  - imsx_codeMinorFieldName
                  - imsx_codeMinorFieldValue
          required:
            - imsx_codeMinorField
        imsx_error_details:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
      required:
        - imsx_codeMajor
        - imsx_severity
        - imsx_description
        - imsx_CodeMinor
    NotFoundResponse:
      type: object
      properties:
        imsx_codeMajor:
          type: string
          default: failure
          description: The major response code
          example: failure
        imsx_severity:
          type: string
          default: error
          description: The severity of the response
          example: error
        imsx_description:
          type: string
        imsx_CodeMinor:
          type: object
          properties:
            imsx_codeMinorField:
              type: array
              items:
                type: object
                properties:
                  imsx_codeMinorFieldName:
                    type: string
                    default: TargetEndSystem
                    description: The field name for the minor code
                    example: TargetEndSystem
                  imsx_codeMinorFieldValue:
                    type: string
                    default: unknownobject
                    description: The field value for the minor code
                    example: unknownobject
                required:
                  - imsx_codeMinorFieldName
                  - imsx_codeMinorFieldValue
          required:
            - imsx_codeMinorField
        imsx_error_details:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
      required:
        - imsx_codeMajor
        - imsx_severity
        - imsx_description
        - imsx_CodeMinor
    UnprocessableEntityResponse:
      type: object
      properties:
        imsx_codeMajor:
          type: string
          default: failure
          description: The major response code
          example: failure
        imsx_severity:
          type: string
          default: error
          description: The severity of the response
          example: error
        imsx_description:
          type: string
        imsx_CodeMinor:
          type: object
          properties:
            imsx_codeMinorField:
              type: array
              items:
                type: object
                properties:
                  imsx_codeMinorFieldName:
                    type: string
                    default: TargetEndSystem
                    description: The field name for the minor code
                    example: TargetEndSystem
                  imsx_codeMinorFieldValue:
                    type: string
                    default: invaliddata
                    description: The field value for the minor code
                    example: invaliddata
                required:
                  - imsx_codeMinorFieldName
                  - imsx_codeMinorFieldValue
          required:
            - imsx_codeMinorField
        imsx_error_details:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
      required:
        - imsx_codeMajor
        - imsx_severity
        - imsx_description
        - imsx_CodeMinor
    TooManyRequestsResponse:
      type: object
      properties:
        imsx_codeMajor:
          type: string
          default: failure
          description: The major response code
          example: failure
        imsx_severity:
          type: string
          default: error
          description: The severity of the response
          example: error
        imsx_description:
          type: string
        imsx_CodeMinor:
          type: object
          properties:
            imsx_codeMinorField:
              type: array
              items:
                type: object
                properties:
                  imsx_codeMinorFieldName:
                    type: string
                    default: TargetEndSystem
                    description: The field name for the minor code
                    example: TargetEndSystem
                  imsx_codeMinorFieldValue:
                    type: string
                    default: server_busy
                    description: The field value for the minor code
                    example: server_busy
                required:
                  - imsx_codeMinorFieldName
                  - imsx_codeMinorFieldValue
          required:
            - imsx_codeMinorField
        imsx_error_details:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
      required:
        - imsx_codeMajor
        - imsx_severity
        - imsx_description
        - imsx_CodeMinor
    InternalServerErrorResponse:
      type: object
      properties:
        imsx_codeMajor:
          type: string
          default: failure
          description: The major response code
          example: failure
        imsx_severity:
          type: string
          default: error
          description: The severity of the response
          example: error
        imsx_description:
          type: string
        imsx_CodeMinor:
          type: object
          properties:
            imsx_codeMinorField:
              type: array
              items:
                type: object
                properties:
                  imsx_codeMinorFieldName:
                    type: string
                    default: TargetEndSystem
                    description: The field name for the minor code
                    example: TargetEndSystem
                  imsx_codeMinorFieldValue:
                    type: string
                    default: internal_server_error
                    description: The field value for the minor code
                    example: internal_server_error
                required:
                  - imsx_codeMinorFieldName
                  - imsx_codeMinorFieldValue
          required:
            - imsx_codeMinorField
        imsx_error_details:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
      required:
        - imsx_codeMajor
        - imsx_severity
        - imsx_description
        - imsx_CodeMinor
    SubjectEnum:
      type: string
      enum: *ref_5
    Org:
      type: object
      properties:
        sourcedId:
          type: string
        status:
          type: string
          enum: *ref_2
        dateLastModified:
          type: string
          format: date-time
        metadata:
          type:
            - object
            - 'null'
          additionalProperties: {}
        name:
          type: string
        type:
          type: string
          enum:
            - department
            - school
            - district
            - local
            - state
            - national
        identifier:
          type: string
        parent:
          type:
            - object
            - 'null'
          properties:
            href:
              type: string
              format: uri
            sourcedId:
              type: string
            type:
              type: string
          required:
            - href
            - sourcedId
            - type
        children:
          type:
            - array
            - 'null'
          items:
            type: object
            properties:
              href:
                type: string
                format: uri
              sourcedId:
                type: string
              type:
                type: string
            required:
              - href
              - sourcedId
              - type
          default: []
      required:
        - sourcedId
        - status
        - name
        - type
        - identifier
        - children
      description: Represents an organization.
