openapi: 3.0.3
info:
  title: ibl-data-manager
  version: 4.84.1-ai-plus
  description: API for iblai
paths:
  /api/ai-account/connected-services/callback/:
    get:
      operationId: ai_account_connected_services_callback_retrieve
      tags:
        - ai-account
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectedService'
          description: Callback for the OAuth flow
  /api/ai-account/connected-services/orgs/{org}/users/{user_id}/:
    get:
      operationId: ai_account_connected_services_orgs_users_list
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: provider
          schema:
            type: string
            enum:
              - google
          description: '* `google` - Google'
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: query
          name: service
          schema:
            type: string
            enum:
              - google_calendar
              - google_document
              - google_drive
              - google_slides
          description: |-
            * `google_drive` - Google Drive
            * `google_document` - Google Document
            * `google_slides` - Google Slides
            * `google_calendar` - Google Calendar
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-account
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConnectedService'
          description: ''
  /api/ai-account/connected-services/orgs/{org}/users/{user_id}/{id}/:
    get:
      operationId: ai_account_connected_services_orgs_users_retrieve
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this connected service.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-account
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectedService'
          description: ''
    delete:
      operationId: ai_account_connected_services_orgs_users_destroy
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this connected service.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-account
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-account/connected-services/orgs/{org}/users/{user_id}/{provider}/{service}/:
    get:
      operationId: ai_account_connected_services_orgs_users_retrieve_2
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: provider
          schema:
            type: string
          required: true
        - in: path
          name: service
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-account
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthStartResponse'
              examples:
                StartOAuthFlow:
                  value:
                    auth_url: https://accounts.google.com/o/oauth2/v2/auth
                  summary: Start OAuth flow
          description: Starts the OAuth flow for the given provider and service
  /api/ai-account/orgs/{org}/credential/:
    get:
      operationId: ai_account_orgs_credential_retrieve
      description: |-
        Retrieve LLM credentials for an organization.

        Query Parameters:
            name (optional): Filter results by LLM provider name

        Args:
            request: The HTTP request
            org: Organization key identifier

        Returns:
            Response: List of LLM credentials for the organization

        Raises:
            NotFound: When organization is not found or when no credentials match the filters
            ValidationError: When query parameters are invalid
      parameters:
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Filter credentials by provider name (e.g., 'openai', 'google')
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LLMCredentialResponse'
              examples:
                LLMCredentialsExample:
                  value:
                    - name: openai
                      value:
                        key: sk-xxxxxxxxxxxxxxxxxxxx
                      platform: main
                    - name: google
                      value:
                        type: service_account
                        project_id: project-id
                        private_key: |
                          -----BEGIN PRIVATE KEY-----
                          XXXX
                          -----END PRIVATE KEY-----
                        client_email: service-account@project.iam.gserviceaccount.com
                      platform: main
                      service_info:
                        id: 1
                        name: google
                        logo: google.png
                        display_name: Google
                  summary: LLM credentials example
          description: ''
    post:
      operationId: ai_account_orgs_credential_create
      description: |-
        Create a new LLM credential for an organization.

        Args:
            request: The HTTP request containing credential information
            org: Organization key identifier

        Returns:
            Response: Created LLM credential

        Raises:
            NotFound: When organization is not found
            ValidationError: When request data is invalid
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LLMCredentialRequest'
            examples:
              CreateLLMCredentialExample:
                value:
                  name: openai
                  value:
                    key: sk-xxxxxxxxxxxxxxxxxxxx
                  platform: main
                summary: Create LLM credential example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/LLMCredentialRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/LLMCredentialRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/LLMCredentialRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/LLMCredentialRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LLMCredentialResponse'
              examples:
                CreateLLMCredentialExample:
                  value:
                    name: openai
                    value:
                      key: sk-xxxxxxxxxxxxxxxxxxxx
                    platform: main
                  summary: Create LLM credential example
          description: ''
    patch:
      operationId: ai_account_orgs_credential_partial_update
      description: |-
        Update an existing LLM credential for an organization.

        Args:
            request: The HTTP request containing updated credential information
            org: Organization key identifier

        Returns:
            Response: Updated LLM credential

        Raises:
            NotFound: When organization or credential is not found
            ValidationError: When request data is invalid
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedLLMCredentialRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedLLMCredentialRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedLLMCredentialRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedLLMCredentialRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedLLMCredentialRequest'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LLMCredentialResponse'
          description: ''
    delete:
      operationId: ai_account_orgs_credential_destroy
      description: |-
        Delete an existing LLM credential for an organization.

        Args:
            request: The HTTP request containing credential information (must include 'name')
            org: Organization key identifier

        Returns:
            Response: 204

        Raises:
            NotFound: When organization or credential is not found
            ValidationError: When request data is invalid
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-account/orgs/{org}/credential/schema/:
    get:
      operationId: ai_account_orgs_credential_schema_retrieve
      description: |-
        Retrieve LLM credentials schemas.

        Query Parameters:
            name (optional): Filter results by LLM service name

        Args:
            request: The HTTP request
            org: Organization key identifier

        Returns:
            Response: List of integration credentials schema available.

        Raises:
            NotFound: When  no credentials match the filters
            ValidationError: When query parameters are invalid
      parameters:
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Filter credentials by provider name (e.g., 'openai', 'google')
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LLMCredentialSchema'
              examples:
                IntegrationCredentialsSchemaExample:
                  value:
                    - name: openai
                      schema:
                        key: string
                  summary: Integration credentials schema example
          description: ''
  /api/ai-account/orgs/{org}/integration-credential/:
    get:
      operationId: ai_account_orgs_integration_credential_retrieve
      description: |-
        Retrieve integration credentials for an organization.

        Query Parameters:
            name (optional): Filter results by integration service name

        Args:
            request: The HTTP request
            org: Organization key identifier

        Returns:
            Response: List of integration credentials for the organization

        Raises:
            NotFound: When organization is not found or when no credentials match the filters
            ValidationError: When query parameters are invalid
      parameters:
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Filter credentials by provider name (e.g., 'openai', 'google')
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegrationCredential'
              examples:
                IntegrationCredentialsExample:
                  value:
                    - name: google-drive
                      value:
                        type: service_account
                        project_id: project-id
                        private_key: |
                          -----BEGIN PRIVATE KEY-----
                          XXXX
                          -----END PRIVATE KEY-----
                        client_email: service-account@project.iam.gserviceaccount.com
                      platform: main
                      service_info:
                        id: 1
                        name: google-drive
                        logo: url.png
                        display_name: Google Drive
                  summary: Integration credentials example
          description: ''
    post:
      operationId: ai_account_orgs_integration_credential_create
      description: |-
        Create a new integration credential for an organization.

        Args:
            request: The HTTP request containing credential information
            org: Organization key identifier

        Returns:
            Response: Created integration credential

        Raises:
            NotFound: When organization is not found
            ValidationError: When request data is invalid
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialRequest'
            examples:
              CreateIntegrationCredentialExample:
                value:
                  name: google-drive
                  value:
                    type: service_account
                    project_id: project-id
                    private_key: |
                      -----BEGIN PRIVATE KEY-----
                      XXXX
                      -----END PRIVATE KEY-----
                    client_email: service-account@project.iam.gserviceaccount.com
                  platform: main
                  service_info:
                    id: 1
                    name: google-drive
                    logo: url.png
                    display_name: Google Drive
                summary: Create integration credential example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CredentialRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CredentialRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CredentialRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/CredentialRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegrationCredential'
              examples:
                CreateIntegrationCredentialExample:
                  value:
                    name: google-drive
                    value:
                      type: service_account
                      project_id: project-id
                      private_key: |
                        -----BEGIN PRIVATE KEY-----
                        XXXX
                        -----END PRIVATE KEY-----
                      client_email: service-account@project.iam.gserviceaccount.com
                    platform: main
                    service_info:
                      id: 1
                      name: google-drive
                      logo: url.png
                      display_name: Google Drive
                  summary: Create integration credential example
          description: ''
    patch:
      operationId: ai_account_orgs_integration_credential_partial_update
      description: |-
        Update an existing integration credential for an organization.

        Args:
            request: The HTTP request containing updated credential information
            org: Organization key identifier

        Returns:
            Response: Updated integration credential

        Raises:
            NotFound: When organization or credential is not found
            ValidationError: When request data is invalid
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedCredentialRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedCredentialRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedCredentialRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedCredentialRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedCredentialRequest'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegrationCredential'
          description: ''
    delete:
      operationId: ai_account_orgs_integration_credential_destroy
      description: |-
        Delete an existing integration credential for an organization.

        Args:
            request: The HTTP request containing credential information (must include 'name')
            org: Organization key identifier

        Returns:
            Response: 204

        Raises:
            NotFound: When organization or credential is not found
            ValidationError: When request data is invalid
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-account/orgs/{org}/integration-credential/schema/:
    get:
      operationId: ai_account_orgs_integration_credential_schema_retrieve
      description: |-
        Retrieve integration credentials schema for.

        Query Parameters:
            name (optional): Filter results by integration service name

        Args:
            request: The HTTP request
            org: Organization key identifier

        Returns:
            Response: List of integration credentials schema available.

        Raises:
            NotFound: When  no credentials match the filters
            ValidationError: When query parameters are invalid
      parameters:
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Filter credentials by provider name (e.g., 'openai', 'google')
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegrationCredentialSchema'
              examples:
                IntegrationCredentialsSchemaExample:
                  value:
                    - name: google-drive
                      schema:
                        type: string
                        project_id: string
                        private_key: string
                        client_email: string
                  summary: Integration credentials schema example
          description: ''
  /api/ai-account/orgs/{org}/llm-credential/:
    get:
      operationId: ai_account_orgs_llm_credential_retrieve
      description: |-
        Retrieve LLM credentials for an organization.

        Query Parameters:
            name (optional): Filter results by LLM provider name

        Args:
            request: The HTTP request
            org: Organization key identifier

        Returns:
            Response: List of LLM credentials for the organization

        Raises:
            NotFound: When organization is not found or when no credentials match the filters
            ValidationError: When query parameters are invalid
      parameters:
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Filter credentials by provider name (e.g., 'openai', 'google')
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LLMCredentialResponse'
              examples:
                LLMCredentialsExample:
                  value:
                    - name: openai
                      value:
                        key: sk-xxxxxxxxxxxxxxxxxxxx
                      platform: main
                    - name: google
                      value:
                        type: service_account
                        project_id: project-id
                        private_key: |
                          -----BEGIN PRIVATE KEY-----
                          XXXX
                          -----END PRIVATE KEY-----
                        client_email: service-account@project.iam.gserviceaccount.com
                      platform: main
                      service_info:
                        id: 1
                        name: google
                        logo: google.png
                        display_name: Google
                  summary: LLM credentials example
          description: ''
    post:
      operationId: ai_account_orgs_llm_credential_create
      description: |-
        Create a new LLM credential for an organization.

        Args:
            request: The HTTP request containing credential information
            org: Organization key identifier

        Returns:
            Response: Created LLM credential

        Raises:
            NotFound: When organization is not found
            ValidationError: When request data is invalid
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LLMCredentialRequest'
            examples:
              CreateLLMCredentialExample:
                value:
                  name: openai
                  value:
                    key: sk-xxxxxxxxxxxxxxxxxxxx
                  platform: main
                summary: Create LLM credential example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/LLMCredentialRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/LLMCredentialRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/LLMCredentialRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/LLMCredentialRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LLMCredentialResponse'
              examples:
                CreateLLMCredentialExample:
                  value:
                    name: openai
                    value:
                      key: sk-xxxxxxxxxxxxxxxxxxxx
                    platform: main
                  summary: Create LLM credential example
          description: ''
    patch:
      operationId: ai_account_orgs_llm_credential_partial_update
      description: |-
        Update an existing LLM credential for an organization.

        Args:
            request: The HTTP request containing updated credential information
            org: Organization key identifier

        Returns:
            Response: Updated LLM credential

        Raises:
            NotFound: When organization or credential is not found
            ValidationError: When request data is invalid
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedLLMCredentialRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedLLMCredentialRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedLLMCredentialRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedLLMCredentialRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedLLMCredentialRequest'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LLMCredentialResponse'
          description: ''
    delete:
      operationId: ai_account_orgs_llm_credential_destroy
      description: |-
        Delete an existing LLM credential for an organization.

        Args:
            request: The HTTP request containing credential information (must include 'name')
            org: Organization key identifier

        Returns:
            Response: 204

        Raises:
            NotFound: When organization or credential is not found
            ValidationError: When request data is invalid
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-account/orgs/{org}/masked-integration-credential/:
    get:
      operationId: ai_account_orgs_masked_integration_credential_list
      description: |-
        Retrieve masked integration credentials for an organization.

        Query Parameters:
            name (optional): Filter results by integration service name

        Args:
            request: The HTTP request
            org: Organization key identifier

        Returns:
            Response: List of integration credentials for the organization

        Raises:
            NotFound: When organization is not found or when no credentials match the filters
            ValidationError: When query parameters are invalid
      parameters:
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Filter credentials by provider name (e.g., 'openai', 'google')
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MaskedIntegrationCredential'
              examples:
                MaskedIntegrationCredentialsExample:
                  value:
                    - - name: google-drive
                        value:
                          key: key-content****
                        platform: main
                        service_info:
                          id: 1
                          name: google-drive
                          logo: url.png
                          display_name: Google Drive
                  summary: Masked Integration credentials example
          description: ''
  /api/ai-account/orgs/{org}/masked-llm-credential/:
    get:
      operationId: ai_account_orgs_masked_llm_credential_retrieve
      description: >-
        Retrieve LLM credentials for an organization with the value entries
        masked.


        Query Parameters:
            name (optional): Filter results by LLM provider name

        Args:
            request: The HTTP request
            org: Organization key identifier

        Returns:
            Response: List of LLM credentials for the organization

        Raises:
            NotFound: When organization is not found or when no credentials match the filters
            ValidationError: When query parameters are invalid
      parameters:
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Filter credentials by provider name (e.g., 'openai', 'google')
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaskedLLMCredential'
              examples:
                LLMCredentialsExample:
                  value:
                    - name: openai
                      value:
                        key: sk-xxxxxxxxxxxxxxxxxxxx
                      platform: main
                      service_info:
                        id: 1
                        name: openai
                        logo: openai.png
                        display_name: OpenAI
                    - name: google
                      value:
                        key: go-xxxxxxxxxxxxxxxxxxxx
                      platform: main
                      service_info:
                        id: 2
                        name: google
                        logo: google.png
                        display_name: Google
                  summary: LLM credentials example
          description: ''
  /api/ai-account/orgs/{org}/use-default-llm-key/:
    post:
      operationId: ai_account_orgs_use_default_llm_key_create
      description: |-
        Enable or disable the use of main LLM credentials for an organization.

        Request Body:
            enable (boolean): Set to true to enable main credentials
            disable (boolean): Set to true to disable main credentials

        Args:
            request: The HTTP request
            org: Organization key identifier

        Returns:
            Response: Confirmation message

        Raises:
            ValidationError: When neither enable nor disable is specified
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UseMainCreds'
            examples:
              EnableMainCredentialsExample:
                value:
                  enable: true
                  disable: false
                summary: Enable main credentials example
              DisableMainCredentialsExample:
                value:
                  enable: false
                  disable: true
                summary: Disable main credentials example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UseMainCreds'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UseMainCreds'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UseMainCreds'
          '*/*':
            schema:
              $ref: '#/components/schemas/UseMainCreds'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
              examples:
                EnableMainCredentialsResponse:
                  value:
                    message: Tenant is now using the main credentials
                  summary: Enable main credentials response
                DisableMainCredentialsResponse:
                  value:
                    message: Tenant is not using the main credentials
                  summary: Disable main credentials response
          description: ''
  /api/ai-account/orgs/{org}/use-free-trial/:
    post:
      operationId: ai_account_orgs_use_free_trial_create
      description: |-
        Enable, disable, or update free trial settings for an organization.

        Request Body:
            enable (boolean): Set to true to enable free trial
            disable (boolean): Set to true to disable free trial
            metadata (object, optional): Additional metadata for the free trial

        Args:
            request: The HTTP request
            org: Organization key identifier

        Returns:
            Response: Confirmation message
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-account
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-account/orgs/{org}/users/{user_id}/default-llm-key-usage:
    get:
      operationId: ai_account_orgs_users_default_llm_key_usage_retrieve
      description: |-
        Retrieve the status of main LLM credential usage for an organization.

        Args:
            request: The HTTP request
            org: Organization key identifier
            user_id: User identifier

        Returns:
            Response: Status of main LLM credential usage
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-account
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-account/orgs/{org}/users/{user_id}/free-trial:
    get:
      operationId: ai_account_orgs_users_free_trial_retrieve
      description: |-
        Retrieve the free trial status for an organization.

        Args:
            request: The HTTP request
            org: Organization key identifier

        Returns:
            Response: Free trial status (boolean)

        Raises:
            NotFound: When organization is not found
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-account
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  is_in_free_trial:
                    type: boolean
              examples:
                FreeTrialStatusExample:
                  value:
                    is_in_free_trial: true
                  summary: Free trial status example
          description: ''
  /api/ai-analytics/audience/orgs/{org}/active-users/over-time:
    get:
      operationId: ai_analytics_audience_orgs_active_users_over_time_retrieve
      description: >-
        Get active user counts over time.


        This endpoint provides daily counts of active users (users with known
        activity)

        over a specified time period.


        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)

        Returns:
            Daily active user counts over the specified time period, with change metrics
            compared to previous periods.

        Default time range is the last 7 days if no dates are specified.


        An active user is defined as a user with any activity within the past 30
        days.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/ai-analytics/audience/orgs/{org}/active-users/per-course:
    get:
      operationId: ai_analytics_audience_orgs_active_users_per_course_retrieve
      description: |-
        Get active user counts on a per-course basis.

        This endpoint provides counts of active users for each course within
        the specified date range.

        Query Parameters:
            start_date (str, optional): Start date for filtering (ISO format)
            end_date (str, optional): End date for filtering (ISO format)

        Returns:
            A list of courses with their active user counts.

        Default time range is the last 7 days if no dates are specified.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActiveUsersPerCourse'
          description: ''
  /api/ai-analytics/audience/orgs/{org}/active-users/users:
    get:
      operationId: ai_analytics_audience_orgs_active_users_users_retrieve
      description: |-
        Get a list of active users with activity metrics.

        This endpoint provides a paginated list of users who have had activity
        within the specified date range.

        Query Parameters:
            start_date (str, optional): Start date for filtering (ISO format)
            end_date (str, optional): End date for filtering (ISO format)
            course_id (str, optional): Filter by course ID
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page

        Returns:
            A paginated list of active users with their activity metrics.

        Default time range is the last 7 days if no dates are specified.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActiveUsersList'
          description: ''
  /api/ai-analytics/audience/orgs/{org}/enrollments/courses/{course_id}/over-time:
    get:
      operationId: ai_analytics_audience_orgs_enrollments_courses_over_time_retrieve
      description: |-
        Get enrollment or unenrollment counts over time.

        This endpoint provides daily counts of new enrollments or unenrollments
        over a specified time period.

        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)
            course_id (str, optional): Filter by course ID
            active (bool): Get enrollments when true, unenrollments when false

        Returns:
            Daily counts over the specified time period, with change metrics
            compared to previous periods.

        Default time range is the last 7 days if no dates are specified.
      parameters:
        - in: query
          name: active
          schema:
            enum:
              - 'y'
              - 'yes'
              - 'true'
              - 'True'
              - 'n'
              - 'no'
              - 'false'
              - 'False'
            type: string
            default: 'y'
            minLength: 1
          description: |-
            Any of `y`, `yes`, `true`. set to false or no for unenrollments 

            * `y` - y
            * `yes` - yes
            * `true` - true
            * `True` - True
            * `n` - n
            * `no` - no
            * `false` - false
            * `False` - False
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/ai-analytics/audience/orgs/{org}/enrollments/courses/{course_id}/users:
    get:
      operationId: ai_analytics_audience_orgs_enrollments_courses_users_retrieve
      description: |-
        List users enrolled in a specific course.

        This endpoint provides a list of users who are enrolled or unenrolled
        in a specified course.

        Query Parameters:
            course_id (str): The course ID to get enrollments for
            active (bool): Filter for active enrollments when true, inactive when false
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page

        Returns:
            A paginated list of users with:
            - Username
            - Full name
            - Email
            - Enrollment timestamp
      parameters:
        - in: query
          name: active
          schema:
            enum:
              - 'y'
              - 'yes'
              - 'true'
              - 'True'
              - 'n'
              - 'no'
              - 'false'
              - 'False'
            type: string
            default: 'y'
            minLength: 1
          description: |-
            Any of `y`, `yes`, `true`. set to false or no for unenrollments 

            * `y` - y
            * `yes` - yes
            * `true` - true
            * `True` - True
            * `n` - n
            * `no` - no
            * `false` - false
            * `False` - False
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrollmentsPerUser'
          description: ''
  /api/ai-analytics/audience/orgs/{org}/enrollments/over-time:
    get:
      operationId: ai_analytics_audience_orgs_enrollments_over_time_retrieve
      description: |-
        Get enrollment or unenrollment counts over time.

        This endpoint provides daily counts of new enrollments or unenrollments
        over a specified time period.

        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)
            course_id (str, optional): Filter by course ID
            active (bool): Get enrollments when true, unenrollments when false

        Returns:
            Daily counts over the specified time period, with change metrics
            compared to previous periods.

        Default time range is the last 7 days if no dates are specified.
      parameters:
        - in: query
          name: active
          schema:
            enum:
              - 'y'
              - 'yes'
              - 'true'
              - 'True'
              - 'n'
              - 'no'
              - 'false'
              - 'False'
            type: string
            default: 'y'
            minLength: 1
          description: |-
            Any of `y`, `yes`, `true`. set to false or no for unenrollments 

            * `y` - y
            * `yes` - yes
            * `true` - true
            * `True` - True
            * `n` - n
            * `no` - no
            * `false` - false
            * `False` - False
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/ai-analytics/audience/orgs/{org}/enrollments/per-course:
    get:
      operationId: ai_analytics_audience_orgs_enrollments_per_course_retrieve
      description: >-
        List enrollment statistics on a per-course basis.


        This endpoint provides enrollment counts for all courses, with options

        to filter for active or inactive enrollments and to include time-based
        data.


        Query Parameters:
            active (bool): Filter for active enrollments when true, inactive when false
            start_date (str, optional): Start date for time-based filtering (ISO format)
            end_date (str, optional): End date for time-based filtering (ISO format)
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page

        Returns:
            A paginated list of courses with their enrollment counts and percentages.
      parameters:
        - in: query
          name: active
          schema:
            enum:
              - 'y'
              - 'yes'
              - 'true'
              - 'True'
              - 'n'
              - 'no'
              - 'false'
              - 'False'
            type: string
            default: 'y'
            minLength: 1
          description: |-
            Any of `y`, `yes`, `true`. set to false or no for unenrollments 

            * `y` - y
            * `yes` - yes
            * `true` - true
            * `True` - True
            * `n` - n
            * `no` - no
            * `false` - false
            * `False` - False
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Enrollments'
          description: ''
  /api/ai-analytics/audience/orgs/{org}/registered-users/:
    get:
      operationId: ai_analytics_audience_orgs_registered_users_retrieve
      description: >-
        List all learners on the platform with aggregated metrics.


        This endpoint returns a paginated list of all learners with key metrics
        including:

        - Enrollment counts

        - Completion counts

        - Time spent on platform


        Query Parameters:
            page (int): Page number for pagination
            length (int): Number of items per page
            search (str): Filter learners by username, email, or name

        Returns:
            A paginated list of learners with their associated metrics.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: search
          schema:
            type: string
            minLength: 1
          description: Search string for learner
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerlearnerUserList'
          description: ''
  /api/ai-analytics/audience/orgs/{org}/registered-users/over-time:
    get:
      operationId: ai_analytics_audience_orgs_registered_users_over_time_retrieve
      description: |-
        Get registered user counts over time.

        This endpoint provides daily counts of new user registrations over a
        specified time period.

        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)

        Returns:
            Daily registration counts over the specified time period, with change metrics
            compared to previous periods.

        Default time range is the last 7 days if no dates are specified.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/ai-analytics/audience/orgs/{org}/registered-users/per-course:
    get:
      operationId: ai_analytics_audience_orgs_registered_users_per_course_retrieve
      description: >-
        List enrollment statistics on a per-course basis.


        This endpoint provides enrollment counts for all courses, with options

        to filter for active or inactive enrollments and to include time-based
        data.


        Query Parameters:
            active (bool): Filter for active enrollments when true, inactive when false
            start_date (str, optional): Start date for time-based filtering (ISO format)
            end_date (str, optional): End date for time-based filtering (ISO format)
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page

        Returns:
            A paginated list of courses with their enrollment counts and percentages.
      parameters:
        - in: query
          name: active
          schema:
            enum:
              - 'y'
              - 'yes'
              - 'true'
              - 'True'
              - 'n'
              - 'no'
              - 'false'
              - 'False'
            type: string
            default: 'y'
            minLength: 1
          description: |-
            Any of `y`, `yes`, `true`. set to false or no for unenrollments 

            * `y` - y
            * `yes` - yes
            * `true` - true
            * `True` - True
            * `n` - n
            * `no` - no
            * `false` - false
            * `False` - False
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Enrollments'
          description: ''
  /api/ai-analytics/costs/pertenant/:
    get:
      operationId: ai_analytics_costs_pertenant_list
      description: Retrieve paginated LLM usage costs aggregated by tenant.
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date-time
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            format: date-time
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CostPerTenant'
              examples:
                LLMCostsPerTenantResponse:
                  value:
                    - - platform_key: tenant1
                        total_cost: 5.75
                        model_costs:
                          - model: gpt-4
                            total_cost: 4.25
                          - model: gpt-3.5-turbo
                            total_cost: 1.5
                  summary: LLM Costs Per Tenant Response
          description: ''
        '400':
          description: Invalid parameters
  /api/ai-analytics/departments/orgs/{org}/:
    get:
      operationId: ai_analytics_departments_orgs_retrieve
      description: >-
        Get a list of departments with metrics and filtering options.


        This endpoint provides a paginated list of departments with aggregated
        metrics

        about learner performance, course completions, and skill acquisition.


        Query Parameters:
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page
            program (str, optional): Filter by program
            pathway (str, optional): Filter by pathway
            departments (list, optional): Filter by department ids
            department_id (str, optional): Filter by department id
            location (str, optional): Filter by location
            is_enrolled (bool, optional): Filter for departments with enrolled users
            start_date (date, optional): Filter by learner join date (start range)
            end_date (date, optional): Filter by learner join date (end range)

        Returns:
            A paginated list of departments with comprehensive metrics.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: departments
          schema:
            type: array
            items:
              type: string
          description: >-
            Departments search string. Single string or list of strings. e.g
            'sample_department' or `['department', 'another department']` 
        - in: query
          name: end_date
          schema:
            type: string
            format: date
          description: Filter by learners date_joined. Start date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: is_enrolled
          schema:
            type: boolean
            nullable: true
          description: Filter for users who have at least an enro;lment
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: query
          name: location
          schema:
            type: string
            minLength: 1
          description: Location search string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: pathway
          schema:
            type: string
            minLength: 1
          description: Pathway string
        - in: query
          name: program
          schema:
            type: string
            minLength: 1
          description: Program search string
        - in: query
          name: start_date
          schema:
            type: string
            format: date
          description: Filter by learners date_joined. Start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupList'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/activity:
    get:
      operationId: ai_analytics_engagement_orgs_activity_retrieve
      description: >-
        Get engagement metrics on a per-course basis.


        This endpoint provides a paginated list of courses with engagement
        metrics

        including activity counts, time spent, and interaction data.


        Query Parameters:
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page

        Returns:
            A paginated list of courses with their engagement metrics.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EngagementPerCourse'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/course_completion/over-time:
    get:
      operationId: ai_analytics_engagement_orgs_course_completion_over_time_retrieve
      description: >-
        Completion count per user per course across the platform


        Query Params

        1. start_date e.g 2020-10-01

        2. end_date e.g 2020-10-10


        Default result when no query param is added is last_7_days (today
        inclusive)
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/course_completion/per-course:
    get:
      operationId: ai_analytics_engagement_orgs_course_completion_per_course_retrieve
      description: |-
        List course completion metrics on a per-course basis.

        This endpoint provides a paginated table of courses with enrollment and
        completion statistics for each course.

        Returns:
            A paginated list of courses with:
            - Course identification (ID and name)
            - Enrollment count
            - Completion count
            - Average completion rate
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCompletionPerCourse'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/time/average:
    get:
      operationId: ai_analytics_engagement_orgs_courses_time_average_retrieve
      description: >-
        Average time spent in secs on a per-day basis


        Query Params

        1. start_date e.g 2020-10-01

        2. end_date e.g 2020-10-10

        3. course_id <optional>


        Default result when no query param is added is last_7_days (today
        inclusive)
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AverageOvertime'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/time/detail:
    get:
      operationId: ai_analytics_engagement_orgs_courses_time_detail_retrieve
      description: |-
        Time spent per course in secs in a tree like form

        Kwargs
        course_id e.g course-v1:Org+Course4+Run

        Query Params
        1. start_date <optional> e.g 2020-10-01
        2. end_date <optional> e.g 2020-10-10
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimeDetail'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/time/over-time:
    get:
      operationId: ai_analytics_engagement_orgs_courses_time_over_time_retrieve
      description: >-
        Time spent per course in secs on a per-day basis


        Query Params

        1. start_date e.g 2020-10-01

        2. end_date e.g 2020-10-10

        Kwargs

        3. course_id


        Default result when no query param is added is last_7_days (today
        inclusive)
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/time/users:
    get:
      operationId: ai_analytics_engagement_orgs_courses_time_users_retrieve
      description: |-
        Time spent by users in a course

        Query Params
        course_id  e.g course-v1:Org+Course4+Run
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimeSpentByUsersInCourse'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/time/users/{user_id}/detail:
    get:
      operationId: ai_analytics_engagement_orgs_courses_time_users_detail_retrieve
      description: |-
        Time spent within a course in ordered hierarchical format

        Kwargs
        1. course_id  e.g course-v1:Org+Course4+Run
        2. user_id e.g developer@ibleducation.com or dev123 (username|email)
        Query Params
        3. start_date <optional> e.g 2020-10-01
        4. end_date <optional> e.g 2020-10-10
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerLearnerTimeSpentInCourseTree'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/time/users/{user_id}/over-time:
    get:
      operationId: ai_analytics_engagement_orgs_courses_time_users_over_time_retrieve
      description: >-
        Time spent in secs on a per-day basis


        Query Params

        1. course_id <optional> e.g course-v1:Org+Course4+Run

        2. user_id <optional> e.g developer@ibleducation.com or dev123
        (username|email)

        3. start_date e.g 2020-10-01

        4. end_date e.g 2020-10-10


        Default result when no query param is added is last_7_days (today
        inclusive)
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/videos/:
    get:
      operationId: ai_analytics_engagement_orgs_courses_videos_retrieve
      description: >-
        Get video engagement metrics for a specific course.


        This endpoint provides detailed video engagement statistics for a single
        course,

        including view counts, completion rates, and time spent on videos.


        Query Parameters:
            course_id (str): The course ID to get video engagement data for

        Returns:
            Detailed video engagement metrics for the specified course.
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideosSpecificCourse'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/videos/over-time:
    get:
      operationId: ai_analytics_engagement_orgs_courses_videos_over_time_retrieve
      description: >-
        Get video watch counts over time.


        This endpoint provides daily counts of videos watched over a specified
        time period,

        with options to filter by course or user.


        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)
            course_id (str, optional): Filter by course ID
            user_id (str, optional): Filter by username or email

        Returns:
            Daily video watch counts over the specified time period.

        Default time range is the last 7 days if no dates are specified.


        Access Control:
            - Platform admins can access any video watch data
            - Learners can access their own video watch data
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/videos/summary:
    get:
      operationId: ai_analytics_engagement_orgs_courses_videos_summary_retrieve
      description: >-
        Get a summary of video watch statistics for a specific course.


        This endpoint provides a structured summary of video watch data for a
        course,

        organized in a tree-like format by course sections and subsections.


        Query Parameters:
            course_id (str): The course ID to get video summary for

        Returns:
            A hierarchical structure of video watch data for the course, including:
            - Section and subsection organization
            - Video identification and metadata
            - Watch counts and completion rates
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideosInCourseSummary'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/videos/users:
    get:
      operationId: ai_analytics_engagement_orgs_courses_videos_users_retrieve
      description: |-
        List of users' videos completed records for a specific course

        Kwargs
        course_id  e.g course-v1:Org+Course4+Run
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatchedVideosPerUser'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/time/average-perlearner-percourse:
    get:
      operationId: ai_analytics_engagement_orgs_time_average_perlearner_percourse_retrieve
      description: >-
        Average time spent by a learner in enrolled courses. Gives a rough
        estimate of whats the average time

        that would be spent by a learner in a course


        Query Params

        1. start_date e.g 2020-10-01

        2. end_date e.g 2020-10-10
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AverageOvertime'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/time/average-with-over-time:
    get:
      operationId: ai_analytics_engagement_orgs_time_average_with_over_time_retrieve
      description: >-
        Average time spent in secs on a per-day basis


        Query Params

        1. start_date e.g 2020-10-01

        2. end_date e.g 2020-10-10

        3. course_id <optional>


        Default result when no query param is added is last_7_days (today
        inclusive)
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AverageOvertime'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/time/over-time:
    get:
      operationId: ai_analytics_engagement_orgs_time_over_time_retrieve
      description: |-
        Get time spent on the platform over time.

        This endpoint provides daily time spent values (in seconds) across the
        platform over a specified time period.

        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)

        Returns:
            Daily time spent values over the specified time period, with change metrics
            compared to previous periods.

        Default time range is the last 7 days if no dates are specified.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/time/per-course:
    get:
      operationId: ai_analytics_engagement_orgs_time_per_course_retrieve
      description: |-
        Get time spent statistics on a per-course basis.

        This endpoint provides a paginated list of courses with the total time
        spent by users in each course.

        Query Parameters:
            start_date (str, optional): Start date for filtering (ISO format)
            end_date (str, optional): End date for filtering (ISO format)
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page

        Returns:
            A paginated list of courses with:
            - Course identification (ID and name)
            - Total time spent (in seconds)
            - Formatted time spent (human-readable)
            - Percentage of total platform time
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimeSpentPerCourse'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/videos/:
    get:
      operationId: ai_analytics_engagement_orgs_videos_retrieve
      description: >-
        Get video engagement metrics on a per-course basis.


        This endpoint provides a paginated list of courses with video engagement
        metrics

        including view counts, completion rates, and time spent on videos.


        Query Parameters:
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page

        Returns:
            A paginated list of courses with their video engagement metrics.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoEngagementPerCourse'
          description: ''
  /api/ai-analytics/engagement/orgs/{org}/videos/over-time:
    get:
      operationId: ai_analytics_engagement_orgs_videos_over_time_retrieve
      description: >-
        Get video watch counts over time.


        This endpoint provides daily counts of videos watched over a specified
        time period,

        with options to filter by course or user.


        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)
            course_id (str, optional): Filter by course ID
            user_id (str, optional): Filter by username or email

        Returns:
            Daily video watch counts over the specified time period.

        Default time range is the last 7 days if no dates are specified.


        Access Control:
            - Platform admins can access any video watch data
            - Learners can access their own video watch data
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/ai-analytics/orgs/{org}/users/{user_id}/average-messages-per-session/:
    get:
      operationId: ai_analytics_orgs_users_average_messages_per_session_list
      description: >-
        Retrieve average message counts per session over time.


        This endpoint returns data on the average number of messages exchanged
        in each

        conversation session within a specified date range, with options for
        filtering

        by mentor and aggregating by different time periods (hourly, daily,
        weekly).


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: Time series of average message counts and session totals.

        Raises:
            NotFound: If the specified organization does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD) - required.
            end_date (str): End date for filtering (YYYY-MM-DD) - required.
            mentor_id (str): Filter by mentor unique ID.
            aggregation (str): Time aggregation level (hourly, daily, weekly) - default: daily.
      parameters:
        - in: query
          name: aggregation
          schema:
            type: string
            enum:
              - daily
              - hourly
              - weekly
            default: daily
          description: Time aggregation level (hourly, daily, weekly)
        - in: query
          name: end_date
          schema:
            type: string
          description: End date for filtering (YYYY-MM-DD)
          required: true
        - in: query
          name: group_by
          schema:
            type: string
            default: day
            minLength: 1
        - in: query
          name: mentor_id
          schema:
            type: string
          description: Filter by mentor unique ID
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
          description: Start date for filtering (YYYY-MM-DD)
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MessageStatistics'
              examples:
                AverageMessagesPerSessionResponse:
                  value:
                    - - time: '2023-06-01T00:00:00Z'
                        avg_messages: 12
                        total_sessions: 35
                      - time: '2023-06-02T00:00:00Z'
                        avg_messages: 14
                        total_sessions: 28
                      - time: '2023-06-03T00:00:00Z'
                        avg_messages: 11
                        total_sessions: 42
                  summary: Average Messages Per Session Response
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/chat-history/:
    get:
      operationId: ai_analytics_orgs_users_chat_history_list
      description: |-
        API viewset for retrieving and filtering chat message history.

        This viewset provides endpoints for retrieving chat message history
        within an organization, with extensive filtering options by date range,
        user, topic, mentor, and sentiment.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: filter_user_id
          schema:
            type: string
            minLength: 1
        - in: query
          name: mentor
          schema:
            type: string
            format: uuid
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: sentiment
          schema:
            type: string
            minLength: 1
        - in: query
          name: start_date
          schema:
            type: string
            format: date
        - in: query
          name: topics
          schema:
            type: string
            minLength: 1
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedConversationsList'
          description: ''
    post:
      operationId: ai_analytics_orgs_users_chat_history_create
      description: |-
        API viewset for retrieving and filtering chat message history.

        This viewset provides endpoints for retrieving chat message history
        within an organization, with extensive filtering options by date range,
        user, topic, mentor, and sentiment.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: filter_user_id
          schema:
            type: string
            minLength: 1
        - in: query
          name: mentor
          schema:
            type: string
            format: uuid
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: sentiment
          schema:
            type: string
            minLength: 1
        - in: query
          name: start_date
          schema:
            type: string
            format: date
        - in: query
          name: topics
          schema:
            type: string
            minLength: 1
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Conversations'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Conversations'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Conversations'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Conversations'
          '*/*':
            schema:
              $ref: '#/components/schemas/Conversations'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conversations'
          description: ''
  /api/ai-analytics/orgs/{org}/users/{user_id}/chat-history-filter/:
    get:
      operationId: ai_analytics_orgs_users_chat_history_filter_retrieve
      description: >-
        Retrieve filter options for chat message history.


        This endpoint returns data on available filter options for the chat
        message

        history endpoint, including topics, date ranges (weekly or monthly),

        sentiments, and users who have chat history.


        Args:
            request: The HTTP request containing query parameters.
            org: Organization key identifier.

        Returns:
            Response: Available filter options for chat message history.

        Raises:
            NotFound: If the specified organization does not exist.

        Query Parameters:
            monthly_range (bool): Whether to return monthly or weekly date ranges.
            mentor_id (str): Filter users by those who have chatted with a specific mentor.
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: mentor_id
          schema:
            type: string
            format: uuid
        - in: query
          name: monthly_range
          schema:
            type: boolean
            default: false
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            format: date
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatHistoryFilterData'
              examples:
                ChatMessageHistoryFilterOptionsResponse:
                  value:
                    topics:
                      - id: 1
                        name: Machine Learning
                      - id: 2
                        name: Data Science
                    date_ranges:
                      - start_date: '2023-06-01'
                        end_date: '2023-06-30'
                      - start_date: '2023-07-01'
                        end_date: '2023-07-31'
                    setiment:
                      - positive
                      - negative
                      - neutral
                    users:
                      - username: johndoe
                        email: john@example.com
                      - username: janesmith
                        email: jane@example.com
                  summary: Chat Message History Filter Options Response
          description: ''
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/chat-history/{id}/:
    get:
      operationId: ai_analytics_orgs_users_chat_history_retrieve
      description: |-
        API viewset for retrieving and filtering chat message history.

        This viewset provides endpoints for retrieving chat message history
        within an organization, with extensive filtering options by date range,
        user, topic, mentor, and sentiment.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: filter_user_id
          schema:
            type: string
            minLength: 1
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: query
          name: mentor
          schema:
            type: string
            format: uuid
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: sentiment
          schema:
            type: string
            minLength: 1
        - in: query
          name: start_date
          schema:
            type: string
            format: date
        - in: query
          name: topics
          schema:
            type: string
            minLength: 1
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conversations'
          description: ''
    put:
      operationId: ai_analytics_orgs_users_chat_history_update
      description: |-
        API viewset for retrieving and filtering chat message history.

        This viewset provides endpoints for retrieving chat message history
        within an organization, with extensive filtering options by date range,
        user, topic, mentor, and sentiment.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: filter_user_id
          schema:
            type: string
            minLength: 1
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: query
          name: mentor
          schema:
            type: string
            format: uuid
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: sentiment
          schema:
            type: string
            minLength: 1
        - in: query
          name: start_date
          schema:
            type: string
            format: date
        - in: query
          name: topics
          schema:
            type: string
            minLength: 1
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Conversations'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Conversations'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Conversations'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Conversations'
          '*/*':
            schema:
              $ref: '#/components/schemas/Conversations'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conversations'
          description: ''
    patch:
      operationId: ai_analytics_orgs_users_chat_history_partial_update
      description: |-
        API viewset for retrieving and filtering chat message history.

        This viewset provides endpoints for retrieving chat message history
        within an organization, with extensive filtering options by date range,
        user, topic, mentor, and sentiment.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: filter_user_id
          schema:
            type: string
            minLength: 1
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: query
          name: mentor
          schema:
            type: string
            format: uuid
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: sentiment
          schema:
            type: string
            minLength: 1
        - in: query
          name: start_date
          schema:
            type: string
            format: date
        - in: query
          name: topics
          schema:
            type: string
            minLength: 1
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedConversations'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedConversations'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedConversations'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedConversations'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedConversations'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conversations'
          description: ''
    delete:
      operationId: ai_analytics_orgs_users_chat_history_destroy
      description: |-
        API viewset for retrieving and filtering chat message history.

        This viewset provides endpoints for retrieving chat message history
        within an organization, with extensive filtering options by date range,
        user, topic, mentor, and sentiment.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: filter_user_id
          schema:
            type: string
            minLength: 1
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: query
          name: mentor
          schema:
            type: string
            format: uuid
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: sentiment
          schema:
            type: string
            minLength: 1
        - in: query
          name: start_date
          schema:
            type: string
            format: date
        - in: query
          name: topics
          schema:
            type: string
            minLength: 1
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-analytics/orgs/{org}/users/{user_id}/conversation/:
    get:
      operationId: ai_analytics_orgs_users_conversation_list
      description: >-
        Retrieve conversation volume data over time.


        This endpoint returns data on the number of conversations that occurred

        within a specified date range, with options for different time
        aggregations

        (hourly, daily, weekly). Results can be filtered by mentor.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.
            user_id: User identifier (not used in the implementation).

        Returns:
            Response: Time series data of conversation counts.

        Raises:
            NotFound: If the specified organization does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD) - required.
            end_date (str): End date for filtering (YYYY-MM-DD) - required.
            mentor_id (str): Filter by mentor unique ID.
            aggregation (str): Time aggregation level (hourly, daily, weekly) - default: daily.
      parameters:
        - in: query
          name: aggregation
          schema:
            type: string
            enum:
              - daily
              - hourly
              - weekly
            default: daily
          description: Time aggregation level (hourly, daily, weekly)
        - in: query
          name: end_date
          schema:
            type: string
          description: End date for filtering (YYYY-MM-DD)
          required: true
        - in: query
          name: mentor_id
          schema:
            type: string
          description: Filter by mentor unique ID
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
          description: Start date for filtering (YYYY-MM-DD)
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConversationVolume'
              examples:
                ConversationVolumeResponse(Daily):
                  value:
                    - - date: '2023-06-01T00:00:00Z'
                        conversation_count: 42
                      - date: '2023-06-02T00:00:00Z'
                        conversation_count: 38
                      - date: '2023-06-03T00:00:00Z'
                        conversation_count: 45
                  summary: Conversation Volume Response (Daily)
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/conversation-summary/:
    get:
      operationId: ai_analytics_orgs_users_conversation_summary_retrieve
      description: >-
        Retrieve a summary of conversation metrics.


        This endpoint returns aggregated metrics about conversations within an
        organization,

        including:

        - Total number of conversations

        - Total number of human messages

        - Total number of AI messages


        Results can be filtered by mentor.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: Summary of conversation metrics.

        Raises:
            NotFound: If the specified organization does not exist.

        Query Parameters:
            mentor_id (str): Filter by mentor unique ID.
      parameters:
        - in: query
          name: group_by
          schema:
            type: string
            default: day
            minLength: 1
        - in: query
          name: mentor_id
          schema:
            type: string
          description: Filter by mentor unique ID
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationSummary'
              examples:
                ConversationSummaryResponse:
                  value:
                    total_conversations: 450
                    total_human_messages: 2250
                    total_ai_messages: 2450
                  summary: Conversation Summary Response
          description: ''
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/costs/model/:
    get:
      operationId: ai_analytics_orgs_users_costs_model_retrieve
      description: |-
        Retrieve the  model costs for a tenant

        Filter parameters for period are start_date and enddate

        Accessible to tenant Admins only.
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date-time
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            format: date-time
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelCost'
          description: ''
  /api/ai-analytics/orgs/{org}/users/{user_id}/costs/permentor/:
    get:
      operationId: ai_analytics_orgs_users_costs_permentor_retrieve
      description: >-
        Retrieve LLM usage costs aggregated by mentor.


        This endpoint returns data on the total cost of LLM usage for each
        mentor

        within a specified date range, with pagination support. The costs are

        calculated by summing the costs of all observations associated with

        traces from the mentor's sessions.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: Paginated list of mentors with their total LLM usage costs.

        Raises:
            NotFound: If the specified organization does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD) - required.
            end_date (str): End date for filtering (YYYY-MM-DD) - required.
            limit (int): Number of results per page - default: 5.
            offset (int): Offset for pagination - default: 0.
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date-time
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            format: date-time
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantMentorTraces'
              examples:
                LLMTracesCostPerMentorResponse:
                  value:
                    count: 15
                    next: >-
                      https://api.example.com/analytics/llm-traces/cost/mentors/?limit=5&offset=5
                    previous: null
                    results:
                      - mentor_name: AI Mentor
                        mentor_unique_id: ai-mentor-123
                        total_cost: 2.35
                      - mentor_name: Data Science Mentor
                        mentor_unique_id: data-science-456
                        total_cost: 1.85
                  summary: LLM Traces Cost Per Mentor Response
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/costs/peruser/:
    get:
      operationId: ai_analytics_orgs_users_costs_peruser_retrieve
      description: |-
        Retrieve LLM usage costs aggregated by user.

        This endpoint returns data on the total cost of LLM usage for each user
        within a specified date range, with pagination support. The costs are
        calculated by summing the costs of all observations associated with
        traces from the user's sessions.

        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: Paginated list of users with their total LLM usage costs.

        Raises:
            NotFound: If the specified organization does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD) - required.
            end_date (str): End date for filtering (YYYY-MM-DD) - required.
            limit (int): Number of results per page - default: 10.
            offset (int): Offset for pagination - default: 0.
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date-time
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            format: date-time
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LLMTracesListResponse'
              examples:
                LLMTracesCostPerUserResponse:
                  value:
                    count: 25
                    next: >-
                      https://api.example.com/analytics/llm-traces/cost/users/?limit=10&offset=10
                    previous: null
                    results:
                      - username: johndoe
                        total_cost: 0.85
                      - username: janesmith
                        total_cost: 0.72
                  summary: LLM Traces Cost Per User Response
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/mentor-detail/:
    get:
      operationId: ai_analytics_orgs_users_mentor_detail_retrieve
      description: >-
        Retrieve summary statistics about mentors.


        This endpoint returns aggregated statistics about mentors within an
        organization,

        including total mentors, active mentors (mentors with at least one
        session),

        questions answered, and ratings.


        Args:
            request: The HTTP request.
            org: Organization key identifier.

        Returns:
            Response: Summary statistics about mentors.

        Raises:
            NotFound: If the specified organization does not exist.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorDetailAnalytics'
              examples:
                MentorSummaryResponse:
                  value:
                    total_mentors: 25
                    active_mentors: 18
                    total_questions_answered: 0
                    total_ratings: 0
                  summary: Mentor Summary Response
          description: ''
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/mentor-summary/:
    get:
      operationId: ai_analytics_orgs_users_mentor_summary_retrieve
      description: >-
        Retrieve summary statistics about mentors.


        This endpoint returns aggregated statistics about mentors within an
        organization,

        including total mentors, active mentors (mentors with at least one
        session),

        questions answered, and ratings.


        Args:
            request: The HTTP request.
            org: Organization key identifier.

        Returns:
            Response: Summary statistics about mentors.

        Raises:
            NotFound: If the specified organization does not exist.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorDetailAnalytics'
              examples:
                MentorSummaryResponse:
                  value:
                    total_mentors: 25
                    active_mentors: 18
                    total_questions_answered: 0
                    total_ratings: 0
                  summary: Mentor Summary Response
          description: ''
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/mentors/{mentor_unique_id}/cost/:
    get:
      operationId: ai_analytics_orgs_users_mentors_cost_retrieve
      description: >-
        Retrieve LLM usage costs for a specific mentor.


        This endpoint returns data on the total cost of LLM usage for a specific
        mentor

        within a specified date range. The cost is calculated by summing the
        costs

        of all observations associated with traces from the tenant's sessions.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.
            mentor_unique_id: User key identifier.

        Returns:
            Response: Total LLM usage cost for the specified tenant.

        Raises:
            NotFound: If the specified organization does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD) - required.
            end_date (str): End date for filtering (YYYY-MM-DD) - required.
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date-time
          required: true
        - in: path
          name: mentor_unique_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            format: date-time
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cost'
              examples:
                LLMTenantCostResponse:
                  value:
                    total_cost: 5.75
                  summary: LLM Tenant Cost Response
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/most-discussed-topics/:
    get:
      operationId: ai_analytics_orgs_users_most_discussed_topics_list
      description: >-
        Retrieve the most discussed topics over time.


        This endpoint returns data on the frequency of topics discussed in
        conversations

        within a specified date range, with options for filtering by mentor and

        aggregating by different time periods (hourly, daily, weekly).


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: List of topics with their conversation counts, ordered by frequency.

        Raises:
            NotFound: If the specified organization does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD) - required.
            end_date (str): End date for filtering (YYYY-MM-DD) - required.
            mentor_id (str): Filter by mentor unique ID.
            aggregation (str): Time aggregation level (hourly, daily, weekly) - default: daily.
      parameters:
        - in: query
          name: aggregation
          schema:
            type: string
            enum:
              - daily
              - hourly
              - weekly
            default: daily
          description: Time aggregation level (hourly, daily, weekly)
        - in: query
          name: end_date
          schema:
            type: string
          description: End date for filtering (YYYY-MM-DD)
          required: true
        - in: query
          name: group_by
          schema:
            type: string
            default: day
            minLength: 1
        - in: query
          name: mentor_id
          schema:
            type: string
          description: Filter by mentor unique ID
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
          description: Start date for filtering (YYYY-MM-DD)
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TopicRecord'
              examples:
                MostDiscussedTopicsResponse:
                  value:
                    - - topic_name: Machine Learning
                        conversation_count: 85
                      - topic_name: Data Science
                        conversation_count: 72
                      - topic_name: Python Programming
                        conversation_count: 65
                  summary: Most Discussed Topics Response
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/observations/:
    get:
      operationId: ai_analytics_orgs_users_observations_list
      description: >-
        Viewset for retrieving and listing Langfuse observations.


        This viewset provides read-only access to Langfuse observations data for
        platform admins.

        Observations represent detailed tracking of AI model interactions and
        responses.


        Permissions:
            - Restricted to platform administrators only
      parameters:
        - name: limit
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: offset
          required: false
          in: query
          description: The initial index from which to return the results.
          schema:
            type: integer
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedObservationList'
          description: ''
  /api/ai-analytics/orgs/{org}/users/{user_id}/observations/{id}/:
    get:
      operationId: ai_analytics_orgs_users_observations_retrieve
      description: >-
        Viewset for retrieving and listing Langfuse observations.


        This viewset provides read-only access to Langfuse observations data for
        platform admins.

        Observations represent detailed tracking of AI model interactions and
        responses.


        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Observation'
          description: ''
  /api/ai-analytics/orgs/{org}/users/{user_id}/overview-summary/:
    get:
      operationId: ai_analytics_orgs_users_overview_summary_retrieve
      description: |-
        Retrieve an overview of key analytics metrics.

        This endpoint returns a comprehensive overview of key analytics metrics
        for an organization, including:
        - Conversation volume: Total sessions and month-over-month change
        - Users: Total unique users and month-over-month change
        - Topics: Total unique topics and month-over-month change
        - User ratings: Total ratings and month-over-month change

        Results can be filtered by mentor.

        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.
            user_id: User identifier (not used in the implementation).

        Returns:
            Response: Overview of key analytics metrics with month-over-month changes.

        Raises:
            NotFound: If the specified organization does not exist.

        Query Parameters:
            mentor_id (str): Filter analytics by mentor unique ID.
      parameters:
        - in: query
          name: group_by
          schema:
            type: string
            default: day
            minLength: 1
        - in: query
          name: mentor_id
          schema:
            type: string
          description: Filter analytics by mentor unique ID
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsOverview'
              examples:
                AnalyticsOverviewResponse:
                  value:
                    conversation_volume:
                      total: 450
                      change: 12.5
                    users:
                      total: 120
                      change: 8.3
                    topics:
                      total: 35
                      change: 5.2
                    user_rating:
                      total: 280
                      change: 15.7
                  summary: Analytics Overview Response
          description: ''
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/rating-summary/:
    get:
      operationId: ai_analytics_orgs_users_rating_summary_list
      description: |-
        Retrieve user rating metrics over time.

        This endpoint returns data on the number of user ratings submitted
        within a specified date range, aggregated by day or hour.

        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: Time series of rating counts aggregated by day or hour.

        Raises:
            NotFound: If the specified organization does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD) - required.
            end_date (str): End date for filtering (YYYY-MM-DD) - required.
            group_by (str): Aggregation level (day or hour) - default: day.
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
          description: End date for filtering (YYYY-MM-DD)
          required: true
        - in: query
          name: group_by
          schema:
            type: string
            enum:
              - day
              - hour
            default: day
          description: Aggregation level (day or hour)
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
          description: Start date for filtering (YYYY-MM-DD)
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RatingRecord'
              examples:
                UserRatingAnalyticsResponse(Daily):
                  value:
                    - - time: '2023-06-01T00:00:00Z'
                        total_ratings: 15
                      - time: '2023-06-02T00:00:00Z'
                        total_ratings: 12
                      - time: '2023-06-03T00:00:00Z'
                        total_ratings: 18
                  summary: User Rating Analytics Response (Daily)
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/registered-users-trend/:
    get:
      operationId: ai_analytics_orgs_users_registered_users_trend_list
      description: >-
        Retrieve trends of registered users over time.


        This endpoint returns data on the number of new user registrations

        within a specified date range, with options for different time
        aggregations

        (hourly, daily, weekly, monthly). The data is backfilled to ensure

        continuous time series even for periods with zero registrations.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: Time series of user registration counts.

        Raises:
            NotFound: If the specified organization does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD) - required.
            end_date (str): End date for filtering (YYYY-MM-DD) - required.
            aggregation (str): Time aggregation level (hourly, daily, weekly, monthly) - default: daily.
      parameters:
        - in: query
          name: aggregation
          schema:
            type: string
            enum:
              - daily
              - hourly
              - monthly
              - weekly
            default: daily
          description: Time aggregation level (hourly, daily, weekly, monthly)
        - in: query
          name: end_date
          schema:
            type: string
          description: End date for filtering (YYYY-MM-DD)
          required: true
        - in: query
          name: group_by
          schema:
            type: string
            default: day
            minLength: 1
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
          description: Start date for filtering (YYYY-MM-DD)
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TrendEntry'
              examples:
                RegisteredUsersTrendResponse(Daily):
                  value:
                    - - interval: '2023-06-01T00:00:00Z'
                        count: 15
                      - interval: '2023-06-02T00:00:00Z'
                        count: 12
                      - interval: '2023-06-03T00:00:00Z'
                        count: 18
                  summary: Registered Users Trend Response (Daily)
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/sentiment-count/:
    get:
      operationId: ai_analytics_orgs_users_sentiment_count_list
      description: |-
        Retrieve user sentiment counts over time.

        This endpoint returns data on the number of user sentiment entries
        within a specified time period, aggregated by date.

        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.
            user_id: User identifier.

        Returns:
            Response: Time series data of sentiment counts.

        Raises:
            NotFound: If the specified organization does not exist.
            ValidationError: If the provided query parameters are invalid.

        Query Parameters:
            period (str): Time period filter (today, yesterday, 7d, 30d, 90d) - default: 7d.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: period
          schema:
            type: string
            default: 7d
            minLength: 1
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserSentimentCountView'
              examples:
                UserSentimentCountResponse:
                  value:
                    - - date: '2023-06-01T00:00:00Z'
                        conversation_count: 25
                      - date: '2023-06-02T00:00:00Z'
                        conversation_count: 18
                      - date: '2023-06-03T00:00:00Z'
                        conversation_count: 22
                  summary: User Sentiment Count Response
          description: ''
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/tenant-cost/:
    get:
      operationId: ai_analytics_orgs_users_tenant_cost_retrieve
      description: >-
        Retrieve LLM usage costs for a specific tenant.


        This endpoint returns data on the total cost of LLM usage for a specific
        tenant

        within a specified date range. The cost is calculated by summing the
        costs

        of all observations associated with traces from the tenant's sessions.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: Total LLM usage cost for the specified tenant.

        Raises:
            NotFound: If the specified organization does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD) - required.
            end_date (str): End date for filtering (YYYY-MM-DD) - required.
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date-time
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            format: date-time
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cost'
              examples:
                LLMTenantCostResponse:
                  value:
                    total_cost: 5.75
                  summary: LLM Tenant Cost Response
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/top-students-by-chat-messages/:
    get:
      operationId: ai_analytics_orgs_users_top_students_by_chat_messages_list
      description: >-
        Retrieve the most engaged students based on chat message count.


        This endpoint returns data on the top 20 students with the highest
        number of

        chat messages, with optional filtering by mentor and date range.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.
            user_id: User identifier (not used in the implementation).

        Returns:
            Response: List of top students with their chat message counts.

        Raises:
            NotFound: If the specified organization does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            mentor_id (str): Filter by mentor unique ID.
            start_date (str): Start date for filtering (YYYY-MM-DD).
            end_date (str): End date for filtering (YYYY-MM-DD).
      parameters:
        - in: query
          name: group_by
          schema:
            type: string
            default: day
            minLength: 1
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/StudentChatMessage'
              examples:
                TopStudentsByChatMessagesResponse:
                  value:
                    - - username: johndoe
                        chat_message_count: 120
                      - username: janesmith
                        chat_message_count: 95
                      - username: bobwilson
                        chat_message_count: 82
                  summary: Top Students By Chat Messages Response
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/topic-overview/:
    get:
      operationId: ai_analytics_orgs_users_topic_overview_retrieve
      description: >-
        Retrieve aggregated topic statistics.


        This endpoint returns statistical information about topics within an
        organization,

        including total topics, new topics, and percentage changes compared to
        the

        previous month. Results can be filtered by mentor.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: Statistical information about topics.

        Raises:
            NotFound: If the specified organization or mentor does not exist.

        Query Parameters:
            mentor_id (str): Filter statistics by mentor unique ID.
      parameters:
        - in: query
          name: mentor_id
          schema:
            type: string
          description: Filter statistics by mentor unique ID
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopicStatisticsResponse'
              examples:
                TopicStatisticsResponse:
                  value:
                    total_topics: 150
                    total_topics_change_percentage: 12.5
                    new_topics: 35
                    new_topics_change_percentage: 8.3
                  summary: Topic Statistics Response
          description: ''
        '404':
          description: Organization or mentor not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/topic-statistics/:
    get:
      operationId: ai_analytics_orgs_users_topic_statistics_retrieve
      description: |-
        Retrieve paginated statistics about topics.

        This endpoint returns detailed statistics about topics, including:
        - Number of conversations related to each topic
        - Total message count for each topic
        - Average sentiment of conversations about each topic
        - Average user rating for conversations about each topic

        Results can be filtered by mentor and date range, and are paginated.

        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: Paginated list of topic statistics.

        Raises:
            NotFound: If the specified organization or mentor does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD).
            end_date (str): End date for filtering (YYYY-MM-DD).
            mentor_id (str): Filter by mentor unique ID.
            page (int): Page number for pagination - default: 1.
            page_size (int): Number of results per page - default: 20.
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
          description: End date for filtering (YYYY-MM-DD)
        - in: query
          name: group_by
          schema:
            type: string
            default: day
            minLength: 1
        - in: query
          name: mentor_id
          schema:
            type: string
          description: Filter by mentor unique ID
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
            default: 1
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
            default: 20
          description: Number of results per page
        - in: query
          name: start_date
          schema:
            type: string
          description: Start date for filtering (YYYY-MM-DD)
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTopicStatisticsResponse'
              examples:
                PaginatedTopicStatisticsResponse:
                  value:
                    count: 35
                    next: https://api.example.com/analytics/topics/?page=2
                    previous: null
                    results:
                      - name: Machine Learning
                        conversations: 85
                        messages: 1250
                        avg_user_rating: positive
                      - name: Data Science
                        conversations: 72
                        messages: 980
                        avg_user_rating: positive
                  summary: Paginated Topic Statistics Response
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization or mentor not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/topics/summary/:
    get:
      operationId: ai_analytics_orgs_users_topics_summary_list
      description: >-
        Retrieve a summary of the most frequent topics.


        This endpoint returns a summary of the top 10 topics discussed in chat
        sessions,

        ordered by conversation count. Results can be filtered by mentor and
        date range.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: A list of the top 10 topics with their conversation counts.

        Raises:
            NotFound: If the specified organization does not exist.
            BadRequest: If the provided date format is invalid.

        Query Parameters:
            mentor_id (str): Filter by mentor unique ID.
            start_date (str): Start date for filtering (YYYY-MM-DD).
            end_date (str): End date for filtering (YYYY-MM-DD).
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            format: date
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TopicSummaryView'
              examples:
                TopicSummaryResponse:
                  value:
                    - - name: Machine Learning
                        conversation_count: 120
                      - name: Data Science
                        conversation_count: 95
                      - name: Python Programming
                        conversation_count: 82
                  summary: Topic Summary Response
          description: ''
        '400':
          description: Invalid date format
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/total-users-by-mentor/:
    get:
      operationId: ai_analytics_orgs_users_total_users_by_mentor_list
      description: >-
        Retrieve the total number of users interacting with mentors over time.


        This endpoint returns data on the number of unique users who interacted
        with

        mentors each day or hour within a specified date range, with optional

        filtering by specific mentor. If no date range is provided, the last 30
        days

        are used by default.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: Time series of unique user counts.

        Raises:
            NotFound: If the specified organization or mentor does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD) - defaults to 30 days ago.
            end_date (str): End date for filtering (YYYY-MM-DD) - defaults to today.
            aggregation (str): Time aggregation level (hourly, daily) - default: daily.
            mentor_id (str): Filter by mentor unique ID.
      parameters:
        - in: query
          name: aggregation
          schema:
            type: string
            enum:
              - daily
              - hourly
            default: daily
          description: Time aggregation level (hourly, daily)
        - in: query
          name: end_date
          schema:
            type: string
          description: End date for filtering (YYYY-MM-DD)
        - in: query
          name: group_by
          schema:
            type: string
            default: day
            minLength: 1
        - in: query
          name: mentor_id
          schema:
            type: string
          description: Filter by mentor unique ID
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
          description: Start date for filtering (YYYY-MM-DD)
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserChatByPeriod'
              examples:
                TotalUsersByMentorResponse(Daily):
                  value:
                    - - period: '2023-06-01T00:00:00Z'
                        user_count: 42
                      - period: '2023-06-02T00:00:00Z'
                        user_count: 38
                      - period: '2023-06-03T00:00:00Z'
                        user_count: 45
                  summary: Total Users By Mentor Response (Daily)
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization or mentor not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/traces/:
    get:
      operationId: ai_analytics_orgs_users_traces_list
      description: >-
        Viewset for retrieving and listing Langfuse traces.


        This viewset provides read-only access to Langfuse traces data for
        platform admins.

        Traces represent high-level tracking of user interactions and AI
        responses.


        Permissions:
            - Restricted to platform administrators only
      parameters:
        - name: limit
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: offset
          required: false
          in: query
          description: The initial index from which to return the results.
          schema:
            type: integer
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTraceList'
          description: ''
  /api/ai-analytics/orgs/{org}/users/{user_id}/traces/{id}/:
    get:
      operationId: ai_analytics_orgs_users_traces_retrieve
      description: >-
        Viewset for retrieving and listing Langfuse traces.


        This viewset provides read-only access to Langfuse traces data for
        platform admins.

        Traces represent high-level tracking of user interactions and AI
        responses.


        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Trace'
          description: ''
  /api/ai-analytics/orgs/{org}/users/{user_id}/transcripts/:
    get:
      operationId: ai_analytics_orgs_users_transcripts_list
      description: >-
        Retrieve message data from conversations.


        This endpoint returns data on messages within conversations, with
        options

        for filtering by date range, topics, and mentor.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.
            user_id: User identifier (not used in the implementation).

        Returns:
            Response: A list of conversation message data.

        Raises:
            NotFound: If the specified organization does not exist.
            ValidationError: If the provided query parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD).
            end_date (str): End date for filtering (YYYY-MM-DD).
            topics (str): Comma-separated list of topics to filter by.
            mentor (str): Filter by mentor unique ID.
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: mentor
          schema:
            type: string
            minLength: 1
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            format: date
        - in: query
          name: topics
          schema:
            type: string
            minLength: 1
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConversationMessage'
              examples:
                ConversationMessageResponse:
                  value:
                    - - session_id: abc123
                        student_name: John Doe
                        mentor_name: AI Mentor
                        topic: Machine Learning
                        message_count: 15
                        inserted_at: '2023-06-15T10:30:00Z'
                        sentiment: positive
                      - session_id: def456
                        student_name: Jane Smith
                        mentor_name: AI Mentor
                        topic: Data Science
                        message_count: 12
                        inserted_at: '2023-06-16T14:20:00Z'
                        sentiment: neutral
                  summary: Conversation Message Response
          description: ''
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/usage-summary/:
    get:
      operationId: ai_analytics_orgs_users_usage_summary_list
      description: >-
        Retrieve daily user engagement metrics with mentors.


        This endpoint returns data on the number of unique users who interact
        with

        mentors each day within a specified date range.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: Daily time series of unique user counts.

        Raises:
            NotFound: If the specified organization does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD) - required.
            end_date (str): End date for filtering (YYYY-MM-DD) - required.
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
          description: End date for filtering (YYYY-MM-DD)
          required: true
        - in: query
          name: group_by
          schema:
            type: string
            default: day
            minLength: 1
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
          description: Start date for filtering (YYYY-MM-DD)
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserCountRecord'
              examples:
                UserMentorAnalyticsResponse:
                  value:
                    - - date: '2023-06-01'
                        user_count: 42
                      - date: '2023-06-02'
                        user_count: 38
                      - date: '2023-06-03'
                        user_count: 45
                  summary: User Mentor Analytics Response
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/user-cohorts-over-time/:
    get:
      operationId: ai_analytics_orgs_users_user_cohorts_over_time_retrieve
      description: >-
        Retrieve user cohort trends over time.


        This endpoint returns data on the distribution of new versus veteran
        users

        over time, with options for different time aggregations and filtering by
        mentor.

        New users are those who registered within the specified date range,
        while

        veteran users are those who registered before the date range but were
        active

        during it.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: Time series of new and veteran user counts.

        Raises:
            NotFound: If the specified organization does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD) - required.
            end_date (str): End date for filtering (YYYY-MM-DD) - required.
            aggregation (str): Time aggregation level (hourly, daily, weekly) - default: daily.
            mentor_id (str): Filter by mentor unique ID.
      parameters:
        - in: query
          name: aggregation
          schema:
            type: string
            enum:
              - daily
              - hourly
              - weekly
            default: daily
          description: Time aggregation level (hourly, daily, weekly)
        - in: query
          name: end_date
          schema:
            type: string
          description: End date for filtering (YYYY-MM-DD)
          required: true
        - in: query
          name: mentor_id
          schema:
            type: string
          description: Filter by mentor unique ID
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
          description: Start date for filtering (YYYY-MM-DD)
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserTrendByPeriod'
              examples:
                UserCohortsOverTimeResponse:
                  value:
                    periods:
                      - '2023-06-01T00:00:00Z'
                      - '2023-06-02T00:00:00Z'
                      - '2023-06-03T00:00:00Z'
                    new_users:
                      - 8
                      - 12
                      - 5
                    veteran_users:
                      - 42
                      - 38
                      - 45
                  summary: User Cohorts Over Time Response
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/user-cost/:
    get:
      operationId: ai_analytics_orgs_users_user_cost_retrieve
      description: >-
        Retrieve LLM usage costs for a specific user.


        This endpoint returns data on the total cost of LLM usage for a specific
        user

        within a specified date range. The cost is calculated by summing the
        costs

        of all observations associated with traces from the tenant's sessions.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.
            user_id: User key identifier.

        Returns:
            Response: Total LLM usage cost for the specified tenant.

        Raises:
            NotFound: If the specified organization does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD) - required.
            end_date (str): End date for filtering (YYYY-MM-DD) - required.
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date-time
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            format: date-time
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cost'
              examples:
                LLMTenantCostResponse:
                  value:
                    total_cost: 5.75
                  summary: LLM Tenant Cost Response
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/user-feedback/:
    get:
      operationId: ai_analytics_orgs_users_user_feedback_list
      description: >-
        Retrieve aggregated user chat feedback counts.


        This endpoint returns data on the number of user chat feedback entries

        within a specified date range, with options for different time
        aggregations

        (hourly, daily, weekly). Results can be filtered by mentor.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: Time series data of feedback counts.

        Raises:
            NotFound: If the specified organization does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD) - required.
            end_date (str): End date for filtering (YYYY-MM-DD) - required.
            mentor_id (str): Filter by mentor unique ID.
            aggregation (str): Time aggregation level (hourly, daily, weekly) - default: daily.
      parameters:
        - in: query
          name: aggregation
          schema:
            type: string
            enum:
              - daily
              - hourly
              - weekly
            default: daily
          description: Time aggregation level (hourly, daily, weekly)
        - in: query
          name: end_date
          schema:
            type: string
          description: End date for filtering (YYYY-MM-DD)
          required: true
        - in: query
          name: mentor_id
          schema:
            type: string
          description: Filter by mentor unique ID
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
          description: Start date for filtering (YYYY-MM-DD)
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserChatFeedbackCount'
              examples:
                UserChatFeedbackCountResponse(Daily):
                  value:
                    - - period: '2023-06-01T00:00:00Z'
                        feedback_count: 15
                      - period: '2023-06-02T00:00:00Z'
                        feedback_count: 12
                      - period: '2023-06-03T00:00:00Z'
                        feedback_count: 18
                  summary: User Chat Feedback Count Response (Daily)
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/user-metrics/:
    get:
      operationId: ai_analytics_orgs_users_user_metrics_retrieve
      description: |-
        Retrieve comprehensive user metrics.

        This endpoint returns data on various user metrics with month-over-month
        change calculations:
        - Registered users: Total users registered on the platform
        - New users: Users who joined in the current month
        - Unique users: Distinct users who have had sessions
        - Veteran users: Users who have been active for at least 6 months

        Results can be filtered by mentor.

        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: Comprehensive user metrics with month-over-month changes.

        Raises:
            NotFound: If the specified organization does not exist.

        Query Parameters:
            mentor_id (str): Filter metrics by mentor unique ID.
      parameters:
        - in: query
          name: group_by
          schema:
            type: string
            default: day
            minLength: 1
        - in: query
          name: mentor_id
          schema:
            type: string
          description: Filter metrics by mentor unique ID
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserMetricsResponse'
              examples:
                UserMetricsResponse:
                  value:
                    registered_users:
                      total: 1250
                      change_percentage: 8.75
                    new_users:
                      total: 85
                      change_percentage: 12.5
                    unique_users:
                      total: 420
                      change_percentage: 5.25
                    veteran_users:
                      total: 335
                      change_percentage: 3.8
                  summary: User Metrics Response
          description: ''
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/user-metrics-pie-chart/:
    get:
      operationId: ai_analytics_orgs_users_user_metrics_pie_chart_retrieve
      description: >-
        Retrieve user distribution data for pie charts.


        This endpoint returns data on the distribution of new versus returning
        users

        within a specified date range, including both counts and percentages,

        suitable for pie chart visualization.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: Distribution of new versus returning users with counts and percentages.

        Raises:
            NotFound: If the specified organization does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD) - required.
            end_date (str): End date for filtering (YYYY-MM-DD) - required.
            mentor_id (str): Filter by mentor unique ID.
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
          description: End date for filtering (YYYY-MM-DD)
          required: true
        - in: query
          name: mentor_id
          schema:
            type: string
          description: Filter by mentor unique ID
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
          description: Start date for filtering (YYYY-MM-DD)
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PieChartData'
              examples:
                UserMetricsPieChartResponse:
                  value:
                    new_users:
                      count: 85
                      percentage: 28.33
                    returning_users:
                      count: 215
                      percentage: 71.67
                  summary: User Metrics Pie Chart Response
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/user-sentiment/:
    get:
      operationId: ai_analytics_orgs_users_user_sentiment_retrieve
      description: >-
        Retrieve user sentiment distribution.


        This endpoint returns data on the distribution of user sentiments
        (positive,

        negative, neutral) within a specified date range, expressed as
        percentages.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.

        Returns:
            Response: Sentiment distribution percentages and total sentiment count.

        Raises:
            NotFound: If the specified organization does not exist.
            BadRequest: If the provided parameters are invalid.

        Query Parameters:
            start_date (str): Start date for filtering (YYYY-MM-DD) - required.
            end_date (str): End date for filtering (YYYY-MM-DD) - required.
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
          description: End date for filtering (YYYY-MM-DD)
          required: true
        - in: query
          name: group_by
          schema:
            type: string
            default: day
            minLength: 1
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
          description: Start date for filtering (YYYY-MM-DD)
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SentimentSummary'
              examples:
                UserSentimentDistributionResponse:
                  value:
                    sentiment_distribution:
                      positive: 65.25
                      negative: 12.5
                      neutral: 22.25
                    total_sentiments: 400
                  summary: User Sentiment Distribution Response
          description: ''
        '400':
          description: Invalid parameters
        '404':
          description: Organization not found
  /api/ai-analytics/overview/orgs/{org}/active-users:
    get:
      operationId: ai_analytics_overview_orgs_active_users_retrieve
      description: >-
        Get active user counts over time.


        This endpoint provides daily counts of active users (users with known
        activity)

        over a specified time period.


        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)

        Returns:
            Daily active user counts over the specified time period, with change metrics
            compared to previous periods.

        Default time range is the last 7 days if no dates are specified.


        An active user is defined as a user with any activity within the past 30
        days.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/ai-analytics/overview/orgs/{org}/average-grade:
    get:
      operationId: ai_analytics_overview_orgs_average_grade_retrieve
      description: >-
        Get average grade value for platform, course, or user.


        This endpoint returns the average grade at different levels:

        - Platform level: Average grade across all courses

        - Course level: Average grade for a specific course

        - Learner level: Average grade for a specific learner

        - Course-learner level: Grade for a specific learner in a specific
        course


        Query Parameters:
            course_id (str, optional): Filter by course ID
            learner_id (str, optional): Filter by username or email

        Returns:
            The average grade value based on the specified filters.

        Access Control:
            - Platform admins can access any grade data
            - Learners can access their own grade data
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Average'
          description: ''
  /api/ai-analytics/overview/orgs/{org}/courses/completions:
    get:
      operationId: ai_analytics_overview_orgs_courses_completions_retrieve
      description: >-
        Get course completion summary metrics over time.


        This endpoint provides completion statistics across the platform over a

        specified time period, including daily completion counts and overall
        metrics.


        Query Parameters:
            start_date (str): Start date for the time range (ISO format)
            end_date (str): End date for the time range (ISO format)

        Returns:
            Completion data including:
            - Daily completion counts over time
            - Total unique user count
            - Total completion count
            - Completion percentage
            - Change metrics compared to previous periods

        Default time range is the last 7 days if no dates are specified.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCompletionSummaryOvertime'
          description: ''
  /api/ai-analytics/overview/orgs/{org}/learners:
    get:
      operationId: ai_analytics_overview_orgs_learners_retrieve
      description: >-
        List all learners on the platform with aggregated metrics.


        This endpoint returns a paginated list of all learners with key metrics
        including:

        - Enrollment counts

        - Completion counts

        - Time spent on platform


        Query Parameters:
            page (int): Page number for pagination
            length (int): Number of items per page
            search (str): Filter learners by username, email, or name

        Returns:
            A paginated list of learners with their associated metrics.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: search
          schema:
            type: string
            minLength: 1
          description: Search string for learner
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerlearnerUserList'
          description: ''
  /api/ai-analytics/overview/orgs/{org}/most-active-courses:
    get:
      operationId: ai_analytics_overview_orgs_most_active_courses_retrieve
      description: |-
        Get time spent statistics on a per-course basis.

        This endpoint provides a paginated list of courses with the total time
        spent by users in each course.

        Query Parameters:
            start_date (str, optional): Start date for filtering (ISO format)
            end_date (str, optional): End date for filtering (ISO format)
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page

        Returns:
            A paginated list of courses with:
            - Course identification (ID and name)
            - Total time spent (in seconds)
            - Formatted time spent (human-readable)
            - Percentage of total platform time
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimeSpentPerCourse'
          description: ''
  /api/ai-analytics/overview/orgs/{org}/registered-users:
    get:
      operationId: ai_analytics_overview_orgs_registered_users_retrieve
      description: |-
        Get registered user counts over time.

        This endpoint provides daily counts of new user registrations over a
        specified time period.

        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)

        Returns:
            Daily registration counts over the specified time period, with change metrics
            compared to previous periods.

        Default time range is the last 7 days if no dates are specified.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/ai-analytics/performance/orgs/{org}/courses/{course_id}/grading/average:
    get:
      operationId: ai_analytics_performance_orgs_courses_grading_average_retrieve
      description: >-
        Get average grade value for platform, course, or user.


        This endpoint returns the average grade at different levels:

        - Platform level: Average grade across all courses

        - Course level: Average grade for a specific course

        - Learner level: Average grade for a specific learner

        - Course-learner level: Grade for a specific learner in a specific
        course


        Query Parameters:
            course_id (str, optional): Filter by course ID
            learner_id (str, optional): Filter by username or email

        Returns:
            The average grade value based on the specified filters.

        Access Control:
            - Platform admins can access any grade data
            - Learners can access their own grade data
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Average'
          description: ''
  /api/ai-analytics/performance/orgs/{org}/courses/{course_id}/grading/average-with-cutoff:
    get:
      operationId: >-
        ai_analytics_performance_orgs_courses_grading_average_with_cutoff_retrieve
      description: |-
        Returns average course grade and grade cuttoff

        e.g
        ```
        {
            "data": {
                "grade_cutoffs": {
                    "A": 90,
                    "B": 80,
                    "C": 70,
                },
                "average_grade": 50.0,
            }
        }
        ```

        Kwargs
        course_id
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AvgCourseGradeWithCutoff'
          description: ''
  /api/ai-analytics/performance/orgs/{org}/courses/{course_id}/grading/detail:
    get:
      operationId: ai_analytics_performance_orgs_courses_grading_detail_retrieve
      description: |-
        Grading summary for the entire course overview in a tree-like format

        Kwargs
        course_id <required>
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseGradingDetail'
          description: ''
  /api/ai-analytics/performance/orgs/{org}/courses/{course_id}/grading/per-learner:
    get:
      operationId: ai_analytics_performance_orgs_courses_grading_per_learner_retrieve
      description: |-
        Grading information per enrolled user in a course

        Kwargs
        course_id <required>
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GradingPerUser'
          description: ''
  /api/ai-analytics/performance/orgs/{org}/courses/{course_id}/grading/summary:
    get:
      operationId: ai_analytics_performance_orgs_courses_grading_summary_retrieve
      description: |-
        Returns average grades across various assignment types in a course

        Query Params
        course_id

        Returns:
            dict
            {
                "data": [
                    {
                        "assignment_type': <str>,
                        "weight": <float>,
                        "average_weighted_grade": <float>,
                        "average_section_grade": <float>
                    }, ...
                ]
            }
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseGradeSummary'
          description: ''
  /api/ai-analytics/performance/orgs/{org}/grading/average:
    get:
      operationId: ai_analytics_performance_orgs_grading_average_retrieve
      description: >-
        Get average grade value for platform, course, or user.


        This endpoint returns the average grade at different levels:

        - Platform level: Average grade across all courses

        - Course level: Average grade for a specific course

        - Learner level: Average grade for a specific learner

        - Course-learner level: Grade for a specific learner in a specific
        course


        Query Parameters:
            course_id (str, optional): Filter by course ID
            learner_id (str, optional): Filter by username or email

        Returns:
            The average grade value based on the specified filters.

        Access Control:
            - Platform admins can access any grade data
            - Learners can access their own grade data
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Average'
          description: ''
  /api/ai-analytics/performance/orgs/{org}/grading/per-course:
    get:
      operationId: ai_analytics_performance_orgs_grading_per_course_retrieve
      description: |-
        List grade-related performance data for all courses.

        This endpoint provides a comprehensive view of grade performance across
        courses, including enrollment counts, pass rates, and average grades.

        Returns:
            A paginated list of courses with:
            - Course identification (ID and name)
            - Enrollment count
            - Number of students who passed
            - Average grade
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerformanceGradesPerCourse'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/learners:
    get:
      operationId: ai_analytics_perlearner_orgs_learners_retrieve
      description: >-
        Enhanced API endpoint for listing learners with comprehensive filtering.


        This endpoint provides a paginated list of learners with detailed
        metrics

        and supports advanced filtering options. It uses DM token authentication

        and respects department-based access controls.


        Query Parameters:
            page (int): Page number for pagination
            length (int): Number of items per page
            search (str): Filter by username, email, or full name
            program (str): Filter by program
            location (str): Filter by location
            is_enrolled (bool): Filter for users with enrollments
            platform (str): Filter by platform
            start_date (date): Filter by join date (start range)
            end_date (date): Filter by join date (end range)

        Returns:
            A paginated list of learners with comprehensive metrics including:
            - Course enrollments and completions
            - Time spent on platform
            - Pathway progress
            - Certificate and skill information
            - Location data

        Access Control:
            - Platform admins can see all learners
            - Department admins can only see learners in their departments
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            format: date
          description: Learner date_joined end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: is_enrolled
          schema:
            type: boolean
            nullable: true
          description: Filter for users who have at least an enrollment
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: query
          name: location
          schema:
            type: string
            minLength: 1
          description: Location search string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: platform
          schema:
            type: string
            minLength: 1
          description: Platform search string
        - in: query
          name: program
          schema:
            type: string
            minLength: 1
          description: Program search string
        - in: query
          name: search
          schema:
            type: string
            minLength: 1
          description: Search string for learner. email, username or full name
        - in: query
          name: start_date
          schema:
            type: string
            format: date
          description: Learner date_joined start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewPerLearnerList'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users:
    get:
      operationId: ai_analytics_perlearner_orgs_users_retrieve
      description: >-
        List all learners on the platform with aggregated metrics.


        This endpoint returns a paginated list of all learners with key metrics
        including:

        - Enrollment counts

        - Completion counts

        - Time spent on platform


        Query Parameters:
            page (int): Page number for pagination
            length (int): Number of items per page
            search (str): Filter learners by username, email, or name

        Returns:
            A paginated list of learners with their associated metrics.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: search
          schema:
            type: string
            minLength: 1
          description: Search string for learner
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerlearnerUserList'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/activity/:
    get:
      operationId: ai_analytics_perlearner_orgs_users_activity_retrieve
      description: |-
        Provides information on user enrollments

        Params
        user_id e.g developer@ibleducation.com| developer
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivityAPI'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/grading/cutoffs:
    get:
      operationId: ai_analytics_perlearner_orgs_users_courses_grading_cutoffs_retrieve
      description: |-
        Provides about a learner current grade in a course with the course cut
        Kwargs
        1. course_id e.g course-v1:Org+Course4+Run
        2. user_id e.g developer@ibleducation.com or dev123 (username|email)
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerlearnerGradeWithCutOff'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/grading/detail:
    get:
      operationId: ai_analytics_perlearner_orgs_users_courses_grading_detail_retrieve
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailedGradeView'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/grading/summary:
    get:
      operationId: ai_analytics_perlearner_orgs_users_courses_grading_summary_retrieve
      description: |-
        Query Params
        1. course_id e.g course-v1:Org+Course4+Run
        2. user_id e.g developer@ibleducation.com or dev123 (username|email)
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerlearnerGradeSummary'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/overview/engagement-index:
    get:
      operationId: >-
        ai_analytics_perlearner_orgs_users_courses_overview_engagement_index_retrieve
      description: >-
        Average of days with atleast an activity within ENGAGEMENT_INDEX_PERIOD
        consecutive days for a learner in a course
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Value'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/overview/grade:
    get:
      operationId: ai_analytics_perlearner_orgs_users_courses_overview_grade_retrieve
      description: |-
        Provides about a learner current grade in a course with the course cut
        Kwargs
        1. course_id e.g course-v1:Org+Course4+Run
        2. user_id e.g developer@ibleducation.com or dev123 (username|email)
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerlearnerGradeWithCutOff'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/overview/performance-index:
    get:
      operationId: >-
        ai_analytics_perlearner_orgs_users_courses_overview_performance_index_retrieve
      description: >-
        Evaluates performance index for platform, per course, per user and per
        user-per course


        Query Params

        course_id <optional>

        learner_id <optional>
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Value'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/overview/time/over-time:
    get:
      operationId: >-
        ai_analytics_perlearner_orgs_users_courses_overview_time_over_time_retrieve
      description: >-
        Time spent within a course in secs on a per-day basis


        Kwargs

        1. course_id  e.g course-v1:Org+Course4+Run

        2. user_id e.g developer@ibleducation.com or dev123 (username|email)

        Query Params

        3. start_date e.g 2020-10-01

        4. end_date e.g 2020-10-10


        Default result when no query param is added is last_7_days (today
        inclusive)
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/videos:
    get:
      operationId: ai_analytics_perlearner_orgs_users_courses_videos_retrieve
      description: |-
        List of videos within a course a learner has watched

        Kwargs
        1. course_id e.g course-v1:Org+Course4+Run
        2. user_id e.g developer@ibleducation.com or dev123 (username|email)

        Default result when no query param is added is [], 0
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerLearnerCourseVideosWatched'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/videos/over-time:
    get:
      operationId: ai_analytics_perlearner_orgs_users_courses_videos_over_time_retrieve
      description: >-
        Get video watch counts over time.


        This endpoint provides daily counts of videos watched over a specified
        time period,

        with options to filter by course or user.


        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)
            course_id (str, optional): Filter by course ID
            user_id (str, optional): Filter by username or email

        Returns:
            Daily video watch counts over the specified time period.

        Default time range is the last 7 days if no dates are specified.


        Access Control:
            - Platform admins can access any video watch data
            - Learners can access their own video watch data
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/grades/per-course:
    get:
      operationId: ai_analytics_perlearner_orgs_users_grades_per_course_retrieve
      description: |-
        Summary Grading Information for a learner on a per-enrollment basis

        Query Params
        1. user_id e.g developer@ibleducation.com or dev123 (username|email)
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerlearnerGradingPerCourseAPI'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/info:
    get:
      operationId: ai_analytics_perlearner_orgs_users_info_retrieve
      description: |-
        Retrieve detailed information about a specific learner.

        This endpoint returns personal and activity information about a learner,
        including profile data, activity metrics, and location information.

        Path Parameters:
            user_id (str): The username or email of the learner

        Query Parameters:
            meta (bool): Include additional analytics information when true

        Returns:
            Detailed learner information including:
            - Profile data (username, name, email)
            - Registration and activity dates
            - Activity metrics (assessments, time spent, videos watched)
            - Location and browser information (when available)

        Access Control:
            - Platform admins can access any learner
            - Learners can access their own information
            - Department admins can access learners in their departments
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: meta
          schema:
            enum:
              - 'y'
              - 'yes'
              - 'true'
              - 'True'
              - 'n'
              - 'no'
              - 'false'
              - 'False'
            type: string
            default: 'n'
            minLength: 1
          description: |-
            Include extra analytics information?

            * `y` - y
            * `yes` - yes
            * `true` - true
            * `True` - True
            * `n` - n
            * `no` - no
            * `false` - false
            * `False` - False
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: search
          schema:
            type: string
            minLength: 1
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LearnerInformationAPI'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/last-access:
    get:
      operationId: ai_analytics_perlearner_orgs_users_last_access_retrieve
      description: >-
        Last course accessed by a learner, includes upto unit information as
        well
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerLearnerLastAccess'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/overview/engagement-index:
    get:
      operationId: ai_analytics_perlearner_orgs_users_overview_engagement_index_retrieve
      description: >-
        Average of days with atleast an activity within ENGAGEMENT_INDEX_PERIOD
        consecutive days
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Value'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/overview/grades/average:
    get:
      operationId: ai_analytics_perlearner_orgs_users_overview_grades_average_retrieve
      description: >-
        Get average grade value for platform, course, or user.


        This endpoint returns the average grade at different levels:

        - Platform level: Average grade across all courses

        - Course level: Average grade for a specific course

        - Learner level: Average grade for a specific learner

        - Course-learner level: Grade for a specific learner in a specific
        course


        Query Parameters:
            course_id (str, optional): Filter by course ID
            learner_id (str, optional): Filter by username or email

        Returns:
            The average grade value based on the specified filters.

        Access Control:
            - Platform admins can access any grade data
            - Learners can access their own grade data
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Average'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/overview/performance-index:
    get:
      operationId: ai_analytics_perlearner_orgs_users_overview_performance_index_retrieve
      description: >-
        Evaluates performance index for platform, per course, per user and per
        user-per course


        Query Params

        course_id <optional>

        learner_id <optional>
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Value'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/overview/time/over-time:
    get:
      operationId: ai_analytics_perlearner_orgs_users_overview_time_over_time_retrieve
      description: >-
        Time spent in secs on a per-day basis


        Query Params

        1. course_id <optional> e.g course-v1:Org+Course4+Run

        2. user_id <optional> e.g developer@ibleducation.com or dev123
        (username|email)

        3. start_date e.g 2020-10-01

        4. end_date e.g 2020-10-10


        Default result when no query param is added is last_7_days (today
        inclusive)
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/videos/over-time:
    get:
      operationId: ai_analytics_perlearner_orgs_users_videos_over_time_retrieve
      description: >-
        Get video watch counts over time.


        This endpoint provides daily counts of videos watched over a specified
        time period,

        with options to filter by course or user.


        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)
            course_id (str, optional): Filter by course ID
            user_id (str, optional): Filter by username or email

        Returns:
            Daily video watch counts over the specified time period.

        Default time range is the last 7 days if no dates are specified.


        Access Control:
            - Platform admins can access any video watch data
            - Learners can access their own video watch data
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/videos/per-course:
    get:
      operationId: ai_analytics_perlearner_orgs_users_videos_per_course_retrieve
      description: |-
        Summary Videos watched data for a learner per enrollment

        Query Params
        1. user_id e.g developer@ibleducation.com or dev123 (username|email)
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PerlearnerEngagementVideosWatchedPerCourse
          description: ''
  /api/ai-analytics/user-groups/orgs/{org}/:
    get:
      operationId: ai_analytics_user_groups_orgs_retrieve
      description: >-
        Get a list of user groups with metrics and filtering options.


        This endpoint provides a paginated list of user groups with aggregated
        metrics

        about learner performance, course completions, and skill acquisition.


        This endpoint uses DM token authentication and respects department-based

        access controls.


        Query Parameters:
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page
            program (str, optional): Filter by program
            pathway (str, optional): Filter by pathway
            groups (list, optional): Filter by group names
            location (str, optional): Filter by location
            is_enrolled (bool, optional): Filter for groups with enrolled users
            start_date (date, optional): Filter by learner join date (start range)
            end_date (date, optional): Filter by learner join date (end range)

        Returns:
            A paginated list of user groups with comprehensive metrics.

        Access Control:
            - Platform admins can see all groups
            - Department admins can only see groups in their departments
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            format: date
          description: Filter by learners date_joined. Start date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: groups
          schema:
            type: array
            items:
              type: string
          description: >-
            Groups search string. Single string or list of strings. e.g
            'sample_group' or `['group', 'another group']` 
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: is_enrolled
          schema:
            type: boolean
            nullable: true
          description: Filter for users who have at least an enrollment
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: query
          name: location
          schema:
            type: string
            minLength: 1
          description: Location search string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: pathway
          schema:
            type: string
            minLength: 1
          description: Pathway string
        - in: query
          name: program
          schema:
            type: string
            minLength: 1
          description: Program search string
        - in: query
          name: start_date
          schema:
            type: string
            format: date
          description: Filter by learners date_joined. Start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupList'
          description: ''
  /api/ai-bot/v1/bots/{org}/bot/:
    get:
      operationId: ai_bot_v1_bots_bot_list
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Bot'
          description: ''
    post:
      operationId: ai_bot_v1_bots_bot_create
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BotCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/BotCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BotCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BotCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/BotCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BotCreate'
          description: ''
  /api/ai-bot/v1/bots/{org}/bot-commands/:
    get:
      operationId: ai_bot_v1_bots_bot_commands_list
      description: |-
        Create slash commands for a specific bot
        eg. /iblai-baseline
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BotCommand'
          description: ''
    post:
      operationId: ai_bot_v1_bots_bot_commands_create
      description: |-
        Create slash commands for a specific bot
        eg. /iblai-baseline
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BotCommand'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/BotCommand'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BotCommand'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BotCommand'
          '*/*':
            schema:
              $ref: '#/components/schemas/BotCommand'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BotCommand'
          description: ''
  /api/ai-bot/v1/bots/{org}/bot-commands/{id}/:
    get:
      operationId: ai_bot_v1_bots_bot_commands_retrieve
      description: |-
        Create slash commands for a specific bot
        eg. /iblai-baseline
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot command.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BotCommand'
          description: ''
    put:
      operationId: ai_bot_v1_bots_bot_commands_update
      description: |-
        Create slash commands for a specific bot
        eg. /iblai-baseline
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot command.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BotCommand'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/BotCommand'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BotCommand'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BotCommand'
          '*/*':
            schema:
              $ref: '#/components/schemas/BotCommand'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BotCommand'
          description: ''
    patch:
      operationId: ai_bot_v1_bots_bot_commands_partial_update
      description: |-
        Create slash commands for a specific bot
        eg. /iblai-baseline
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot command.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedBotCommand'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedBotCommand'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedBotCommand'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedBotCommand'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedBotCommand'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BotCommand'
          description: ''
    delete:
      operationId: ai_bot_v1_bots_bot_commands_destroy
      description: |-
        Create slash commands for a specific bot
        eg. /iblai-baseline
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot command.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-bot/v1/bots/{org}/bot/{id}/:
    get:
      operationId: ai_bot_v1_bots_bot_retrieve
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Bot'
          description: ''
    put:
      operationId: ai_bot_v1_bots_bot_update
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BotCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/BotCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BotCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BotCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/BotCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BotCreate'
          description: ''
    patch:
      operationId: ai_bot_v1_bots_bot_partial_update
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedBotCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedBotCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedBotCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedBotCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedBotCreate'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BotCreate'
          description: ''
    delete:
      operationId: ai_bot_v1_bots_bot_destroy
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-bot/v1/bots/{org}/bot/{id}/config/discord/:
    get:
      operationId: ai_bot_v1_bots_bot_config_discord_retrieve
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscordConfig'
          description: ''
    patch:
      operationId: ai_bot_v1_bots_bot_config_discord_partial_update
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedDiscordConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedDiscordConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedDiscordConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedDiscordConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedDiscordConfig'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscordConfig'
          description: ''
  /api/ai-bot/v1/bots/{org}/bot/{id}/config/slack/:
    get:
      operationId: ai_bot_v1_bots_bot_config_slack_retrieve
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SlackConfig'
          description: ''
  /api/ai-bot/v1/bots/{org}/bot/{id}/config/slack/update/:
    post:
      operationId: ai_bot_v1_bots_bot_config_slack_update_create
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SlackConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SlackConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SlackConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SlackConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/SlackConfig'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SlackConfig'
          description: ''
    put:
      operationId: ai_bot_v1_bots_bot_config_slack_update_update
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SlackConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SlackConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SlackConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SlackConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/SlackConfig'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SlackConfig'
          description: ''
    patch:
      operationId: ai_bot_v1_bots_bot_config_slack_update_partial_update
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedSlackConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedSlackConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedSlackConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedSlackConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedSlackConfig'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SlackConfig'
          description: ''
  /api/ai-bot/v1/bots/{org}/bot/{id}/config/teams/:
    get:
      operationId: ai_bot_v1_bots_bot_config_teams_retrieve
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TeamsConfig'
          description: ''
  /api/ai-bot/v1/bots/{org}/bot/{id}/config/teams/update/:
    post:
      operationId: ai_bot_v1_bots_bot_config_teams_update_create
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TeamsConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TeamsConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TeamsConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TeamsConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/TeamsConfig'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TeamsConfig'
          description: ''
    put:
      operationId: ai_bot_v1_bots_bot_config_teams_update_update
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TeamsConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TeamsConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TeamsConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TeamsConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/TeamsConfig'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TeamsConfig'
          description: ''
    patch:
      operationId: ai_bot_v1_bots_bot_config_teams_update_partial_update
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedTeamsConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedTeamsConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedTeamsConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedTeamsConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedTeamsConfig'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TeamsConfig'
          description: ''
  /api/ai-bot/v1/bots/{org}/bot/{id}/config/webex/:
    get:
      operationId: ai_bot_v1_bots_bot_config_webex_retrieve
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebexConfig'
          description: ''
    patch:
      operationId: ai_bot_v1_bots_bot_config_webex_partial_update
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedWebexConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedWebexConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedWebexConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedWebexConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedWebexConfig'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebexConfig'
          description: ''
  /api/ai-bot/v1/bots/{org}/bot/{id}/config/whatsapp/:
    get:
      operationId: ai_bot_v1_bots_bot_config_whatsapp_retrieve
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatsappConfig'
          description: ''
  /api/ai-bot/v1/bots/{org}/bot/{id}/whatsapp-config/:
    put:
      operationId: ai_bot_v1_bots_bot_whatsapp_config_update
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhatsappConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/WhatsappConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/WhatsappConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WhatsappConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/WhatsappConfig'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatsappConfig'
          description: ''
    patch:
      operationId: ai_bot_v1_bots_bot_whatsapp_config_partial_update
      description: Create modify and update bot information for a specific tenant.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this bot.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedWhatsappConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedWhatsappConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedWhatsappConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedWhatsappConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedWhatsappConfig'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatsappConfig'
          description: ''
  /api/ai-bot/v1/bots/{org}/discord-user-config/:
    get:
      operationId: ai_bot_v1_bots_discord_user_config_list
      description: >-
        Setup discord user id linkage with discord bots

        this will be used to authenticate the user when interracting with
        discord bots.

        the user id can be copied from the discord app after tapping on the user
        profile.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DiscordUserConfig'
          description: ''
    post:
      operationId: ai_bot_v1_bots_discord_user_config_create
      description: >-
        Setup discord user id linkage with discord bots

        this will be used to authenticate the user when interracting with
        discord bots.

        the user id can be copied from the discord app after tapping on the user
        profile.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiscordUserConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/DiscordUserConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DiscordUserConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DiscordUserConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/DiscordUserConfig'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscordUserConfig'
          description: ''
  /api/ai-bot/v1/bots/{org}/discord-user-config/{id}/:
    get:
      operationId: ai_bot_v1_bots_discord_user_config_retrieve
      description: >-
        Setup discord user id linkage with discord bots

        this will be used to authenticate the user when interracting with
        discord bots.

        the user id can be copied from the discord app after tapping on the user
        profile.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this discord user config.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscordUserConfig'
          description: ''
    put:
      operationId: ai_bot_v1_bots_discord_user_config_update
      description: >-
        Setup discord user id linkage with discord bots

        this will be used to authenticate the user when interracting with
        discord bots.

        the user id can be copied from the discord app after tapping on the user
        profile.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this discord user config.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiscordUserConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/DiscordUserConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DiscordUserConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DiscordUserConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/DiscordUserConfig'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscordUserConfig'
          description: ''
    patch:
      operationId: ai_bot_v1_bots_discord_user_config_partial_update
      description: >-
        Setup discord user id linkage with discord bots

        this will be used to authenticate the user when interracting with
        discord bots.

        the user id can be copied from the discord app after tapping on the user
        profile.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this discord user config.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedDiscordUserConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedDiscordUserConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedDiscordUserConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedDiscordUserConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedDiscordUserConfig'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscordUserConfig'
          description: ''
    delete:
      operationId: ai_bot_v1_bots_discord_user_config_destroy
      description: >-
        Setup discord user id linkage with discord bots

        this will be used to authenticate the user when interracting with
        discord bots.

        the user id can be copied from the discord app after tapping on the user
        profile.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this discord user config.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-bot/v1/bots/{org}/slack-user-config/:
    get:
      operationId: ai_bot_v1_bots_slack_user_config_list
      description: >-
        Setup slack username and domain linkage with slack bots

        this will be used to authenticate the user when interracting with slack
        bots.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SlackUserConfig'
          description: ''
    post:
      operationId: ai_bot_v1_bots_slack_user_config_create
      description: >-
        Setup slack username and domain linkage with slack bots

        this will be used to authenticate the user when interracting with slack
        bots.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SlackUserConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SlackUserConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SlackUserConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SlackUserConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/SlackUserConfig'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SlackUserConfig'
          description: ''
  /api/ai-bot/v1/bots/{org}/slack-user-config/{id}/:
    get:
      operationId: ai_bot_v1_bots_slack_user_config_retrieve
      description: >-
        Setup slack username and domain linkage with slack bots

        this will be used to authenticate the user when interracting with slack
        bots.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this slack user config.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SlackUserConfig'
          description: ''
    put:
      operationId: ai_bot_v1_bots_slack_user_config_update
      description: >-
        Setup slack username and domain linkage with slack bots

        this will be used to authenticate the user when interracting with slack
        bots.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this slack user config.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SlackUserConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SlackUserConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SlackUserConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SlackUserConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/SlackUserConfig'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SlackUserConfig'
          description: ''
    patch:
      operationId: ai_bot_v1_bots_slack_user_config_partial_update
      description: >-
        Setup slack username and domain linkage with slack bots

        this will be used to authenticate the user when interracting with slack
        bots.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this slack user config.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedSlackUserConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedSlackUserConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedSlackUserConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedSlackUserConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedSlackUserConfig'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SlackUserConfig'
          description: ''
    delete:
      operationId: ai_bot_v1_bots_slack_user_config_destroy
      description: >-
        Setup slack username and domain linkage with slack bots

        this will be used to authenticate the user when interracting with slack
        bots.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this slack user config.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-bot/v1/bots/{org}/whatsapp-user-config/:
    get:
      operationId: ai_bot_v1_bots_whatsapp_user_config_list
      description: >-
        Setup phone number linkage with whatsapp bots

        This phone number will be used to authenticate and allow access to
        whatsapp bots.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WhatsappUserConfig'
          description: ''
    post:
      operationId: ai_bot_v1_bots_whatsapp_user_config_create
      description: >-
        Setup phone number linkage with whatsapp bots

        This phone number will be used to authenticate and allow access to
        whatsapp bots.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhatsappUserConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/WhatsappUserConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/WhatsappUserConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WhatsappUserConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/WhatsappUserConfig'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatsappUserConfig'
          description: ''
  /api/ai-bot/v1/bots/{org}/whatsapp-user-config/{id}/:
    get:
      operationId: ai_bot_v1_bots_whatsapp_user_config_retrieve
      description: >-
        Setup phone number linkage with whatsapp bots

        This phone number will be used to authenticate and allow access to
        whatsapp bots.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this whatsapp user config.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatsappUserConfig'
          description: ''
    put:
      operationId: ai_bot_v1_bots_whatsapp_user_config_update
      description: >-
        Setup phone number linkage with whatsapp bots

        This phone number will be used to authenticate and allow access to
        whatsapp bots.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this whatsapp user config.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhatsappUserConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/WhatsappUserConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/WhatsappUserConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WhatsappUserConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/WhatsappUserConfig'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatsappUserConfig'
          description: ''
    patch:
      operationId: ai_bot_v1_bots_whatsapp_user_config_partial_update
      description: >-
        Setup phone number linkage with whatsapp bots

        This phone number will be used to authenticate and allow access to
        whatsapp bots.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this whatsapp user config.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedWhatsappUserConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedWhatsappUserConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedWhatsappUserConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedWhatsappUserConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedWhatsappUserConfig'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatsappUserConfig'
          description: ''
    delete:
      operationId: ai_bot_v1_bots_whatsapp_user_config_destroy
      description: >-
        Setup phone number linkage with whatsapp bots

        This phone number will be used to authenticate and allow access to
        whatsapp bots.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this whatsapp user config.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-bot/v1/bots/webhooks/{org}/discord/{name}/:
    post:
      operationId: ai_bot_v1_bots_webhooks_discord_create
      description: Webhook endpoint to receive and process discord messages.
      parameters:
        - in: path
          name: name
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiscordWebhook'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DiscordWebhook'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DiscordWebhook'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscordWebhook'
          description: ''
  /api/ai-bot/v1/bots/webhooks/{org}/slack/{name}/:
    post:
      operationId: ai_bot_v1_bots_webhooks_slack_create
      parameters:
        - in: path
          name: name
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SlackWebhook'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SlackWebhook'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SlackWebhook'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SlackWebhook'
          description: ''
  /api/ai-bot/v1/bots/webhooks/{org}/teams/{name}/:
    post:
      operationId: ai_bot_v1_bots_webhooks_teams_create
      parameters:
        - in: path
          name: name
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TeamsWebhook'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TeamsWebhook'
          description: ''
  /api/ai-bot/v1/bots/webhooks/{org}/webex/{name}/:
    post:
      operationId: ai_bot_v1_bots_webhooks_webex_create
      description: Webhook endpoint to receive and process discord messages.
      parameters:
        - in: path
          name: name
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebexWebhook'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WebexWebhook'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/WebexWebhook'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebexWebhook'
          description: ''
  /api/ai-bot/v1/bots/webhooks/{org}/whatsapp/{name}/:
    get:
      operationId: ai_bot_v1_bots_webhooks_whatsapp_retrieve
      description: >-
        Respond to whatsapp's webhook challenge.

        Parameters Required include the tenant key (org) and the name of the
        bot: (name)
      parameters:
        - in: path
          name: name
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatAppWebHook'
          description: ''
    post:
      operationId: ai_bot_v1_bots_webhooks_whatsapp_create
      description: Accept and process webhook events from whatsapp.
      parameters:
        - in: path
          name: name
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-bot
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhatAppWebHook'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WhatAppWebHook'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/WhatAppWebHook'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatAppWebHook'
          description: ''
  /api/ai-finetuning/v1/org/{org}/user/{username}/datasets/:
    get:
      operationId: ai_finetuning_v1_org_user_datasets_list
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: query
          name: date_created
          schema:
            type: string
            format: date-time
        - in: query
          name: num_data_points
          schema:
            type: integer
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: retry_attempts
          schema:
            type: integer
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: query
          name: status
          schema:
            type: string
            enum:
              - completed
              - failed
              - pending
              - processing
          description: |-
            * `pending` - Pending
            * `processing` - Processing
            * `completed` - Completed
            * `failed` - Failed
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - ai-finetuning
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedDataSetList'
          description: ''
    post:
      operationId: ai_finetuning_v1_org_user_datasets_create
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - ai-finetuning
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataSetCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/DataSetCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DataSetCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DataSetCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/DataSetCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSetCreate'
          description: ''
  /api/ai-finetuning/v1/org/{org}/user/{username}/datasets/{id}/:
    get:
      operationId: ai_finetuning_v1_org_user_datasets_retrieve
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this data set.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - ai-finetuning
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSet'
          description: ''
    put:
      operationId: ai_finetuning_v1_org_user_datasets_update
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this data set.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - ai-finetuning
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataSet'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/DataSet'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DataSet'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DataSet'
          '*/*':
            schema:
              $ref: '#/components/schemas/DataSet'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSet'
          description: ''
    patch:
      operationId: ai_finetuning_v1_org_user_datasets_partial_update
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this data set.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - ai-finetuning
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedDataSet'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedDataSet'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedDataSet'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedDataSet'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedDataSet'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSet'
          description: ''
    delete:
      operationId: ai_finetuning_v1_org_user_datasets_destroy
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this data set.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - ai-finetuning
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-finetuning/v1/org/{org}/user/{username}/trainings/:
    get:
      operationId: ai_finetuning_v1_org_user_trainings_list
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: query
          name: base_model_name
          schema:
            type: string
        - in: query
          name: dataset
          schema:
            type: string
            format: uuid
        - in: query
          name: date_created
          schema:
            type: string
            format: date-time
        - in: query
          name: fine_tuned_model
          schema:
            type: string
        - in: query
          name: last_modified
          schema:
            type: string
            format: date-time
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: preprocess_dataset
          schema:
            type: boolean
        - in: query
          name: provider
          schema:
            type: string
            enum:
              - openai
          description: '* `openai` - Openai'
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: query
          name: status
          schema:
            type: string
            enum:
              - cancelled
              - completed
              - failed
              - pending
              - processing
          description: |-
            * `pending` - Pending
            * `processing` - Processing
            * `completed` - Completed
            * `cancelled` - Cancelled
            * `failed` - Failed
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - ai-finetuning
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTrainingList'
          description: ''
    post:
      operationId: ai_finetuning_v1_org_user_trainings_create
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - ai-finetuning
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TrainingCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TrainingCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TrainingCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TrainingCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/TrainingCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingCreate'
          description: ''
  /api/ai-finetuning/v1/org/{org}/user/{username}/trainings/{id}/:
    get:
      operationId: ai_finetuning_v1_org_user_trainings_retrieve
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this training.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - ai-finetuning
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Training'
          description: ''
    put:
      operationId: ai_finetuning_v1_org_user_trainings_update
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this training.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - ai-finetuning
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TrainingCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TrainingCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TrainingCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TrainingCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/TrainingCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingCreate'
          description: ''
    patch:
      operationId: ai_finetuning_v1_org_user_trainings_partial_update
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this training.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - ai-finetuning
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedTrainingCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedTrainingCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedTrainingCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedTrainingCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedTrainingCreate'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingCreate'
          description: ''
    delete:
      operationId: ai_finetuning_v1_org_user_trainings_destroy
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this training.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - ai-finetuning
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-finetuning/v1/org/{org}/user/{username}/trainings/finetuned-models/:
    get:
      operationId: ai_finetuning_v1_org_user_trainings_finetuned_models_retrieve
      description: >-
        Retrieves a paginated list of completed fine-tuned models, excluding
        those without a fine-tuned model.

        Filtering and pagination is allowed.


        NB: This is only a helper endpoint. The same functionality can be
        achieved with the appropriate filters using the
            training list endpoint.
        Returns:
            Response: A paginated response containing the serialized fine-tuned models.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - ai-finetuning
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Training'
          description: ''
  /api/ai-index/orgs/{org}/users/{user_id}/documents/{document_id}/:
    get:
      operationId: ai_index_orgs_users_documents_retrieve
      description: |-
        Retrieve details of a specific document embedding.

        This endpoint returns detailed information about a specific
        document embedding identified by its ID.

        Args:
            request: The HTTP request.
            org: Organization key identifier.
            document_id: The ID of the document embedding to retrieve.

        Returns:
            Response: Detailed information about the document embedding.

        Raises:
            NotFound: If the specified document embedding does not exist.
      parameters:
        - in: path
          name: document_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-index
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetrieverDocumentEmbedding'
              examples:
                DocumentEmbeddingDetailResponse:
                  value:
                    id: 1
                    document_name: CareerClustersPathways_0
                    document_type: pdf
                    pathway: test-pathway
                    url: https://example.com/files/CareerClustersPathways_0.pdf
                    tokens: 46578
                    platform_key: main
                    access: public
                    is_trained: true
                    last_trained_at: '2025-07-24T17:32:13.031Z'
                  summary: Document Embedding Detail Response
          description: ''
        '404':
          description: Document not found
    put:
      operationId: ai_index_orgs_users_documents_update
      description: >-
        Update a specific document embedding.


        This endpoint allows updating various properties of a document
        embedding,

        including its name, type, pathway, and training status.


        Args:
            request: The HTTP request containing the updated document data.
            org: Organization key identifier.
            document_id: The ID of the document embedding to update.

        Returns:
            Response: The updated document embedding information.

        Raises:
            BadRequest: If the provided data is invalid.
            NotFound: If the specified document embedding does not exist.
      parameters:
        - in: path
          name: document_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-index
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RetrieverDocumentEmbeddingRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RetrieverDocumentEmbeddingRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/RetrieverDocumentEmbeddingRequest'
            examples:
              UpdateDocumentEmbeddingRequest:
                value:
                  document_name: Updated Document Name
                  document_type: pdf
                  pathway: test-pathway
                  url: https://example.com/files/updated_document.pdf
                  platform_key: main
                  train: true
                  access: public
                summary: Update Document Embedding Request
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetrieverDocumentEmbedding'
              examples:
                UpdateDocumentEmbeddingResponse:
                  value:
                    id: 1
                    document_name: Updated Document Name
                    document_type: pdf
                    pathway: test-pathway
                    url: https://example.com/files/updated_document.pdf
                    tokens: 46578
                    platform_key: main
                    is_trained: true
                    access: public
                  summary: Update Document Embedding Response
          description: ''
        '400':
          description: Invalid request data
        '404':
          description: Document not found
    delete:
      operationId: ai_index_orgs_users_documents_destroy
      description: |-
        Delete a specific document embedding.

        This endpoint removes a document embedding from the system,
        including untraining it from any associated pathways.

        Args:
            request: The HTTP request.
            org: Organization key identifier.
            document_id: The ID of the document embedding to delete.

        Returns:
            Response: An empty response with a 204 status code if successful.

        Raises:
            NotFound: If the specified document embedding does not exist.
      parameters:
        - in: path
          name: document_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-index
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Document successfully deleted
        '404':
          description: Document not found
  /api/ai-index/orgs/{org}/users/{user_id}/documents/{document_id}/settings/:
    get:
      operationId: ai_index_orgs_users_documents_settings_retrieve
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: document_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-index
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentSettingsResponse'
          description: ''
    post:
      operationId: ai_index_orgs_users_documents_settings_create
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: document_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-index
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentSettingsResponse'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/DocumentSettingsResponse'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DocumentSettingsResponse'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DocumentSettingsResponse'
          '*/*':
            schema:
              $ref: '#/components/schemas/DocumentSettingsResponse'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentSettingsResponse'
          description: ''
  /api/ai-index/orgs/{org}/users/{user_id}/documents/document-from-pool/:
    post:
      operationId: ai_index_orgs_users_documents_document_from_pool_create
      description: |-
        Train a document from the document pool

        Sample request:
        ```json
        {"document_id": 3, "to_pathway": "7c43ec09-3d37-489c-a461-8d73df1d91c7"}
        ```
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-index
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentFromPoolRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainDocumentViewResponse'
          description: ''
        '400':
          description: Invalid request data
  /api/ai-index/orgs/{org}/users/{user_id}/documents/pathways/{pathway}/:
    get:
      operationId: ai_index_orgs_users_documents_pathways_list
      description: >-
        Description:

        Retrieves a list of document embeddings for a specific pathway with
        optional search and pagination.


        Methods:

        - GET: Retrieves document embeddings that match the specified search
        criteria and are paginated according to offset and limit.


        Parameters:

        - search (str): Search query to filter document names or URLs.

        - offset (int): Offset number for pagination.

        - limit (int): Limit number for pagination.


        Returns:

        - GET: A paginated list of document embeddings with their details.

        {
            "count": 10,
            "next": "http://api.example.com/retriever_documents/?offset=10&limit=2",
            "previous": "http://api.example.com/retriever_documents/?offset=0&limit=2",
            "results": [
            {
                "document_name": "Document2",
                "platform_key": "example_platform",
                "pathway": "example_pathway"
            }
            ]
        }


        Error Responses:

        - 400 Bad Request: Invalid query parameters.

        - 404 Not Found: No document embeddings found for the specified
        criteria.
      parameters:
        - in: query
          name: limit
          schema:
            type: integer
          description: limit number
        - in: query
          name: offset
          schema:
            type: integer
          description: Offset number
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: pathway
          schema:
            type: string
          required: true
        - in: query
          name: search
          schema:
            type: string
            minLength: 1
          description: Search query
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-index
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedRetrieverDocumentEmbeddingList'
              examples:
                DocumentEmbeddingsResponse:
                  value:
                    count: 123
                    next: http://api.example.org/accounts/?offset=400&limit=100
                    previous: http://api.example.org/accounts/?offset=200&limit=100
                    results:
                      - - id: 1
                          document_name: CareerClustersPathways_0
                          document_type: pdf
                          pathway: test-pathway
                          url: >-
                            https://example.com/files/CareerClustersPathways_0.pdf
                          tokens: 46578
                          platform_key: main
                          is_trained: true
                          access: public
                        - id: 2
                          document_name: Introduction_to_AI
                          document_type: pdf
                          pathway: test-pathway
                          url: https://example.com/files/Introduction_to_AI.pdf
                          tokens: 32150
                          platform_key: main
                          is_trained: true
                          access: public
                  summary: Document Embeddings Response
          description: ''
  /api/ai-index/orgs/{org}/users/{user_id}/documents/search/:
    post:
      operationId: ai_index_orgs_users_documents_search_create
      description: |-
        Retrieve resource documents similar to the given query.

        This endpoint performs a semantic search to find documents that are
        relevant to the provided query within the specified pathway.

        Args:
            request: The HTTP request containing the search query.
            org: Organization key identifier.

        Returns:
            Response: A list of documents relevant to the search query.

        Raises:
            ValidationError: If the request data is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-index
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RetrieverRequestSearch'
            examples:
              RetrieverSearchRequest:
                value:
                  query: Computational thinking
                  pathway: test-pathway
                summary: Retriever Search Request
          application/scim+json:
            schema:
              $ref: '#/components/schemas/RetrieverRequestSearch'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RetrieverRequestSearch'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RetrieverRequestSearch'
          '*/*':
            schema:
              $ref: '#/components/schemas/RetrieverRequestSearch'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetrieverResponseSearch'
              examples:
                RetrieverSearchResponse:
                  value:
                    results:
                      - page_content: >-
                          computational thinking can go from a thought exercise
                          to a practical application when implemented in code.
                      - page_content: >-
                          Computational thinking involves breaking down complex
                          problems into smaller, more manageable parts.
                  summary: Retriever Search Response
          description: ''
        '400':
          description: Invalid request data
  /api/ai-index/orgs/{org}/users/{user_id}/documents/sources/:
    post:
      operationId: ai_index_orgs_users_documents_sources_create
      description: |-
        Retrieve document sources related to a given query.

        This endpoint performs a semantic search to find document sources
        that are relevant to the provided query within the specified pathway,
        and returns them along with confidence levels.

        Args:
            request: The HTTP request containing the search query.
            org: Organization key identifier.

        Returns:
            Response: A list of document sources with confidence levels.

        Raises:
            ValidationError: If the request data is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-index
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RetrieverRequestSearch'
            examples:
              RetrieverSearchSourcesRequest:
                value:
                  query: Computational thinking
                  pathway: test-pathway
                summary: Retriever Search Sources Request
          application/scim+json:
            schema:
              $ref: '#/components/schemas/RetrieverRequestSearch'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RetrieverRequestSearch'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RetrieverRequestSearch'
          '*/*':
            schema:
              $ref: '#/components/schemas/RetrieverRequestSearch'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RetrieverRequestSearchDocument'
              examples:
                RetrieverSearchSourcesResponse:
                  value:
                    - - source: >-
                          https://example.com/media/private/mentor-documents/1.1%20Introduction.pdf
                        confidence_level: 90.38
                      - source: >-
                          https://example.com/media/private/mentor-documents/2.3%20Algorithms.pdf
                        confidence_level: 85.72
                  summary: Retriever Search Sources Response
          description: ''
        '400':
          description: Invalid request data
  /api/ai-index/orgs/{org}/users/{user_id}/documents/tasks/{task_id}/:
    get:
      operationId: ai_index_orgs_users_documents_tasks_retrieve
      description: |-
        Check the status of a document training task.

        This endpoint retrieves the current status of an asynchronous
        document training task that was previously initiated.

        Args:
            request: The HTTP request.
            org: Organization key identifier.
            task_id: The ID of the training task to check.

        Returns:
            Response: The current status of the document training task,
                     which can be "pending", "completed", or "failed".
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: task_id
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-index
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckDocumentTrainingStatus'
              examples:
                DocumentTrainingStatusResponse-Pending:
                  value:
                    status: pending
                    message: Training document pending
                  summary: Document Training Status Response - Pending
                DocumentTrainingStatusResponse-Completed:
                  value:
                    status: completed
                    message: Training document completed successfully
                  summary: Document Training Status Response - Completed
                DocumentTrainingStatusResponse-Failed:
                  value:
                    status: failed
                    message: Training document failed
                  summary: Document Training Status Response - Failed
          description: ''
  /api/ai-index/orgs/{org}/users/{user_id}/documents/train/:
    post:
      operationId: ai_index_orgs_users_documents_train_create
      description: |-
        Train a document through a worker process.

        This endpoint queues larger documents for training through a worker
        process, which is more suitable for handling documents that would
        take too long to process directly.

        Args:
            request: The HTTP request containing the document information.
            org: Organization key identifier.

        Returns:
            Response: A confirmation that the document was queued for training,
                     including a task ID for tracking the progress.

        Raises:
            ValidationError: If the request data is invalid.
            BadRequest: If there was an error processing the document.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-index
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TrainDocumentViewRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TrainDocumentViewRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/TrainDocumentViewRequest'
            examples:
              TrainDocumentRequest:
                value:
                  - pathway: test-pathway
                    url: >-
                      https://example.com/media/private/mentor-documents/1.1%20Introduction.pdf
                    type: url
                    access: public
                summary: Train Document Request
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainDocumentViewResponse'
              examples:
                TrainDocumentResponse:
                  value:
                    - task_id: 4194d20c-37d5-4148-882f-f7d2d91f7769
                      document_id: doc-123456
                      message: Document received. Your request to train is queued
                  summary: Train Document Response
          description: ''
        '400':
          description: Invalid request data
  /api/ai-index/orgs/{org}/users/{user_id}/documents/train/retriever/:
    post:
      operationId: ai_index_orgs_users_documents_train_retriever_create
      description: |-
        Train a document directly without using a worker.

        This endpoint is designed for training smaller documents directly
        without queuing them through a worker process. For larger documents,
        use the TrainDocumentView endpoint instead.

        Args:
            request: The HTTP request containing the document information.
            org: Organization key identifier.

        Returns:
            Response: A confirmation that the document was trained successfully.

        Raises:
            ValidationError: If the request data is invalid.
            BadRequest: If the document training failed.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-index
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RetreiverTrainViewRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RetreiverTrainViewRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/RetreiverTrainViewRequest'
            examples:
              TrainDocumentRequest:
                value:
                  pathway: test-pathway
                  url: >-
                    https://example.com/media/private/mentor-documents/1.1%20Introduction.pdf
                summary: Train Document Request
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetreiverTrainViewResponse'
              examples:
                TrainDocumentResponse:
                  value:
                    detail: Document trained successfully
                  summary: Train Document Response
          description: ''
        '400':
          description: Invalid request data or training failed
  /api/ai-index/orgs/{org}/users/{user_id}/documents/train/sessions/{session_id}/:
    post:
      operationId: ai_index_orgs_users_documents_train_sessions_create
      description: >-
        Description:

        Submit a document file  in a chat session. Checks file type, size, and
        ensures the session exists, then processes the file.

        Process  document for use in a specific chat session.

        which will be processed and made available for the AI to reference

        when responding to queries in that session.


        Methods:

        - POST: Submits a document or media file for training within a specified
        chat session.


        Parameters:

        - org (str):

        - session_id (str): UUID of the chat session for which the document is
        being submitted.

        - *args, **kwargs: Additional arguments.

        - file (file): Multipart file input.


        Returns:

        - POST: Returns a JSON message with the result of the upload process.
        Response code 200 on success.

        {
            "message": "File processed."
        }


        Error Responses:

        - 400 Bad Request:

        - "File field is required" if the 'file' parameter is missing.

        - "invalid file object" if the file object is not valid.

        - Specific error message if an exception occurs while saving to Redis.

        - 404 Not Found:

        - "Session not found" if the provided session_id does not match any
        existing session.

        - 413 Request Entity Too Large:

        - "file is too large" including specific limits for document and media
        files if the file exceeds size limits.


        Access Control:

        Requires authentication with a Bearer token in the Authorization header.
        The user associated with the session must exist and be authorized for
        the request.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: session_id
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-index
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TrainChatSessionDocumentViewRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TrainChatSessionDocumentViewRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/TrainChatSessionDocumentViewRequest'
            examples:
              TrainChatSessionDocumentRequest:
                value:
                  file: binary file content
                summary: Train Chat Session Document Request
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainChatSessionDocumentView'
              examples:
                TrainChatSessionDocumentResponse:
                  value:
                    message: File processed.
                  summary: Train Chat Session Document Response
          description: ''
        '400':
          description: Invalid file or processing error
        '413':
          description: File too large
  /api/ai-index/orgs/{org}/users/{user_id}/resource/{resource_id}/data/scrapped/:
    get:
      operationId: ai_index_orgs_users_resource_data_scrapped_retrieve
      description: |-
        Retrieve detailed information about a specific scraped resource.

        This endpoint returns the complete scraped data for a specific resource
        identified by its ID.

        Args:
            request: The HTTP request.
            org: Organization key identifier.
            user_id: The username of the user associated with the resource.
            resource_id: The ID of the resource to retrieve.

        Returns:
            Response: The complete scraped data for the specified resource.

        Raises:
            NotFound: If the specified resource data does not exist.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: resource_id
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-index
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceScrappedData'
              examples:
                ResourceScrappedDataDetailResponse:
                  value:
                    id: 1
                    resource:
                      id: 101
                      name: Introduction to Machine Learning
                      data:
                        isLike: true
                        isArchive: false
                    content_type: content
                    content: >-
                      Machine learning is a field of study that gives computers
                      the ability to learn without being explicitly
                      programmed...
                    extra_data:
                      title: Introduction to Machine Learning
                      description: >-
                        A comprehensive guide to machine learning concepts and
                        applications
                      author: John Smith
                      published_date: '2023-01-15'
                    date_created: '2023-06-15T10:30:00Z'
                  summary: Resource Scrapped Data Detail Response
          description: ''
        '404':
          description: Resource data not found
  /api/ai-index/orgs/{org}/users/{user_id}/resource/data/scrapped/:
    get:
      operationId: ai_index_orgs_users_resource_data_scrapped_list
      description: >-
        Retrieve and filter scraped data from resources.


        This endpoint returns a list of scraped data from resources associated

        with the specified user, with optional filtering based on query
        parameters.


        Args:
            request: The HTTP request containing filter query parameters.
            org: Organization key identifier.
            user_id: The username of the user whose resources to retrieve.

        Returns:
            Response: A list of scraped resource data matching the filter criteria.

        Raises:
            BadRequest: If the username is invalid or query parameters are incorrect.
      parameters:
        - in: query
          name: is_archive
          schema:
            type: boolean
            nullable: true
        - in: query
          name: is_like
          schema:
            type: boolean
            nullable: true
        - in: query
          name: is_video
          schema:
            type: boolean
            nullable: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: search_key
          schema:
            type: string
            minLength: 1
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-index
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ResourceScrappedData'
              examples:
                ResourceScrappedDataResponse:
                  value:
                    - - id: 1
                        resource:
                          id: 101
                          name: Introduction to Machine Learning
                          data:
                            isLike: true
                            isArchive: false
                        content_type: content
                        content: Machine learning is a field of study...
                        extra_data:
                          title: Introduction to Machine Learning
                          description: A comprehensive guide to ML concepts
                        date_created: '2023-06-15T10:30:00Z'
                  summary: Resource Scrapped Data Response
          description: ''
        '400':
          description: Invalid username or query parameters
  /api/ai-index/webhook/scan/:
    post:
      operationId: ai_index_webhook_scan_create
      description: >-
        Receive and process file scan status from external security scanning
        services.


        This webhook endpoint receives scan results for files that have been
        submitted

        for security scanning. It processes the results asynchronously and
        determines

        if the files are safe for further processing.


        Args:
            request: The HTTP request containing scan result data.

        Returns:
            Response: A confirmation that the scan result was received and is being processed.

        Raises:
            BadRequest: If the provided scan result data is invalid.
      tags:
        - ai-index
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScanWebhookRequest'
            examples:
              ScanWebhookRequest:
                value:
                  file_id: f12345
                  filename: document.pdf
                  status: clean
                  message: No threats detected
                summary: Scan Webhook Request
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ScanWebhookRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ScanWebhookRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ScanWebhookRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/ScanWebhookRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanWebhookResponse'
              examples:
                ScanWebhookResponse:
                  value:
                    message: Scan result received. Processing in background.
                  summary: Scan Webhook Response
          description: ''
        '400':
          description: Invalid request data
  /api/ai-marketing/orgs/{org}/users/{user_id}/heygen-videos/:
    get:
      operationId: ai_marketing_orgs_users_heygen_videos_list
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-marketing
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedHeygenMarketingVideoListList'
          description: ''
    post:
      operationId: ai_marketing_orgs_users_heygen_videos_create
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-marketing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HeygenMarketingVideoList'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/HeygenMarketingVideoList'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/HeygenMarketingVideoList'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/HeygenMarketingVideoList'
          '*/*':
            schema:
              $ref: '#/components/schemas/HeygenMarketingVideoList'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HeygenMarketingVideoList'
          description: ''
  /api/ai-marketing/orgs/{org}/users/{user_id}/heygen-videos/{name}/:
    get:
      operationId: ai_marketing_orgs_users_heygen_videos_retrieve
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: name
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-marketing
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HeygenMarketingVideoDetail'
          description: ''
  /api/ai-media/orgs/{org}/users/{user_id}/heygen/templates/:
    get:
      operationId: ai_media_orgs_users_heygen_templates_list
      description: API view to list or append Heygen template ids for a tenant.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedHeygenTemplateResponseSingleList'
          description: ''
    post:
      operationId: ai_media_orgs_users_heygen_templates_create
      description: |-
        Endpoint to add a Heygen template id to an org.

        Only platform admins have access to this endpoint.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HeygenTemplateRequest'
            examples:
              NewHeygenTemplateIdExample:
                value:
                  template_id: new_id
                  name: template name
                  preview_image_url: https://example.com/preview.png
                summary: New Heygen template id example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/HeygenTemplateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/HeygenTemplateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/HeygenTemplateRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/HeygenTemplateRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HeygenTemplateResponseSingle'
              examples:
                NewHeygenTemplateIdExample:
                  value:
                    template_id: new_id
                    name: template name
                    preview_image_url: https://example.com/preview.png
                  summary: New Heygen template id example
          description: ''
  /api/ai-media/orgs/{org}/users/{user_id}/heygen/templates/{template_name}/:
    delete:
      operationId: ai_media_orgs_users_heygen_templates_destroy
      description: |-
        Endpoint to delete a Heygen template id for an org.


        The reponse status code is always 204 when no error.


        Only platform admins have access to this endpoint.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: template_name
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-media/orgs/{org}/users/{user_id}/heygen/video-captions/{heygen_marketing_video_id}/:
    get:
      operationId: ai_media_orgs_users_heygen_video_captions_retrieve
      description: Endpoint to download caption for a video.
      parameters:
        - in: path
          name: heygen_marketing_video_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    post:
      operationId: ai_media_orgs_users_heygen_video_captions_create
      description: |-
        Endpoint to upload a new caption for a generated video.

        Only platform admins have access to this endpoint.
      parameters:
        - in: path
          name: heygen_marketing_video_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/VideoCaption'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/VideoCaption'
          application/json:
            schema:
              $ref: '#/components/schemas/VideoCaption'
            examples:
              HeygenVideoExample:
                value:
                  name: video name
                  data:
                    caption_url: https://newcaption.com/caption.ass
                  script: Hello world. this is a script.
                  id: 35
                  video_file: https://example.com/abcd.mp4
                  generation_status: completed
                summary: Heygen video example
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HeygenVideoDetail'
              examples:
                HeygenVideoExample:
                  value:
                    name: video name
                    data:
                      caption_url: https://newcaption.com/caption.ass
                    script: Hello world. this is a script.
                    id: 35
                    video_file: https://example.com/abcd.mp4
                    generation_status: completed
                  summary: Heygen video example
          description: ''
  /api/ai-media/orgs/{org}/users/{user_id}/heygen/video-download/{heygen_marketing_video_id}/:
    get:
      operationId: ai_media_orgs_users_heygen_video_download_retrieve
      description: |-
        Endpoint used to download a heygen video.


        Only platform admins have access to this endpoint.
      parameters:
        - in: path
          name: heygen_marketing_video_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-media/orgs/{org}/users/{user_id}/heygen/videos/:
    get:
      operationId: ai_media_orgs_users_heygen_videos_list
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedHeygenMarketingVideoListList'
          description: ''
    post:
      operationId: ai_media_orgs_users_heygen_videos_create
      description: |-
        Endpoint to create a Heygen video

        Only platform admins have access to this endpoint.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HeygenVideoRequest'
            examples:
              HeygenVideoExample:
                value:
                  name: video name
                  data: {}
                  script: Hello world. this is a script.
                  id: 35
                  video_file: https://example.com/abcd.mp4
                  generation_status: completed
                summary: Heygen video example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/HeygenVideoRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/HeygenVideoRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/HeygenVideoRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/HeygenVideoRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HeygenVideoDetail'
              examples:
                HeygenVideoExample:
                  value:
                    name: video name
                    data: {}
                    script: Hello world. this is a script.
                    id: 35
                    video_file: https://example.com/abcd.mp4
                    generation_status: completed
                  summary: Heygen video example
          description: ''
  /api/ai-media/orgs/{org}/users/{user_id}/heygen/videos/{heygen_marketing_video_id}/:
    get:
      operationId: ai_media_orgs_users_heygen_videos_retrieve
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: heygen_marketing_video_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HeygenVideoDetail'
          description: ''
    delete:
      operationId: ai_media_orgs_users_heygen_videos_destroy
      description: |-
        Endpoint used to delete a heygen video.

        Only platform admins have access to this endpoint.
      parameters:
        - in: path
          name: heygen_marketing_video_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-media/orgs/{org}/users/{user_id}/veo/video-download/{veo_video_id}/:
    get:
      operationId: ai_media_orgs_users_veo_video_download_retrieve
      description: |-
        Endpoint used to download a Veo video.


        Only platform admins have access to this endpoint.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: path
          name: veo_video_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-media/orgs/{org}/users/{user_id}/veo/videos/:
    get:
      operationId: ai_media_orgs_users_veo_videos_list
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedVeoVideoListList'
          description: ''
    post:
      operationId: ai_media_orgs_users_veo_videos_create
      description: |-
        Endpoint to create a Veo3 video

        Only platform admins have access to this endpoint.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/VeoVideoRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/VeoVideoRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/VeoVideoRequest'
            examples:
              VeoVideoExample:
                value:
                  name: video name
                  data: {}
                  prompt_text: Hello world. this is a prompt.
                  prompt_image: https://example.com/abcd.png
                  id: 35
                  video_file: https://example.com/abcd.mp4
                  generation_status: completed
                summary: Veo video example
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VeoVideoDetail'
              examples:
                VeoVideoExample:
                  value:
                    name: video name
                    data: {}
                    prompt_text: Hello world. this is a prompt.
                    prompt_image: https://example.com/abcd.png
                    id: 35
                    video_file: https://example.com/abcd.mp4
                    generation_status: completed
                  summary: Veo video example
          description: ''
  /api/ai-media/orgs/{org}/users/{user_id}/veo/videos/{veo_video_id}/:
    get:
      operationId: ai_media_orgs_users_veo_videos_retrieve
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: path
          name: veo_video_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VeoVideoDetail'
          description: ''
    delete:
      operationId: ai_media_orgs_users_veo_videos_destroy
      description: |-
        Endpoint used to delete a veo3 video.

        Only platform admins have access to this endpoint.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: path
          name: veo_video_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-media/orgs/{org}/users/{user_id}/video-script-generation/audio/:
    post:
      operationId: ai_media_orgs_users_video_script_generation_audio_create
      description: >-
        Endpoint to generate video scripts from a audio file. The audio file can
        be one of mp3 and wav.


        The request should be a multipart form with your audio file in the
        `file` field.


        Initial Response:

        ```

        {"script": None, "status": "started_generation", "generation_id":
        "your-generation-id."}

        ```

        This signals the generation has started. You can use the generation id
        to query video script generation status from this endpoint, using a JSON
        like below:

        ```

        {"generation_id": "your-generation-id"}

        ```


        Example response:

        ```

        {"script": "hello this is a video script.", "status": "finished",
        "generation_id": "your-generation-id"}


        ```
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-media/orgs/{org}/users/{user_id}/video-script-generation/document/:
    post:
      operationId: ai_media_orgs_users_video_script_generation_document_create
      description: |2-
            Endpoint to generate video scripts from a document file. The document file can be one of docx, doc, pptx, ppt, txt and pdf.

            The request should be a multipart form with your document file in the `file` field.
        Initial Response:
            ```
            {"script": None, "status": "started_generation", "generation_id": "your-generation-id."}
            ```
            This signals the generation has started. You can use the generation id to query video script generation status from this endpoint, using a JSON like below:
            ```
            {"generation_id": "your-generation-id"}
            ```

            Example response:
            ```
            {"script": "hello this is a video script.", "status": "finished", "generation_id": "your-generation-id"}

            ```
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-media/orgs/{org}/users/{user_id}/video-script-generation/text/:
    post:
      operationId: ai_media_orgs_users_video_script_generation_text_create
      description: |-
        Endpoint to generate video scripts from a text.

        The request body should be a JSON with your text, like below:
        ```
        {"text": "Generate a script about a campus comedy."}
        ```

        Example response:
        ```
        {"script": "hello this is a video script."}

        ```
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-mentor/langfuse/health/:
    get:
      operationId: ai_mentor_langfuse_health_retrieve
      description: Proxy endpoint to check for langfuse health status
      tags:
        - ai-mentor
      responses:
        '200':
          description: No response body
  /api/ai-mentor/orgs/{org}/all-triggers/:
    get:
      operationId: ai_mentor_orgs_all_triggers_retrieve
      description: |-
        List all triggers for an organization.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.

        Returns:
            Response: A list of trigger slugs for the organization.

        Raises:
            BadRequest: If the request is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: List of trigger slugs
        '400':
          description: Invalid request
  /api/ai-mentor/orgs/{org}/mentors/{mentor}/email-inbox/:
    get:
      operationId: ai_mentor_orgs_mentors_email_inbox_list
      description: |-
        Retrieve a list of emails in a mentor's inbox.

        The list can be filtered using the 'search' query parameter to search
        for specific terms in the email content or subject.

        Args:
            mentor: The unique identifier of the mentor.

        Returns:
            Response: A paginated list of emails in the mentor's inbox.

        Raises:
            NotFound: If the specified mentor does not exist.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: search
          schema:
            type: string
          description: Search term to filter emails by content or subject
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedEmailPromptListList'
              examples:
                EmailInboxResponseExample:
                  value:
                    count: 123
                    next: http://api.example.org/accounts/?page=4
                    previous: http://api.example.org/accounts/?page=2
                    results:
                      - - id: 123
                          sender_email: user@example.com
                          sender_name: alice
                          subject: Question about machine learning
                          content_summary: >-
                            Hello, I have a question about implementing neural
                            networks...
                          inserted_at: '2024-01-15T10:30:00Z'
                          mentor_name: mentor_ai
                          mentor_email: mentor_ai@example.com
                          is_processed: true
                        - id: 124
                          sender_email: another@example.com
                          sender_name: bob
                          subject: Help with Python code
                          content_summary: I'm trying to debug this Python function...
                          inserted_at: '2024-01-14T15:45:00Z'
                          mentor_name: mentor_ai
                          mentor_email: mentor_ai@example.com
                          is_processed: true
                  summary: Email Inbox Response Example
          description: ''
        '404':
          description: Mentor not found
  /api/ai-mentor/orgs/{org}/mentors/{mentor}/email-inbox-summary/:
    get:
      operationId: ai_mentor_orgs_mentors_email_inbox_summary_retrieve
      description: |-
        Retrieve a summary of a mentor's email inbox.

        Args:
            request: The HTTP request.
            mentor: The unique identifier of the mentor.

        Returns:
            Response: A summary of the mentor's email inbox statistics.

        Raises:
            NotFound: If the specified mentor does not exist.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailPromptSummary'
              examples:
                EmailInboxSummaryResponseExample:
                  value:
                    total_emails: 25
                    replied_emails: 18
                    pending_emails: 7
                  summary: Email Inbox Summary Response Example
          description: ''
        '404':
          description: Mentor not found
  /api/ai-mentor/orgs/{org}/mentors/{mentor}/email-inbox/{email_prompt_id}/:
    get:
      operationId: ai_mentor_orgs_mentors_email_inbox_retrieve
      description: |-
        Retrieve details of a specific email in a mentor's inbox.

        Args:
            request: The HTTP request.
            email_prompt_id: The ID of the email to retrieve.

        Returns:
            Response: The detailed information about the email.

        Raises:
            NotFound: If the specified email does not exist.
      parameters:
        - in: path
          name: email_prompt_id
          schema:
            type: integer
          required: true
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailPromptDetail'
              examples:
                EmailDetailResponseExample:
                  value:
                    id: 123
                    sender_email: user@example.com
                    sender_name: John Doe
                    subject: Question about machine learning
                    content: >-
                      Hello, I have a question about implementing neural
                      networks...
                    mentor_name: ai-mentor
                    mentor_email: ai-mentor@example.com
                    inserted_at: '2024-01-15T10:30:00Z'
                    is_processed: true
                    mentor_response: >-
                      Thanks for your question. I don't know about it either.
                      Thank you.
                    send_status: Email is sent via internal API.
                  summary: Email Detail Response Example
          description: ''
        '404':
          description: Email not found
  /api/ai-mentor/orgs/{org}/mentors/{mentor}/link-course/:
    get:
      operationId: ai_mentor_orgs_mentors_link_course_retrieve
      description: |-
        API endpoint to link mentor with a course and enable guided mode.

        Permissions:
            - Accessible to tenant admins.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkCourseResponse'
              examples:
                SuccessfulResponse:
                  value:
                    mentor_unique_id: xxx-xxxx-xxxxx-xxxxx
                    course_id: course-id-v1:abcdefg
                    is_linked: true
                  summary: Successful Response
          description: ''
    post:
      operationId: ai_mentor_orgs_mentors_link_course_create
      description: |-
        API endpoint to link mentor with a course and enable guided mode.

        Permissions:
            - Accessible to tenant admins.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkCourseRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/LinkCourseRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/LinkCourseRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/LinkCourseRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/LinkCourseRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkCourseResponse'
              examples:
                SuccessfulResponse:
                  value:
                    mentor_unique_id: xxx-xxxx-xxxxx-xxxxx
                    course_id: course-id-v1:abcdefg
                    is_linked: true
                  summary: Successful Response
          description: ''
  /api/ai-mentor/orgs/{org}/mentors/by-email/:
    post:
      operationId: ai_mentor_orgs_mentors_by_email_create
      description: >-
        Returns a list of mentor unique IDs that a user can access via email in
        the specified organization.
      summary: Get accessible mentors by email
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccessibleMentorsByEmailRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/AccessibleMentorsByEmailRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AccessibleMentorsByEmailRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AccessibleMentorsByEmailRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/AccessibleMentorsByEmailRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessibleMentorsByEmailResponse'
              examples:
                SuccessfulResponse:
                  value:
                    mentors:
                      - 550e8400-e29b-41d4-a716-446655440000
                      - 6ba7b810-9dad-11d1-80b4-00c04fd430c8
                    user_id: 1234
                  summary: Successful Response
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
              examples:
                MissingParameters:
                  value:
                    error: email is required
                  summary: Missing Parameters
          description: Invalid request parameters
        '404':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
              examples:
                UserNotFound:
                  value:
                    error: User with id 123 not found by email in platform
                  summary: User Not Found
          description: User or platform not found
  /api/ai-mentor/orgs/{org}/metadata/:
    post:
      operationId: ai_mentor_orgs_metadata_create
      description: |-
        Create or update metadata for a mentor.

        Args:
            request: The HTTP request containing the metadata.
            org: The organization/tenant identifier.

        Returns:
            Response: The created or updated mentor metadata.

        Raises:
            BadRequest: If the provided data is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorMetadata'
            examples:
              MentorMetadataRequestExample:
                value:
                  metadata:
                    specialty: machine learning
                    experience_level: expert
                    languages:
                      - English
                      - Spanish
                  mentor_id: 123
                summary: Mentor Metadata Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorMetadata'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorMetadata'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorMetadata'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorMetadata'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorMetadata'
              examples:
                MentorMetadataResponseExample:
                  value:
                    metadata:
                      specialty: machine learning
                      experience_level: expert
                      languages:
                        - English
                        - Spanish
                    mentor_id: 123
                  summary: Mentor Metadata Response Example
          description: ''
        '400':
          description: Invalid data
  /api/ai-mentor/orgs/{org}/projects/:
    get:
      operationId: ai_mentor_orgs_projects_list
      description: Retrieve a list of projects with optional filtering and search.
      summary: List projects
      parameters:
        - name: limit
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: offset
          required: false
          in: query
          description: The initial index from which to return the results.
          schema:
            type: integer
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: search
          schema:
            type: string
          description: Search in project name and description
        - in: query
          name: shared
          schema:
            type: boolean
          description: Filter by shared status (true/false)
        - in: query
          name: sort
          schema:
            type: string
          description: >-
            Order by field (prefix with - for descending). Example: name or
            -created_at
          examples:
            SortByName:
              value: name
              summary: Sort by name
            SortByNameDescending:
              value: '-name'
              summary: Sort by name descending
            SortByCreationDate:
              value: created_at
              summary: Sort by creation date
            SortByCreationDateDescending:
              value: '-created_at'
              summary: Sort by creation date descending
        - in: query
          name: username
          schema:
            type: string
          description: Filter projects by owner's username
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProjectList'
              examples:
                ProjectsListExample:
                  value:
                    count: 123
                    next: http://api.example.org/accounts/?offset=400&limit=100
                    previous: http://api.example.org/accounts/?offset=200&limit=100
                    results:
                      - - id: 1
                          name: Python Learning Path
                          description: A collection of mentors for learning Python
                          shared: true
                          owner: 1
                          owner_username: john_doe
                          platform: 1
                          platform_key: main
                          platform_name: main
                          mentor_count: 5
                          is_personal: false
                          created_at: '2024-01-15T10:30:00Z'
                          updated_at: '2024-01-15T10:30:00Z'
                          mentors:
                            - id: 1
                              name: Python Mentor
                              description: Expert in Python
                              unique_id: 550e8400-e29b-41d4-a716-446655440000
                              slug: python-mentor
                              created_at: '2024-01-15T10:30:00Z'
                  summary: Projects List Example
          description: ''
    post:
      operationId: ai_mentor_orgs_projects_create
      description: Create a new project with optional mentors.
      summary: Create a new project
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Project'
            examples:
              CreateProjectRequest:
                value:
                  name: Machine Learning Basics
                  description: A project for learning machine learning fundamentals
                  shared: true
                  mentors_to_add:
                    - 550e8400-e29b-41d4-a716-446655440000
                    - 550e8400-e29b-41d4-a716-446655440001
                summary: Create Project Request
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Project'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Project'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Project'
          '*/*':
            schema:
              $ref: '#/components/schemas/Project'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
              examples:
                CreateProjectResponse:
                  value:
                    id: 1
                    name: Machine Learning Basics
                    description: A project for learning machine learning fundamentals
                    shared: true
                    owner: 1
                    owner_username: john_doe
                    platform: 1
                    platform_key: main
                    platform_name: main
                    mentor_count: 2
                    is_personal: false
                    mentors:
                      - id: 1
                        name: ML Mentor
                        description: Machine learning expert
                        unique_id: 550e8400-e29b-41d4-a716-446655440000
                        slug: ml-mentor
                        created_at: '2024-01-15T10:30:00Z'
                    created_at: '2024-01-15T10:30:00Z'
                    updated_at: '2024-01-15T10:30:00Z'
                  summary: Create Project Response
          description: ''
        '400':
          description: Invalid data provided
  /api/ai-mentor/orgs/{org}/projects/{id}/:
    get:
      operationId: ai_mentor_orgs_projects_retrieve
      description: Get detailed information about a specific project including its mentors.
      summary: Retrieve a project
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
          description: ''
        '404':
          description: Project not found
    put:
      operationId: ai_mentor_orgs_projects_update
      description: Update project information and optionally modify its mentors.
      summary: Update a project
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Project'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Project'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Project'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Project'
          '*/*':
            schema:
              $ref: '#/components/schemas/Project'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
          description: ''
        '400':
          description: Invalid data provided
        '403':
          description: Permission denied
    patch:
      operationId: ai_mentor_orgs_projects_partial_update
      description: >-
        API ViewSet for managing projects.


        Projects are groups of mentors that can be created by anyone (students
        and tenant admins).

        They serve as a way to organize and group related mentors together.


        Projects can be:

        - Personal (shared=False): Only visible to their owners

        - Shared (shared=True): Visible to platform admins and potentially other
        users


        Projects are accessed through integrated URLs within the mentor router:
            /orgs/<org>/projects/ - All accessible projects in a platform (admin access)
            /orgs/<org>/projects/<id>/ - Specific project (admin access)
            /orgs/<org>/users/<user_id>/projects/ - User's projects (user access)
            /orgs/<org>/users/<user_id>/projects/<id>/ - User's specific project

        Query Parameters:
            - username: Filter projects by owner's username (admin routes only)
            - shared: Filter by shared status (true/false)
            - search: Search in name and description
            - sort: Order by field (prefix with - for descending). Example: sort=name or sort=-created_at

        Permissions:
            - GET: Accessible to project owners and platform admins (for shared projects)
            - POST: Any authenticated user can create projects
            - PUT, PATCH, DELETE: Accessible to project owners only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedProject'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedProject'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedProject'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedProject'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedProject'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
          description: ''
    delete:
      operationId: ai_mentor_orgs_projects_destroy
      description: Delete a project permanently.
      summary: Delete a project
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Project deleted successfully
        '403':
          description: Permission denied
  /api/ai-mentor/orgs/{org}/quiz-customizer/:
    get:
      operationId: ai_mentor_orgs_quiz_customizer_retrieve
      description: |-
        Retrieve existing questions.

        Args:
            request: The HTTP request.

        Returns:
            Response: The existing questions.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    post:
      operationId: ai_mentor_orgs_quiz_customizer_create
      description: |-
        Generate follow-up questions based on initial questions.

        Args:
            request: The HTTP request containing the initial questions.

        Returns:
            Response: The generated follow-up questions.

        Raises:
            BadRequest: If the provided data is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuestionRequest'
            examples:
              GenerateQuestionsRequestExample:
                value:
                  username: johndoe
                  initial_questions:
                    - text: What is machine learning?
                      difficulty_level: 2
                      possible_answers:
                        - text: A type of artificial intelligence
                        - text: A programming language
                  question_count: 5
                  subject: Artificial Intelligence
                summary: Generate Questions Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/QuestionRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/QuestionRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/QuestionRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/QuestionRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuestionResponse'
              examples:
                GenerateQuestionsResponseExample:
                  value:
                    questions:
                      - text: What are the main types of machine learning?
                        difficulty_level: 3
                        options:
                          - text: >-
                              Supervised, Unsupervised, and Reinforcement
                              Learning
                            is_correct: true
                          - text: Python, Java, and C++
                            is_correct: false
                          - text: Classification, Regression, and Clustering
                            is_correct: false
                  summary: Generate Questions Response Example
          description: ''
        '400':
          description: Invalid data
  /api/ai-mentor/orgs/{org}/sessions/:
    post:
      operationId: ai_mentor_orgs_sessions_create
      description: >-
        Retrieve or create a chat session with a mentor.


        Passing `null` as `tools` results in using all tools assigned to the
        mentor.

        To specify that no tools be used, pass an empty list.


        Args:
            request: HTTP request containing mentor details.
            org: Organization key identifier.
            user_id (optional): Username for authentication (if required by the mentor).

        Returns:
            Response: JSON object containing the session ID.

        Raises:
            Http404: If the mentor is not found.
            ValidationError: If the username is invalid.
            ValidationError: If one or more tool slugs are invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatSessionRequest'
            examples:
              ValidRequest:
                value:
                  mentor: ai-mentor
                summary: Valid Request
              ValidRequestWithTools:
                value:
                  mentor: ai-mentor
                  tools:
                    - websearch-tool
                  enable_artifacts: true
                summary: Valid Request with tools
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ChatSessionRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ChatSessionRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ChatSessionRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/ChatSessionRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSessionResponse'
              examples:
                SuccessfulResponse:
                  value:
                    session_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                    tools:
                      - id: 10
                        name: Web Search Tool
                        display_name: Web Search Tool
                        slug: websearch-tool
                        description: Tool to search for information from the web
                        metadata: null
                        enable_artifacts: true
                        allow_base_agent: true
                        allow_openai_agent: true
                        allow_google_agent: true
                  summary: Successful Response
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: Unspecified response body
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: Unspecified response body
          description: ''
  /api/ai-mentor/orgs/{org}/trigger/:
    post:
      operationId: ai_mentor_orgs_trigger_create
      description: |-
        Create or modify a trigger.

        Args:
            request: The HTTP request containing the trigger data.
            org: The organization/tenant identifier.

        Returns:
            Response: The created or updated trigger details.

        Raises:
            BadRequest: If the provided data is invalid or missing required parameters.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TriggerRequest'
            examples:
              Create/UpdateTriggerRequestExample:
                value:
                  slug: trggr-slug-1
                  template: url_to_email_everyday
                  parameters:
                    recipients:
                      - tcook@apple.com
                    trigger_url: https://google.com
                summary: Create/Update Trigger Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TriggerRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TriggerRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TriggerRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/TriggerRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TriggerResponse'
              examples:
                Create/UpdateTriggerResponseExample:
                  value:
                    slug: trggr-slug-1
                    template: url_to_email_everyday
                    platform: main
                    parameters:
                      recipients:
                        - tcook@apple.com
                      trigger_url: https://google.com
                  summary: Create/Update Trigger Response Example
          description: ''
        '400':
          description: Invalid data or missing required parameters
  /api/ai-mentor/orgs/{org}/trigger-templates/:
    get:
      operationId: ai_mentor_orgs_trigger_templates_retrieve
      description: |-
        Retrieve available trigger templates.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.

        Returns:
            Response: A dictionary of available trigger templates and their required parameters.

        Raises:
            BadRequest: If the request is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Dictionary of trigger templates and their required parameters
        '400':
          description: Invalid request
  /api/ai-mentor/orgs/{org}/trigger/{slug}/:
    get:
      operationId: ai_mentor_orgs_trigger_retrieve
      description: |-
        Retrieve details of a specific trigger.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            slug: The unique slug identifier of the trigger.

        Returns:
            Response: The details of the specified trigger.

        Raises:
            Http404: If the specified trigger does not exist.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: slug
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TriggerResponse'
              examples:
                TriggerDetailResponseExample:
                  value:
                    slug: trggr-slug-1
                    template: url_to_email_everyday
                    platform: main
                    parameters:
                      recipients:
                        - tcook@apple.com
                      trigger_url: https://google.com
                  summary: Trigger Detail Response Example
          description: ''
        '404':
          description: Trigger not found
  /api/ai-mentor/orgs/{org}/trigger/{slug}/deletion/:
    post:
      operationId: ai_mentor_orgs_trigger_deletion_create
      description: |-
        Delete a specific trigger.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            slug: The unique slug identifier of the trigger to delete.

        Returns:
            Response: A confirmation of the deletion status.

        Raises:
            BadRequest: If the specified trigger does not exist.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: slug
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Trigger successfully deleted
        '400':
          description: Trigger not found or invalid request
  /api/ai-mentor/orgs/{org}/users/{user_id}/:
    get:
      operationId: ai_mentor_orgs_users_list
      description: |-
        Retrieve a list of mentors.

        Returns:
            - List of mentors matching the filters.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: Department to filter by
        - in: query
          name: filter_by
          schema:
            type: string
            minLength: 1
          description: 'Filter options include, date, name, default is date '
        - in: query
          name: metadata_key
          schema:
            type: string
            minLength: 1
          description: Metadata key to be queried with
        - in: query
          name: metadata_value
          schema:
            type: string
            minLength: 1
          description: Metadata value to be filter for
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: return_session_information
          schema:
            type: boolean
          description: >-
            Declares if session information should be included in the mentor
            data
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: visibility
          schema:
            type: string
            minLength: 1
          description: visibility type  to be queried with
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedMentorList'
              examples:
                MentorListExample:
                  value:
                    count: 123
                    next: http://api.example.org/accounts/?page=4
                    previous: http://api.example.org/accounts/?page=2
                    results:
                      - - name: John Doe
                          unique_id: '1234'
                          platform_key: main
                          metadata:
                            specialty: AI
                        - name: Jane Smith
                          unique_id: '5678'
                          platform_key: main
                          metadata:
                            specialty: Data Science
                  summary: Mentor list example
          description: ''
    post:
      operationId: ai_mentor_orgs_users_create
      description: |-
        Create a new mentor.
        Body Parameters:
            - name: Mentor name.
            - unique_id: Unique identifier.
            - platform_key: Associated platform.
            - metadata: Additional mentor attributes.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: Department to filter by
        - in: query
          name: filter_by
          schema:
            type: string
            minLength: 1
          description: 'Filter options include, date, name, default is date '
        - in: query
          name: metadata_key
          schema:
            type: string
            minLength: 1
          description: Metadata key to be queried with
        - in: query
          name: metadata_value
          schema:
            type: string
            minLength: 1
          description: Metadata value to be filter for
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: return_session_information
          schema:
            type: boolean
          description: >-
            Declares if session information should be included in the mentor
            data
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: visibility
          schema:
            type: string
            minLength: 1
          description: visibility type  to be queried with
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorCreate'
            examples:
              CreateMentorExample:
                value:
                  name: John Doe
                  unique_id: '1234'
                  platform_key: main
                  metadata:
                    specialty: AI
                summary: Create mentor example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mentor'
              examples:
                CreateMentorExample:
                  value:
                    name: John Doe
                    unique_id: '1234'
                    platform_key: main
                    metadata:
                      specialty: AI
                  summary: Create mentor example
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/{name}/:
    get:
      operationId: ai_mentor_orgs_users_retrieve
      description: |-
        API ViewSet for managing mentors.

        Provides endpoints to retrieve, create, update, and delete mentor data.

        Permissions:
            - Accessible to both tenant admins and students.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: Department to filter by
        - in: query
          name: filter_by
          schema:
            type: string
            minLength: 1
          description: 'Filter options include, date, name, default is date '
        - in: query
          name: metadata_key
          schema:
            type: string
            minLength: 1
          description: Metadata key to be queried with
        - in: query
          name: metadata_value
          schema:
            type: string
            minLength: 1
          description: Metadata value to be filter for
        - in: path
          name: name
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: return_session_information
          schema:
            type: boolean
          description: >-
            Declares if session information should be included in the mentor
            data
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: visibility
          schema:
            type: string
            minLength: 1
          description: visibility type  to be queried with
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mentor'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_update
      description: >-
        Update a mentor's details with RBAC enforcement and custom serializer
        handling.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: Department to filter by
        - in: query
          name: filter_by
          schema:
            type: string
            minLength: 1
          description: 'Filter options include, date, name, default is date '
        - in: query
          name: metadata_key
          schema:
            type: string
            minLength: 1
          description: Metadata key to be queried with
        - in: query
          name: metadata_value
          schema:
            type: string
            minLength: 1
          description: Metadata value to be filter for
        - in: path
          name: name
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: return_session_information
          schema:
            type: boolean
          description: >-
            Declares if session information should be included in the mentor
            data
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: visibility
          schema:
            type: string
            minLength: 1
          description: visibility type  to be queried with
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorCreate'
            examples:
              UpdateMentorExample:
                value:
                  name: John Doe
                  unique_id: '1234'
                  platform_key: main
                  metadata:
                    specialty: AI Research
                summary: Update mentor example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mentor'
              examples:
                UpdateMentorExample:
                  value:
                    name: John Doe
                    unique_id: '1234'
                    platform_key: main
                    metadata:
                      specialty: AI Research
                  summary: Update mentor example
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_partial_update
      description: |-
        API ViewSet for managing mentors.

        Provides endpoints to retrieve, create, update, and delete mentor data.

        Permissions:
            - Accessible to both tenant admins and students.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: Department to filter by
        - in: query
          name: filter_by
          schema:
            type: string
            minLength: 1
          description: 'Filter options include, date, name, default is date '
        - in: query
          name: metadata_key
          schema:
            type: string
            minLength: 1
          description: Metadata key to be queried with
        - in: query
          name: metadata_value
          schema:
            type: string
            minLength: 1
          description: Metadata value to be filter for
        - in: path
          name: name
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: return_session_information
          schema:
            type: boolean
          description: >-
            Declares if session information should be included in the mentor
            data
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: visibility
          schema:
            type: string
            minLength: 1
          description: visibility type  to be queried with
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedMentorCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedMentorCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMentorCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedMentorCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedMentorCreate'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorCreate'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_destroy
      description: Soft delete a mentor.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: Department to filter by
        - in: query
          name: filter_by
          schema:
            type: string
            minLength: 1
          description: 'Filter options include, date, name, default is date '
        - in: query
          name: metadata_key
          schema:
            type: string
            minLength: 1
          description: Metadata key to be queried with
        - in: query
          name: metadata_value
          schema:
            type: string
            minLength: 1
          description: Metadata value to be filter for
        - in: path
          name: name
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: return_session_information
          schema:
            type: boolean
          description: >-
            Declares if session information should be included in the mentor
            data
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: visibility
          schema:
            type: string
            minLength: 1
          description: visibility type  to be queried with
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/ai-generated-images/:
    get:
      operationId: ai_mentor_orgs_users_ai_generated_images_list
      description: >-
        Endpoint to view and delete AI generated images for a user.


        AI Generated images are images generated during chat with AI. They are
        cached to allow retrieval and deletion.


        optional filtering parameters allowed are

        - username: The username of the user for which this image was stored.

        - provider: The provider used to generate the image. eg. openai, nvidia
        (nim), replicate.

        - model: the text to image model on the provider used to generate the
        image.


        This endpoint is accessible to both students and platform admins.
      parameters:
        - in: query
          name: model
          schema:
            type: string
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: provider
          schema:
            type: string
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: username
          schema:
            type: string
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAIGeneratedImageList'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/ai-generated-images/{id}/:
    get:
      operationId: ai_mentor_orgs_users_ai_generated_images_retrieve
      description: >-
        Endpoint to view and delete AI generated images for a user.


        AI Generated images are images generated during chat with AI. They are
        cached to allow retrieval and deletion.


        optional filtering parameters allowed are

        - username: The username of the user for which this image was stored.

        - provider: The provider used to generate the image. eg. openai, nvidia
        (nim), replicate.

        - model: the text to image model on the provider used to generate the
        image.


        This endpoint is accessible to both students and platform admins.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this ai generated image.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIGeneratedImage'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_ai_generated_images_destroy
      description: >-
        Endpoint to view and delete AI generated images for a user.


        AI Generated images are images generated during chat with AI. They are
        cached to allow retrieval and deletion.


        optional filtering parameters allowed are

        - username: The username of the user for which this image was stored.

        - provider: The provider used to generate the image. eg. openai, nvidia
        (nim), replicate.

        - model: the text to image model on the provider used to generate the
        image.


        This endpoint is accessible to both students and platform admins.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this ai generated image.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/ai-user-profile-memory/:
    get:
      operationId: ai_mentor_orgs_users_ai_user_profile_memory_list
      description: >-
        Endpoint to get a list of AI user profile memory entries or to add an
        entry.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AIUserProfileMemoryRelation'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_ai_user_profile_memory_create
      description: |-
        Endpoint to create an AI user profile memory entry.

        Sample request:
        ```
        {"favorite-animal": "my favorite animal is cat"}
        ```
        Sample Response (the same as request data):
        ```
        {"favorite-animal": "my favorite animal is cat"}
        ```
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AIUserProfileRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/AIUserProfileRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AIUserProfileRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AIUserProfileRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/AIUserProfileRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIUserProfileMemoryRelation'
              examples:
                SuccessfulResponse:
                  value:
                    favorite-animal: my favorite animal is cat
                  summary: Successful Response
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/ai-user-profile-memory/{tag}/:
    delete:
      operationId: ai_mentor_orgs_users_ai_user_profile_memory_destroy
      description: >-
        The endpoint to delete an AI user profile memory entry.


        No query parameters or JSON parameters are required.


        The response is always empty. Successful request will be responded with
        status 204, and failed request will be responded with status 404.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: tag
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/artifacts/:
    get:
      operationId: ai_mentor_orgs_users_artifacts_list
      description: >-
        Retrieve a paginated list of artifacts for a user, with optional
        filtering and search.
      summary: List artifacts
      parameters:
        - in: query
          name: chat_message_id
          schema:
            type: string
            format: uuid
          description: Filter by specific chat message UUID
        - in: query
          name: file_extension
          schema:
            type: string
          description: Filter by file extension (e.g., 'py', 'md', 'html')
        - in: query
          name: llm_name
          schema:
            type: string
          description: Filter by LLM name (e.g., 'gpt-4', 'claude-3')
        - in: query
          name: llm_provider
          schema:
            type: string
          description: Filter by LLM provider (e.g., 'openai', 'anthropic')
        - in: query
          name: mentor_id
          schema:
            type: string
            format: uuid
          description: Filter by mentor UUID
        - in: query
          name: ordering
          schema:
            type: string
          description: >-
            Order by field (prefix with - for descending). Options:
            date_created, date_updated, title
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number
        - in: query
          name: page_size
          schema:
            type: integer
          description: 'Number of items per page (max: 100)'
        - in: query
          name: search
          schema:
            type: string
          description: Search in title and content
        - in: query
          name: session_id
          schema:
            type: string
            format: uuid
          description: Filter by session UUID
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: username
          schema:
            type: string
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedArtifactListList'
              examples:
                ArtifactListResponse:
                  value:
                    count: 123
                    next: http://api.example.org/accounts/?page=4
                    previous: http://api.example.org/accounts/?page=2
                    results:
                      - count: 50
                        next: >-
                          http://example.com/api/ai-mentor/orgs/main/users/johndoe/artifacts/?page=2
                        previous: null
                        results:
                          - id: 1
                            title: Python Calculator
                            file_extension: py
                            llm_name: gpt-4
                            llm_provider: openai
                            date_created: '2024-01-15T10:30:00Z'
                            date_updated: '2024-01-15T10:30:00Z'
                            username: johndoe
                            session_id: 550e8400-e29b-41d4-a716-446655440000
                            content_length: 1250
                  summary: Artifact List Response
          description: ''
        '401':
          description: Authentication required
        '403':
          description: Permission denied
  /api/ai-mentor/orgs/{org}/users/{user_id}/artifacts/{id}/:
    get:
      operationId: ai_mentor_orgs_users_artifacts_retrieve
      description: >-
        Get detailed information about a specific artifact including its full
        content.
      summary: Retrieve an artifact
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this artifact.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Artifact'
              examples:
                ArtifactDetailResponse:
                  value:
                    id: 1
                    title: Python Calculator
                    content: |-
                      ```python
                      def add(a, b):
                          return a + b
                      ```
                    file_extension: py
                    chat_message: 550e8400-e29b-41d4-a716-446655440001
                    llm_name: gpt-4
                    llm_provider: openai
                    date_created: '2024-01-15T10:30:00Z'
                    date_updated: '2024-01-15T10:30:00Z'
                    metadata: {}
                    username: johndoe
                    session_id: 550e8400-e29b-41d4-a716-446655440000
                  summary: Artifact Detail Response
          description: ''
        '401':
          description: Authentication required
        '403':
          description: Permission denied
        '404':
          description: Artifact not found
    put:
      operationId: ai_mentor_orgs_users_artifacts_update
      description: Update all fields of an artifact (excluding chat_message reference).
      summary: Update an artifact
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this artifact.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Artifact'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Artifact'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Artifact'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Artifact'
          '*/*':
            schema:
              $ref: '#/components/schemas/Artifact'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Artifact'
          description: ''
        '400':
          description: Invalid data
        '401':
          description: Authentication required
        '403':
          description: Permission denied
        '404':
          description: Artifact not found
    patch:
      operationId: ai_mentor_orgs_users_artifacts_partial_update
      description: Update specific fields of an artifact.
      summary: Partially update an artifact
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this artifact.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedArtifact'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedArtifact'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedArtifact'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedArtifact'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedArtifact'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Artifact'
          description: ''
        '400':
          description: Invalid data
        '401':
          description: Authentication required
        '403':
          description: Permission denied
        '404':
          description: Artifact not found
    delete:
      operationId: ai_mentor_orgs_users_artifacts_destroy
      description: Delete a specific artifact.
      summary: Delete an artifact
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this artifact.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Artifact deleted successfully
        '401':
          description: Authentication required
        '403':
          description: Permission denied
        '404':
          description: Artifact not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/assumed-knowledge/:
    get:
      operationId: ai_mentor_orgs_users_assumed_knowledge_retrieve
      description: |-
        Retrieve assumed knowledge levels.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user to retrieve assumed knowledge for.

        Returns:
            Response: The assumed knowledge levels for different categories.

        Raises:
            NotFound: If no assumed knowledge exists for the user.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssumedKnowledge'
              examples:
                AssumedKnowledgeResponseExample:
                  value:
                    levels:
                      - category: Programming
                        level: Intermediate
                      - category: Mathematics
                        level: Advanced
                  summary: Assumed Knowledge Response Example
          description: ''
        '404':
          description: Assumed knowledge not found
    post:
      operationId: ai_mentor_orgs_users_assumed_knowledge_create
      description: |-
        Update assumed knowledge levels.

        Args:
            request: The HTTP request containing the updated knowledge levels.
            org: The organization/tenant identifier.
            user_id: The ID of the user to update assumed knowledge for.

        Returns:
            Response: The updated assumed knowledge levels.

        Raises:
            BadRequest: If the provided data is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssumedKnowledge'
            examples:
              UpdateAssumedKnowledgeRequestExample:
                value:
                  levels:
                    - category: Programming
                      level: Advanced
                    - category: Mathematics
                      level: Advanced
                    - category: Statistics
                      level: Intermediate
                summary: Update Assumed Knowledge Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/AssumedKnowledge'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AssumedKnowledge'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AssumedKnowledge'
          '*/*':
            schema:
              $ref: '#/components/schemas/AssumedKnowledge'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssumedKnowledge'
              examples:
                UpdateAssumedKnowledgeResponseExample:
                  value:
                    levels:
                      - category: Programming
                        level: Advanced
                      - category: Mathematics
                        level: Advanced
                      - category: Statistics
                        level: Intermediate
                  summary: Update Assumed Knowledge Response Example
          description: ''
        '400':
          description: Invalid data
  /api/ai-mentor/orgs/{org}/users/{user_id}/audio-to-text/:
    post:
      operationId: ai_mentor_orgs_users_audio_to_text_create
      description: |-
        Convert an uploaded audio file to text.

        Args:
            request: The HTTP request containing the audio file.
            org: The organization/tenant identifier.
            user_id: The ID of the user uploading the audio.

        Returns:
            Response: The transcribed text from the audio file.

        Raises:
            BadRequest: If the audio file is invalid or cannot be processed.
            NotFound: If the API key for the tenant is not found.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AudioToTextRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AudioToTextRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/AudioToTextRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AudioToTextResponse'
              examples:
                AudioToTextResponseExample:
                  value:
                    text: This is the transcribed text from the audio file.
                  summary: Audio to Text Response Example
          description: ''
        '400':
          description: Invalid audio file or processing error
        '404':
          description: API key not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/available-template-mentors/:
    get:
      operationId: ai_mentor_orgs_users_available_template_mentors_retrieve
      description: |-
        This endpoint list available template mentors for a tenant

        Returns:

            200 : List of Template Mentors
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateMentor'
              examples:
                ListOfAvailableTemplateMentors:
                  value:
                    - id: 1
                      name: mentorAI
                      platform: main
                      slug: ai-mentor
                      unique_id: 8485a252-eecf-436b-ba25-3f4ea3e7cda9
                      description: >-
                        Upbeat, encouraging tutor helping students understand
                        concepts by explaining ideas and asking questions.
                      system_prompt: Wrap all responses in MARKDOWN formatted text.
                  summary: List of available template mentors
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/call-configurations/:
    get:
      operationId: ai_mentor_orgs_users_call_configurations_list
      description: >-
        API ViewSet for managing call configurations.


        This ViewSet provides endpoints to retrieve, create, and update call
        configurations

        for mentors. Call configurations define how voice calls are handled for
        a mentor.


        Permissions:
            - Accessible only to platform admins.

        Endpoints:
            GET /api/org/{org}/mentors/{mentor_pk}/call-configurations/
                - List all call configurations for a specific mentor
                - Returns paginated list of call configurations

            POST /api/org/{org}/mentors/{mentor_pk}/call-configurations/
                - Create a new call configuration for a mentor
                - Requires call configuration data in request body

            PUT /api/org/{org}/mentors/{mentor_pk}/call-configurations/{id}/
                - Update an existing call configuration
                - Requires call configuration data in request body

        Query Parameters:
            - mentor: Filter configurations by mentor ID

        Returns:
            - CallConfigurationSerializer data
      parameters:
        - in: query
          name: mentor
          schema:
            type: string
        - in: query
          name: mode
          schema:
            type: string
            enum:
              - inference
              - realtime
          description: |-
            * `realtime` - Realtime
            * `inference` - Inference
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CallConfiguration'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_call_configurations_create
      description: >-
        API ViewSet for managing call configurations.


        This ViewSet provides endpoints to retrieve, create, and update call
        configurations

        for mentors. Call configurations define how voice calls are handled for
        a mentor.


        Permissions:
            - Accessible only to platform admins.

        Endpoints:
            GET /api/org/{org}/mentors/{mentor_pk}/call-configurations/
                - List all call configurations for a specific mentor
                - Returns paginated list of call configurations

            POST /api/org/{org}/mentors/{mentor_pk}/call-configurations/
                - Create a new call configuration for a mentor
                - Requires call configuration data in request body

            PUT /api/org/{org}/mentors/{mentor_pk}/call-configurations/{id}/
                - Update an existing call configuration
                - Requires call configuration data in request body

        Query Parameters:
            - mentor: Filter configurations by mentor ID

        Returns:
            - CallConfigurationSerializer data
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallConfiguration'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CallConfiguration'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CallConfiguration'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CallConfiguration'
          '*/*':
            schema:
              $ref: '#/components/schemas/CallConfiguration'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallConfiguration'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/call-configurations/{id}/:
    get:
      operationId: ai_mentor_orgs_users_call_configurations_retrieve
      description: >-
        API ViewSet for managing call configurations.


        This ViewSet provides endpoints to retrieve, create, and update call
        configurations

        for mentors. Call configurations define how voice calls are handled for
        a mentor.


        Permissions:
            - Accessible only to platform admins.

        Endpoints:
            GET /api/org/{org}/mentors/{mentor_pk}/call-configurations/
                - List all call configurations for a specific mentor
                - Returns paginated list of call configurations

            POST /api/org/{org}/mentors/{mentor_pk}/call-configurations/
                - Create a new call configuration for a mentor
                - Requires call configuration data in request body

            PUT /api/org/{org}/mentors/{mentor_pk}/call-configurations/{id}/
                - Update an existing call configuration
                - Requires call configuration data in request body

        Query Parameters:
            - mentor: Filter configurations by mentor ID

        Returns:
            - CallConfigurationSerializer data
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this call configuration.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallConfiguration'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_call_configurations_update
      description: >-
        API ViewSet for managing call configurations.


        This ViewSet provides endpoints to retrieve, create, and update call
        configurations

        for mentors. Call configurations define how voice calls are handled for
        a mentor.


        Permissions:
            - Accessible only to platform admins.

        Endpoints:
            GET /api/org/{org}/mentors/{mentor_pk}/call-configurations/
                - List all call configurations for a specific mentor
                - Returns paginated list of call configurations

            POST /api/org/{org}/mentors/{mentor_pk}/call-configurations/
                - Create a new call configuration for a mentor
                - Requires call configuration data in request body

            PUT /api/org/{org}/mentors/{mentor_pk}/call-configurations/{id}/
                - Update an existing call configuration
                - Requires call configuration data in request body

        Query Parameters:
            - mentor: Filter configurations by mentor ID

        Returns:
            - CallConfigurationSerializer data
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this call configuration.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallConfiguration'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CallConfiguration'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CallConfiguration'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CallConfiguration'
          '*/*':
            schema:
              $ref: '#/components/schemas/CallConfiguration'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallConfiguration'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_call_configurations_partial_update
      description: >-
        API ViewSet for managing call configurations.


        This ViewSet provides endpoints to retrieve, create, and update call
        configurations

        for mentors. Call configurations define how voice calls are handled for
        a mentor.


        Permissions:
            - Accessible only to platform admins.

        Endpoints:
            GET /api/org/{org}/mentors/{mentor_pk}/call-configurations/
                - List all call configurations for a specific mentor
                - Returns paginated list of call configurations

            POST /api/org/{org}/mentors/{mentor_pk}/call-configurations/
                - Create a new call configuration for a mentor
                - Requires call configuration data in request body

            PUT /api/org/{org}/mentors/{mentor_pk}/call-configurations/{id}/
                - Update an existing call configuration
                - Requires call configuration data in request body

        Query Parameters:
            - mentor: Filter configurations by mentor ID

        Returns:
            - CallConfigurationSerializer data
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this call configuration.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedCallConfiguration'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedCallConfiguration'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedCallConfiguration'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedCallConfiguration'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedCallConfiguration'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallConfiguration'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/category-groups/:
    get:
      operationId: ai_mentor_orgs_users_category_groups_list
      description: Retrieve a list of Mentor Category Groups.
      parameters:
        - in: query
          name: audience
          schema:
            type: integer
        - in: query
          name: audience__name
          schema:
            type: string
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MentorCategoryGroup'
              examples:
                ExampleResponse:
                  value:
                    - - id: 1
                        name: Education
                        description: education testing
                        audience:
                          id: 3
                          name: Student
                          description: students
                        audiences:
                          - id: 3
                            name: Student
                            description: students
                        date_created: '2022-10-13T00:00:00Z'
                        categories:
                          - id: 1
                            name: Math
                            description: math testing
                            audience: student
                  summary: Example Response
          description: ''
    post:
      operationId: ai_mentor_orgs_users_category_groups_create
      description: Create a new Mentor Category Group. Only accessible to Platform Admins.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorCategoryGroupCreate'
            examples:
              CreateMentorCategoryGroupExample:
                value:
                  name: STEM
                  description: Science, Technology, Engineering, and Mathematics
                  audience: 3
                  audiences:
                    - 1
                    - 2
                    - 3
                summary: Create Mentor Category Group Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorCategoryGroupCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorCategoryGroupCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorCategoryGroupCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorCategoryGroupCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorCategoryGroup'
              examples:
                CreateMentorCategoryGroupExample:
                  value:
                    name: STEM
                    description: Science, Technology, Engineering, and Mathematics
                    audience: 3
                    audiences:
                      - 1
                      - 2
                      - 3
                  summary: Create Mentor Category Group Example
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/category-groups/{id}/:
    get:
      operationId: ai_mentor_orgs_users_category_groups_retrieve
      description: >-
        Mentor Category Groups offer parent grouping for mentor category
        objects.


        The parameter `audience` is deprecated and is currently left behind for
        backward compatibility.


        Permissions:
            GET: Accessible to both Platform Admins and Students
            POST, DELETE, PATCH, PUT: Accessible to only Platform Admins
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this mentor category group.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorCategoryGroup'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_category_groups_update
      description: >-
        Mentor Category Groups offer parent grouping for mentor category
        objects.


        The parameter `audience` is deprecated and is currently left behind for
        backward compatibility.


        Permissions:
            GET: Accessible to both Platform Admins and Students
            POST, DELETE, PATCH, PUT: Accessible to only Platform Admins
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this mentor category group.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorCategoryGroupCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorCategoryGroupCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorCategoryGroupCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorCategoryGroupCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorCategoryGroupCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorCategoryGroupCreate'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_category_groups_partial_update
      description: >-
        Mentor Category Groups offer parent grouping for mentor category
        objects.


        The parameter `audience` is deprecated and is currently left behind for
        backward compatibility.


        Permissions:
            GET: Accessible to both Platform Admins and Students
            POST, DELETE, PATCH, PUT: Accessible to only Platform Admins
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this mentor category group.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedMentorCategoryGroupCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedMentorCategoryGroupCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMentorCategoryGroupCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedMentorCategoryGroupCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedMentorCategoryGroupCreate'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorCategoryGroupCreate'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_category_groups_destroy
      description: >-
        Mentor Category Groups offer parent grouping for mentor category
        objects.


        The parameter `audience` is deprecated and is currently left behind for
        backward compatibility.


        Permissions:
            GET: Accessible to both Platform Admins and Students
            POST, DELETE, PATCH, PUT: Accessible to only Platform Admins
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this mentor category group.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/clean-vector-results/{session_id}/:
    get:
      operationId: ai_mentor_orgs_users_clean_vector_results_list
      description: |-
        Retrieve and clean up vector results from a specific session.

        This endpoint retrieves the documents last used by the mentor to answer
        the most recent query from the user in the specified session, and cleans
        them to remove any inappropriate content.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user making the request.
            session_id: The ID of the session to retrieve vector results from.

        Returns:
            Response: The cleaned vector results.

        Raises:
            BadRequest: If the API key for the cleaning provider is not found.
            NotFound: If no vector results are found for the session.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: session_id
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VectorResult'
              examples:
                VectorResultsResponseExample:
                  value:
                    - - type: document
                        title: Introduction to Machine Learning
                        snippet: >-
                          Machine learning is a subset of artificial
                          intelligence that focuses on developing systems that
                          can learn from data.
                        source: https://example.com/ml-intro
                        score: 0.92
                        confidence_level: 0.85
                  summary: Vector Results Response Example
          description: ''
        '400':
          description: API key not found
        '404':
          description: Session or results not found
    post:
      operationId: ai_mentor_orgs_users_clean_vector_results_create
      description: >-
        Clean up provided vector results.


        This endpoint allows users to submit specific vector results for
        cleaning,

        which is useful when there are particular documents that need to be
        processed.


        Args:
            request: The HTTP request containing the vector results to clean.
            org: The organization/tenant identifier.
            user_id: The ID of the user making the request.

        Returns:
            Response: The cleaned vector results.

        Raises:
            BadRequest: If the API key for the cleaning provider is not found or the provided data is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: session_id
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/VectorResult'
            examples:
              CleanVectorResultsRequestExample:
                value:
                  - - type: document
                      title: Introduction to Machine Learning
                      snippet: >-
                        Machine learning is a subset of artificial intelligence
                        that focuses on developing systems that can learn from
                        data.
                      source: https://example.com/ml-intro
                      score: 0.92
                      confidence_level: 0.85
                summary: Clean Vector Results Request Example
          application/scim+json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/VectorResult'
          application/x-www-form-urlencoded:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/VectorResult'
          multipart/form-data:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/VectorResult'
          '*/*':
            schema:
              type: array
              items:
                $ref: '#/components/schemas/VectorResult'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VectorResult'
              examples:
                CleanVectorResultsResponseExample:
                  value:
                    - - type: document
                        title: Introduction to Machine Learning
                        snippet: >-
                          Machine learning is a subset of artificial
                          intelligence that focuses on developing systems that
                          can learn from data.
                        source: https://example.com/ml-intro
                        score: 0.92
                        confidence_level: 0.85
                  summary: Clean Vector Results Response Example
          description: ''
        '400':
          description: API key not found or invalid data
  /api/ai-mentor/orgs/{org}/users/{user_id}/clear-chathistory:
    delete:
      operationId: ai_mentor_orgs_users_clear_chathistory_destroy
      description: Endpoint to clear a user's chat history.
      summary: Delete User Chat History
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-task-files/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_task_files_list
      description: >-
        Endpoint to fetch update and delete files associated with course
        creation tasks.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCourseCreationTaskFileList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_course_creation_task_files_create
      description: >-
        Endpoint to fetch update and delete files associated with course
        creation tasks.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseCreationTaskFile'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseCreationTaskFile'
          application/json:
            schema:
              $ref: '#/components/schemas/CourseCreationTaskFile'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCreationTaskFile'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-task-files/{id}/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_task_files_retrieve
      description: >-
        Endpoint to fetch update and delete files associated with course
        creation tasks.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task file.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCreationTaskFile'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_course_creation_task_files_update
      description: >-
        Endpoint to fetch update and delete files associated with course
        creation tasks.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task file.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseCreationTaskFile'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseCreationTaskFile'
          application/json:
            schema:
              $ref: '#/components/schemas/CourseCreationTaskFile'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCreationTaskFile'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_course_creation_task_files_partial_update
      description: >-
        Endpoint to fetch update and delete files associated with course
        creation tasks.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task file.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedCourseCreationTaskFile'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedCourseCreationTaskFile'
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedCourseCreationTaskFile'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCreationTaskFile'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_course_creation_task_files_destroy
      description: >-
        Endpoint to fetch update and delete files associated with course
        creation tasks.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task file.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-tasks/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_tasks_list
      description: >-
        Create, retrieve and delete course creation tasks


        Course creation tasks allow you to schedule the creation of a course on
        OpenEdx deployment connected to this data manager.


        The course is created entirely by an ai model (as specified in your
        inputs).


        The llm decides on the content of the course based on the name,
        description, target audience and other parameters.

        Bigger and newer models tend to outperform smaller once.


        Clear and unambiguous parameters are more likely to produce better
        results.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCourseCreationTaskList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_course_creation_tasks_create
      description: >-
        Create, retrieve and delete course creation tasks


        Course creation tasks allow you to schedule the creation of a course on
        OpenEdx deployment connected to this data manager.


        The course is created entirely by an ai model (as specified in your
        inputs).


        The llm decides on the content of the course based on the name,
        description, target audience and other parameters.

        Bigger and newer models tend to outperform smaller once.


        Clear and unambiguous parameters are more likely to produce better
        results.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseCreationTask'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseCreationTask'
          application/json:
            schema:
              $ref: '#/components/schemas/CourseCreationTask'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCreationTask'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-tasks/{id}/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_tasks_retrieve
      description: >-
        Create, retrieve and delete course creation tasks


        Course creation tasks allow you to schedule the creation of a course on
        OpenEdx deployment connected to this data manager.


        The course is created entirely by an ai model (as specified in your
        inputs).


        The llm decides on the content of the course based on the name,
        description, target audience and other parameters.

        Bigger and newer models tend to outperform smaller once.


        Clear and unambiguous parameters are more likely to produce better
        results.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCreationTask'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_course_creation_tasks_destroy
      description: >-
        Create, retrieve and delete course creation tasks


        Course creation tasks allow you to schedule the creation of a course on
        OpenEdx deployment connected to this data manager.


        The course is created entirely by an ai model (as specified in your
        inputs).


        The llm decides on the content of the course based on the name,
        description, target audience and other parameters.

        Bigger and newer models tend to outperform smaller once.


        Clear and unambiguous parameters are more likely to produce better
        results.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-tasks/{id}/cancel/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_tasks_cancel_retrieve
      description: |-
        Cancel a course creation task run.
        ** Conditions Required **:
        The task must be running or pending.
        ** Response **:
        - 200: The course creation task is successfully cancelled.
        - 400: The course creation task is not in a running or pending state.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCreationTask'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-tasks/{id}/create-course-outline/:
    get:
      operationId: >-
        ai_mentor_orgs_users_course_creation_tasks_create_course_outline_retrieve
      description: |-
        This is intended for stepwise approach of course creation.

        Use this to intiate generating an outline of the course.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FullCourse'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_course_creation_tasks_create_course_outline_create
      description: |-
        This is intended for stepwise approach of course creation.

        Use this to intiate generating an outline of the course.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseCreationTask'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseCreationTask'
          application/json:
            schema:
              $ref: '#/components/schemas/CourseCreationTask'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FullCourse'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-tasks/{id}/start/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_tasks_start_retrieve
      description: >-
        Kick start the course creation task.

        This endpoint should be called once the files for a course creation task
        has

        been successfully uploaded.


        ** Conditions Required **:

        - The course creation task must be in a pending state or failed state.


        ** Response **:

        - 200: The course creation task is successfully started.

        - 400: The course creation task is not in a pending state.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCreationTask'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/component/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_component_list
      description: |-
        API viewset for managing course units.

        This viewset allows platform administrators to retrieve and manage
        units within course subsections, and generate content for them.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: query
          name: course
          schema:
            type: integer
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: query
          name: section
          schema:
            type: integer
        - in: query
          name: subsection
          schema:
            type: integer
        - in: query
          name: task
          schema:
            type: integer
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedUnitList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_course_creation_component_create
      description: |-
        API viewset for managing course units.

        This viewset allows platform administrators to retrieve and manage
        units within course subsections, and generate content for them.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Unit'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Unit'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Unit'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Unit'
          '*/*':
            schema:
              $ref: '#/components/schemas/Unit'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unit'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/component/{id}/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_component_retrieve
      description: |-
        API viewset for managing course units.

        This viewset allows platform administrators to retrieve and manage
        units within course subsections, and generate content for them.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this unit.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unit'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_course_creation_component_update
      description: |-
        API viewset for managing course units.

        This viewset allows platform administrators to retrieve and manage
        units within course subsections, and generate content for them.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this unit.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Unit'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Unit'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Unit'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Unit'
          '*/*':
            schema:
              $ref: '#/components/schemas/Unit'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unit'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_course_creation_component_partial_update
      description: |-
        API viewset for managing course units.

        This viewset allows platform administrators to retrieve and manage
        units within course subsections, and generate content for them.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this unit.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedUnit'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedUnit'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedUnit'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedUnit'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedUnit'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unit'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_course_creation_component_destroy
      description: |-
        API viewset for managing course units.

        This viewset allows platform administrators to retrieve and manage
        units within course subsections, and generate content for them.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this unit.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/component/{id}/draft-content/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_component_draft_content_retrieve
      description: |-
        Generate draft content for a specific unit.

        This action starts a background task to create draft content
        for the specified unit using AI.

        Args:
            request: The HTTP request.
            pk: The primary key of the unit to generate content for.

        Returns:
            Response: A confirmation that the content generation task has been started.

        Raises:
            NotFound: If the specified unit does not exist.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this unit.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Content creation started successfully
        '404':
          description: Unit not found
    post:
      operationId: ai_mentor_orgs_users_course_creation_component_draft_content_create
      description: |-
        Generate draft content for a specific unit.

        This action starts a background task to create draft content
        for the specified unit using AI.

        Args:
            request: The HTTP request.
            pk: The primary key of the unit to generate content for.

        Returns:
            Response: A confirmation that the content generation task has been started.

        Raises:
            NotFound: If the specified unit does not exist.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this unit.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Unit'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Unit'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Unit'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Unit'
          '*/*':
            schema:
              $ref: '#/components/schemas/Unit'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Content creation started successfully
        '404':
          description: Unit not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_course_list
      description: |-
        API viewset for managing EdX courses.

        This viewset allows platform administrators to retrieve, delete, and
        perform various operations on EdX courses that were created through
        course creation tasks.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: query
          name: task
          schema:
            type: integer
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedEdxCourseList'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_course_retrieve
      description: |-
        API viewset for managing EdX courses.

        This viewset allows platform administrators to retrieve, delete, and
        perform various operations on EdX courses that were created through
        course creation tasks.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this edx course.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EdxCourse'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_course_creation_course_destroy
      description: |-
        API viewset for managing EdX courses.

        This viewset allows platform administrators to retrieve, delete, and
        perform various operations on EdX courses that were created through
        course creation tasks.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this edx course.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/draft-content-for-all-units/:
    get:
      operationId: >-
        ai_mentor_orgs_users_course_creation_course_draft_content_for_all_units_retrieve
      description: |-
        Generate draft content for all units in a course.

        This action starts a background task to create draft content
        for all units in the course using AI.

        Args:
            request: The HTTP request.
            pk: The primary key of the course to generate content for.

        Returns:
            Response: A confirmation that the content generation task has been started.

        Raises:
            NotFound: If the specified course does not exist.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this edx course.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Content creation started successfully
        '404':
          description: Course not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/full-structure/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_course_full_structure_retrieve
      description: |-
        Retrieve the full structure of a course.

        This action returns the complete hierarchical structure of the course,
        including all sections, subsections, units, and components.

        Args:
            request: The HTTP request.
            pk: The primary key of the course to retrieve.

        Returns:
            Response: The full structure of the course.

        Raises:
            NotFound: If the specified course does not exist.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this edx course.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FullCourse'
              examples:
                FullStructureResponseExample:
                  value:
                    id: 1
                    course_id: course-v1:edX+DemoX+Demo_Course
                    display_name: Demo Course
                    sections:
                      - id: 1
                        display_name: Introduction
                        subsections:
                          - id: 1
                            display_name: Getting Started
                            units:
                              - id: 1
                                display_name: Welcome
                                components: []
                  summary: Full Structure Response Example
          description: ''
        '404':
          description: Course not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/load-from-edx/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_course_load_from_edx_retrieve
      description: |-
        Load existing course structure from OpenEdX.

        This action starts a background task to pull the course structure
        from the EdX platform into the database.

        Args:
            request: The HTTP request.
            pk: The primary key of the course to load.

        Returns:
            Response: A confirmation that the load task has been started.

        Raises:
            NotFound: If the specified course does not exist.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this edx course.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Course load started successfully
        '404':
          description: Course not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/sync-to-edx/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_course_sync_to_edx_retrieve
      description: |-
        Synchronize the course structure to EdX.

        This action starts a background task to push the course structure
        from the database to the EdX platform.

        Args:
            request: The HTTP request.
            pk: The primary key of the course to synchronize.

        Returns:
            Response: A confirmation that the sync task has been started.

        Raises:
            NotFound: If the specified course does not exist.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this edx course.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Course sync started successfully
        '404':
          description: Course not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/files/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_files_list
      description: >-
        Endpoint to fetch update and delete files associated with course
        creation tasks.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCourseCreationTaskFileList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_course_creation_files_create
      description: >-
        Endpoint to fetch update and delete files associated with course
        creation tasks.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseCreationTaskFile'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseCreationTaskFile'
          application/json:
            schema:
              $ref: '#/components/schemas/CourseCreationTaskFile'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCreationTaskFile'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/files/{id}/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_files_retrieve
      description: >-
        Endpoint to fetch update and delete files associated with course
        creation tasks.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task file.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCreationTaskFile'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_course_creation_files_update
      description: >-
        Endpoint to fetch update and delete files associated with course
        creation tasks.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task file.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseCreationTaskFile'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseCreationTaskFile'
          application/json:
            schema:
              $ref: '#/components/schemas/CourseCreationTaskFile'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCreationTaskFile'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_course_creation_files_partial_update
      description: >-
        Endpoint to fetch update and delete files associated with course
        creation tasks.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task file.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedCourseCreationTaskFile'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedCourseCreationTaskFile'
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedCourseCreationTaskFile'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCreationTaskFile'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_course_creation_files_destroy
      description: >-
        Endpoint to fetch update and delete files associated with course
        creation tasks.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task file.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/section/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_section_list
      description: |-
        API viewset for managing course sections.

        This viewset allows platform administrators to retrieve and manage
        sections within EdX courses.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: query
          name: course
          schema:
            type: integer
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: query
          name: task
          schema:
            type: integer
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedSectionList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_course_creation_section_create
      description: |-
        API viewset for managing course sections.

        This viewset allows platform administrators to retrieve and manage
        sections within EdX courses.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Section'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Section'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Section'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Section'
          '*/*':
            schema:
              $ref: '#/components/schemas/Section'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Section'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/section/{id}/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_section_retrieve
      description: |-
        API viewset for managing course sections.

        This viewset allows platform administrators to retrieve and manage
        sections within EdX courses.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this section.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Section'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_course_creation_section_update
      description: |-
        API viewset for managing course sections.

        This viewset allows platform administrators to retrieve and manage
        sections within EdX courses.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this section.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Section'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Section'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Section'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Section'
          '*/*':
            schema:
              $ref: '#/components/schemas/Section'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Section'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_course_creation_section_partial_update
      description: |-
        API viewset for managing course sections.

        This viewset allows platform administrators to retrieve and manage
        sections within EdX courses.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this section.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedSection'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedSection'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedSection'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedSection'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedSection'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Section'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_course_creation_section_destroy
      description: |-
        API viewset for managing course sections.

        This viewset allows platform administrators to retrieve and manage
        sections within EdX courses.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this section.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/subsection/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_subsection_list
      description: |-
        API viewset for managing course subsections.

        This viewset allows platform administrators to retrieve and manage
        subsections within course sections.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: query
          name: course
          schema:
            type: integer
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: query
          name: section
          schema:
            type: integer
        - in: query
          name: task
          schema:
            type: integer
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedSubSectionList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_course_creation_subsection_create
      description: |-
        API viewset for managing course subsections.

        This viewset allows platform administrators to retrieve and manage
        subsections within course sections.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubSection'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SubSection'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SubSection'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SubSection'
          '*/*':
            schema:
              $ref: '#/components/schemas/SubSection'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubSection'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/subsection/{id}/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_subsection_retrieve
      description: |-
        API viewset for managing course subsections.

        This viewset allows platform administrators to retrieve and manage
        subsections within course sections.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this sub section.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubSection'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_course_creation_subsection_update
      description: |-
        API viewset for managing course subsections.

        This viewset allows platform administrators to retrieve and manage
        subsections within course sections.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this sub section.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubSection'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SubSection'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SubSection'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SubSection'
          '*/*':
            schema:
              $ref: '#/components/schemas/SubSection'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubSection'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_course_creation_subsection_partial_update
      description: |-
        API viewset for managing course subsections.

        This viewset allows platform administrators to retrieve and manage
        subsections within course sections.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this sub section.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedSubSection'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedSubSection'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedSubSection'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedSubSection'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedSubSection'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubSection'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_course_creation_subsection_destroy
      description: |-
        API viewset for managing course subsections.

        This viewset allows platform administrators to retrieve and manage
        subsections within course sections.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this sub section.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/tasks/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_tasks_list_2
      description: >-
        Create, retrieve and delete course creation tasks


        Course creation tasks allow you to schedule the creation of a course on
        OpenEdx deployment connected to this data manager.


        The course is created entirely by an ai model (as specified in your
        inputs).


        The llm decides on the content of the course based on the name,
        description, target audience and other parameters.

        Bigger and newer models tend to outperform smaller once.


        Clear and unambiguous parameters are more likely to produce better
        results.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCourseCreationTaskList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_course_creation_tasks_create_2
      description: >-
        Create, retrieve and delete course creation tasks


        Course creation tasks allow you to schedule the creation of a course on
        OpenEdx deployment connected to this data manager.


        The course is created entirely by an ai model (as specified in your
        inputs).


        The llm decides on the content of the course based on the name,
        description, target audience and other parameters.

        Bigger and newer models tend to outperform smaller once.


        Clear and unambiguous parameters are more likely to produce better
        results.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseCreationTask'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseCreationTask'
          application/json:
            schema:
              $ref: '#/components/schemas/CourseCreationTask'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCreationTask'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/tasks/{id}/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_tasks_retrieve_2
      description: >-
        Create, retrieve and delete course creation tasks


        Course creation tasks allow you to schedule the creation of a course on
        OpenEdx deployment connected to this data manager.


        The course is created entirely by an ai model (as specified in your
        inputs).


        The llm decides on the content of the course based on the name,
        description, target audience and other parameters.

        Bigger and newer models tend to outperform smaller once.


        Clear and unambiguous parameters are more likely to produce better
        results.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCreationTask'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_course_creation_tasks_destroy_2
      description: >-
        Create, retrieve and delete course creation tasks


        Course creation tasks allow you to schedule the creation of a course on
        OpenEdx deployment connected to this data manager.


        The course is created entirely by an ai model (as specified in your
        inputs).


        The llm decides on the content of the course based on the name,
        description, target audience and other parameters.

        Bigger and newer models tend to outperform smaller once.


        Clear and unambiguous parameters are more likely to produce better
        results.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/tasks/{id}/cancel/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_tasks_cancel_retrieve_2
      description: |-
        Cancel a course creation task run.
        ** Conditions Required **:
        The task must be running or pending.
        ** Response **:
        - 200: The course creation task is successfully cancelled.
        - 400: The course creation task is not in a running or pending state.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCreationTask'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/tasks/{id}/create-course-outline/:
    get:
      operationId: >-
        ai_mentor_orgs_users_course_creation_tasks_create_course_outline_retrieve_2
      description: |-
        This is intended for stepwise approach of course creation.

        Use this to intiate generating an outline of the course.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FullCourse'
          description: ''
    post:
      operationId: >-
        ai_mentor_orgs_users_course_creation_tasks_create_course_outline_create_2
      description: |-
        This is intended for stepwise approach of course creation.

        Use this to intiate generating an outline of the course.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseCreationTask'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseCreationTask'
          application/json:
            schema:
              $ref: '#/components/schemas/CourseCreationTask'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FullCourse'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/tasks/{id}/start/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_tasks_start_retrieve_2
      description: >-
        Kick start the course creation task.

        This endpoint should be called once the files for a course creation task
        has

        been successfully uploaded.


        ** Conditions Required **:

        - The course creation task must be in a pending state or failed state.


        ** Response **:

        - 200: The course creation task is successfully started.

        - 400: The course creation task is not in a pending state.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this course creation task.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCreationTask'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/unit/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_unit_list
      description: |-
        API viewset for managing course units.

        This viewset allows platform administrators to retrieve and manage
        units within course subsections, and generate content for them.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: query
          name: course
          schema:
            type: integer
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: query
          name: section
          schema:
            type: integer
        - in: query
          name: subsection
          schema:
            type: integer
        - in: query
          name: task
          schema:
            type: integer
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedUnitList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_course_creation_unit_create
      description: |-
        API viewset for managing course units.

        This viewset allows platform administrators to retrieve and manage
        units within course subsections, and generate content for them.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Unit'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Unit'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Unit'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Unit'
          '*/*':
            schema:
              $ref: '#/components/schemas/Unit'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unit'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/unit/{id}/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_unit_retrieve
      description: |-
        API viewset for managing course units.

        This viewset allows platform administrators to retrieve and manage
        units within course subsections, and generate content for them.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this unit.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unit'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_course_creation_unit_update
      description: |-
        API viewset for managing course units.

        This viewset allows platform administrators to retrieve and manage
        units within course subsections, and generate content for them.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this unit.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Unit'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Unit'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Unit'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Unit'
          '*/*':
            schema:
              $ref: '#/components/schemas/Unit'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unit'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_course_creation_unit_partial_update
      description: |-
        API viewset for managing course units.

        This viewset allows platform administrators to retrieve and manage
        units within course subsections, and generate content for them.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this unit.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedUnit'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedUnit'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedUnit'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedUnit'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedUnit'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unit'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_course_creation_unit_destroy
      description: |-
        API viewset for managing course units.

        This viewset allows platform administrators to retrieve and manage
        units within course subsections, and generate content for them.

        Permissions:
            - Restricted to platform administrators only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this unit.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/unit/{id}/draft-content/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_unit_draft_content_retrieve
      description: |-
        Generate draft content for a specific unit.

        This action starts a background task to create draft content
        for the specified unit using AI.

        Args:
            request: The HTTP request.
            pk: The primary key of the unit to generate content for.

        Returns:
            Response: A confirmation that the content generation task has been started.

        Raises:
            NotFound: If the specified unit does not exist.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this unit.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Content creation started successfully
        '404':
          description: Unit not found
    post:
      operationId: ai_mentor_orgs_users_course_creation_unit_draft_content_create
      description: |-
        Generate draft content for a specific unit.

        This action starts a background task to create draft content
        for the specified unit using AI.

        Args:
            request: The HTTP request.
            pk: The primary key of the unit to generate content for.

        Returns:
            Response: A confirmation that the content generation task has been started.

        Raises:
            NotFound: If the specified unit does not exist.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this unit.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Unit'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Unit'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Unit'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Unit'
          '*/*':
            schema:
              $ref: '#/components/schemas/Unit'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Content creation started successfully
        '404':
          description: Unit not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/create-mentor-wizard/:
    post:
      operationId: ai_mentor_orgs_users_create_mentor_wizard_create
      description: |-
        Create a new mentor using the wizard interface.

        Args:
            request: The HTTP request containing the mentor data.
            org: The organization/tenant identifier.
            user_id: The ID of the user creating the mentor.

        Returns:
            Response: The created mentor.

        Raises:
            BadRequest: If the provided data is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorWizard'
            examples:
              CreateMentorRequestExample:
                value:
                  name: Data Science Mentor
                  description: >-
                    A mentor specialized in data science and machine learning
                    concepts.
                summary: Create Mentor Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorWizard'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorWizard'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorWizard'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorWizard'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mentor'
              examples:
                CreateMentorResponseExample:
                  value:
                    id: 1
                    name: Data Science Mentor
                    description: >-
                      A mentor specialized in data science and machine learning
                      concepts.
                    platform: main
                    categories: []
                    types: []
                    subjects: []
                    unique_id: 937d3d46-3048-4f9d-aa5c-ce7c51d85332
                    created_by: admin
                    date_created: '2023-01-01T12:00:00Z'
                  summary: Create Mentor Response Example
          description: ''
        '400':
          description: Invalid data
  /api/ai-mentor/orgs/{org}/users/{user_id}/custom-instruction/:
    get:
      operationId: ai_mentor_orgs_users_custom_instruction_retrieve
      description: |-
        Retrieve custom instructions for a specific user.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user to retrieve custom instructions for.

        Returns:
            Response: The custom instructions for the user.

        Raises:
            NotFound: If no custom instructions exist for the user.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomInstructionResponse'
              examples:
                CustomInstructionResponseExample:
                  value:
                    id: 1
                    username: johndoe
                    platform_key: main
                    content: Always explain concepts in simple terms with examples.
                    created_at: '2023-01-01T12:00:00Z'
                    updated_at: '2023-01-02T14:30:00Z'
                  summary: Custom Instruction Response Example
          description: ''
        '404':
          description: Custom instruction not found
    post:
      operationId: ai_mentor_orgs_users_custom_instruction_create
      description: |-
        Create a new custom instruction for a user.

        Args:
            request: The HTTP request containing the custom instruction data.
            org: The organization/tenant identifier.
            user_id: The ID of the user to create custom instructions for.

        Returns:
            Response: The created custom instruction.

        Raises:
            BadRequest: If the provided data is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomInstructionResponse'
            examples:
              CreateCustomInstructionRequestExample:
                value:
                  content: Always explain concepts in simple terms with examples.
                summary: Create Custom Instruction Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CustomInstructionResponse'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CustomInstructionResponse'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CustomInstructionResponse'
          '*/*':
            schema:
              $ref: '#/components/schemas/CustomInstructionResponse'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomInstructionResponse'
              examples:
                CreateCustomInstructionResponseExample:
                  value:
                    id: 1
                    username: johndoe
                    platform_key: main
                    content: Always explain concepts in simple terms with examples.
                    created_at: '2023-01-01T12:00:00Z'
                    updated_at: '2023-01-01T12:00:00Z'
                  summary: Create Custom Instruction Response Example
          description: ''
        '400':
          description: Invalid data
    put:
      operationId: ai_mentor_orgs_users_custom_instruction_update
      description: |-
        Update an existing custom instruction for a user.

        Args:
            request: The HTTP request containing the updated custom instruction data.
            org: The organization/tenant identifier.
            user_id: The ID of the user to update custom instructions for.

        Returns:
            Response: The updated custom instruction.

        Raises:
            BadRequest: If the provided data is invalid.
            NotFound: If no custom instruction exists for the user.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomInstructionResponse'
            examples:
              UpdateCustomInstructionRequestExample:
                value:
                  content: >-
                    Always explain concepts in simple terms with examples and
                    analogies.
                summary: Update Custom Instruction Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CustomInstructionResponse'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CustomInstructionResponse'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CustomInstructionResponse'
          '*/*':
            schema:
              $ref: '#/components/schemas/CustomInstructionResponse'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomInstructionResponse'
              examples:
                UpdateCustomInstructionResponseExample:
                  value:
                    id: 1
                    username: johndoe
                    platform_key: main
                    content: >-
                      Always explain concepts in simple terms with examples and
                      analogies.
                    created_at: '2023-01-01T12:00:00Z'
                    updated_at: '2023-01-02T14:30:00Z'
                  summary: Update Custom Instruction Response Example
          description: ''
        '400':
          description: Invalid data
        '404':
          description: Custom instruction not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/disclaimer-agreements/:
    get:
      operationId: ai_mentor_orgs_users_disclaimer_agreements_list
      description: >-
        API view for managing disclaimer agreements.


        This viewset provides Create Read and Delete operations for disclaimer
        agreements with different access levels:


        Platform Admins:

        - Can view all disclaimer agreements for their platform

        - Have full access to create (for themselves) and delete agreements for
        themselves and other users.

        - Results are paginated and can be filtered


        Students:

        - Can only view their own disclaimer agreements

        - Limited to agreements where they are the user

        - Results are paginated and can be filtered


        List endpoint returns paginated results with disclaimer agreement
        objects:


        ```

        {
            "count": int,
            "next": str,
            "previous": str,
            "results": [
                {
                    "id": int,
                    "user": str,
                    "disclaimer": int,
                    "agreed_at": datetime,

                },
                ...
            ]
        }

        ```


        Detail endpoints return a single disclaimer agreement object with the
        same structure
      parameters:
        - in: query
          name: disclaimer
          schema:
            type: integer
        - in: query
          name: mentor_id
          schema:
            type: string
            format: uuid
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: username
          schema:
            type: string
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedDisclaimerAgreementList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_disclaimer_agreements_create
      description: >-
        API view for managing disclaimer agreements.


        This viewset provides Create Read and Delete operations for disclaimer
        agreements with different access levels:


        Platform Admins:

        - Can view all disclaimer agreements for their platform

        - Have full access to create (for themselves) and delete agreements for
        themselves and other users.

        - Results are paginated and can be filtered


        Students:

        - Can only view their own disclaimer agreements

        - Limited to agreements where they are the user

        - Results are paginated and can be filtered


        List endpoint returns paginated results with disclaimer agreement
        objects:


        ```

        {
            "count": int,
            "next": str,
            "previous": str,
            "results": [
                {
                    "id": int,
                    "user": str,
                    "disclaimer": int,
                    "agreed_at": datetime,

                },
                ...
            ]
        }

        ```


        Detail endpoints return a single disclaimer agreement object with the
        same structure
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DisclaimerAgreement'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/DisclaimerAgreement'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DisclaimerAgreement'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DisclaimerAgreement'
          '*/*':
            schema:
              $ref: '#/components/schemas/DisclaimerAgreement'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DisclaimerAgreement'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/disclaimer-agreements/{id}/:
    get:
      operationId: ai_mentor_orgs_users_disclaimer_agreements_retrieve
      description: >-
        API view for managing disclaimer agreements.


        This viewset provides Create Read and Delete operations for disclaimer
        agreements with different access levels:


        Platform Admins:

        - Can view all disclaimer agreements for their platform

        - Have full access to create (for themselves) and delete agreements for
        themselves and other users.

        - Results are paginated and can be filtered


        Students:

        - Can only view their own disclaimer agreements

        - Limited to agreements where they are the user

        - Results are paginated and can be filtered


        List endpoint returns paginated results with disclaimer agreement
        objects:


        ```

        {
            "count": int,
            "next": str,
            "previous": str,
            "results": [
                {
                    "id": int,
                    "user": str,
                    "disclaimer": int,
                    "agreed_at": datetime,

                },
                ...
            ]
        }

        ```


        Detail endpoints return a single disclaimer agreement object with the
        same structure
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this disclaimer agreement.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DisclaimerAgreement'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_disclaimer_agreements_destroy
      description: >-
        API view for managing disclaimer agreements.


        This viewset provides Create Read and Delete operations for disclaimer
        agreements with different access levels:


        Platform Admins:

        - Can view all disclaimer agreements for their platform

        - Have full access to create (for themselves) and delete agreements for
        themselves and other users.

        - Results are paginated and can be filtered


        Students:

        - Can only view their own disclaimer agreements

        - Limited to agreements where they are the user

        - Results are paginated and can be filtered


        List endpoint returns paginated results with disclaimer agreement
        objects:


        ```

        {
            "count": int,
            "next": str,
            "previous": str,
            "results": [
                {
                    "id": int,
                    "user": str,
                    "disclaimer": int,
                    "agreed_at": datetime,

                },
                ...
            ]
        }

        ```


        Detail endpoints return a single disclaimer agreement object with the
        same structure
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this disclaimer agreement.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/disclaimers/:
    get:
      operationId: ai_mentor_orgs_users_disclaimers_list
      description: >-
        ViewSet for managing mentor disclaimers.


        This viewset provides endpoints for creating and managing mentor
        disclaimers, which are

        statements or information that mentors need to share with students.


        Permissions:
            - Platform administrators have full CRUD access
            - Students have read-only access
            - Unauthenticated users have no access

        Endpoints:
            - GET /api/orgs/{org}/users/{user_id}/disclaimers/ - List all disclaimers
            - POST /api/orgs/{org}/users/{user_id}/disclaimers/ - Create a new disclaimer
            - GET /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Retrieve a specific disclaimer
            - PUT/PATCH /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Update a disclaimer
            - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/add_mentor/ - Add mentor to disclaimer
            - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/remove_mentor/ - Remove mentor from disclaimer

        Query Parameters:
            - Supports filtering via DjangoFilterBackend
            - See DisclaimerFilterSet for available filters

        Returns:
            List endpoint returns paginated results with disclaimer objects:

            ```
            {
                "count": int,
                "next": str,
                "previous": str,
                "results": [
                    {
                        "id": int,
                        "title": str,
                        "content": str,
                        "mentor": str,
                        "platform": str,
                        "created_at": datetime,
                        "updated_at": datetime
                    },
                    ...
                ]
            }
            ```

            Detail endpoints return a single disclaimer object with the same structure
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
        - in: query
          name: mentor_id
          schema:
            type: string
            format: uuid
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: scope
          schema:
            type: string
            enum:
              - mentor
              - platform
          description: |-
            * `platform` - Platform
            * `mentor` - Mentor
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedDisclaimerList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_disclaimers_create
      description: >-
        ViewSet for managing mentor disclaimers.


        This viewset provides endpoints for creating and managing mentor
        disclaimers, which are

        statements or information that mentors need to share with students.


        Permissions:
            - Platform administrators have full CRUD access
            - Students have read-only access
            - Unauthenticated users have no access

        Endpoints:
            - GET /api/orgs/{org}/users/{user_id}/disclaimers/ - List all disclaimers
            - POST /api/orgs/{org}/users/{user_id}/disclaimers/ - Create a new disclaimer
            - GET /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Retrieve a specific disclaimer
            - PUT/PATCH /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Update a disclaimer
            - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/add_mentor/ - Add mentor to disclaimer
            - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/remove_mentor/ - Remove mentor from disclaimer

        Query Parameters:
            - Supports filtering via DjangoFilterBackend
            - See DisclaimerFilterSet for available filters

        Returns:
            List endpoint returns paginated results with disclaimer objects:

            ```
            {
                "count": int,
                "next": str,
                "previous": str,
                "results": [
                    {
                        "id": int,
                        "title": str,
                        "content": str,
                        "mentor": str,
                        "platform": str,
                        "created_at": datetime,
                        "updated_at": datetime
                    },
                    ...
                ]
            }
            ```

            Detail endpoints return a single disclaimer object with the same structure
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Disclaimer'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Disclaimer'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Disclaimer'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Disclaimer'
          '*/*':
            schema:
              $ref: '#/components/schemas/Disclaimer'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Disclaimer'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/disclaimers/{id}/:
    get:
      operationId: ai_mentor_orgs_users_disclaimers_retrieve
      description: >-
        ViewSet for managing mentor disclaimers.


        This viewset provides endpoints for creating and managing mentor
        disclaimers, which are

        statements or information that mentors need to share with students.


        Permissions:
            - Platform administrators have full CRUD access
            - Students have read-only access
            - Unauthenticated users have no access

        Endpoints:
            - GET /api/orgs/{org}/users/{user_id}/disclaimers/ - List all disclaimers
            - POST /api/orgs/{org}/users/{user_id}/disclaimers/ - Create a new disclaimer
            - GET /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Retrieve a specific disclaimer
            - PUT/PATCH /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Update a disclaimer
            - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/add_mentor/ - Add mentor to disclaimer
            - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/remove_mentor/ - Remove mentor from disclaimer

        Query Parameters:
            - Supports filtering via DjangoFilterBackend
            - See DisclaimerFilterSet for available filters

        Returns:
            List endpoint returns paginated results with disclaimer objects:

            ```
            {
                "count": int,
                "next": str,
                "previous": str,
                "results": [
                    {
                        "id": int,
                        "title": str,
                        "content": str,
                        "mentor": str,
                        "platform": str,
                        "created_at": datetime,
                        "updated_at": datetime
                    },
                    ...
                ]
            }
            ```

            Detail endpoints return a single disclaimer object with the same structure
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this disclaimer.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Disclaimer'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_disclaimers_update
      description: >-
        ViewSet for managing mentor disclaimers.


        This viewset provides endpoints for creating and managing mentor
        disclaimers, which are

        statements or information that mentors need to share with students.


        Permissions:
            - Platform administrators have full CRUD access
            - Students have read-only access
            - Unauthenticated users have no access

        Endpoints:
            - GET /api/orgs/{org}/users/{user_id}/disclaimers/ - List all disclaimers
            - POST /api/orgs/{org}/users/{user_id}/disclaimers/ - Create a new disclaimer
            - GET /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Retrieve a specific disclaimer
            - PUT/PATCH /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Update a disclaimer
            - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/add_mentor/ - Add mentor to disclaimer
            - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/remove_mentor/ - Remove mentor from disclaimer

        Query Parameters:
            - Supports filtering via DjangoFilterBackend
            - See DisclaimerFilterSet for available filters

        Returns:
            List endpoint returns paginated results with disclaimer objects:

            ```
            {
                "count": int,
                "next": str,
                "previous": str,
                "results": [
                    {
                        "id": int,
                        "title": str,
                        "content": str,
                        "mentor": str,
                        "platform": str,
                        "created_at": datetime,
                        "updated_at": datetime
                    },
                    ...
                ]
            }
            ```

            Detail endpoints return a single disclaimer object with the same structure
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this disclaimer.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Disclaimer'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Disclaimer'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Disclaimer'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Disclaimer'
          '*/*':
            schema:
              $ref: '#/components/schemas/Disclaimer'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Disclaimer'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_disclaimers_partial_update
      description: >-
        ViewSet for managing mentor disclaimers.


        This viewset provides endpoints for creating and managing mentor
        disclaimers, which are

        statements or information that mentors need to share with students.


        Permissions:
            - Platform administrators have full CRUD access
            - Students have read-only access
            - Unauthenticated users have no access

        Endpoints:
            - GET /api/orgs/{org}/users/{user_id}/disclaimers/ - List all disclaimers
            - POST /api/orgs/{org}/users/{user_id}/disclaimers/ - Create a new disclaimer
            - GET /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Retrieve a specific disclaimer
            - PUT/PATCH /api/orgs/{org}/users/{user_id}/disclaimers/{id}/ - Update a disclaimer
            - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/add_mentor/ - Add mentor to disclaimer
            - POST /api/orgs/{org}/users/{user_id}/disclaimers/{id}/remove_mentor/ - Remove mentor from disclaimer

        Query Parameters:
            - Supports filtering via DjangoFilterBackend
            - See DisclaimerFilterSet for available filters

        Returns:
            List endpoint returns paginated results with disclaimer objects:

            ```
            {
                "count": int,
                "next": str,
                "previous": str,
                "results": [
                    {
                        "id": int,
                        "title": str,
                        "content": str,
                        "mentor": str,
                        "platform": str,
                        "created_at": datetime,
                        "updated_at": datetime
                    },
                    ...
                ]
            }
            ```

            Detail endpoints return a single disclaimer object with the same structure
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this disclaimer.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedDisclaimer'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedDisclaimer'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedDisclaimer'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedDisclaimer'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedDisclaimer'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Disclaimer'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/disclaimers/{id}/add-mentor/:
    post:
      operationId: ai_mentor_orgs_users_disclaimers_add_mentor_create
      description: >-
        Add a mentor to a disclaimer with `mentor` scope. Only platform admins
        can perform this action.
      summary: Add mentor to disclaimer
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this disclaimer.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddMentorToDisclaimer'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/AddMentorToDisclaimer'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AddMentorToDisclaimer'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AddMentorToDisclaimer'
          '*/*':
            schema:
              $ref: '#/components/schemas/AddMentorToDisclaimer'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Disclaimer'
          description: ''
        '400':
          description: Bad Request
        '403':
          description: Permission Denied
        '404':
          description: Not Found
  /api/ai-mentor/orgs/{org}/users/{user_id}/disclaimers/{id}/remove-mentor/:
    post:
      operationId: ai_mentor_orgs_users_disclaimers_remove_mentor_create
      description: >-
        Remove a mentor from a disclaimer with `mentor` scope. Only platform
        admins can perform this action. Validates that at least one mentor
        remains after removal.
      summary: Remove mentor from disclaimer
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this disclaimer.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RemoveMentorFromDisclaimer'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/RemoveMentorFromDisclaimer'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RemoveMentorFromDisclaimer'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RemoveMentorFromDisclaimer'
          '*/*':
            schema:
              $ref: '#/components/schemas/RemoveMentorFromDisclaimer'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Disclaimer'
          description: ''
        '400':
          description: Bad Request
        '403':
          description: Permission Denied
        '404':
          description: Not Found
  /api/ai-mentor/orgs/{org}/users/{user_id}/downloads/tasks/{task_id}/:
    get:
      operationId: ai_mentor_orgs_users_downloads_tasks_retrieve
      description: |-
        Retrieves the chat history for a user if the export task is ready.

        This Endpoint to download user chathistory.

        Accessible to tenant admins and students.

        Returns:

            200: When task is not ready.

            200: chat history object

            400: When data is not valid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: task_id
          schema:
            type: string
            format: uuid
          required: true
        - in: query
          name: to_csv
          schema:
            type: boolean
            default: false
          description: Choose download in csv or not
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatHistoryItem'
              examples:
                ChatHistoryTaskNotReady:
                  value:
                    state: task_not_ready
                  summary: Chat history task not ready
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/edx-memory/:
    get:
      operationId: ai_mentor_orgs_users_edx_memory_list
      description: >-
        Endpoints to fetch and delete Edx stored Memory information stored for a
        user and a corresponding edx course they have interracted with.

        This information is passed to the corresponding mentor so the mentor has
        context information

        about the course and unit that the user last interracted with.


        There can be only one UserEdxMemory instance per student and course_id.


        Url Args:
            org (str): The organization's platform key.
            user_id (str): The username  identifier of the individual.

        Returns:

            200: A paginated list of UserEdxMemory objects

        Examples:

            - List all memories
                GET: /api/ai-mentor/orgs/main/users/johndoe/edx-memory/

                Request:        None
                Response:       {
                                    "count": 0,
                                    "next": null,
                                    "previous": null,
                                    "results": [{
                                        "student": 1,
                                        "course_id": "course-v1:main+CARBON+2024_Fall",
                                        "data": {},
                                        "date_created": "2024-06-25T15:30:26.257140",
                                        "last_modified": "2024-06-25T15:30:26.257140"
                                    }]
                                }
            - Get a single UserEdxMemory object
                GET: /api/ai-mentor/orgs/main/users/johndoe/edx-memory/1/

                Request:        None
                Response:       {
                                    "student": 1,
                                    "course_id": "course-v1:main+CARBON+2024_Fall",
                                    "data": {},
                                    "date_created": "2024-06-25T15:30:26.257140",
                                    "last_modified": "2024-06-25T15:30:26.257140"
                                }
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: student
          schema:
            type: integer
            maximum: 2147483647
            minimum: 0
          description: edX user ID
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: username
          schema:
            type: string
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedUserEdxMemoryList'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/edx-memory/{id}/:
    get:
      operationId: ai_mentor_orgs_users_edx_memory_retrieve
      description: >-
        Endpoints to fetch and delete Edx stored Memory information stored for a
        user and a corresponding edx course they have interracted with.

        This information is passed to the corresponding mentor so the mentor has
        context information

        about the course and unit that the user last interracted with.


        There can be only one UserEdxMemory instance per student and course_id.


        Url Args:
            org (str): The organization's platform key.
            user_id (str): The username  identifier of the individual.

        Returns:

            200: A paginated list of UserEdxMemory objects

        Examples:

            - List all memories
                GET: /api/ai-mentor/orgs/main/users/johndoe/edx-memory/

                Request:        None
                Response:       {
                                    "count": 0,
                                    "next": null,
                                    "previous": null,
                                    "results": [{
                                        "student": 1,
                                        "course_id": "course-v1:main+CARBON+2024_Fall",
                                        "data": {},
                                        "date_created": "2024-06-25T15:30:26.257140",
                                        "last_modified": "2024-06-25T15:30:26.257140"
                                    }]
                                }
            - Get a single UserEdxMemory object
                GET: /api/ai-mentor/orgs/main/users/johndoe/edx-memory/1/

                Request:        None
                Response:       {
                                    "student": 1,
                                    "course_id": "course-v1:main+CARBON+2024_Fall",
                                    "data": {},
                                    "date_created": "2024-06-25T15:30:26.257140",
                                    "last_modified": "2024-06-25T15:30:26.257140"
                                }
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this user edx memory.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserEdxMemory'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_edx_memory_destroy
      description: >-
        Endpoints to fetch and delete Edx stored Memory information stored for a
        user and a corresponding edx course they have interracted with.

        This information is passed to the corresponding mentor so the mentor has
        context information

        about the course and unit that the user last interracted with.


        There can be only one UserEdxMemory instance per student and course_id.


        Url Args:
            org (str): The organization's platform key.
            user_id (str): The username  identifier of the individual.

        Returns:

            200: A paginated list of UserEdxMemory objects

        Examples:

            - List all memories
                GET: /api/ai-mentor/orgs/main/users/johndoe/edx-memory/

                Request:        None
                Response:       {
                                    "count": 0,
                                    "next": null,
                                    "previous": null,
                                    "results": [{
                                        "student": 1,
                                        "course_id": "course-v1:main+CARBON+2024_Fall",
                                        "data": {},
                                        "date_created": "2024-06-25T15:30:26.257140",
                                        "last_modified": "2024-06-25T15:30:26.257140"
                                    }]
                                }
            - Get a single UserEdxMemory object
                GET: /api/ai-mentor/orgs/main/users/johndoe/edx-memory/1/

                Request:        None
                Response:       {
                                    "student": 1,
                                    "course_id": "course-v1:main+CARBON+2024_Fall",
                                    "data": {},
                                    "date_created": "2024-06-25T15:30:26.257140",
                                    "last_modified": "2024-06-25T15:30:26.257140"
                                }
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this user edx memory.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/elevenlabs-voice/:
    get:
      operationId: ai_mentor_orgs_users_elevenlabs_voice_list
      description: |-
        Retrieve a list of Elevenlabs voices available to a user.

        This endpoint returns both custom voices created by the user
        and premade voices available to all users.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user to retrieve voices for.

        Returns:
            Response: A list of available Elevenlabs voices.

        Raises:
            NotFound: If the specified user does not exist.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ElevenlabsCustomVoiceResponse'
              examples:
                VoiceListResponseExample:
                  value:
                    - - name: my_voice1
                        owner_student: student0
                        language: en
                        is_premade: false
                        sample_audio_url: https://example.com/audio/sample1.mp3
                      - name: my_voice2
                        owner_student: student0
                        language: en
                        is_premade: false
                        sample_audio_url: https://example.com/audio/sample2.mp3
                      - name: Annie
                        owner_student: null
                        language: en
                        is_premade: true
                        sample_audio_url: https://example.com/audio/annie.mp3
                  summary: Voice List Response Example
          description: ''
        '404':
          description: User not found
    post:
      operationId: ai_mentor_orgs_users_elevenlabs_voice_create
      description: >-
        Create a new custom Elevenlabs voice.


        This endpoint allows users to upload audio files to create a custom
        voice

        that can be used with the Elevenlabs text-to-speech service.


        Note: The audio files' total length should be longer than 1 minute and

        the total size should be smaller than 11 MiB.


        Args:
            request: The HTTP request containing the voice name and audio files.
            org: The organization/tenant identifier.
            user_id: The ID of the user creating the voice.

        Returns:
            Response: The created voice configuration.

        Raises:
            BadRequest: If the provided data is invalid, credentials are not found, or there's an API error.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ElevenlabsCustomVoice'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ElevenlabsCustomVoice'
          application/json:
            schema:
              $ref: '#/components/schemas/ElevenlabsCustomVoice'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ElevenlabsCustomVoiceResponse'
              examples:
                CreateVoiceResponseExample:
                  value:
                    name: my_voice1
                    owner_student: student0
                    language: en
                    is_premade: false
                    sample_audio_url: https://example.com/audio/sample1.mp3
                  summary: Create Voice Response Example
          description: ''
        '400':
          description: Invalid data, credentials not found, or API error
  /api/ai-mentor/orgs/{org}/users/{user_id}/elevenlabs-voice/{voice_name}/:
    delete:
      operationId: ai_mentor_orgs_users_elevenlabs_voice_destroy
      description: >-
        Delete an existing Elevenlabs voice configuration.


        This endpoint removes a custom voice configuration both from the local
        database

        and from the Elevenlabs remote API if applicable.


        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user who owns the voice.
            voice_name: The name of the voice to delete.

        Returns:
            Response: A confirmation of the deletion.

        Raises:
            BadRequest: If the Elevenlabs credentials are not found or there's an API error.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: path
          name: voice_name
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Voice successfully deleted
        '400':
          description: Credentials not found or API error
  /api/ai-mentor/orgs/{org}/users/{user_id}/export-chathistory/:
    post:
      operationId: ai_mentor_orgs_users_export_chathistory_create
      description: |-
        Initiates a background task to export the user's chat history.

        Returns:

            200: task id.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskView'
              examples:
                ExportUserChatHistory:
                  value:
                    task_id: 307be194-2351-44ff-8d7b-24660fd9ec34
                  summary: Export user chat history
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/extracted-memories/:
    get:
      operationId: ai_mentor_orgs_users_extracted_memories_retrieve
      description: >-
        Returns extracted memory for a user. This is the memory that the user
        tells the mentor to remember or is inferred from conversations.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserMemory'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/filtered-memories/:
    get:
      operationId: ai_mentor_orgs_users_filtered_memories_list
      description: |-
        Retrieve a list of memories based on filter conditions.
        Only accessible to tenant admins.

        Returns:
            Response: A paginated list of memories.
            Put your queries using the parameters in the query parameters. For example, to search a mentor's regular mode memory, use the following url:
            ```
            https://base.manager.iblai.app/api/ai-mentor/orgs/your-org/users/your-user/filtered-memories/?mentor=f81fc856-fd8f-4e6b-9d3b-72aa68279c40&mode=regular&username=another-user
            ```

        Raises:
            NotFound: If the query is invalid.
      parameters:
        - in: query
          name: category
          schema:
            type: string
          description: a string of category to filter memories
        - in: query
          name: end_date
          schema:
            type: string
          description: ISO date for end date (optional)
        - in: query
          name: mentor
          schema:
            type: string
          description: the mentor unique id which the memory is linked to
        - in: query
          name: mode
          schema:
            type: string
          description: >-
            mode which the memory applies to. can be `guided`, `regular` or
            `all`
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: platform
          schema:
            type: string
          description: the platform which the memory is linked to
        - in: query
          name: session
          schema:
            type: string
          description: the session id which the memory is linked to
        - in: query
          name: start_date
          schema:
            type: string
          description: ISO date for start date (optional)
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: username
          schema:
            type: string
          description: the username of the memories
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedUserMemoryList'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/free-usage-count:
    get:
      operationId: ai_mentor_orgs_users_free_usage_count_retrieve
      description: |-
        Retrieve the count of free usage credits available to a user.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user to check free usage for.

        Returns:
            Response: The count of free usage credits available.

        Raises:
            NotFound: If the specified user does not exist.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FreeUsageCount'
              examples:
                FreeUsageCountExample:
                  value:
                    count: 10
                  summary: Free Usage Count Example
          description: ''
        '404':
          description: User not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/mcp-servers/:
    get:
      operationId: ai_mentor_orgs_users_mcp_servers_list
      description: |-
        List all MCP servers.

        Returns a paginated list of MCP servers that can be filtered by platform
        and searched by name or URL.
      parameters:
        - in: query
          name: is_featured
          schema:
            type: boolean
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: platform
          schema:
            type: integer
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedMCPServerList'
              examples:
                SuccessfulResponse:
                  value:
                    count: 123
                    next: http://api.example.org/accounts/?page=4
                    previous: http://api.example.org/accounts/?page=2
                    results:
                      - - id: 1
                          name: MCP Server 1
                          url: https://mcp-server-1.example.com
                          transport: sse
                          platform: 1
                          headers:
                            Authorization: Bearer 1234567890
                          is_featured: true
                        - id: 2
                          name: MCP Server 2
                          url: https://mcp-server-2.example.com
                          transport: sse
                          platform: 1
                          headers: {}
                          is_featured: false
                  summary: Successful Response
          description: ''
    post:
      operationId: ai_mentor_orgs_users_mcp_servers_create
      description: >-
        ViewSet for MCP Servers.


        Allows platform admins to list, create, retrieve, update, and delete MCP
        servers.


        Permissions:
            - Accessible to tenant admins.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MCPServer'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MCPServer'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MCPServer'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MCPServer'
          '*/*':
            schema:
              $ref: '#/components/schemas/MCPServer'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MCPServer'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/mcp-servers/{id}/:
    get:
      operationId: ai_mentor_orgs_users_mcp_servers_retrieve
      description: >-
        ViewSet for MCP Servers.


        Allows platform admins to list, create, retrieve, update, and delete MCP
        servers.


        Permissions:
            - Accessible to tenant admins.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this mcp server.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MCPServer'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_mcp_servers_update
      description: >-
        ViewSet for MCP Servers.


        Allows platform admins to list, create, retrieve, update, and delete MCP
        servers.


        Permissions:
            - Accessible to tenant admins.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this mcp server.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MCPServer'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MCPServer'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MCPServer'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MCPServer'
          '*/*':
            schema:
              $ref: '#/components/schemas/MCPServer'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MCPServer'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_mcp_servers_partial_update
      description: >-
        ViewSet for MCP Servers.


        Allows platform admins to list, create, retrieve, update, and delete MCP
        servers.


        Permissions:
            - Accessible to tenant admins.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this mcp server.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedMCPServer'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedMCPServer'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMCPServer'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedMCPServer'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedMCPServer'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MCPServer'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_mcp_servers_destroy
      description: >-
        ViewSet for MCP Servers.


        Allows platform admins to list, create, retrieve, update, and delete MCP
        servers.


        Permissions:
            - Accessible to tenant admins.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this mcp server.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/memories/:
    get:
      operationId: ai_mentor_orgs_users_memories_list
      description: |-
        Retrieve a list of memories based on filter conditions.

        Returns:
            Response: A paginated list of memories.
            Put your queries using the parameters in the query parameters. For example, to search a mentor's regular mode memory, use the following url:
            ```
            https://base.manager.iblai.app/api/ai-mentor/orgs/your-org/users/your-user/memories/?mentor=f81fc856-fd8f-4e6b-9d3b-72aa68279c40&mode=regular
            ```

        Raises:
            NotFound: If the query is invalid.
      parameters:
        - in: query
          name: category
          schema:
            type: string
          description: a string of category to filter memories
        - in: query
          name: end_date
          schema:
            type: string
          description: ISO date for end date (optional)
        - in: query
          name: mentor
          schema:
            type: string
          description: the mentor unique id which the memory is linked to
        - in: query
          name: mode
          schema:
            type: string
          description: >-
            mode which the memory applies to. can be `guided`, `regular` or
            `all`
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: platform
          schema:
            type: string
          description: the platform which the memory is linked to
        - in: query
          name: session
          schema:
            type: string
          description: the session id which the memory is linked to
        - in: query
          name: start_date
          schema:
            type: string
          description: ISO date for start date (optional)
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedUserMemoryList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_memories_create
      description: Create memory using the request data
      summary: Create memory
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserMemoryRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserMemoryRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserMemoryRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserMemoryRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserMemoryRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedUserMemoryList'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/memory-categories/:
    get:
      operationId: ai_mentor_orgs_users_memory_categories_retrieve
      description: >-
        Use the this endpoint to get all memory categories:

        ```

        GET /api/ai-mentor/orgs/main/users/your-user/memory-categories/

        ```

        Sample response

        ```

        {"categories": ["lessons_learned", "knowledge_gaps", "help_requests",
        "personal_information"]}

        ```
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/memory-entries/{entry_unique_id}/:
    get:
      operationId: ai_mentor_orgs_users_memory_entries_retrieve
      description: |-
        Get a memory entry's detail by its unique id.

        Sample response
        ```
        {
          "unique_id": "f03642ce-b7ec-42a2-8604-7aa0c6e7b6d3",
          "key": "new key",
          "value": "this is new memory value!",
          "inserted_at": "2025-09-01T14:43:36.232705+00:00",
          "updated_at": "2025-09-01T14:43:36.232712+00:00",
          "expires_at": null,
          "category": "lessons_learned"
        }
        ```
      parameters:
        - in: path
          name: entry_unique_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserMemoryEntry'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_memory_entries_create
      description: >-
        ```

        POST
        /api/ai-mentor/orgs/main/users/your-user/memory-entries/f03642ce-b7ec-42a2-8604-7aa0c6e7b6d3/

        ```

        Sample request:

        ```

        {"value": "this is new memory value!", "key": "new key!",}

        ```

        Sample response:

        ```

        {
          "unique_id": "f03642ce-b7ec-42a2-8604-7aa0c6e7b6d3",
          "key": "new key",
          "value": "this is new memory value!",
          "inserted_at": "2025-09-01T14:43:36.232705+00:00",
          "updated_at": "2025-09-01T14:43:36.232712+00:00",
          "expires_at": null,
          "category": "lessons_learned"
        }

        ```
      parameters:
        - in: path
          name: entry_unique_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserMemoryEntry'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserMemoryEntry'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserMemoryEntry'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserMemoryEntry'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserMemoryEntry'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserMemoryEntry'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_memory_entries_destroy
      description: >-
        Delete a memory entry or a category of memories.


        Sample request (memory entry unique id)

        ```

        DELETE
        /api/ai-mentor/orgs/main/users/your-user/memory-entries/d66e4962-2406-48b1-9b73-14ff30138872/

        ```

        Sample request (category name)

        ```

        DELETE
        /api/ai-mentor/orgs/main/users/your-user/memory-entries/lessons_learned/

        ```
      parameters:
        - in: path
          name: entry_unique_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Memory deleted successfully.
        '404':
          description: Memory not found.
  /api/ai-mentor/orgs/{org}/users/{user_id}/memory-filter/:
    get:
      operationId: ai_mentor_orgs_users_memory_filter_retrieve
      description: |-
        Use the this endpoint to get all memory categories:
        ```
        GET /api/ai-mentor/orgs/main/users/your-user/memory-filter/
        ```
        Sample response
        ```
        {
          "categories": [
            "lessons_learned",
            "knowledge_gaps",
            "help_requests",
            "personal_information"
          ],
          "users": [
            {
              "username": "animashaun1vie",
              "email": "animashaun1vie@gmail.com",
              "lti_email": ""
            }
          ]
        }
        ```
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/memory/{memory_unique_id_or_name}/:
    get:
      operationId: ai_mentor_orgs_users_memory_retrieve
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: memory_unique_id_or_name
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserMemory'
              examples:
                MemoryDetail:
                  value:
                    mode: guided
                    name: user memory 1
                    unique_id: c0901cee-3c03-4bad-b445-07847bb6969e
                    username: myuser
                    platform: main
                    mentor: 2126ee0f-17ac-433e-8f40-abbd3a918ea5
                    session_id: 72515328-24fa-423f-9c63-570223d31787
                    catalog_item_type: course
                    catalog_item_id: course-v1:abcdf
                    entries:
                      - key: name
                        value: myname
                        inserted_at: '2024-03-10T12:00:00Z'
                        updated_at: '2024-03-11T14:30:00Z'
                        expires_at: '2024-03-13T14:30:00Z'
                      - key: info
                        value: myinfo
                        inserted_at: '2024-03-10T12:00:00Z'
                        updated_at: '2024-03-11T14:30:00Z'
                        expires_at: '2024-03-13T14:30:00Z'
                    inserted_at: '2024-03-10T12:00:00Z'
                    updated_at: '2024-03-11T14:30:00Z'
                    is_auto_generated: false
                    category: important
                  summary: Memory detail
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_memory_destroy
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: memory_unique_id_or_name
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Memory deleted successfully.
        '404':
          description: Memory not found.
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor-feedback/{feedback_id}/:
    get:
      operationId: ai_mentor_orgs_users_mentor_feedback_retrieve
      description: |-
        Retrieve details of a specific user chat feedback entry.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            feedback_id: The ID of the feedback entry to retrieve.

        Returns:
            Response: The feedback entry details.

        Raises:
            NotFound: If the specified feedback entry does not exist.
      parameters:
        - in: path
          name: feedback_id
          schema:
            type: integer
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserChatFeedback'
              examples:
                UserChatFeedbackExample:
                  value:
                    id: 1
                    username: lydiah
                    session: 937d3d46-3048-4f9d-aa5c-ce7c51d85332
                    user_text: Who is Marc H. Supcoff
                    ai_response: Marc H. Supcoff is an Adjunct Professor of Law
                    reason: Good reason
                    additional_feedback: Good response
                    rating: 1
                    mentor: 12
                    message: 3
                  summary: User Chat Feedback Example
          description: ''
        '404':
          description: Feedback not found
    put:
      operationId: ai_mentor_orgs_users_mentor_feedback_update
      description: |-
        Update an existing user chat feedback entry.

        Args:
            request: The HTTP request containing the updated feedback data.
            org: The organization/tenant identifier.
            feedback_id: The ID of the feedback entry to update.

        Returns:
            Response: The updated feedback entry.

        Raises:
            NotFound: If the specified feedback entry does not exist.
            BadRequest: If the provided data is invalid or the mentor does not exist.
      parameters:
        - in: path
          name: feedback_id
          schema:
            type: integer
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserChatFeedback'
            examples:
              UpdateFeedbackRequestExample:
                value:
                  username: johndoe
                  session: 937d3d46-3048-4f9d-aa5c-ce7c51d85332
                  user_text: Who is Marc H. Supcoff
                  ai_response: Marc H. Supcoff is an Adjunct Professor of Law
                  reason: Good reason
                  additional_feedback: Good response
                  rating: 1
                  mentor: ai-mentor
                  message: 3
                summary: Update Feedback Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserChatFeedback'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserChatFeedback'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserChatFeedback'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserChatFeedback'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserChatFeedback'
              examples:
                UpdateFeedbackResponseExample:
                  value:
                    id: 1
                    username: johndoe
                    session: 937d3d46-3048-4f9d-aa5c-ce7c51d85332
                    user_text: Who is Marc H. Supcoff
                    ai_response: Marc H. Supcoff is an Adjunct Professor of Law
                    reason: Good reason
                    additional_feedback: Good response
                    rating: 1
                    mentor: 12
                    message: 3
                  summary: Update Feedback Response Example
          description: ''
        '400':
          description: Invalid data or mentor not found
        '404':
          description: Feedback not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor-feedback/create/:
    post:
      operationId: ai_mentor_orgs_users_mentor_feedback_create_create
      description: |-
        Create a new user chat feedback entry.

        Args:
            request: The HTTP request containing the feedback data.
            org: The organization/tenant identifier.

        Returns:
            Response: The created feedback entry.

        Raises:
            BadRequest: If the provided data is invalid or the mentor does not exist.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserChatFeedback'
            examples:
              CreateFeedbackRequestExample:
                value:
                  username: johndoe
                  session: 937d3d46-3048-4f9d-aa5c-ce7c51d85332
                  user_text: Who is Marc H. Supcoff
                  ai_response: Marc H. Supcoff is an Adjunct Professor of Law
                  reason: Good reason
                  additional_feedback: Good response
                  rating: 1
                  mentor: ai-mentor
                  message: 3
                summary: Create Feedback Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserChatFeedback'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserChatFeedback'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserChatFeedback'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserChatFeedback'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserChatFeedback'
              examples:
                CreateFeedbackResponseExample:
                  value:
                    id: 1
                    username: johndoe
                    session: 937d3d46-3048-4f9d-aa5c-ce7c51d85332
                    user_text: Who is Marc H. Supcoff
                    ai_response: Marc H. Supcoff is an Adjunct Professor of Law
                    reason: Good reason
                    additional_feedback: Good response
                    rating: 1
                    mentor: 12
                    message: 3
                  summary: Create Feedback Response Example
          description: ''
        '400':
          description: Invalid data or mentor not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor-llms/:
    get:
      operationId: ai_mentor_orgs_users_mentor_llms_list
      description: Retrieve available LLMs for a user.
      parameters:
        - in: query
          name: mentor_id
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LLMResponse'
              examples:
                LLMResponse:
                  value:
                    - - id: 2
                        name: google
                        description: Google LLMs
                        metadata: null
                        resource_ids:
                          - https://ai.google.dev/pricing
                        tags:
                          tasks:
                            - Generation
                            - Foundation
                          languages:
                            - English
                          skill_levels:
                            - Beginner
                            - Advanced
                        overview: >-
                          <h4> Overview </h4> <p>  Gemini 1.5 delivers
                          dramatically enhanced performance with a more
                          efficient architecture. The first model we’ve released
                          for early testing, Gemini 1.5 Pro, introduces a
                          breakthrough experimental feature in long-context
                          understanding.</p> <p>The chat-bison model is a large
                          language model that excels at language understanding,
                          language generation and conversations. This chat model
                          is fine-tuned to conduct natural multi-turn
                          conversations. The PaLM 2 Chat Bison is ideal for text
                          tasks that require back-and-forth interactions. For
                          text tasks that can be completed with one API response
                          (without the need for continuous conversation), use
                          the PaLM 2 Text Bison.</p>
                        use_cases: None
                        documentation: None
                        sdk_samples: None
                  summary: LLM Response
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor-tools/:
    get:
      operationId: ai_mentor_orgs_users_mentor_tools_list
      description: Retrieve the list of available mentor tools.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ToolResponse'
              examples:
                ListOfTools:
                  value:
                    - - id: 1
                        name: openai
                        metadata: null
                      - id: 2
                        name: google
                        metadata: null
                  summary: List of tools
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor-types/:
    get:
      operationId: ai_mentor_orgs_users_mentor_types_list
      description: Retrieve Mentor Types
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MentorType'
              examples:
                ListOfMentorTypes:
                  value:
                    - - id: 1
                        name: Tutor
                        description: Academic tutor
                      - id: 2
                        name: Coach
                        description: Life coach
                  summary: List of Mentor Types
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor-with-settings/:
    post:
      operationId: ai_mentor_orgs_users_mentor_with_settings_create
      description: |-
        View to create a mentor from a template with settings.

        Accessible to tenant admins only.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorFromTemplateWithSettingRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorFromTemplateWithSettingRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/MentorFromTemplateWithSettingRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mentor'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor/audience/:
    get:
      operationId: ai_mentor_orgs_users_mentor_audience_list
      description: |-
        Retrieve the list of mentor audiences.

        Returns:
            - 200: List of mentor audiences.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MentorAudience'
              examples:
                RetrieveMentorAudiences:
                  value:
                    - - id: 1
                        name: Student
                        description: Mentor for student audience
                  summary: Retrieve mentor audiences
          description: ''
    post:
      operationId: ai_mentor_orgs_users_mentor_audience_create
      description: |-
        Create a new mentor audience.

        Accessible to tenant admins only.

        Returns:
            - 201: Created mentor audience.
            - 401: Unauthorized.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorAudience'
            examples:
              CreateMentorAudience:
                value:
                  name: Student
                  description: Mentor for student audience
                summary: Create mentor audience
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorAudience'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorAudience'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorAudience'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorAudience'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorAudience'
              examples:
                CreateMentorAudience:
                  value:
                    name: Student
                    description: Mentor for student audience
                  summary: Create mentor audience
          description: ''
        '401':
          description: Unauthorized - Only tenant admins can create mentor audiences.
    delete:
      operationId: ai_mentor_orgs_users_mentor_audience_destroy
      description: |-
        Delete a mentor audience.

        Accessible to tenant admins only.

        Returns:
            - 204: No content.
            - 400: Bad request if audience name is missing.
            - 404: Not found if audience does not exist.
            - 401: Unauthorized.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No Content - Mentor audience deleted successfully.
        '400':
          description: Bad Request - Invalid data.
        '401':
          description: Unauthorized - Only tenant admins can delete mentor audiences.
        '404':
          description: Not Found - Audience does not exist.
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor/categories/:
    get:
      operationId: ai_mentor_orgs_users_mentor_categories_list
      description: |-
        Retrieve a list of mentor categories.

        Returns:
            200: A list of mentor categories.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MentorCategory'
              examples:
                ListOfMentorCategories:
                  value:
                    - - id: 1
                        name: Education
                        description: Education testing
                        audience:
                          id: 3
                          name: Student
                          description: students
                        audiences:
                          - id: 3
                            name: Student
                            description: students
                  summary: List of mentor categories
          description: ''
    post:
      operationId: ai_mentor_orgs_users_mentor_categories_create
      description: |-
        Create a new mentor category.

        Accessible only to tenant admins.

        Returns:
            200: Details of the created mentor category.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorCategoryCreate'
            examples:
              CreateAMentorCategory:
                value:
                  name: Education
                  description: Education testing
                  audience: 1
                summary: Create a mentor category
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorCategoryCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorCategoryCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorCategoryCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorCategoryCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorCategory'
              examples:
                CreatedMentorCategoryResponse:
                  value:
                    id: 1
                    name: Education
                    description: Education testing
                    audience:
                      id: 1
                      name: student
                      description: Student ...
                    audiences:
                      - id: 1
                        name: student
                        description: Student ...
                  summary: Created mentor category response
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_mentor_categories_destroy
      description: |-
        Delete a mentor category.

        Accessible only to tenant admins.

        Returns:
            204: "No content" when Delete succeeded.
            400: Bad request data received
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor/seed/:
    get:
      operationId: ai_mentor_orgs_users_mentor_seed_retrieve
      description: |-
        Seed initial mentors in a tenant.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user initiating the seeding.

        Returns:
            Response: A success message with details about the seeded mentors.

        Raises:
            BadRequest: If the seeding process fails.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedMentorsView'
              examples:
                SeedMentorsResponseExample:
                  value:
                    detail: Successfully seeded 5 mentors in the tenant.
                  summary: Seed Mentors Response Example
          description: ''
        '400':
          description: Seeding failed
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/:
    get:
      operationId: ai_mentor_orgs_users_mentors_retrieve
      description: Retrieve details of a specific mentor by slug or name.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mentor'
              examples:
                ExampleResponse:
                  value:
                    name: mentorAI
                    platform: main
                    slug: ai-mentor
                    description: >-
                      Upbeat, encouraging tutor helping students understand
                      concepts by explaining ideas and asking questions.
                    allow_anonymous: false
                    pathways: []
                    suggested_prompts:
                      - ''
                    llm_provider: IBLChatOpenAI
                    system_prompt: Wrap all responses in MARKDOWN formatted text.
                    metadata:
                      admin: true
                      student: true
                      featured: true
                      allow_to_use_as_template: true
                    proactive_message: ''
                    moderation_system_prompt: >-
                      You are a moderator tasked with identifying whether a
                      prompt from a user is appropriate or inappropriate. 
                    enable_moderation: false
                    enable_multi_query_rag: false
                    enable_openai_assistant: false
                    enable_total_grounding: false
                    guided_prompt_instructions: you are...
                    enable_guided_prompts: true
                    mcp_servers:
                      - id: 1
                        name: mcp-server-1
                        description: mcp-server-1-description
                        url: https://mcp-server-1.com
                        platform: 1
                        platform_key: main
                    enable_suggested_prompts: true
                    safety_system_prompt: >-
                      You are a moderator tasked with identifying whether a
                      message from an ai model to a user is is appropriate or
                      inappropriate. If the message is immoral or contains
                      abusive words, insults, damaging content, and law breaking
                      acts, etc it should be deemed inappropriate. Otherwise it
                      is deemed appropriate.
                    safety_response: >-
                      Sorry, the AI model generated an inappropriate response.
                      Kindly refine your prompt or try again with a different
                      prompt.
                    enable_safety_system: false
                    categories:
                      - id: 1
                        name: Learning
                        description: Learning
                        audience: student
                    types:
                      - id: 1
                        name: Math
                        description: math testing
                    subjects:
                      - id: 1
                        name: Math
                        description: math testing
                    google_voice:
                      id: 1
                      name: en-us
                      provider: google
                      language: English (US)
                      description: A deep male voice
                      audio_url: https://public.storage/iblm-public/audio/en-us-1.mp3
                    openai_voice:
                      id: 2
                      name: en-us-female
                      provider: openai
                      language: English (US)
                      description: A soft female voice.
                      audio_url: https://public.storage/iblm-public/audio/en-us-1.mp3
                    created_by: system
                  summary: Example Response
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/auto-memory-prompt/:
    get:
      operationId: ai_mentor_orgs_users_mentors_auto_memory_prompt_retrieve
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutoMemoryPrompt'
              examples:
                AutoMemoryPromptGetter:
                  value:
                    auto_memory_prompt: >-
                      Generate for me some entries of memory based on the chat
                      history...
                  summary: auto memory prompt getter
          description: ''
    post:
      operationId: ai_mentor_orgs_users_mentors_auto_memory_prompt_create
      description: Set or reset auto memory prompt
      summary: Set or reset auto memory prompt
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutoMemoryPrompt'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/AutoMemoryPrompt'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AutoMemoryPrompt'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AutoMemoryPrompt'
          '*/*':
            schema:
              $ref: '#/components/schemas/AutoMemoryPrompt'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutoMemoryPrompt'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/available-tools/:
    get:
      operationId: ai_mentor_orgs_users_mentors_available_tools_list
      description: Retrieve tools available for a particular mentor.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ToolResponse'
              examples:
                ListOfTools:
                  value:
                    - - id: 1
                        name: Web Search
                        slug: web-search
                        metadata: null
                        category:
                          id: 1
                          name: Category 1
                          description: description
                      - id: 2
                        name: Trained Documents
                        slug: trained-documents
                        metadata: null
                        category:
                          id: 2
                          name: Category 2
                          description: description
                  summary: List of tools
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/create-call-credentials/:
    post:
      operationId: ai_mentor_orgs_users_mentors_create_call_credentials_create
      description: >-
        Generate IBL Call Pro authentication parameters for audio calls.


        This endpoint creates the necessary authentication tokens and parameters

        for connecting to a IBL Call Pro room for audio communication with a
        mentor.


        Args:
            request: The HTTP request object containing the required parameters.
            org: The organization/tenant identifier.
            user_id: The ID of the user requesting authentication.

        Returns:
            Response: IBL Call Pro authentication parameters including URL, room name,
                     participant name, and authentication token.

        Raises:
            ValidationError: If the request parameters are invalid.
            BadRequest: If the IBL Call Pro credentials are not properly configured.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallAuthenticationRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CallAuthenticationRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CallAuthenticationRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CallAuthenticationRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/CallAuthenticationRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallAuthenticationResponse'
              examples:
                SuccessfulResponse:
                  value:
                    ws_url: wss://call.iblai.org
                    room_name: mentor-audio-call-mentorAI|main
                    participant_name: username
                    participant_token: jwt_token_string
                  summary: Successful Response
          description: ''
        '400':
          description: >-
            Invalid request parameters or improperly configured IBL Call Pro
            credentials
        '401':
          description: Authentication failed
        '404':
          description: No mentor or session found
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/current-memory/:
    get:
      operationId: ai_mentor_orgs_users_mentors_current_memory_retrieve
      description: |-
        Retrieve memory components for a specific mentor.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user making the request.
            mentor: The identifier of the mentor to retrieve memory for.

        Returns:
            Response: The memory components for the mentor.

        Raises:
            NotFound: If the specified mentor or memory does not exist.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryComponentResponse'
              examples:
                MentorMemoryResponseExample:
                  value:
                    knowledge_gaps:
                      - neural networks
                      - deep learning
                    lessons_learned:
                      - supervised learning
                      - decision trees
                    help_requests:
                      - explain backpropagation
                  summary: Mentor Memory Response Example
          description: ''
        '404':
          description: Mentor or memory not found
    put:
      operationId: ai_mentor_orgs_users_mentors_current_memory_update
      description: |-
        Update memory components for a specific mentor.

        Args:
            request: The HTTP request containing the updated memory data.
            org: The organization/tenant identifier.
            user_id: The ID of the user making the request.
            mentor: The identifier of the mentor to update memory for.

        Returns:
            Response: The updated memory components for the mentor.

        Raises:
            BadRequest: If the provided data is invalid.
            NotFound: If the specified mentor does not exist.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuestionRequest'
            examples:
              UpdateMemoryRequestExample:
                value:
                  username: johndoe
                  initial_questions:
                    - text: What is machine learning?
                      difficulty_level: 2
                      possible_answers:
                        - text: A type of artificial intelligence
                        - text: A programming language
                  question_count: 5
                  subject: Artificial Intelligence
                summary: Update Memory Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/QuestionRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/QuestionRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/QuestionRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/QuestionRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuestionResponse'
              examples:
                UpdateMemoryResponseExample:
                  value:
                    questions:
                      - text: What are the main types of machine learning?
                        difficulty_level: 3
                        options:
                          - text: >-
                              Supervised, Unsupervised, and Reinforcement
                              Learning
                            is_correct: true
                          - text: Python, Java, and C++
                            is_correct: false
                          - text: Classification, Regression, and Clustering
                            is_correct: false
                  summary: Update Memory Response Example
          description: ''
        '400':
          description: Invalid data
        '404':
          description: Mentor not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/custom-voice/:
    get:
      operationId: ai_mentor_orgs_users_mentors_custom_voice_retrieve
      description: |-
        Retrieve the current custom voice settings for a mentor.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user who owns the mentor link.
            mentor: The unique identifier of the mentor.

        Returns:
            Response: The current custom voice settings.

        Raises:
            NotFound: If the specified mentor or student does not exist.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorCustomVoiceResponse'
              examples:
                CustomVoiceResponseExample:
                  value:
                    voice_provider: elevenlabs
                    voice_name: my-voice1
                  summary: Custom Voice Response Example
          description: ''
        '404':
          description: Mentor or student not found
    post:
      operationId: ai_mentor_orgs_users_mentors_custom_voice_create
      description: |-
        Set a custom voice for a mentor.

        This endpoint allows setting a custom voice for a specific mentor,
        either using the default voice provider or Elevenlabs.

        Args:
            request: The HTTP request containing the voice provider and name.
            org: The organization/tenant identifier.
            user_id: The ID of the user who owns the mentor link.
            mentor: The unique identifier of the mentor.

        Returns:
            Response: The updated custom voice settings.

        Raises:
            BadRequest: If the provided data is invalid or the voice does not exist.
            NotFound: If the mentor or student does not exist.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorCustomVoice'
            examples:
              SetDefaultVoiceRequestExample:
                value:
                  voice_provider: default
                  voice_name: default
                summary: Set Default Voice Request Example
              SetElevenlabsVoiceRequestExample:
                value:
                  voice_provider: elevenlabs
                  voice_name: my-voice1
                summary: Set Elevenlabs Voice Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorCustomVoice'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorCustomVoice'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorCustomVoice'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorCustomVoice'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorCustomVoiceResponse'
              examples:
                CustomVoiceResponseExample:
                  value:
                    voice_provider: elevenlabs
                    voice_name: my-voice1
                  summary: Custom Voice Response Example
          description: ''
        '400':
          description: Invalid data or voice not found
        '404':
          description: Mentor or student not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/custom-voice-tts/:
    post:
      operationId: ai_mentor_orgs_users_mentors_custom_voice_tts_create
      description: |-
        Generate audio from text using a mentor's custom voice.

        This endpoint converts the provided text to speech using the
        custom voice configured for the specified mentor.

        Args:
            request: The HTTP request containing the text to convert.
            org: The organization/tenant identifier.
            user_id: The ID of the user who owns the mentor link.
            mentor: The unique identifier of the mentor.

        Returns:
            Response: An MP3 audio file of the synthesized speech.

        Raises:
            BadRequest: If the text is empty, credentials are not found, or custom voice is not set.
            NotFound: If the mentor or student does not exist.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              additionalProperties: {}
          application/x-www-form-urlencoded:
            schema:
              type: object
              additionalProperties: {}
          application/json:
            schema:
              type: object
              additionalProperties: {}
            examples:
              TTSRequestExample:
                value:
                  text: hello world, how are you today?
                summary: TTS Request Example
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: MP3 audio file
        '400':
          description: Invalid data, credentials not found, or custom voice not set
        '404':
          description: Mentor or student not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/edit-scenarios/:
    put:
      operationId: ai_mentor_orgs_users_mentors_edit_scenarios_update
      description: |-
        Update scenarios for a specific mentor.

        Args:
            request: The HTTP request containing the updated scenarios.
            org: The organization/tenant identifier.
            user_id: The ID of the user making the request.
            mentor: The identifier of the mentor to update scenarios for.

        Returns:
            Response: The updated scenarios for the mentor.

        Raises:
            BadRequest: If the provided data is invalid.
            NotFound: If the specified mentor does not exist.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorScenario'
            examples:
              UpdateScenariosRequestExample:
                value:
                  - display: Chat
                    name: chat
                    prompts:
                      - summary: Give Me a Summary
                        content: please give me a summary of this topic
                        icon: add
                      - summary: Ask Some Questions
                        content: ask the user some questions
                        icon: start
                summary: Update Scenarios Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorScenario'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorScenario'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorScenario'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorScenario'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorScenario'
              examples:
                UpdateScenariosResponseExample:
                  value:
                    - display: Chat
                      name: chat
                      prompts:
                        - summary: Give Me a Summary
                          content: please give me a summary of this topic
                          icon: add
                        - summary: Ask Some Questions
                          content: ask the user some questions
                          icon: start
                  summary: Update Scenarios Response Example
          description: ''
        '400':
          description: Invalid data
        '404':
          description: Mentor not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/fork/:
    post:
      operationId: ai_mentor_orgs_users_mentors_fork_create
      description: |-
        Fork (clone) an existing mentor.

        Args:
            request: The HTTP request containing the fork parameters.
            org: The organization/tenant identifier.
            mentor: The identifier of the mentor to fork.
            user_id: The ID of the user initiating the fork.

        Returns:
            Response: The newly created forked mentor.

        Raises:
            BadRequest: If the provided data is invalid or the fork operation fails.
            NotFound: If the specified mentor does not exist.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorFork'
            examples:
              ForkMentorRequestExample:
                value:
                  new_mentor_name: Data Science Mentor Clone
                  destination_platform_key: secondary
                  clone_documents: true
                summary: Fork Mentor Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorFork'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorFork'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorFork'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorFork'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mentor'
              examples:
                ForkMentorResponseExample:
                  value:
                    id: 2
                    name: Data Science Mentor Clone
                    description: >-
                      A mentor specialized in data science and machine learning
                      concepts.
                    platform: secondary
                    categories: []
                    unique_id: a47d3d46-3048-4f9d-aa5c-ce7c51d85332
                    created_by: admin
                    date_created: '2023-01-02T12:00:00Z'
                  summary: Fork Mentor Response Example
          description: ''
        '400':
          description: Invalid data or fork failed
        '404':
          description: Mentor not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/historical-memory/:
    get:
      operationId: ai_mentor_orgs_users_mentors_historical_memory_retrieve
      description: |-
        Retrieve memory history entries for a specific mentor and user.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user to retrieve memory history for.
            mentor: The identifier of the mentor to retrieve memory history for.

        Returns:
            Response: The memory history entries for the mentor and user.

        Raises:
            NotFound: If the specified mentor or memory history does not exist.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryComponentMemoryDetail'
              examples:
                MemoryHistoryResponseExample:
                  value:
                    - data:
                        - kind: KnowledgeGap
                          content: >-
                            Learner believes that financial management is only
                            relevant for large corporations and not for personal
                            finance.
                        - kind: LessonsLearned
                          content: >-
                            Learner lacks knowledge of advanced financial
                            analysis techniques such as ratio analysis and cash
                            flow forecasting.
                        - kind: HelpRequest
                          content: >-
                            Learner requests clarification on the difference
                            between fixed and variable costs.
                      catalog_item: null
                      mentor_unique_id: dad70882-907d-4e13-be10-142f3b4631a1
                      student: student0
                      inserted_at: '2024-12-30 14:20:52'
                  summary: Memory History Response Example
          description: ''
        '404':
          description: Mentor or memory history not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/memory-progress/:
    get:
      operationId: ai_mentor_orgs_users_mentors_memory_progress_retrieve
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryProgress'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/memory-settings/:
    get:
      operationId: ai_mentor_orgs_users_mentors_memory_settings_retrieve
      description: |-
        Retrieve memory settings for a specific mentor.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user making the request.
            mentor: The identifier of the mentor to retrieve settings for.

        Returns:
            Response: The memory settings for the mentor.

        Raises:
            NotFound: If the specified mentor or settings do not exist.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorMemorySettingsResponse'
              examples:
                MemorySettingsResponseExample:
                  value:
                    item_type: course
                    item_identifier: course-v1:edX+DemoX+Demo_Course
                    learner_advance_correct_rate: 0.5
                    learner_advance_question_count: 12
                  summary: Memory Settings Response Example
          description: ''
        '404':
          description: Mentor or settings not found
    post:
      operationId: ai_mentor_orgs_users_mentors_memory_settings_create
      description: |-
        Endpoint for mentor memory item settings.

        Accessible to platform admins and superusers.

        Returns:

            200: Change mentor memory component item.

            400: When request is not valid.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorMemorySettingsRequest'
            examples:
              UpdateMemorySettingsRequestExample:
                value:
                  item_type: program
                  item_identifier: program-v1:edX+DemoProgram
                  learner_advance_correct_rate: 0.5
                  learner_advance_question_count: 12
                summary: Update Memory Settings Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorMemorySettingsRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorMemorySettingsRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorMemorySettingsRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorMemorySettingsRequest'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorMemorySettingsResponse'
              examples:
                SampleResponse:
                  value:
                    item_type: course
                    item_identifier: course-v1:main+101+01
                    learner_advance_correct_rate: 0.5
                    learner_advance_question_count: 12
                  summary: Sample Response
          description: ''
        '400':
          description: Invalid data
        '404':
          description: Mentor not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/mentor-eval/:
    get:
      operationId: ai_mentor_orgs_users_mentors_mentor_eval_retrieve
      description: |-
        Retrieve evaluation criteria for a specific mentor.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user making the request.
            mentor: The identifier of the mentor to retrieve evaluations for.

        Returns:
            Response: The evaluation criteria for the mentor.

        Raises:
            NotFound: If the specified mentor or evaluations do not exist.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorEval'
              examples:
                MentorEvaluationsResponseExample:
                  value:
                    - id: 1
                      mentor: mentorAI - main
                      questions:
                        - content: how to explain a computer to a 5 year old?
                          sample_answer: ''
                        - content: how to learn linux well?
                          sample_answer: ''
                      eval_id: 3c714f0c-5652-4e30-93ee-fe35aac58fdc
                      name: ''
                      passing_score: 60
                      question_set: 1
                      evaluation_prompt: >-
                        Please evaluate the following answer to the question:
                        {{question}}.

                         The sample answer to the question is {{sample_answer}} 

                         The answer you are evaluating is {{mentor_answer}}. 

                         Give me a rating as an integer between 0 to 100, only say the rating and nothing else.
                  summary: Mentor Evaluations Response Example
          description: ''
        '404':
          description: Mentor or evaluations not found
    post:
      operationId: ai_mentor_orgs_users_mentors_mentor_eval_create
      description: |-
        Create or update evaluation criteria for a specific mentor.

        Args:
            request: The HTTP request containing the evaluation data.
            org: The organization/tenant identifier.
            user_id: The ID of the user making the request.
            mentor: The identifier of the mentor to create/update evaluations for.

        Returns:
            Response: The created or updated evaluation criteria.

        Raises:
            BadRequest: If the provided data is invalid or the mentor does not exist.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorEvalRequest'
            examples:
              CreateEvaluationRequestExample:
                value:
                  questions:
                    - content: how to explain a computer to a 5 year old?
                      sample_answer: ''
                    - content: how to learn linux well?
                      sample_answer: ''
                summary: Create Evaluation Request Example
              UpdateEvaluationRequestExample:
                value:
                  id: 1
                  passing_score: 75
                summary: Update Evaluation Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorEvalRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorEvalRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorEvalRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorEvalRequest'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorEval'
              examples:
                EvaluationResponseExample:
                  value:
                    id: 1
                    mentor: mentorAI - main
                    questions:
                      - content: how to explain a computer to a 5 year old?
                        sample_answer: ''
                      - content: how to learn linux well?
                        sample_answer: ''
                    eval_id: 3c714f0c-5652-4e30-93ee-fe35aac58fdc
                    name: ''
                    passing_score: 60
                    question_set: 1
                    evaluation_prompt: >-
                      Please evaluate the following answer to the question:
                      {{question}}.

                       The sample answer to the question is {{sample_answer}} 

                       The answer you are evaluating is {{mentor_answer}}. 

                       Give me a rating as an integer between 0 to 100, only say the rating and nothing else.
                  summary: Evaluation Response Example
          description: ''
        '400':
          description: Invalid data or mentor not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/mentor-eval-execution/:
    post:
      operationId: ai_mentor_orgs_users_mentors_mentor_eval_execution_create
      description: |-
        Run an evaluation for a specific mentor.

        Args:
            request: The HTTP request containing the evaluation ID.
            org: The organization/tenant identifier.
            user_id: The ID of the user making the request.
            mentor: The identifier of the mentor to evaluate.

        Returns:
            Response: The ID of the generated evaluation report.

        Raises:
            BadRequest: If the evaluation ID is invalid or the mentor does not match.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunMentorEval'
            examples:
              RunEvaluationRequestExample:
                value:
                  id: 100
                summary: Run Evaluation Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/RunMentorEval'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RunMentorEval'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RunMentorEval'
          '*/*':
            schema:
              $ref: '#/components/schemas/RunMentorEval'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Evaluation execution started successfully
        '400':
          description: Invalid evaluation ID or mentor mismatch
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/mentor-user-settings/:
    get:
      operationId: ai_mentor_orgs_users_mentors_mentor_user_settings_retrieve
      description: >-
        Endpoint to get user settings for a mentor.



        GET
        https://base.manager.iblai.app/api/ai-mentor/orgs/your-org/users/your-user/mentors/unique-id/mentor-user-settings/


        Sample response

        ```

        {"reference_saved_memories": true}

        ```
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorUserSetting'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_mentors_mentor_user_settings_create
      description: >-
        Endpoint to set user settings for a mentor.



        POST
        https://base.manager.iblai.app/api/ai-mentor/orgs/your-org/users/your-user/mentors/unique-id/mentor-user-settings/


        Sample request

        ```

        {"reference_saved_memories": true}

        ```


        Sample response

        ```

        {"reference_saved_memories": true}

        ```
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorUserSetting'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorUserSetting'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorUserSetting'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorUserSetting'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorUserSetting'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorUserSetting'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/public-settings/:
    get:
      operationId: ai_mentor_orgs_users_mentors_public_settings_retrieve
      description: |-
        Retrieve public mentor settings.

        Args:
            request: HTTP request instance.
            user_id: The ID of the user requesting settings.
            mentor: The mentor identifier (name, slug, or unique_id).
            org: The organization key.

        Returns:
            Response containing the mentor settings or an error message.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSettingsPublic'
          description: ''
        '404':
          description: Mentor not found.
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/public-sharable-link/:
    get:
      operationId: ai_mentor_orgs_users_mentors_public_sharable_link_retrieve
      description: Return True if the token is valid and link is enabled, else False
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareableMentorLink'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/reports/{report_id}/mentor-eval-report/:
    get:
      operationId: ai_mentor_orgs_users_mentors_reports_mentor_eval_report_retrieve
      description: |-
        Retrieve a specific evaluation report.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user making the request.
            mentor: The identifier of the mentor that was evaluated.
            report_id: The ID of the evaluation report to retrieve.

        Returns:
            Response: The detailed evaluation report.

        Raises:
            BadRequest: If the report does not exist, does not match the mentor, or is still being generated.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: report_id
          schema:
            type: integer
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorEvalReport'
              examples:
                EvaluationReportResponseExample:
                  value:
                    id: 125
                    mentor_eval: (Mentor mentorAI|main, Question Set 5)
                    mentor: mentorAI - main
                    conversation_ratings:
                      - full_conversation_text: >-
                          Question: Question: how to explain a computer to a 5
                          year old?


                          Answer: To explain a computer to a 5 year old, I would
                          say it's like a magic box that can do many things when
                          you click or tap on different things to see how it
                          works.
                        rating_text: '95'
                        score: 95
                      - full_conversation_text: >-
                          Question: Question: how to learn linux well?


                          Answer: To learn Linux well, you should start with the
                          basics and practice regularly.
                        rating_text: '95'
                        score: 95
                    overall_score: 95
                    is_passed: true
                    generated_at: '2024-12-03T14:17:17.725963Z'
                  summary: Evaluation Report Response Example
          description: ''
        '400':
          description: Report not found or still being generated
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/scenarios/:
    get:
      operationId: ai_mentor_orgs_users_mentors_scenarios_retrieve
      description: |-
        Retrieve available scenarios for a specific mentor.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user making the request.
            mentor: The identifier of the mentor to retrieve scenarios for.

        Returns:
            Response: The available scenarios for the mentor.

        Raises:
            NotFound: If the specified mentor or scenarios do not exist.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorScenario'
              examples:
                MentorScenariosResponseExample:
                  value:
                    - display: Chat
                      name: chat
                      prompts:
                        - summary: Give Me a Summary
                          content: please give me a summary of this topic
                          icon: add
                        - summary: Ask Some Questions
                          content: ask the user some questions
                          icon: start
                    - display: Plan
                      name: plan
                      prompts:
                        - summary: Give Me a Summary
                          content: please give me a summary of this topic
                          icon: add
                        - summary: Ask Some Questions
                          content: ask the user some questions
                          icon: start
                  summary: Mentor Scenarios Response Example
          description: ''
        '404':
          description: Mentor or scenarios not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/settings/:
    get:
      operationId: ai_mentor_orgs_users_mentors_settings_retrieve
      description: >-
        Fetch the settings of a mentor within an organization. Only accessible
        to tenant admins.
      summary: Retrieve Mentor Settings
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: Department to authorize users by
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSettingsPublic'
              examples:
                ExampleResponse:
                  value:
                    mentor: mentor_123
                    display_name: John Doe
                    profile_image: https://example.com/image.jpg
                    theme: dark
                    enable_image_generation: true
                  summary: Example Response
          description: ''
        '404':
          description: Mentor not found
    put:
      operationId: ai_mentor_orgs_users_mentors_settings_update
      description: >-
        Update various mentor settings including system prompts, tool
        permissions, and UI configurations.
      summary: Update Mentor Settings
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: Department to authorize users by
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorSettingsRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorSettingsRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/MentorSettingsRequest'
            examples:
              ExampleRequest:
                value:
                  display_name: Jane Doe
                  theme: light
                  enable_code_interpreter: false
                  mentor_visibility: private
                summary: Example Request
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSettings'
          description: ''
        '400':
          description: Invalid request data
        '404':
          description: Mentor not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/sharable-link:
    get:
      operationId: ai_mentor_orgs_users_mentors_sharable_link_retrieve
      description: Enpoints to manage mentor shareable links
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareableMentorLink'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_mentors_sharable_link_create
      description: Enpoints to manage mentor shareable links
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShareableMentorLink'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ShareableMentorLink'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ShareableMentorLink'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ShareableMentorLink'
          '*/*':
            schema:
              $ref: '#/components/schemas/ShareableMentorLink'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareableMentorLink'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_mentors_sharable_link_update
      description: Enpoints to manage mentor shareable links
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShareableMentorLink'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ShareableMentorLink'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ShareableMentorLink'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ShareableMentorLink'
          '*/*':
            schema:
              $ref: '#/components/schemas/ShareableMentorLink'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareableMentorLink'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_mentors_sharable_link_destroy
      description: Enpoints to manage mentor shareable links
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/spaced-repetition-question-stats/:
    get:
      operationId: ai_mentor_orgs_users_mentors_spaced_repetition_question_stats_retrieve
      description: |-
        Retrieve spaced repetition question statistics.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user to retrieve statistics for.
            mentor: The unique identifier of the mentor.

        Returns:
            Response: Statistics about the user's performance on spaced repetition questions.

        Raises:
            NotFound: If the mentor or student does not exist.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpacedRepetitionQuestionStats'
              examples:
                QuestionStatsResponseExample:
                  value:
                    total_questions: 25
                    success_rate: 0.8
                    reviewed_questions: 20
                  summary: Question Stats Response Example
          description: ''
        '404':
          description: Mentor or student not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/spaced-repetition-recommended-paths/:
    get:
      operationId: ai_mentor_orgs_users_mentors_spaced_repetition_recommended_paths_list
      description: >-
        Retrieve a list of learning paths associated with a specific mentor and
        student.


        This endpoint uses the memory component to establish the learning
        context for a student

        under the guidance of a mentor. It verifies that the provided
        organization identifier matches

        the mentor's platform key, and then retrieves learning path tags
        associated with the student's

        question cards. Each tag is annotated with the total number of question
        cards and the count of

        cards with successful repetitions (i.e., correct answers). The learning
        paths are ordered by the

        number of correct answers and limited to the top five entries.


        Args:
            request: The HTTP request containing the necessary context.
            org (str): The organization identifier/platform key.
            user_id (str): The username of the student.
            mentor (str): The unique identifier of the mentor.
            *args: Additional positional arguments.
            **kwargs: Additional keyword arguments.

        Returns:
            Resp200onse: memory component detail infomrmation

        Raises:
            NotFound: If the memory component for the specified mentor and student cannot be found,
                      or if the organization identifier does not match the mentor's platform key.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/QuestionCardTag'
              examples:
                LearningPathsResponseExample:
                  value:
                    - - name: python-programming
                        total_cards: 15
                        correct_answers: 10
                        correct_rate: 0.67
                      - name: machine-learning
                        total_cards: 20
                        correct_answers: 12
                        correct_rate: 0.6
                  summary: Learning Paths Response Example
          description: ''
        '404':
          description: Mentor or student not found
    put:
      operationId: ai_mentor_orgs_users_mentors_spaced_repetition_recommended_paths_update
      description: |-
        Set a specific learning path for spaced repetition.

        Args:
            request: The HTTP request containing the learning path.
            org: The organization/tenant identifier.
            user_id: The ID of the user to set the learning path for.
            mentor: The unique identifier of the mentor.

        Returns:
            Response: The set learning path.

        Raises:
            BadRequest: If the provided data is invalid.
            NotFound: If the learning path, mentor, or student does not exist.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpacedRepetitionLearningPath'
            examples:
              SetLearningPathRequestExample:
                value:
                  learning_path: python-programming
                summary: Set Learning Path Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SpacedRepetitionLearningPath'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SpacedRepetitionLearningPath'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SpacedRepetitionLearningPath'
          '*/*':
            schema:
              $ref: '#/components/schemas/SpacedRepetitionLearningPath'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpacedRepetitionLearningPath'
              examples:
                SetLearningPathResponseExample:
                  value:
                    learning_path: python-programming
                  summary: Set Learning Path Response Example
          description: ''
        '400':
          description: Invalid data
        '404':
          description: Learning path, mentor, or student not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/star/:
    get:
      operationId: ai_mentor_orgs_users_mentors_star_retrieve
      description: |-
        Endpoint for getting the star status of a mentor.

        Accessible to students and admins.


        Returns:

            200: Star status.

            400: When request is not valid.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StarMentor'
              examples:
                SampleResponse:
                  value:
                    is_starred: false
                    updated_at: '2025-01-11T14:00:00.544398+00:00'
                    mentor: mentor0
                    student: student0
                    recently_accessed_at: '2025-01-16T14:32:08.691442+00:00'
                  summary: Sample Response
          description: ''
    post:
      operationId: ai_mentor_orgs_users_mentors_star_create
      description: |-
        Endpoint for starring a mentor.

        Accessible to students and admins.


        Returns:

            200: Star status.

            400: When request is not valid.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StarMentor'
              examples:
                SampleResponse:
                  value:
                    is_starred: false
                    updated_at: '2025-01-11T14:00:00.544398+00:00'
                    mentor: mentor0
                    student: student0
                    recently_accessed_at: '2025-01-16T14:32:08.691442+00:00'
                  summary: Sample Response
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/summaries/{summary_type}/:
    get:
      operationId: ai_mentor_orgs_users_mentors_summaries_retrieve
      description: >-
        GET
        `/api/orgs/<platform_key>/users/<username>/mentors/<mentor_unique_id>/summaries/<summary_type>/`


        Endpoint to get mentor summary. The summary type can be `user` or
        `general`.


        Sample response:

        ```

        {"rating": 3.9, "summary": "The mentor had a good chat."}

        ```
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: summary_type
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSummary'
              examples:
                SuccessfulResponse:
                  value:
                    rating: 3.9
                    summary: The mentor had a good chat.
                  summary: Successful Response
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/unstar/:
    post:
      operationId: ai_mentor_orgs_users_mentors_unstar_create
      description: |-
        Remove a mentor from a user's starred list.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user unstarring the mentor.
            mentor: The identifier of the mentor to unstar.

        Returns:
            Response: The updated star status of the mentor.

        Raises:
            NotFound: If the specified mentor or student does not exist.
            BadRequest: If the request is invalid.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StarMentor'
              examples:
                UnstarMentorResponseExample:
                  value:
                    is_starred: false
                    updated_at: '2025-01-11T14:00:00.544398+00:00'
                    mentor: mentor0
                    student: student0
                    recently_accessed_at: '2025-01-16T14:32:08.691442+00:00'
                  summary: Unstar Mentor Response Example
          description: ''
        '400':
          description: Invalid request
        '404':
          description: Mentor or student not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/metadata:
    get:
      operationId: ai_mentor_orgs_users_metadata_retrieve
      description: |-
        Retrieve metadata for a mentor.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user making the request.

        Returns:
            Response: The mentor metadata.

        Raises:
            NotFound: If no metadata exists for the specified mentor.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorMetadata'
              examples:
                MentorMetadataResponseExample:
                  value:
                    metadata:
                      specialty: machine learning
                      experience_level: expert
                      languages:
                        - English
                        - Spanish
                    mentor_id: 123
                  summary: Mentor Metadata Response Example
          description: ''
        '404':
          description: Metadata not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/moderation-logs/:
    get:
      operationId: ai_mentor_orgs_users_moderation_logs_list
      description: >-
        Endpoint to view and delete Moderation Logs for a tenant.


        These can be filtered by username, platform_key and  mentor id



        A search query can be conducted to search through the prompts and reason
        for the moderation catch event.
      parameters:
        - in: query
          name: mentor
          schema:
            type: string
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: platform_key
          schema:
            type: string
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: query
          name: target_system
          schema:
            type: string
            enum:
              - Moderation System
              - Safety System
          description: |-
            * `Safety System` - Safety System
            * `Moderation System` - Moderation System
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: username
          schema:
            type: string
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedModerationLogList'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/moderation-logs/{id}/:
    get:
      operationId: ai_mentor_orgs_users_moderation_logs_retrieve
      description: >-
        Endpoint to view and delete Moderation Logs for a tenant.


        These can be filtered by username, platform_key and  mentor id



        A search query can be conducted to search through the prompts and reason
        for the moderation catch event.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this moderation log.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModerationLog'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_moderation_logs_destroy
      description: >-
        Endpoint to view and delete Moderation Logs for a tenant.


        These can be filtered by username, platform_key and  mentor id



        A search query can be conducted to search through the prompts and reason
        for the moderation catch event.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this moderation log.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agent-logs/:
    get:
      operationId: ai_mentor_orgs_users_periodic_agent_logs_list
      description: >-
        Endpoint to view logs for periodic agent runs.


        These logs contain the full mentor output for each run for debugging.

        Logs are ordered from newest to oldest. However this can be changed.


        You can also filter logs for a PeriodicAgent by passing the
        `periodic_agent` query parameter in the URL.
      parameters:
        - in: query
          name: mentor_id
          schema:
            type: string
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: parent_mentor_id
          schema:
            type: string
        - in: query
          name: parent_session_id
          schema:
            type: string
        - in: query
          name: periodic_agent
          schema:
            type: integer
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: query
          name: status
          schema:
            type: string
            enum:
              - error
              - running
              - success
          description: |-
            * `success` - Success
            * `error` - Error
            * `running` - Running
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: username
          schema:
            type: string
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPeriodicAgentLogList'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agent-logs/{id}/:
    get:
      operationId: ai_mentor_orgs_users_periodic_agent_logs_retrieve
      description: >-
        Endpoint to view logs for periodic agent runs.


        These logs contain the full mentor output for each run for debugging.

        Logs are ordered from newest to oldest. However this can be changed.


        You can also filter logs for a PeriodicAgent by passing the
        `periodic_agent` query parameter in the URL.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this periodic agent log.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeriodicAgentLog'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/:
    get:
      operationId: ai_mentor_orgs_users_periodic_agents_list
      description: >-
        Endpoint to create and view, update and delete periodic agents.


        Periodic agents are schedulers issued for mentors. These are configured
        with input prompt (if any)

        as well as a cron schedule to trigger the periodic agent.


        Access to these are restricted to platform admins and tenant
        administrators


        Session information for running the periodic agent will be generated
        with the credentials of the

        user (platform administrator) who created the agent.


        A Periodic Agent is allowed to have a `callback_url` and
        `callback_secret`.

        When a `callback_url` is set for a Periodic Agent, a post request with
        data entries containing the log and timestamp

        of the run will be made to the callback_url provided.

        Here is the payload structure:
                ```
                {
                    "timestamp": "timestamp when the run completed",
                    "status": "status of the periodic agent",
                    "prompt": "input prompt to agent,
                    "agent_output": "...final response of agent",
                    "log": "... full agent run log",
                    "log_id": periodic agent log id.,
                }
                ```
        The payload is encrypted using the `callback_secret` provided.


        You can validate the payload using the X-Hub-Signature-256 signature
        header for request data.

        This is a Sha256 encoded HMAC hex digest of the payload body.


        ```python

        import hmac

        import haslib


        def validate_payload(request: HttpRequest, callback_secret: str):
            # Get the X-Hub-Signature-256 header from the request
            received_signature = request.META.get("HTTP_X_HUB_SIGNATURE_256", "")

            if not received_signature.startswith("sha256="):
                # Invalid signature format
                return False

            received_signature = received_signature[len("sha256=") :]

            try:
                # Get the raw request body
                payload = request.body

                # Compute the expected signature using the app_secret
                expected_signature = hmac.new(
                    callback_secret.encode(), payload, hashlib.sha256
                ).hexdigest()

                if hmac.compare_digest(received_signature, expected_signature):
                    # Signatures match, the payload is genuine
                    return True
                else:
                    # Signatures don't match
                    return False
            except Exception as e:
                # Handle any errors that may occur during validation
                return False

        ```
      parameters:
        - in: query
          name: enabled
          schema:
            type: boolean
        - in: query
          name: mentor_id
          schema:
            type: string
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: parent_mentor_id
          schema:
            type: integer
        - in: query
          name: parent_session_id
          schema:
            type: string
        - in: query
          name: previous_agent
          schema:
            type: integer
        - in: query
          name: previous_agent_status
          schema:
            type: string
            enum:
              - error
              - pending
              - running
              - success
          description: >-
            The status that the previous agent must be in before this agent gets
            scheduled.


            * `success` - Success

            * `error` - Error

            * `running` - Running

            * `pending` - Pending
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: query
          name: status
          schema:
            type: string
            enum:
              - error
              - pending
              - running
              - success
          description: |-
            * `success` - Success
            * `error` - Error
            * `running` - Running
            * `pending` - Pending
        - in: query
          name: title
          schema:
            type: string
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: username
          schema:
            type: string
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPeriodicAgentList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_periodic_agents_create
      description: >-
        Endpoint to create and view, update and delete periodic agents.


        Periodic agents are schedulers issued for mentors. These are configured
        with input prompt (if any)

        as well as a cron schedule to trigger the periodic agent.


        Access to these are restricted to platform admins and tenant
        administrators


        Session information for running the periodic agent will be generated
        with the credentials of the

        user (platform administrator) who created the agent.


        A Periodic Agent is allowed to have a `callback_url` and
        `callback_secret`.

        When a `callback_url` is set for a Periodic Agent, a post request with
        data entries containing the log and timestamp

        of the run will be made to the callback_url provided.

        Here is the payload structure:
                ```
                {
                    "timestamp": "timestamp when the run completed",
                    "status": "status of the periodic agent",
                    "prompt": "input prompt to agent,
                    "agent_output": "...final response of agent",
                    "log": "... full agent run log",
                    "log_id": periodic agent log id.,
                }
                ```
        The payload is encrypted using the `callback_secret` provided.


        You can validate the payload using the X-Hub-Signature-256 signature
        header for request data.

        This is a Sha256 encoded HMAC hex digest of the payload body.


        ```python

        import hmac

        import haslib


        def validate_payload(request: HttpRequest, callback_secret: str):
            # Get the X-Hub-Signature-256 header from the request
            received_signature = request.META.get("HTTP_X_HUB_SIGNATURE_256", "")

            if not received_signature.startswith("sha256="):
                # Invalid signature format
                return False

            received_signature = received_signature[len("sha256=") :]

            try:
                # Get the raw request body
                payload = request.body

                # Compute the expected signature using the app_secret
                expected_signature = hmac.new(
                    callback_secret.encode(), payload, hashlib.sha256
                ).hexdigest()

                if hmac.compare_digest(received_signature, expected_signature):
                    # Signatures match, the payload is genuine
                    return True
                else:
                    # Signatures don't match
                    return False
            except Exception as e:
                # Handle any errors that may occur during validation
                return False

        ```
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PeriodicAgentCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PeriodicAgentCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PeriodicAgentCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PeriodicAgentCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PeriodicAgentCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeriodicAgentCreate'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/{id}/:
    get:
      operationId: ai_mentor_orgs_users_periodic_agents_retrieve
      description: >-
        Endpoint to create and view, update and delete periodic agents.


        Periodic agents are schedulers issued for mentors. These are configured
        with input prompt (if any)

        as well as a cron schedule to trigger the periodic agent.


        Access to these are restricted to platform admins and tenant
        administrators


        Session information for running the periodic agent will be generated
        with the credentials of the

        user (platform administrator) who created the agent.


        A Periodic Agent is allowed to have a `callback_url` and
        `callback_secret`.

        When a `callback_url` is set for a Periodic Agent, a post request with
        data entries containing the log and timestamp

        of the run will be made to the callback_url provided.

        Here is the payload structure:
                ```
                {
                    "timestamp": "timestamp when the run completed",
                    "status": "status of the periodic agent",
                    "prompt": "input prompt to agent,
                    "agent_output": "...final response of agent",
                    "log": "... full agent run log",
                    "log_id": periodic agent log id.,
                }
                ```
        The payload is encrypted using the `callback_secret` provided.


        You can validate the payload using the X-Hub-Signature-256 signature
        header for request data.

        This is a Sha256 encoded HMAC hex digest of the payload body.


        ```python

        import hmac

        import haslib


        def validate_payload(request: HttpRequest, callback_secret: str):
            # Get the X-Hub-Signature-256 header from the request
            received_signature = request.META.get("HTTP_X_HUB_SIGNATURE_256", "")

            if not received_signature.startswith("sha256="):
                # Invalid signature format
                return False

            received_signature = received_signature[len("sha256=") :]

            try:
                # Get the raw request body
                payload = request.body

                # Compute the expected signature using the app_secret
                expected_signature = hmac.new(
                    callback_secret.encode(), payload, hashlib.sha256
                ).hexdigest()

                if hmac.compare_digest(received_signature, expected_signature):
                    # Signatures match, the payload is genuine
                    return True
                else:
                    # Signatures don't match
                    return False
            except Exception as e:
                # Handle any errors that may occur during validation
                return False

        ```
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this periodic agent.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeriodicAgent'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_periodic_agents_update
      description: >-
        Endpoint to create and view, update and delete periodic agents.


        Periodic agents are schedulers issued for mentors. These are configured
        with input prompt (if any)

        as well as a cron schedule to trigger the periodic agent.


        Access to these are restricted to platform admins and tenant
        administrators


        Session information for running the periodic agent will be generated
        with the credentials of the

        user (platform administrator) who created the agent.


        A Periodic Agent is allowed to have a `callback_url` and
        `callback_secret`.

        When a `callback_url` is set for a Periodic Agent, a post request with
        data entries containing the log and timestamp

        of the run will be made to the callback_url provided.

        Here is the payload structure:
                ```
                {
                    "timestamp": "timestamp when the run completed",
                    "status": "status of the periodic agent",
                    "prompt": "input prompt to agent,
                    "agent_output": "...final response of agent",
                    "log": "... full agent run log",
                    "log_id": periodic agent log id.,
                }
                ```
        The payload is encrypted using the `callback_secret` provided.


        You can validate the payload using the X-Hub-Signature-256 signature
        header for request data.

        This is a Sha256 encoded HMAC hex digest of the payload body.


        ```python

        import hmac

        import haslib


        def validate_payload(request: HttpRequest, callback_secret: str):
            # Get the X-Hub-Signature-256 header from the request
            received_signature = request.META.get("HTTP_X_HUB_SIGNATURE_256", "")

            if not received_signature.startswith("sha256="):
                # Invalid signature format
                return False

            received_signature = received_signature[len("sha256=") :]

            try:
                # Get the raw request body
                payload = request.body

                # Compute the expected signature using the app_secret
                expected_signature = hmac.new(
                    callback_secret.encode(), payload, hashlib.sha256
                ).hexdigest()

                if hmac.compare_digest(received_signature, expected_signature):
                    # Signatures match, the payload is genuine
                    return True
                else:
                    # Signatures don't match
                    return False
            except Exception as e:
                # Handle any errors that may occur during validation
                return False

        ```
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this periodic agent.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PeriodicAgentCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PeriodicAgentCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PeriodicAgentCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PeriodicAgentCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PeriodicAgentCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeriodicAgentCreate'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_periodic_agents_partial_update
      description: >-
        Endpoint to create and view, update and delete periodic agents.


        Periodic agents are schedulers issued for mentors. These are configured
        with input prompt (if any)

        as well as a cron schedule to trigger the periodic agent.


        Access to these are restricted to platform admins and tenant
        administrators


        Session information for running the periodic agent will be generated
        with the credentials of the

        user (platform administrator) who created the agent.


        A Periodic Agent is allowed to have a `callback_url` and
        `callback_secret`.

        When a `callback_url` is set for a Periodic Agent, a post request with
        data entries containing the log and timestamp

        of the run will be made to the callback_url provided.

        Here is the payload structure:
                ```
                {
                    "timestamp": "timestamp when the run completed",
                    "status": "status of the periodic agent",
                    "prompt": "input prompt to agent,
                    "agent_output": "...final response of agent",
                    "log": "... full agent run log",
                    "log_id": periodic agent log id.,
                }
                ```
        The payload is encrypted using the `callback_secret` provided.


        You can validate the payload using the X-Hub-Signature-256 signature
        header for request data.

        This is a Sha256 encoded HMAC hex digest of the payload body.


        ```python

        import hmac

        import haslib


        def validate_payload(request: HttpRequest, callback_secret: str):
            # Get the X-Hub-Signature-256 header from the request
            received_signature = request.META.get("HTTP_X_HUB_SIGNATURE_256", "")

            if not received_signature.startswith("sha256="):
                # Invalid signature format
                return False

            received_signature = received_signature[len("sha256=") :]

            try:
                # Get the raw request body
                payload = request.body

                # Compute the expected signature using the app_secret
                expected_signature = hmac.new(
                    callback_secret.encode(), payload, hashlib.sha256
                ).hexdigest()

                if hmac.compare_digest(received_signature, expected_signature):
                    # Signatures match, the payload is genuine
                    return True
                else:
                    # Signatures don't match
                    return False
            except Exception as e:
                # Handle any errors that may occur during validation
                return False

        ```
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this periodic agent.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPeriodicAgentCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedPeriodicAgentCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPeriodicAgentCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPeriodicAgentCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedPeriodicAgentCreate'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeriodicAgentCreate'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_periodic_agents_destroy
      description: >-
        Endpoint to create and view, update and delete periodic agents.


        Periodic agents are schedulers issued for mentors. These are configured
        with input prompt (if any)

        as well as a cron schedule to trigger the periodic agent.


        Access to these are restricted to platform admins and tenant
        administrators


        Session information for running the periodic agent will be generated
        with the credentials of the

        user (platform administrator) who created the agent.


        A Periodic Agent is allowed to have a `callback_url` and
        `callback_secret`.

        When a `callback_url` is set for a Periodic Agent, a post request with
        data entries containing the log and timestamp

        of the run will be made to the callback_url provided.

        Here is the payload structure:
                ```
                {
                    "timestamp": "timestamp when the run completed",
                    "status": "status of the periodic agent",
                    "prompt": "input prompt to agent,
                    "agent_output": "...final response of agent",
                    "log": "... full agent run log",
                    "log_id": periodic agent log id.,
                }
                ```
        The payload is encrypted using the `callback_secret` provided.


        You can validate the payload using the X-Hub-Signature-256 signature
        header for request data.

        This is a Sha256 encoded HMAC hex digest of the payload body.


        ```python

        import hmac

        import haslib


        def validate_payload(request: HttpRequest, callback_secret: str):
            # Get the X-Hub-Signature-256 header from the request
            received_signature = request.META.get("HTTP_X_HUB_SIGNATURE_256", "")

            if not received_signature.startswith("sha256="):
                # Invalid signature format
                return False

            received_signature = received_signature[len("sha256=") :]

            try:
                # Get the raw request body
                payload = request.body

                # Compute the expected signature using the app_secret
                expected_signature = hmac.new(
                    callback_secret.encode(), payload, hashlib.sha256
                ).hexdigest()

                if hmac.compare_digest(received_signature, expected_signature):
                    # Signatures match, the payload is genuine
                    return True
                else:
                    # Signatures don't match
                    return False
            except Exception as e:
                # Handle any errors that may occur during validation
                return False

        ```
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this periodic agent.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/periodic-agents/statistics/:
    get:
      operationId: ai_mentor_orgs_users_periodic_agents_statistics_retrieve
      description: >-
        Retrieve statistics for periodic agents, including counts of succeeded
        and failed tasks. A task is considered failed if its latest log has a
        failed status, and succeeded if its latest log has a success status.
        Query parameters can be used for filtering.
      parameters:
        - in: query
          name: mentor_id
          schema:
            type: string
            format: uuid
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeriodicAgentStatistics'
          description: Statistics for periodic agents.
  /api/ai-mentor/orgs/{org}/users/{user_id}/pin-message/:
    get:
      operationId: ai_mentor_orgs_users_pin_message_list
      description: |-
        Retrieve pinned messages for a user.

        Args:
            request: The HTTP request.
            org: Organization key identifier.
            user_id: The username of the student.

        Returns:
            Response: Paginated list of pinned messages.

        Raises:
            NotFound: If the student or session does not exist.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: session_id
          schema:
            type: string
            minLength: 1
          description: Session id of the message to pin
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PinnedMessageGet'
              examples:
                RetrievePinnedMessagesExample:
                  value:
                    - - session_id: 550e8400-e29b-41d4-a716-446655440000
                        messages:
                          - text: Hello, how can I help you?
                            timestamp: '2024-03-12T12:34:56Z'
                            sender: mentor
                        mentor: Dr. AI
                  summary: Retrieve pinned messages example
          description: ''
    post:
      operationId: ai_mentor_orgs_users_pin_message_create
      description: |-
        Create a pinned message for a user session.

        Args:
            request: The HTTP request containing session details.
            org: Organization key identifier.
            user_id: The username of the student.

        Returns:
            Response: Status 201 on success.

        Raises:
            NotFound: If the student does not exist.
            ValidationError: If request data is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PinnedMessageRequest'
            examples:
              CreatePinnedMessageRequest:
                value:
                  session_id: 550e8400-e29b-41d4-a716-446655440000
                summary: Create pinned message Request
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PinnedMessageRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PinnedMessageRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PinnedMessageRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PinnedMessageRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PinnedMessageCreate'
              examples:
                CreatePinnedMessageResponse:
                  value:
                    session_id: 550e8400-e29b-41d4-a716-446655440000
                    username: user
                    platform: https://base.manager.iblai.app/api/core/platform/1
                  summary: Create pinned message Response
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_pin_message_destroy
      description: |-
        Delete a pinned message for a user.

        Args:
            request: The HTTP request containing session details.
            org: Organization key identifier.
            user_id: The username of the student.

        Returns:
            Response: Status 204 on success.

        Raises:
            NotFound: If the student or pinned message does not exist.
            ValidationError: If request data is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: Unspecified response body
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/planned-jobs/:
    get:
      operationId: ai_mentor_orgs_users_planned_jobs_list
      description: >-
        Endpoints for viewing jobs and their status

        A job run refers to a task with steps that an agent is going to
        undertake.

        You can filter job runs by their status.

        Note that for a single user and a specified session, at most only one
        JobRun instance

        is active at any point in time.
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: query
          name: session
          schema:
            type: string
            format: uuid
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedJobRunList'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/planned-jobs/{id}/:
    get:
      operationId: ai_mentor_orgs_users_planned_jobs_retrieve
      description: >-
        Endpoints for viewing jobs and their status

        A job run refers to a task with steps that an agent is going to
        undertake.

        You can filter job runs by their status.

        Note that for a single user and a specified session, at most only one
        JobRun instance

        is active at any point in time.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this job run.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobRun'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/playwright-scripts/:
    get:
      operationId: ai_mentor_orgs_users_playwright_scripts_list
      description: >-
        Endpoints for viewing playwright scripts and updating playwright scripts
        for a tenant and user.
      parameters:
        - in: query
          name: is_public
          schema:
            type: boolean
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: query
          name: student
          schema:
            type: integer
            maximum: 2147483647
            minimum: 0
          description: edX user ID
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPlayWrightScriptList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_playwright_scripts_create
      description: >-
        Endpoints for viewing playwright scripts and updating playwright scripts
        for a tenant and user.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlayWrightScript'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlayWrightScript'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlayWrightScript'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlayWrightScript'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlayWrightScript'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlayWrightScript'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/playwright-scripts/{id}/:
    get:
      operationId: ai_mentor_orgs_users_playwright_scripts_retrieve
      description: >-
        Endpoints for viewing playwright scripts and updating playwright scripts
        for a tenant and user.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this play wright script.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlayWrightScript'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_playwright_scripts_update
      description: >-
        Endpoints for viewing playwright scripts and updating playwright scripts
        for a tenant and user.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this play wright script.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlayWrightScript'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlayWrightScript'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlayWrightScript'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlayWrightScript'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlayWrightScript'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlayWrightScript'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_playwright_scripts_partial_update
      description: >-
        Endpoints for viewing playwright scripts and updating playwright scripts
        for a tenant and user.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this play wright script.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPlayWrightScript'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedPlayWrightScript'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPlayWrightScript'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPlayWrightScript'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedPlayWrightScript'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlayWrightScript'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_playwright_scripts_destroy
      description: >-
        Endpoints for viewing playwright scripts and updating playwright scripts
        for a tenant and user.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this play wright script.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/predictive-analytics/:
    post:
      operationId: ai_mentor_orgs_users_predictive_analytics_create
      description: |-
        Retrieve predictive analytics based on historical data variables.

        Args:
            request: HTTP request containing predictive analytics input.
            org: Organization key identifier.

        Returns:
            - 200: Object containing predicted data.
            - 400: When AI response cannot be loaded into JSON.
            - 404: When OpenAI key for the tenant is not set.
            - 429: When OpenAI request exceeds the rate limit.

        Example:
            **POST** `/api/ai-prompt/orgs/main/users/johndoe/predictive-analytics/`
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PredictiveAnalyticsRequest'
            examples:
              PredictiveAnalyticsRequestExample:
                value:
                  prompt:
                    data_variables:
                      - variable_name: registered_users
                        data_set:
                          '2023-10-06': 4
                          '2023-10-07': 1
                          '2023-10-08': 0
                          '2023-10-09': 5
                          '2023-10-10': 4
                        number_of_data_points: 5
                      - variable_name: courses_enrolled
                        data_set:
                          '2023-08-09': 0
                          '2023-08-10': 0
                          '2023-08-11': 0
                          '2023-08-12': 0
                          '2023-08-13': 0
                        number_of_data_points: 6
                summary: Predictive Analytics Request Example
              PredictiveAnalyticsResponseExample:
                value:
                  predictions:
                    - variable_name: registered_users
                      predicted_data:
                        '2023-10-11': 2
                        '2023-10-12': 2
                        '2023-10-13': 1
                        '2023-10-14': 1
                        '2023-10-15': 1
                      narrative: >-
                        The number of registered users has been relatively
                        stable with some fluctuations. There is a slight
                        increase in the number of registered users over time.
                    - variable_name: courses_enrolled
                      predicted_data:
                        '2023-10-09': 0
                        '2023-10-10': 0
                        '2023-10-11': 0
                        '2023-10-12': 0
                        '2023-10-13': 0
                      narrative: >-
                        No courses have been enrolled recently, indicating a
                        decline in enrollment. It is expected that the number of
                        courses enrolled will remain at 0 for the next 31 data
                        points.
                summary: Predictive Analytics Response Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PredictiveAnalyticsRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PredictiveAnalyticsRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PredictiveAnalyticsRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PredictiveAnalyticsRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictiveAnalyticsResponse'
              examples:
                PredictiveAnalyticsRequestExample:
                  value:
                    prompt:
                      data_variables:
                        - variable_name: registered_users
                          data_set:
                            '2023-10-06': 4
                            '2023-10-07': 1
                            '2023-10-08': 0
                            '2023-10-09': 5
                            '2023-10-10': 4
                          number_of_data_points: 5
                        - variable_name: courses_enrolled
                          data_set:
                            '2023-08-09': 0
                            '2023-08-10': 0
                            '2023-08-11': 0
                            '2023-08-12': 0
                            '2023-08-13': 0
                          number_of_data_points: 6
                  summary: Predictive Analytics Request Example
                PredictiveAnalyticsResponseExample:
                  value:
                    predictions:
                      - variable_name: registered_users
                        predicted_data:
                          '2023-10-11': 2
                          '2023-10-12': 2
                          '2023-10-13': 1
                          '2023-10-14': 1
                          '2023-10-15': 1
                        narrative: >-
                          The number of registered users has been relatively
                          stable with some fluctuations. There is a slight
                          increase in the number of registered users over time.
                      - variable_name: courses_enrolled
                        predicted_data:
                          '2023-10-09': 0
                          '2023-10-10': 0
                          '2023-10-11': 0
                          '2023-10-12': 0
                          '2023-10-13': 0
                        narrative: >-
                          No courses have been enrolled recently, indicating a
                          decline in enrollment. It is expected that the number
                          of courses enrolled will remain at 0 for the next 31
                          data points.
                  summary: Predictive Analytics Response Example
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/projects/:
    get:
      operationId: ai_mentor_orgs_users_projects_list
      description: Retrieve a list of projects with optional filtering and search.
      summary: List projects
      parameters:
        - name: limit
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: offset
          required: false
          in: query
          description: The initial index from which to return the results.
          schema:
            type: integer
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: search
          schema:
            type: string
          description: Search in project name and description
        - in: query
          name: shared
          schema:
            type: boolean
          description: Filter by shared status (true/false)
        - in: query
          name: sort
          schema:
            type: string
          description: >-
            Order by field (prefix with - for descending). Example: name or
            -created_at
          examples:
            SortByName:
              value: name
              summary: Sort by name
            SortByNameDescending:
              value: '-name'
              summary: Sort by name descending
            SortByCreationDate:
              value: created_at
              summary: Sort by creation date
            SortByCreationDateDescending:
              value: '-created_at'
              summary: Sort by creation date descending
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: username
          schema:
            type: string
          description: Filter projects by owner's username
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProjectList'
              examples:
                ProjectsListExample:
                  value:
                    count: 123
                    next: http://api.example.org/accounts/?offset=400&limit=100
                    previous: http://api.example.org/accounts/?offset=200&limit=100
                    results:
                      - - id: 1
                          name: Python Learning Path
                          description: A collection of mentors for learning Python
                          shared: true
                          owner: 1
                          owner_username: john_doe
                          platform: 1
                          platform_key: main
                          platform_name: main
                          mentor_count: 5
                          is_personal: false
                          created_at: '2024-01-15T10:30:00Z'
                          updated_at: '2024-01-15T10:30:00Z'
                          mentors:
                            - id: 1
                              name: Python Mentor
                              description: Expert in Python
                              unique_id: 550e8400-e29b-41d4-a716-446655440000
                              slug: python-mentor
                              created_at: '2024-01-15T10:30:00Z'
                  summary: Projects List Example
          description: ''
    post:
      operationId: ai_mentor_orgs_users_projects_create
      description: Create a new project with optional mentors.
      summary: Create a new project
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Project'
            examples:
              CreateProjectRequest:
                value:
                  name: Machine Learning Basics
                  description: A project for learning machine learning fundamentals
                  shared: true
                  mentors_to_add:
                    - 550e8400-e29b-41d4-a716-446655440000
                    - 550e8400-e29b-41d4-a716-446655440001
                summary: Create Project Request
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Project'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Project'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Project'
          '*/*':
            schema:
              $ref: '#/components/schemas/Project'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
              examples:
                CreateProjectResponse:
                  value:
                    id: 1
                    name: Machine Learning Basics
                    description: A project for learning machine learning fundamentals
                    shared: true
                    owner: 1
                    owner_username: john_doe
                    platform: 1
                    platform_key: main
                    platform_name: main
                    mentor_count: 2
                    is_personal: false
                    mentors:
                      - id: 1
                        name: ML Mentor
                        description: Machine learning expert
                        unique_id: 550e8400-e29b-41d4-a716-446655440000
                        slug: ml-mentor
                        created_at: '2024-01-15T10:30:00Z'
                    created_at: '2024-01-15T10:30:00Z'
                    updated_at: '2024-01-15T10:30:00Z'
                  summary: Create Project Response
          description: ''
        '400':
          description: Invalid data provided
  /api/ai-mentor/orgs/{org}/users/{user_id}/projects/{id}/:
    get:
      operationId: ai_mentor_orgs_users_projects_retrieve
      description: Get detailed information about a specific project including its mentors.
      summary: Retrieve a project
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this Project.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
          description: ''
        '404':
          description: Project not found
    put:
      operationId: ai_mentor_orgs_users_projects_update
      description: Update project information and optionally modify its mentors.
      summary: Update a project
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this Project.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Project'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Project'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Project'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Project'
          '*/*':
            schema:
              $ref: '#/components/schemas/Project'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
          description: ''
        '400':
          description: Invalid data provided
        '403':
          description: Permission denied
    patch:
      operationId: ai_mentor_orgs_users_projects_partial_update
      description: >-
        API ViewSet for managing projects.


        Projects are groups of mentors that can be created by anyone (students
        and tenant admins).

        They serve as a way to organize and group related mentors together.


        Projects can be:

        - Personal (shared=False): Only visible to their owners

        - Shared (shared=True): Visible to platform admins and potentially other
        users


        Projects are accessed through integrated URLs within the mentor router:
            /orgs/<org>/projects/ - All accessible projects in a platform (admin access)
            /orgs/<org>/projects/<id>/ - Specific project (admin access)
            /orgs/<org>/users/<user_id>/projects/ - User's projects (user access)
            /orgs/<org>/users/<user_id>/projects/<id>/ - User's specific project

        Query Parameters:
            - username: Filter projects by owner's username (admin routes only)
            - shared: Filter by shared status (true/false)
            - search: Search in name and description
            - sort: Order by field (prefix with - for descending). Example: sort=name or sort=-created_at

        Permissions:
            - GET: Accessible to project owners and platform admins (for shared projects)
            - POST: Any authenticated user can create projects
            - PUT, PATCH, DELETE: Accessible to project owners only
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this Project.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedProject'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedProject'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedProject'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedProject'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedProject'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_projects_destroy
      description: Delete a project permanently.
      summary: Delete a project
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this Project.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Project deleted successfully
        '403':
          description: Permission denied
  /api/ai-mentor/orgs/{org}/users/{user_id}/recent-messages/:
    get:
      operationId: ai_mentor_orgs_users_recent_messages_retrieve
      description: |-
        Retrieves recent chat messages based on provided query parameters.

        Returns:
            200: Paginated List of chat messages.
            400: Invalid query parameters.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/recently-accessed-mentors/:
    get:
      operationId: ai_mentor_orgs_users_recently_accessed_mentors_list
      description: |-
        Endpoint for listing most recently accessed mentors.

        Accessible to students and admins.


        Returns:

            200: List of most recently accessed mentors.

            400: When request is not valid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RecentlyAccessedMentor'
              examples:
                SampleResponse:
                  value:
                    - - id: 1
                        unique_id: 24ecff1f-addb-4d8f-b98e-c46cf0a17b69
                        slug: ai-mentor
                        name: mentorAI
                        description: >-
                          Upbeat, encouraging tutor helping            students
                          understand concepts by            explaining ideas and
                          asking questions.
                        recently_accessed_at: '2025-01-09T14:57:18.479911+00:00'
                        last_accessed_by: student0
                        platform_key: main
                      - id: 2
                        unique_id: 34ecff1f-addb-4d8f-b98e-c46cf0a17b69
                        slug: 24ecff1f-addb-4d8f-b98e-c46cf0a17b69
                        name: ibl.ai
                        description: >-
                          A mentor that answers questions            about
                          ibl.ai
                        recently_accessed_at: '2024-12-30T13:37:52.514240+00:00'
                        last_accessed_by: student0
                        platform_key: main
                      - id: 3
                        unique_id: 44ecff1f-addb-4d8f-b98e-c46cf0a17b69
                        slug: mentor-3
                        name: mentorAI 3
                        description: >-
                          Upbeat, encouraging tutor helping students understand
                          concepts by explaining ideas and asking questions.
                        recently_accessed_at: '2025-01-06T16:51:43.426126+00:00'
                        last_accessed_by: student0
                        platform_key: test
                  summary: Sample Response
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/recommend-courses/:
    get:
      operationId: ai_mentor_orgs_users_recommend_courses_retrieve
      description: |-
        Retrieve recommended courses for a specific user.

        Args:
            request: The HTTP request containing query parameters.
            org: The organization/tenant identifier.
            user_id: The ID of the user to get recommendations for.

        Returns:
            Response: A list of recommended courses.

        Raises:
            BadRequest: If the query parameters are invalid.
            NotFound: If the OpenAI API key for the tenant is not found.
            TooManyRequests: If rate limits are exceeded.
            ServerError: If there's an error processing the AI response.
      parameters:
        - in: query
          name: include_learner_skills
          schema:
            type: boolean
            default: true
          description: Include available learner skills for search
        - in: query
          name: include_main_courses
          schema:
            type: boolean
            default: true
          description: Include courses from the main tenant
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: rank_by_difficulty
          schema:
            type: boolean
            default: false
          description: Rank by course difficulty
        - in: query
          name: return_course_data
          schema:
            type: boolean
            default: false
          description: Return course data
        - in: query
          name: return_number
          schema:
            type: integer
          description: Number of courses to return
        - in: query
          name: search_terms
          schema:
            type: string
            minLength: 1
          description: Terms to be searched
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecommendCourseResponse'
              examples:
                CourseRecommendationsExample:
                  value:
                    courses:
                      - id: course-v1:ACI+500+957
                      - id: course-v1:ACI+501+958
                  summary: Course Recommendations Example
          description: ''
        '400':
          description: Invalid query parameters
        '404':
          description: API key not found
        '429':
          description: Rate limit exceeded
        '500':
          description: Server error processing AI response
  /api/ai-mentor/orgs/{org}/users/{user_id}/recommend-courses-block/:
    get:
      operationId: ai_mentor_orgs_users_recommend_courses_block_retrieve
      description: |-
        Retrieve recommended course blocks for a specific user.

        Args:
            request: The HTTP request containing query parameters.
            org: The organization/tenant identifier.
            user_id: The ID of the user to get recommendations for.

        Returns:
            Response: A list of recommended course blocks.

        Raises:
            BadRequest: If the query parameters are invalid.
      parameters:
        - in: query
          name: include_learner_skills
          schema:
            type: boolean
            default: true
          description: Include available learner skills for search
        - in: query
          name: include_main_courses
          schema:
            type: boolean
            default: true
          description: Include courses from the main tenant
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: rank_by_difficulty
          schema:
            type: boolean
            default: false
          description: Rank by course difficulty
        - in: query
          name: return_course_data
          schema:
            type: boolean
            default: false
          description: Return course data
        - in: query
          name: return_number
          schema:
            type: integer
          description: Number of courses to return
        - in: query
          name: search_terms
          schema:
            type: string
            minLength: 1
          description: Terms to be searched
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecommendCourseBlock'
              examples:
                CourseBlockRecommendationsExample:
                  value:
                    blocks:
                      - id: block-v1:ACI+500+957+type@vertical+block@123
                        course_id: course-v1:ACI+500+957
                      - id: block-v1:ACI+501+958+type@vertical+block@456
                        course_id: course-v1:ACI+501+958
                  summary: Course Block Recommendations Example
          description: ''
        '400':
          description: Invalid query parameters
  /api/ai-mentor/orgs/{org}/users/{user_id}/resources/web/:
    post:
      operationId: ai_mentor_orgs_users_resources_web_create
      description: |-
        Search for web resources based on a query.

        Args:
            request: The HTTP request containing the search query.
            org: The organization/tenant identifier.
            user_id: The ID of the user making the request.

        Returns:
            Response: A list of web resources matching the query.

        Raises:
            ValidationError: If the search fails or returns no results.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebResourcesQuery'
            examples:
              WebResourcesRequestExample:
                value:
                  query: ibl education
                summary: Web Resources Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/WebResourcesQuery'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/WebResourcesQuery'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WebResourcesQuery'
          '*/*':
            schema:
              $ref: '#/components/schemas/WebResourcesQuery'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WebResource'
              examples:
                WebResourcesResponseExample:
                  value:
                    - - content: >-
                          Empowering Educators with Generative AI. All-in-one
                          web and mobile AI tools for faculty support and
                          student success: tutoring, content creation and
                          automation.
                        title: ibl.ai | Generative AI Platform for Education
                        source: https://ibl.ai/
                        metadata:
                          source: https://ibl.ai/
                          title: ibl.ai | Generative AI Platform for Education
                        card:
                          title: ibl.ai | Generative AI Platform for Education
                          description: >-
                            New York-based gen AI and open source education
                            company serving the Fortune 500, universities and
                            governments.
                          imageUrl: images/favicon.png
                          domain: ibl.ai
                          site_name: ''
                  summary: Web Resources Response Example
          description: ''
        '400':
          description: Failed to fetch web resources
  /api/ai-mentor/orgs/{org}/users/{user_id}/safety-logs/:
    get:
      operationId: ai_mentor_orgs_users_safety_logs_list
      description: >-
        Endpoint to view and delete Safety System Logs for a tenant.


        These can be filtered by username, platform_key and  mentor id



        A search query can be conducted to search through the prompts and reason
        for the moderation catch event.
      parameters:
        - in: query
          name: mentor
          schema:
            type: string
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: platform_key
          schema:
            type: string
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: query
          name: target_system
          schema:
            type: string
            enum:
              - Moderation System
              - Safety System
          description: |-
            * `Safety System` - Safety System
            * `Moderation System` - Moderation System
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: username
          schema:
            type: string
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedModerationLogList'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/safety-logs/{id}/:
    get:
      operationId: ai_mentor_orgs_users_safety_logs_retrieve
      description: >-
        Endpoint to view and delete Safety System Logs for a tenant.


        These can be filtered by username, platform_key and  mentor id



        A search query can be conducted to search through the prompts and reason
        for the moderation catch event.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this moderation log.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModerationLog'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_safety_logs_destroy
      description: >-
        Endpoint to view and delete Safety System Logs for a tenant.


        These can be filtered by username, platform_key and  mentor id



        A search query can be conducted to search through the prompts and reason
        for the moderation catch event.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this moderation log.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/session-detail/mentors/{mentor}/:
    get:
      operationId: ai_mentor_orgs_users_session_detail_mentors_list
      description: |-
        Retrieve session details including message counts and timestamps.

        Query Parameters:
            page (optional, int): Page number for pagination.

        Returns:
            - 200: Paginated list of session details.
            - 404: Session not found.
      parameters:
        - in: path
          name: mentor
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SessionDetail'
              examples:
                SuccessfulResponse:
                  value:
                    - count: 2
                      previous: null
                      next: /api/sessions/?page=2
                      results:
                        - session_id: 123e4567-e89b-12d3-a456-426614174000
                          message_count: 5
                          last_message_ts: '2024-03-10T14:35:00Z'
                        - session_id: 223e4567-e89b-12d3-a456-426614174001
                          message_count: 7
                          last_message_ts: '2024-03-11T12:05:00Z'
                  summary: Successful Response
          description: ''
        '404':
          description: Session not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/sessionid/:
    get:
      operationId: ai_mentor_orgs_users_sessionid_list
      description: |-
        Retrieve user sessions filtered by start date and end date.

        Query Parameters:
            start_date (optional, ISO format): Start date for filtering sessions.
            end_date (optional, ISO format): End date for filtering sessions.

        Returns:
            - 200: List of session IDs with insertion timestamps.
            - 400: Invalid request parameters.
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ChatHistorySessionId'
              examples:
                SuccessfulResponse:
                  value:
                    - - session_id: 123e4567-e89b-12d3-a456-426614174000
                        inserted_at: '2024-03-10T14:30:00Z'
                      - session_id: 223e4567-e89b-12d3-a456-426614174001
                        inserted_at: '2024-03-11T12:00:00Z'
                  summary: Successful Response
          description: ''
        '400':
          description: Bad request
  /api/ai-mentor/orgs/{org}/users/{user_id}/sessions/:
    post:
      operationId: ai_mentor_orgs_users_sessions_create
      description: >-
        Retrieve or create a chat session with a mentor.


        Passing `null` as `tools` results in using all tools assigned to the
        mentor.

        To specify that no tools be used, pass an empty list.


        Args:
            request: HTTP request containing mentor details.
            org: Organization key identifier.
            user_id (optional): Username for authentication (if required by the mentor).

        Returns:
            Response: JSON object containing the session ID.

        Raises:
            Http404: If the mentor is not found.
            ValidationError: If the username is invalid.
            ValidationError: If one or more tool slugs are invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatSessionRequest'
            examples:
              ValidRequest:
                value:
                  mentor: ai-mentor
                summary: Valid Request
              ValidRequestWithTools:
                value:
                  mentor: ai-mentor
                  tools:
                    - websearch-tool
                  enable_artifacts: true
                summary: Valid Request with tools
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ChatSessionRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ChatSessionRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ChatSessionRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/ChatSessionRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSessionResponse'
              examples:
                SuccessfulResponse:
                  value:
                    session_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                    tools:
                      - id: 10
                        name: Web Search Tool
                        display_name: Web Search Tool
                        slug: websearch-tool
                        description: Tool to search for information from the web
                        metadata: null
                        enable_artifacts: true
                        allow_base_agent: true
                        allow_openai_agent: true
                        allow_google_agent: true
                  summary: Successful Response
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: Unspecified response body
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: Unspecified response body
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/:
    get:
      operationId: ai_mentor_orgs_users_sessions_retrieve
      description: Fetches chat messages for a specific session.
      summary: Retrieve Chat Messages
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: session_id
          schema:
            type: string
            format: uuid
          required: true
        - in: query
          name: share
          schema:
            type: boolean
            default: false
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageView'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_sessions_update
      description: Update the title of a chat session and its tools
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: session_id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessageViewRequest'
            examples:
              ExampleRequest:
                value:
                  title: New Title
                  tools:
                    - web-search
                    - image-generation
                summary: Example Request
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MessageViewRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MessageViewRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MessageViewRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/MessageViewRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageViewUpdatResponse'
              examples:
                ExampleRequest:
                  value:
                    title: New Title
                    tools:
                      - web-search
                      - image-generation
                  summary: Example Request
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_sessions_destroy
      description: Deletes all messages in a chat session.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: session_id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      responses:
        '204':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: Unspecified response body
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/browser-screenshot/:
    get:
      operationId: ai_mentor_orgs_users_sessions_browser_screenshot_retrieve
      description: >-
        Endpoint to fetch the logs of a session.

        Logs are cached for up to 1 hour of their creation: accessing the logs
        after an hour will result in an empty data.


        This is intentional and made to avoid cases where logs bloat our
        in-memory db.


        Accessible to tenant admins and students.


        Url Args:
            org (str): The organization's platform key.
            user_id (str): The username  identifier of the individual.
            session_id (str): The session id.

        Returns:

            200: a SessionBrowserScreenshot object
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: session_id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionBrowserScreenshot'
              examples:
                BrowserScreenshotsResponseExample:
                  value:
                    - type: screenshot
                      session_id: 937d3d46-3048-4f9d-aa5c-ce7c51d85332
                      format: png
                      ext: png
                      url: https://example.com/screenshots/123.png
                      time: '2023-01-01T12:00:00Z'
                  summary: Browser Screenshots Response Example
          description: ''
        '404':
          description: Session or screenshots not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/download-session:
    get:
      operationId: ai_mentor_orgs_users_sessions_download_session_retrieve
      description: |-
        Retrieves the chat history for a session as a plain text file.

        Returns:
            200: txt file containing coversation
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: session_id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/memories/{memory_unique_id}/set-attached/:
    get:
      operationId: ai_mentor_orgs_users_sessions_memories_set_attached_retrieve
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: memory_unique_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: session_id
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionMemoryAttachment'
              examples:
                SessionMemoryAttachmentResponseExample:
                  value:
                    attached: true
                  summary: Session memory attachment response example
          description: ''
    post:
      operationId: ai_mentor_orgs_users_sessions_memories_set_attached_create
      description: Create session memory attachment
      summary: Create session memory attachment
      parameters:
        - in: path
          name: memory_unique_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: session_id
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SessionMemoryAttachment'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SessionMemoryAttachment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SessionMemoryAttachment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SessionMemoryAttachment'
          '*/*':
            schema:
              $ref: '#/components/schemas/SessionMemoryAttachment'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionMemoryAttachment'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/memory/:
    get:
      operationId: ai_mentor_orgs_users_sessions_memory_retrieve
      description: >-
        Retrieve memory data for a specific session.


        This endpoint returns the memory components (knowledge gaps, lessons
        learned,

        help requests) that were generated during the specified chat session.


        Args:
            org: The organization/tenant identifier.
            user_id: The ID of the user who owns the session.
            session_id: The ID of the session to retrieve memory for.

        Returns:
            Response: The memory data associated with the session.

        Raises:
            NotFound: If the session does not exist or does not belong to the user.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: session_id
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionMemoryStorage'
              examples:
                SessionMemoryResponseExample:
                  value:
                    memory:
                      data:
                        - kind: KnowledgeGap
                          content: Understanding of neural network architecture
                        - kind: LessonsLearned
                          content: Basic principles of supervised learning
                        - kind: HelpRequest
                          content: Explanation of backpropagation algorithm
                    session_id: session-uuid-4bfa-8b50-a9bb3ab33e71
                    updated_at: '2024-01-15T10:30:00Z'
                  summary: Session Memory Response Example
          description: ''
        '404':
          description: Session not found or does not belong to user
  /api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/shell-logs/:
    get:
      operationId: ai_mentor_orgs_users_sessions_shell_logs_retrieve
      description: |-
        Retrieve shell logs for a specific session.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user who owns the session.
            session_id: The ID of the session to retrieve logs for.

        Returns:
            Response: The shell logs for the specified session.

        Raises:
            NotFound: If the specified session does not exist.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: session_id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShellLogs'
              examples:
                ShellLogsResponseExample:
                  value:
                    logs: |-
                      $ ls -la
                      total 24
                      drwxr-xr-x  2 user user 4096 Jan 1 12:00 .
                      drwxr-xr-x 10 user user 4096 Jan 1 12:00 ..
                      -rw-r--r--  1 user user  123 Jan 1 12:00 file.txt
                  summary: Shell Logs Response Example
          description: ''
        '404':
          description: Session not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/suggestion:
    get:
      operationId: ai_mentor_orgs_users_sessions_suggestion_list
      description: Retrieve a list of related questions based on a chat session.
      parameters:
        - in: query
          name: num_questions
          schema:
            type: integer
            default: 3
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: session_id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RelatedText'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NoChatMessagesFound'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/sessions/{session_id}/tasks/{task_id}/:
    get:
      operationId: ai_mentor_orgs_users_sessions_tasks_retrieve
      description: >-
        Retrieves the chat history for a given session if the export task is
        ready.


        Returns:

            200: When task is not ready.

            200: chat history object

            400: When data is not valid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: session_id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: task_id
          schema:
            type: string
            format: uuid
          required: true
        - in: query
          name: to_csv
          schema:
            type: boolean
            default: false
          description: Choose download in csv or not
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatHistoryItem'
              examples:
                ChatHistoryTaskNotReady:
                  value:
                    state: task_not_ready
                  summary: Chat history task not ready
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/settings/tenant-llm/:
    get:
      operationId: ai_mentor_orgs_users_settings_tenant_llm_list
      description: |-
        Retrieve all LLM models assigned to a specific tenant.

        Args:
            request: The HTTP request.
            org: The unique identifier of the tenant.

        Returns:
            Response: A list of LLM models assigned to the tenant.

        Raises:
            NotFound: If the specified tenant does not have any associated models.
            ValidationError: If an unexpected error occurs.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LLMModelForTenant'
              examples:
                LLMModelsForTenantExample:
                  value:
                    - - id: 1
                        tenant: example-tenant
                        model_name: gpt-4
                        configuration:
                          max_tokens: 1000
                          temperature: 0.7
                          top_p: 0.9
                        created_at: '2024-03-10T12:00:00Z'
                        updated_at: '2024-03-11T14:30:00Z'
                  summary: LLM Models for Tenant Example
          description: ''
    post:
      operationId: ai_mentor_orgs_users_settings_tenant_llm_create
      description: |-
        Create or update an LLM model for a tenant.

        Accessible only to tenant administrators.

        Args:
            request: The HTTP request containing LLM model details.
            org: The unique identifier of the tenant.

        Returns:
            Response: Details of the newly created or updated LLM model.

        Raises:
            ValidationError: If request data is invalid.
            NotFound: If the tenant does not exist.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LLMModelForTenant'
            examples:
              CreateLLMModelForTenantExample:
                value:
                  tenant: example-tenant
                  model_name: gpt-4
                  configuration:
                    max_tokens: 2000
                    temperature: 0.8
                    top_p: 0.85
                summary: Create LLM Model for Tenant Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/LLMModelForTenant'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/LLMModelForTenant'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/LLMModelForTenant'
          '*/*':
            schema:
              $ref: '#/components/schemas/LLMModelForTenant'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LLMModelForTenant'
              examples:
                SuccessfulCreationResponse:
                  value:
                    info: LLM model for tenant created successfully.
                  summary: Successful Creation Response
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/starred-mentors/:
    get:
      operationId: ai_mentor_orgs_users_starred_mentors_list
      description: |-
        Retrieve a list of mentors starred by a specific user.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user to retrieve starred mentors for.

        Returns:
            Response: A list of the user's starred mentors, sorted by most recently accessed.

        Raises:
            NotFound: If the specified student does not exist.
            BadRequest: If the request is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/StarMentor'
              examples:
                StarredMentorsResponseExample:
                  value:
                    - - updated_at: '2025-01-11T14:00:00.544398+00:00'
                        mentor: mentor0
                        student: student0
                        recently_accessed_at: '2025-01-16T14:32:08.691442+00:00'
                        is_starred: true
                      - updated_at: '2025-01-10T12:30:00.123456+00:00'
                        mentor: mentor1
                        student: student0
                        recently_accessed_at: '2025-01-15T10:15:30.987654+00:00'
                        is_starred: true
                  summary: Starred Mentors Response Example
          description: ''
        '400':
          description: Invalid request
        '404':
          description: Student not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/subjects/:
    get:
      operationId: ai_mentor_orgs_users_subjects_list
      description: Retrieve Subjects
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Subject'
              examples:
                ListOfSubjects:
                  value:
                    - - id: 1
                        name: Mathematics
                        description: Mathematical subjects
                      - id: 2
                        name: Science
                        description: Scientific subjects
                  summary: List of Subjects
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/support-ticket-messages/:
    get:
      operationId: ai_mentor_orgs_users_support_ticket_messages_list
      description: >-
        ViewSet for managing ticket messages.


        This ViewSet provides endpoints to retrieve, create, and update ticket
        messages.


        Permissions:
            - Platform Admins:
                - Platform admins are able to view all ticket messages for the tenant.
            - Students:
                - Students are able to view all ticket messages for only the ticket they are associated with.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: sender
          schema:
            type: string
        - in: query
          name: ticket
          schema:
            type: number
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTicketMessageList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_support_ticket_messages_create
      description: >-
        ViewSet for managing ticket messages.


        This ViewSet provides endpoints to retrieve, create, and update ticket
        messages.


        Permissions:
            - Platform Admins:
                - Platform admins are able to view all ticket messages for the tenant.
            - Students:
                - Students are able to view all ticket messages for only the ticket they are associated with.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TicketMessage'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TicketMessage'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TicketMessage'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TicketMessage'
          '*/*':
            schema:
              $ref: '#/components/schemas/TicketMessage'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TicketMessage'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/support-ticket-messages/{id}/:
    get:
      operationId: ai_mentor_orgs_users_support_ticket_messages_retrieve
      description: >-
        ViewSet for managing ticket messages.


        This ViewSet provides endpoints to retrieve, create, and update ticket
        messages.


        Permissions:
            - Platform Admins:
                - Platform admins are able to view all ticket messages for the tenant.
            - Students:
                - Students are able to view all ticket messages for only the ticket they are associated with.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this ticket message.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TicketMessage'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_support_ticket_messages_update
      description: >-
        ViewSet for managing ticket messages.


        This ViewSet provides endpoints to retrieve, create, and update ticket
        messages.


        Permissions:
            - Platform Admins:
                - Platform admins are able to view all ticket messages for the tenant.
            - Students:
                - Students are able to view all ticket messages for only the ticket they are associated with.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this ticket message.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TicketMessage'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TicketMessage'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TicketMessage'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TicketMessage'
          '*/*':
            schema:
              $ref: '#/components/schemas/TicketMessage'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TicketMessage'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_support_ticket_messages_partial_update
      description: >-
        ViewSet for managing ticket messages.


        This ViewSet provides endpoints to retrieve, create, and update ticket
        messages.


        Permissions:
            - Platform Admins:
                - Platform admins are able to view all ticket messages for the tenant.
            - Students:
                - Students are able to view all ticket messages for only the ticket they are associated with.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this ticket message.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedTicketMessage'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedTicketMessage'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedTicketMessage'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedTicketMessage'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedTicketMessage'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TicketMessage'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_support_ticket_messages_destroy
      description: >-
        ViewSet for managing ticket messages.


        This ViewSet provides endpoints to retrieve, create, and update ticket
        messages.


        Permissions:
            - Platform Admins:
                - Platform admins are able to view all ticket messages for the tenant.
            - Students:
                - Students are able to view all ticket messages for only the ticket they are associated with.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this ticket message.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/support-tickets/:
    get:
      operationId: ai_mentor_orgs_users_support_tickets_list
      description: >-
        ViewSet for managing Human Support Tickets.


        This ViewSet provides endpoints to retrieve, create, and update Human
        Support Tickets.


        Permissions:
            Platform Admins:
                - Platform admins are able to update the ticket status, and view all tickets for the tenant.
                - Platform admins can only update the `subject`, `description` and `status` fields.
            Students:
                - Students are only able to view their own created tickets.
                - students can modify only the `subject` and `description` entries

            Field Updates:
                - subject: Modifiable by both student and platform admin
                - description: Modifiable by only student.
                - status: Modifiable by only platform admin.
      parameters:
        - in: query
          name: mentor_id
          schema:
            type: number
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: session
          schema:
            type: string
            format: uuid
        - in: query
          name: status
          schema:
            type: string
            enum:
              - closed
              - in_progress
              - open
          description: |-
            * `open` - Open
            * `in_progress` - In Progress
            * `closed` - Closed
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: username
          schema:
            type: string
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedHumanSupportTicketList'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/support-tickets/{id}/:
    get:
      operationId: ai_mentor_orgs_users_support_tickets_retrieve
      description: >-
        ViewSet for managing Human Support Tickets.


        This ViewSet provides endpoints to retrieve, create, and update Human
        Support Tickets.


        Permissions:
            Platform Admins:
                - Platform admins are able to update the ticket status, and view all tickets for the tenant.
                - Platform admins can only update the `subject`, `description` and `status` fields.
            Students:
                - Students are only able to view their own created tickets.
                - students can modify only the `subject` and `description` entries

            Field Updates:
                - subject: Modifiable by both student and platform admin
                - description: Modifiable by only student.
                - status: Modifiable by only platform admin.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this human support ticket.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HumanSupportTicket'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_support_tickets_update
      description: >-
        ViewSet for managing Human Support Tickets.


        This ViewSet provides endpoints to retrieve, create, and update Human
        Support Tickets.


        Permissions:
            Platform Admins:
                - Platform admins are able to update the ticket status, and view all tickets for the tenant.
                - Platform admins can only update the `subject`, `description` and `status` fields.
            Students:
                - Students are only able to view their own created tickets.
                - students can modify only the `subject` and `description` entries

            Field Updates:
                - subject: Modifiable by both student and platform admin
                - description: Modifiable by only student.
                - status: Modifiable by only platform admin.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this human support ticket.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HumanSupportTicket'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/HumanSupportTicket'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/HumanSupportTicket'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/HumanSupportTicket'
          '*/*':
            schema:
              $ref: '#/components/schemas/HumanSupportTicket'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HumanSupportTicket'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_support_tickets_partial_update
      description: >-
        ViewSet for managing Human Support Tickets.


        This ViewSet provides endpoints to retrieve, create, and update Human
        Support Tickets.


        Permissions:
            Platform Admins:
                - Platform admins are able to update the ticket status, and view all tickets for the tenant.
                - Platform admins can only update the `subject`, `description` and `status` fields.
            Students:
                - Students are only able to view their own created tickets.
                - students can modify only the `subject` and `description` entries

            Field Updates:
                - subject: Modifiable by both student and platform admin
                - description: Modifiable by only student.
                - status: Modifiable by only platform admin.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this human support ticket.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedHumanSupportTicket'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedHumanSupportTicket'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedHumanSupportTicket'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedHumanSupportTicket'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedHumanSupportTicket'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HumanSupportTicket'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_support_tickets_destroy
      description: >-
        ViewSet for managing Human Support Tickets.


        This ViewSet provides endpoints to retrieve, create, and update Human
        Support Tickets.


        Permissions:
            Platform Admins:
                - Platform admins are able to update the ticket status, and view all tickets for the tenant.
                - Platform admins can only update the `subject`, `description` and `status` fields.
            Students:
                - Students are only able to view their own created tickets.
                - students can modify only the `subject` and `description` entries

            Field Updates:
                - subject: Modifiable by both student and platform admin
                - description: Modifiable by only student.
                - status: Modifiable by only platform admin.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this human support ticket.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/support-tickets/{id}/close/:
    post:
      operationId: ai_mentor_orgs_users_support_tickets_close_create
      description: |-
        Endpoint to close a Human support ticket.

        This endpoint is used to close a Human support ticket.

        Permissions:
            - available to both platform admins and the student who created the ticket.

        Returns:
            Response: A response object containing the closed ticket data.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this human support ticket.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/tasks/{task_id}:
    get:
      operationId: ai_mentor_orgs_users_tasks_retrieve
      description: |-
        Retrieves the status of a task using its task ID.

        Accessible to both tenant admins and students.

        Returns:

            200: task id
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: task_id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetrieveTask'
              examples:
                TaskStatus:
                  value:
                    task: completed
                  summary: Task status
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/tasks/sessions/{session_id}/:
    post:
      operationId: ai_mentor_orgs_users_tasks_sessions_create
      description: |-
        Export chat history for a session.

        Returns:
            200: Task ID for the export operation.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: session_id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskView'
            examples:
              ExampleResponse:
                value:
                  task_id: 307be194-2351-44ff-8d7b-24660fd9ec34
                summary: Example Response
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TaskView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TaskView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TaskView'
          '*/*':
            schema:
              $ref: '#/components/schemas/TaskView'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskView'
              examples:
                ExampleResponse:
                  value:
                    task_id: 307be194-2351-44ff-8d7b-24660fd9ec34
                  summary: Example Response
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/tool-categories/:
    get:
      operationId: ai_mentor_orgs_users_tool_categories_list
      description: Retrieve Tool Categories
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ToolCategory'
              examples:
                ListOfToolCategories:
                  value:
                    - - id: 1
                        name: Content
                        description: content
                      - id: 1
                        name: Administrative
                        description: description
                  summary: List of Tool Categories
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/voices/:
    get:
      operationId: ai_mentor_orgs_users_voices_list
      description: |-
        Retrieve a list of available voice options.

        Args:
            request: The HTTP request.

        Returns:
            Response: A list of available voice options.

        Raises:
            NotFound: If no voice options are available.
      parameters:
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: provider
          schema:
            type: string
            enum:
              - elevenlabs
              - google
              - openai
          description: |-
            * `openai` - Openai
            * `google` - Google
            * `elevenlabs` - Elevenlabs
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedVoiceList'
              examples:
                VoiceOptionsResponseExample:
                  value:
                    count: 123
                    next: http://api.example.org/accounts/?page=4
                    previous: http://api.example.org/accounts/?page=2
                    results:
                      - - id: 1
                          name: Alloy
                          provider: openai
                          gender: female
                          language: en-US
                          description: A versatile, general-purpose voice
                        - id: 2
                          name: Echo
                          provider: openai
                          gender: male
                          language: en-US
                          description: A baritone voice with a lower pitch
                  summary: Voice Options Response Example
          description: ''
        '404':
          description: Voice options not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/voices/{id}/:
    get:
      operationId: ai_mentor_orgs_users_voices_retrieve
      description: |-
        Retrieve details of a specific voice option.

        Args:
            request: The HTTP request.
            pk: The primary key of the voice option to retrieve.

        Returns:
            Response: The details of the specified voice option.

        Raises:
            NotFound: If the specified voice option does not exist.
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this voice.
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Voice'
              examples:
                VoiceOptionDetailResponseExample:
                  value:
                    id: 1
                    name: Alloy
                    provider: openai
                    gender: female
                    language: en-US
                    description: A versatile, general-purpose voice
                  summary: Voice Option Detail Response Example
          description: ''
        '404':
          description: Voice option not found
  /api/ai-mentor/orgs/{org}/webhooks/azure/trigger/{slug}/:
    post:
      operationId: ai_mentor_orgs_webhooks_azure_trigger_create
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: slug
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      responses:
        '200':
          description: No response body
  /api/ai-mentor/orgs/{org}/webhooks/github/pullrequest/:
    post:
      operationId: ai_mentor_orgs_webhooks_github_pullrequest_create
      description: |-
        Handle incoming POST requests from GitHub webhook for pull requests.

        Args:
            request: The HTTP request object containing the webhook payload.
            org: the organizaion name.

        Returns:
            Response: A response indicating the result of processing the webhook event.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-mentor
      responses:
        '200':
          description: No response body
  /api/ai-mentor/webhooks/azure/emailchat/:
    post:
      operationId: ai_mentor_webhooks_azure_emailchat_create
      tags:
        - ai-mentor
      responses:
        '200':
          description: No response body
  /api/ai-mentor/webhooks/n8n-progress/:
    post:
      operationId: ai_mentor_webhooks_n8n_progress_create
      description: >-
        This is the endpoint called by N8N workflows from N8N, to report
        progress to the mentor SPA(DM)


        Example request:

        ```

        {"unique_id": "the-unique-id", "progress": "the email was successfully
        sent.", "finished": false}

        ```
      tags:
        - ai-mentor
      responses:
        '200':
          description: No response body
  /api/ai-prompt/orgs/{org}/metadata/:
    post:
      operationId: ai_prompt_orgs_metadata_create
      description: |-
        Create or update metadata for a prompt.

        Args:
            request: The HTTP request containing the metadata.
            org: The organization/tenant identifier.

        Returns:
            Response: The created or updated prompt metadata.

        Raises:
            BadRequest: If the provided data is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Metadata'
            examples:
              PromptMetadataRequestExample:
                value:
                  metadata:
                    category: technical
                    difficulty: intermediate
                    tags:
                      - python
                      - programming
                  prompt_id: 123
                summary: Prompt Metadata Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Metadata'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Metadata'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Metadata'
          '*/*':
            schema:
              $ref: '#/components/schemas/Metadata'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Metadata'
              examples:
                PromptMetadataResponseExample:
                  value:
                    metadata:
                      category: technical
                      difficulty: intermediate
                      tags:
                        - python
                        - programming
                    prompt_id: 123
                  summary: Prompt Metadata Response Example
          description: ''
        '400':
          description: Invalid data
  /api/ai-prompt/orgs/{org}/users/{user_id}/all-chats-memory/:
    get:
      operationId: ai_prompt_orgs_users_all_chats_memory_retrieve
      description: |-
        Retrieve chat memory for a specific user.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user to retrieve chat memory for.

        Returns:
            Response: The user's chat memory entries.

        Raises:
            NotFound: If no chat memory exists for the user.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserAllChatMemoryView'
              examples:
                UserChatMemoryResponseExample:
                  value:
                    id: 1
                    username: johndoe
                    platform_key: main
                    content: >-
                      Previous conversation context about machine learning
                      concepts.
                    session_id: 937d3d46-3048-4f9d-aa5c-ce7c51d85332
                  summary: User Chat Memory Response Example
          description: ''
        '404':
          description: Memory not found
    post:
      operationId: ai_prompt_orgs_users_all_chats_memory_create
      description: |-
        Create a new chat memory entry for a user.

        Args:
            request: The HTTP request containing the chat memory data.
            org: The organization/tenant identifier.
            user_id: The ID of the user to create chat memory for.

        Returns:
            Response: The created chat memory entry.

        Raises:
            BadRequest: If the provided data is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserAllChatMemoryView'
            examples:
              CreateChatMemoryRequestExample:
                value:
                  username: johndoe
                  platform_key: main
                  content: >-
                    Previous conversation context about machine learning
                    concepts.
                  session_id: 937d3d46-3048-4f9d-aa5c-ce7c51d85332
                summary: Create Chat Memory Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserAllChatMemoryView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserAllChatMemoryView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserAllChatMemoryView'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserAllChatMemoryView'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserAllChatMemoryView'
              examples:
                CreateChatMemoryResponseExample:
                  value:
                    id: 1
                    username: johndoe
                    platform_key: main
                    content: >-
                      Previous conversation context about machine learning
                      concepts.
                    session_id: 937d3d46-3048-4f9d-aa5c-ce7c51d85332
                  summary: Create Chat Memory Response Example
          description: ''
        '400':
          description: Invalid data
    put:
      operationId: ai_prompt_orgs_users_all_chats_memory_update
      description: |-
        Update chat memory for a specific user.

        Args:
            request: The HTTP request containing the updated chat memory data.
            org: The organization/tenant identifier.
            user_id: The ID of the user to update chat memory for.

        Returns:
            Response: A confirmation of the scheduled update task.

        Raises:
            BadRequest: If the provided data is invalid.
            NotFound: If no chat memory exists for the user.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserAllChatMemoryView'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserAllChatMemoryView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserAllChatMemoryView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserAllChatMemoryView'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserAllChatMemoryView'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserChatMemoryUpdateView'
              examples:
                UpdateChatMemoryResponseExample:
                  value:
                    task_id: task-123
                    message: Memory update scheduled successfully
                  summary: Update Chat Memory Response Example
          description: ''
        '400':
          description: Invalid data
        '404':
          description: Memory not found
    delete:
      operationId: ai_prompt_orgs_users_all_chats_memory_destroy
      description: |-
        Delete all chat memory for a specific user.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user to delete chat memory for.

        Returns:
            Response: A success message if the memory was deleted.

        Raises:
            NotFound: If no chat memory exists for the user.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Memory successfully deleted
        '404':
          description: Memory not found
  /api/ai-prompt/orgs/{org}/users/{user_id}/all-chats-memory/{memory_id}/:
    put:
      operationId: ai_prompt_orgs_users_all_chats_memory_update_2
      description: |-
        Update a specific chat memory entry.

        Args:
            request: The HTTP request containing the updated chat memory data.
            org: The organization/tenant identifier.
            user_id: The ID of the user who owns the memory.
            memory_id: The ID of the specific memory entry to update.

        Returns:
            Response: The updated chat memory entry.

        Raises:
            BadRequest: If the provided data is invalid.
            NotFound: If the specified memory entry does not exist.
      parameters:
        - in: path
          name: memory_id
          schema:
            type: integer
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserAllChatMemoryView'
            examples:
              UpdateChatMemoryRequestExample:
                value:
                  username: johndoe
                  platform_key: main
                  content: >-
                    Updated conversation context about machine learning
                    concepts.
                  session_id: 937d3d46-3048-4f9d-aa5c-ce7c51d85332
                summary: Update Chat Memory Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserAllChatMemoryView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserAllChatMemoryView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserAllChatMemoryView'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserAllChatMemoryView'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserAllChatMemoryView'
              examples:
                UpdateChatMemoryResponseExample:
                  value:
                    id: 1
                    username: johndoe
                    platform_key: main
                    content: >-
                      Updated conversation context about machine learning
                      concepts.
                    session_id: 937d3d46-3048-4f9d-aa5c-ce7c51d85332
                  summary: Update Chat Memory Response Example
          description: ''
        '400':
          description: Invalid data
        '404':
          description: Memory not found
    delete:
      operationId: ai_prompt_orgs_users_all_chats_memory_destroy_2
      description: |-
        Delete a specific chat memory entry.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user who owns the memory.
            memory_id: The ID of the specific memory entry to delete.

        Returns:
            Response: A success message if the memory was deleted.

        Raises:
            NotFound: If the specified memory entry does not exist.
      parameters:
        - in: path
          name: memory_id
          schema:
            type: integer
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Memory successfully deleted
        '404':
          description: Memory not found
  /api/ai-prompt/orgs/{org}/users/{user_id}/chat-memory-status/:
    get:
      operationId: ai_prompt_orgs_users_chat_memory_status_retrieve
      description: |-
        Retrieve the chat memory status for a specific user.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user to retrieve memory status for.

        Returns:
            Response: The user's chat memory status.

        Raises:
            NotFound: If no memory status exists for the user.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserChatMemoryStatusView'
              examples:
                MemoryStatusResponseExample:
                  value:
                    id: 1
                    username: johndoe
                    platform_key: main
                    enabled: true
                  summary: Memory Status Response Example
          description: ''
        '404':
          description: Memory status not found
    put:
      operationId: ai_prompt_orgs_users_chat_memory_status_update
      description: |-
        Update the chat memory status for a specific user.

        Args:
            request: The HTTP request containing the updated status.
            org: The organization/tenant identifier.
            user_id: The ID of the user to update memory status for.

        Returns:
            Response: The updated chat memory status.

        Raises:
            BadRequest: If the provided data is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserChatMemoryStatusRequestView'
            examples:
              UpdateMemoryStatusRequestExample:
                value:
                  enabled: false
                summary: Update Memory Status Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserChatMemoryStatusRequestView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserChatMemoryStatusRequestView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserChatMemoryStatusRequestView'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserChatMemoryStatusRequestView'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserChatMemoryStatusView'
              examples:
                UpdateMemoryStatusResponseExample:
                  value:
                    id: 1
                    username: johndoe
                    platform_key: main
                    enabled: false
                  summary: Update Memory Status Response Example
          description: ''
        '400':
          description: Invalid data
  /api/ai-prompt/orgs/{org}/users/{user_id}/languages/:
    get:
      operationId: ai_prompt_orgs_users_languages_retrieve
      description: |-
        Retrieve all available prompt languages.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user making the request.

        Returns:
            Response: A list of available prompt languages.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LanguagesView'
              examples:
                PromptLanguagesExample:
                  value:
                    - id: 1
                      name: English
                      code: en
                    - id: 2
                      name: Spanish
                      code: es
                  summary: Prompt Languages Example
          description: ''
    post:
      operationId: ai_prompt_orgs_users_languages_create
      description: |-
        Create a new prompt language.

        Args:
            request: The HTTP request containing the language data.
            org: The organization/tenant identifier.
            user_id: The ID of the user creating the language.

        Returns:
            Response: The created prompt language.

        Raises:
            BadRequest: If the provided data is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LanguagesView'
            examples:
              CreateLanguageRequestExample:
                value:
                  name: French
                  code: fr
                summary: Create Language Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/LanguagesView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/LanguagesView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/LanguagesView'
          '*/*':
            schema:
              $ref: '#/components/schemas/LanguagesView'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LanguagesView'
              examples:
                CreateLanguageResponseExample:
                  value:
                    id: 3
                    name: French
                    code: fr
                  summary: Create Language Response Example
          description: ''
        '400':
          description: Invalid data
  /api/ai-prompt/orgs/{org}/users/{user_id}/languages/{language_id}/:
    put:
      operationId: ai_prompt_orgs_users_languages_update
      description: |-
        Update a specific prompt language.

        Args:
            request: The HTTP request containing the updated language data.
            org: The organization/tenant identifier.
            user_id: The ID of the user making the request.
            language_id: The ID of the language to update.

        Returns:
            Response: The updated prompt language.

        Raises:
            BadRequest: If the provided data is invalid.
            NotFound: If the specified language does not exist.
      parameters:
        - in: path
          name: language_id
          schema:
            type: integer
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LanguagesView'
            examples:
              UpdateLanguageRequestExample:
                value:
                  name: French (Updated)
                  code: fr
                summary: Update Language Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/LanguagesView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/LanguagesView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/LanguagesView'
          '*/*':
            schema:
              $ref: '#/components/schemas/LanguagesView'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LanguagesView'
              examples:
                UpdateLanguageResponseExample:
                  value:
                    id: 3
                    name: French (Updated)
                    code: fr
                  summary: Update Language Response Example
          description: ''
        '400':
          description: Invalid data
        '404':
          description: Language not found
    delete:
      operationId: ai_prompt_orgs_users_languages_destroy
      description: |-
        Delete a specific prompt language.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user making the request.
            language_id: The ID of the language to delete.

        Returns:
            Response: A success message if the language was deleted.

        Raises:
            NotFound: If the specified language does not exist.
      parameters:
        - in: path
          name: language_id
          schema:
            type: integer
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Language successfully deleted
        '404':
          description: Language not found
  /api/ai-prompt/orgs/{org}/users/{user_id}/memory/:
    get:
      operationId: ai_prompt_orgs_users_memory_retrieve
      description: |-
        Retrieve catalog item memory for a specific user.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user to retrieve catalog item memory for.

        Returns:
            Response: The user's catalog item memory entries.

        Raises:
            NotFound: If no catalog item memory exists for the user.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserCatalogItemMemoryView'
              examples:
                CatalogItemMemoryResponseExample:
                  value:
                    id: 1
                    student: johndoe
                    platform: main
                    catalog_item: course-v1:edX+DemoX+Demo_Course
                    lessons:
                      completed:
                        - lesson1
                        - lesson2
                      in_progress:
                        - lesson3
                    next_steps:
                      recommended:
                        - lesson4
                        - lesson5
                  summary: Catalog Item Memory Response Example
          description: ''
        '404':
          description: Memory not found
    post:
      operationId: ai_prompt_orgs_users_memory_create
      description: |-
        Create a new catalog item memory entry for a user.

        Args:
            request: The HTTP request containing the catalog item memory data.
            org: The organization/tenant identifier.
            user_id: The ID of the user to create catalog item memory for.

        Returns:
            Response: The created catalog item memory entry.

        Raises:
            BadRequest: If the provided data is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCatalogItemMemoryView'
            examples:
              CreateCatalogItemMemoryRequestExample:
                value:
                  student: johndoe
                  platform: main
                  catalog_item: course-v1:edX+DemoX+Demo_Course
                  lessons:
                    completed:
                      - lesson1
                      - lesson2
                    in_progress:
                      - lesson3
                  next_steps:
                    recommended:
                      - lesson4
                      - lesson5
                summary: Create Catalog Item Memory Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserCatalogItemMemoryView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserCatalogItemMemoryView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserCatalogItemMemoryView'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserCatalogItemMemoryView'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserCatalogItemMemoryView'
              examples:
                CreateCatalogItemMemoryResponseExample:
                  value:
                    id: 1
                    student: johndoe
                    platform: main
                    catalog_item: course-v1:edX+DemoX+Demo_Course
                    lessons:
                      completed:
                        - lesson1
                        - lesson2
                      in_progress:
                        - lesson3
                    next_steps:
                      recommended:
                        - lesson4
                        - lesson5
                  summary: Create Catalog Item Memory Response Example
          description: ''
        '400':
          description: Invalid data
    delete:
      operationId: ai_prompt_orgs_users_memory_destroy
      description: |-
        Delete all catalog item memory for a specific user.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user to delete catalog item memory for.

        Returns:
            Response: A success message if the memory was deleted.

        Raises:
            NotFound: If no catalog item memory exists for the user.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Memory successfully deleted
        '404':
          description: Memory not found
  /api/ai-prompt/orgs/{org}/users/{user_id}/memory-context/:
    get:
      operationId: ai_prompt_orgs_users_memory_context_retrieve
      description: Retrieve a user's memory context settings.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserMemoryContextResponse'
              examples:
                UserMemoryContextResponse:
                  value:
                    username: johndoe
                    platform_key: main
                    extra_data: null
                    use_reported_skills: false
                    use_desired_skills: false
                    use_credentials: false
                    use_enrolled_courses: false
                    use_time_spent: false
                    use_completed_courses: false
                    use_completed_programs: false
                  summary: User Memory Context Response
          description: ''
    put:
      operationId: ai_prompt_orgs_users_memory_context_update
      description: |-
        Updates the user's memory context settings.

        Returns:

            200: list of user memory context data.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserMemoryContextRequest'
            examples:
              UserMemoryUpdateRequest:
                value:
                  extra_data: Keep in mind that i also love football
                  use_reported_skills: false
                  use_desired_skills: false
                  use_credentials: false
                  use_enrolled_courses: false
                  use_time_spent: false
                  use_completed_courses: false
                  use_completed_programs: false
                summary: User memory update request
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserMemoryContextRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserMemoryContextRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserMemoryContextRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserMemoryContextRequest'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserMemoryContextResponse'
              examples:
                UserMemoryUpdateResponse:
                  value:
                    username: johndoe
                    platform_key: main
                    extra_data: Keep in mind that i also love football
                    use_reported_skills: false
                    use_desired_skills: false
                    use_credentials: false
                    use_enrolled_courses: false
                    use_time_spent: false
                    use_completed_courses: false
                    use_completed_programs: false
                  summary: User memory update response
          description: ''
  /api/ai-prompt/orgs/{org}/users/{user_id}/memory-status/:
    get:
      operationId: ai_prompt_orgs_users_memory_status_retrieve
      description: |-
        Retrieve the memory status for a specific user.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user to retrieve memory status for.

        Returns:
            Response: The user's memory status.

        Raises:
            NotFound: If no memory status exists for the user.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryStatusView'
              examples:
                MemoryStatusResponseExample:
                  value:
                    id: 1
                    username: johndoe
                    platform_key: main
                    enabled: true
                  summary: Memory Status Response Example
          description: ''
        '404':
          description: Memory status not found
    put:
      operationId: ai_prompt_orgs_users_memory_status_update
      description: |-
        Update the memory status for a specific user.

        Args:
            request: The HTTP request containing the updated status.
            org: The organization/tenant identifier.
            user_id: The ID of the user to update memory status for.

        Returns:
            Response: The updated memory status.

        Raises:
            BadRequest: If the provided data is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemoryStatusRequestView'
            examples:
              UpdateMemoryStatusRequestExample:
                value:
                  enabled: false
                summary: Update Memory Status Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MemoryStatusRequestView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MemoryStatusRequestView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MemoryStatusRequestView'
          '*/*':
            schema:
              $ref: '#/components/schemas/MemoryStatusRequestView'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryStatusView'
              examples:
                UpdateMemoryStatusResponseExample:
                  value:
                    id: 1
                    username: johndoe
                    platform_key: main
                    enabled: false
                  summary: Update Memory Status Response Example
          description: ''
        '400':
          description: Invalid data
  /api/ai-prompt/orgs/{org}/users/{user_id}/memory/{memory_id}/:
    put:
      operationId: ai_prompt_orgs_users_memory_update
      description: |-
        Update a specific catalog item memory entry.

        Args:
            request: The HTTP request containing the updated catalog item memory data.
            org: The organization/tenant identifier.
            user_id: The ID of the user who owns the memory.
            memory_id: The ID of the specific memory entry to update.

        Returns:
            Response: The updated catalog item memory entry.

        Raises:
            BadRequest: If the provided data is invalid.
            NotFound: If the specified memory entry does not exist.
      parameters:
        - in: path
          name: memory_id
          schema:
            type: integer
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCatalogItemMemoryView'
            examples:
              UpdateCatalogItemMemoryRequestExample:
                value:
                  student: johndoe
                  platform: main
                  catalog_item: course-v1:edX+DemoX+Demo_Course
                  lessons:
                    completed:
                      - lesson1
                      - lesson2
                      - lesson3
                    in_progress:
                      - lesson4
                  next_steps:
                    recommended:
                      - lesson5
                      - lesson6
                summary: Update Catalog Item Memory Request Example
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserCatalogItemMemoryView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserCatalogItemMemoryView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserCatalogItemMemoryView'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserCatalogItemMemoryView'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserCatalogItemMemoryView'
              examples:
                UpdateCatalogItemMemoryResponseExample:
                  value:
                    id: 1
                    student: johndoe
                    platform: main
                    catalog_item: course-v1:edX+DemoX+Demo_Course
                    lessons:
                      completed:
                        - lesson1
                        - lesson2
                        - lesson3
                      in_progress:
                        - lesson4
                    next_steps:
                      recommended:
                        - lesson5
                        - lesson6
                  summary: Update Catalog Item Memory Response Example
          description: ''
        '400':
          description: Invalid data
        '404':
          description: Memory not found
    delete:
      operationId: ai_prompt_orgs_users_memory_destroy_2
      description: |-
        Delete a specific catalog item memory entry.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user who owns the memory.
            memory_id: The ID of the specific memory entry to delete.

        Returns:
            Response: A success message if the memory was deleted.

        Raises:
            NotFound: If the specified memory entry does not exist.
      parameters:
        - in: path
          name: memory_id
          schema:
            type: integer
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Memory successfully deleted
        '404':
          description: Memory not found
  /api/ai-prompt/orgs/{org}/users/{user_id}/metadata:
    get:
      operationId: ai_prompt_orgs_users_metadata_retrieve
      description: |-
        Retrieve metadata for a prompt.

        Args:
            request: The HTTP request.
            org: The organization/tenant identifier.
            user_id: The ID of the user making the request.

        Returns:
            Response: The prompt metadata.

        Raises:
            NotFound: If no metadata exists for the specific prompt
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Metadata'
              examples:
                PromptMetadataResponseExample:
                  value:
                    metadata:
                      category: technical
                      difficulty: intermediate
                      tags:
                        - python
                        - programming
                    prompt_id: 123
                  summary: Prompt Metadata Response Example
          description: ''
        '404':
          description: Metadata not found
  /api/ai-prompt/orgs/{org}/users/{user_id}/prompt/:
    get:
      operationId: ai_prompt_orgs_users_prompt_list
      description: |-
        API viewset for managing prompts.

        This view allows tenant admins and students to create, retrieve, update,
        and filter prompts based on various parameters.

        Permissions:
            - Accessible to both tenant administrators and students
      parameters:
        - in: query
          name: category
          schema:
            type: integer
          description: Category of the prompt
        - in: query
          name: created_by
          schema:
            type: string
            minLength: 1
          description: Option to filter by username of the prompt creators.
        - in: query
          name: filter_by
          schema:
            type: string
            minLength: 1
          description: Filter options include, date, prompt, default is date
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            minLength: 1
          description: Mentor unique id of the prompt
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: tag
          schema:
            type: integer
          description: Tag of the prompt
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: visibility
          schema:
            type: string
            minLength: 1
          description: Visibility trype the mentor of the prompt
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Prompt'
          description: ''
    post:
      operationId: ai_prompt_orgs_users_prompt_create
      description: |-
        Create a new prompt.

        Args:
            request: HTTP request containing prompt data.

        Returns:
            Response with created prompt details.

        Raises:
            ValidationError: If the input data is invalid.
      parameters:
        - in: query
          name: category
          schema:
            type: integer
          description: Category of the prompt
        - in: query
          name: created_by
          schema:
            type: string
            minLength: 1
          description: Option to filter by username of the prompt creators.
        - in: query
          name: filter_by
          schema:
            type: string
            minLength: 1
          description: Filter options include, date, prompt, default is date
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            minLength: 1
          description: Mentor unique id of the prompt
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: tag
          schema:
            type: integer
          description: Tag of the prompt
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: visibility
          schema:
            type: string
            minLength: 1
          description: Visibility trype the mentor of the prompt
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Prompt'
            examples:
              CreateANewPrompt:
                value:
                  text: What are the benefits of exercise?
                  category: health
                  tags:
                    - 1
                    - 2
                  mentor: 3
                  prompt_visibility: viewable_by_anyone
                summary: Create a new prompt
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Prompt'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Prompt'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Prompt'
          '*/*':
            schema:
              $ref: '#/components/schemas/Prompt'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prompt'
              examples:
                CreateANewPrompt:
                  value:
                    text: What are the benefits of exercise?
                    category: health
                    tags:
                      - 1
                      - 2
                    mentor: 3
                    prompt_visibility: viewable_by_anyone
                  summary: Create a new prompt
          description: ''
  /api/ai-prompt/orgs/{org}/users/{user_id}/prompt/{id}/:
    get:
      operationId: ai_prompt_orgs_users_prompt_retrieve
      description: |-
        API viewset for managing prompts.

        This view allows tenant admins and students to create, retrieve, update,
        and filter prompts based on various parameters.

        Permissions:
            - Accessible to both tenant administrators and students
      parameters:
        - in: query
          name: category
          schema:
            type: integer
          description: Category of the prompt
        - in: query
          name: created_by
          schema:
            type: string
            minLength: 1
          description: Option to filter by username of the prompt creators.
        - in: query
          name: filter_by
          schema:
            type: string
            minLength: 1
          description: Filter options include, date, prompt, default is date
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this prompt.
          required: true
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            minLength: 1
          description: Mentor unique id of the prompt
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: tag
          schema:
            type: integer
          description: Tag of the prompt
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: visibility
          schema:
            type: string
            minLength: 1
          description: Visibility trype the mentor of the prompt
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prompt'
          description: ''
    put:
      operationId: ai_prompt_orgs_users_prompt_update
      description: |-
        Update an existing prompt.

        Args:
            request: HTTP request containing updated prompt data.

        Returns:
            Response with updated prompt details.

        Raises:
            ValidationError: If the input data is invalid.
            PermissionDenied: If the prompt is system-generated and cannot be edited.
      parameters:
        - in: query
          name: category
          schema:
            type: integer
          description: Category of the prompt
        - in: query
          name: created_by
          schema:
            type: string
            minLength: 1
          description: Option to filter by username of the prompt creators.
        - in: query
          name: filter_by
          schema:
            type: string
            minLength: 1
          description: Filter options include, date, prompt, default is date
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this prompt.
          required: true
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            minLength: 1
          description: Mentor unique id of the prompt
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: tag
          schema:
            type: integer
          description: Tag of the prompt
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: visibility
          schema:
            type: string
            minLength: 1
          description: Visibility trype the mentor of the prompt
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Prompt'
            examples:
              UpdateAnExistingPrompt:
                value:
                  text: Updated prompt text
                  category: updated_category
                  tags:
                    - 3
                    - 4
                  mentor: 1
                  prompt_visibility: viewable_by_admins
                summary: Update an existing prompt
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Prompt'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Prompt'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Prompt'
          '*/*':
            schema:
              $ref: '#/components/schemas/Prompt'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prompt'
              examples:
                UpdateAnExistingPrompt:
                  value:
                    text: Updated prompt text
                    category: updated_category
                    tags:
                      - 3
                      - 4
                    mentor: 1
                    prompt_visibility: viewable_by_admins
                  summary: Update an existing prompt
          description: ''
    patch:
      operationId: ai_prompt_orgs_users_prompt_partial_update
      description: |-
        API viewset for managing prompts.

        This view allows tenant admins and students to create, retrieve, update,
        and filter prompts based on various parameters.

        Permissions:
            - Accessible to both tenant administrators and students
      parameters:
        - in: query
          name: category
          schema:
            type: integer
          description: Category of the prompt
        - in: query
          name: created_by
          schema:
            type: string
            minLength: 1
          description: Option to filter by username of the prompt creators.
        - in: query
          name: filter_by
          schema:
            type: string
            minLength: 1
          description: Filter options include, date, prompt, default is date
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this prompt.
          required: true
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            minLength: 1
          description: Mentor unique id of the prompt
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: tag
          schema:
            type: integer
          description: Tag of the prompt
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: visibility
          schema:
            type: string
            minLength: 1
          description: Visibility trype the mentor of the prompt
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPrompt'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedPrompt'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPrompt'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPrompt'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedPrompt'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prompt'
          description: ''
    delete:
      operationId: ai_prompt_orgs_users_prompt_destroy
      description: |-
        API viewset for managing prompts.

        This view allows tenant admins and students to create, retrieve, update,
        and filter prompts based on various parameters.

        Permissions:
            - Accessible to both tenant administrators and students
      parameters:
        - in: query
          name: category
          schema:
            type: integer
          description: Category of the prompt
        - in: query
          name: created_by
          schema:
            type: string
            minLength: 1
          description: Option to filter by username of the prompt creators.
        - in: query
          name: filter_by
          schema:
            type: string
            minLength: 1
          description: Filter options include, date, prompt, default is date
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this prompt.
          required: true
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            minLength: 1
          description: Mentor unique id of the prompt
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: tag
          schema:
            type: integer
          description: Tag of the prompt
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: visibility
          schema:
            type: string
            minLength: 1
          description: Visibility trype the mentor of the prompt
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-prompt/orgs/{org}/users/{user_id}/prompts/category/:
    get:
      operationId: ai_prompt_orgs_users_prompts_category_retrieve
      description: |-
        Retrieve a list of prompt categories.

        Query Parameters:
            - filter_by (optional): Sorts categories by name if set to "name".

        Args:
            request: The HTTP request.
            org: Organization key identifier.

        Returns:
            - 200: List of prompt categories.
            - 400: If query parameters are invalid.
      parameters:
        - in: query
          name: filter_by
          schema:
            type: string
            minLength: 1
          description: 'Filter options include, date, name, default is date '
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptCategory'
              examples:
                PromptCategoriesExample:
                  value:
                    - id: 1
                      name: Education
                      description: Education-related prompts
                  summary: Prompt Categories Example
          description: ''
    post:
      operationId: ai_prompt_orgs_users_prompts_category_create
      description: |-
        Create a new prompt category.

        Args:
            request: The HTTP request containing category information.
            org: Organization key identifier.
            user_id: User performing the request.

        Returns:
            - 201: Created prompt category.
            - 401: If the user is not a tenant admin.
            - 400: If request data is invalid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PromptCategory'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PromptCategory'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PromptCategory'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PromptCategory'
          '*/*':
            schema:
              $ref: '#/components/schemas/PromptCategory'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptCategory'
              examples:
                CreatePromptCategoryExample:
                  value:
                    id: 1
                    name: Education
                    description: Education-related prompts
                  summary: Create Prompt Category Example
          description: Created prompt category
    delete:
      operationId: ai_prompt_orgs_users_prompts_category_destroy
      description: |-
        Delete a prompt category.

        Args:
            request: The HTTP request containing the category to delete.
            org: Organization key identifier.
            user_id: User performing the request.

        Returns:
            - 204: No Content (successful deletion).
            - 401: If the user is not a tenant admin.
            - 400: If request data is invalid.
            - 404: If the category does not exist.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Prompt category deleted successfully.
        '400':
          description: Invalid request data.
        '404':
          description: Prompt category not found.
  /api/ai-prompt/orgs/{org}/users/{user_id}/prompts/public/:
    get:
      operationId: ai_prompt_orgs_users_prompts_public_list
      description: |-
        API viewset for managing prompts.

        This view allows anyone to retrieve,
        and filter prompts based on various parameters.

        Permissions:
            - Accessible to anyone
      parameters:
        - in: query
          name: category
          schema:
            type: integer
          description: Category of the prompt
        - in: query
          name: created_by
          schema:
            type: string
            minLength: 1
          description: Option to filter by username of the prompt creators.
        - in: query
          name: filter_by
          schema:
            type: string
            minLength: 1
          description: Filter options include, date, prompt, default is date
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            minLength: 1
          description: Mentor unique id of the prompt
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: tag
          schema:
            type: integer
          description: Tag of the prompt
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: visibility
          schema:
            type: string
            minLength: 1
          description: Visibility trype the mentor of the prompt
      tags:
        - ai-prompt
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Prompt'
          description: ''
  /api/ai-prompt/orgs/{org}/users/{user_id}/prompts/public/{id}/:
    get:
      operationId: ai_prompt_orgs_users_prompts_public_retrieve
      description: |-
        API viewset for managing prompts.

        This view allows anyone to retrieve,
        and filter prompts based on various parameters.

        Permissions:
            - Accessible to anyone
      parameters:
        - in: query
          name: category
          schema:
            type: integer
          description: Category of the prompt
        - in: query
          name: created_by
          schema:
            type: string
            minLength: 1
          description: Option to filter by username of the prompt creators.
        - in: query
          name: filter_by
          schema:
            type: string
            minLength: 1
          description: Filter options include, date, prompt, default is date
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this prompt.
          required: true
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            minLength: 1
          description: Mentor unique id of the prompt
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: tag
          schema:
            type: integer
          description: Tag of the prompt
        - in: path
          name: user_id
          schema:
            type: string
          required: true
        - in: query
          name: visibility
          schema:
            type: string
            minLength: 1
          description: Visibility trype the mentor of the prompt
      tags:
        - ai-prompt
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prompt'
          description: ''
  /api/ai-prompt/orgs/{org}/users/{user_id}/sessions/{session_id}/guided-prompts/:
    get:
      operationId: ai_prompt_orgs_users_sessions_guided_prompts_retrieve
      description: >-
        Fetches AI-generated guided prompts for a given session and
        organization.
      summary: Retrieve guided prompts for a chat session
      parameters:
        - in: query
          name: count
          schema:
            type: integer
            maximum: 10
            minimum: 1
            default: 5
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: session_id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GuidedPromptsResponse'
              examples:
                SuccessfulResponse:
                  value:
                    ai_prompts:
                      - What are the benefits of regular exercise?
                      - How can I create a healthy meal plan?
                      - What are some effective stress management techniques?
                  summary: Successful Response
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
              examples:
                OpenAIAPIKeyNotFound:
                  value:
                    error: OpenAI API key for tenant (main) not found.
                  summary: OpenAI API Key Not Found
                SessionNotFound:
                  value:
                    error: Session not found.
                  summary: Session Not Found
          description: ''
        '429':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
              examples:
                RateLimitExceeded:
                  value:
                    error: Quota exceeded for OpenAI requests.
                  summary: Rate Limit Exceeded
          description: ''
        '500':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
              examples:
                AIResponseError:
                  value:
                    error: Unable to process AI response.
                  summary: AI Response Error
          description: ''
  /api/ai-prompt/orgs/{org}/users/{user_id}/styles/:
    get:
      operationId: ai_prompt_orgs_users_styles_retrieve
      description: |-
        Endpoint for getting prompt styles.

        Accessible to tenant admins and students.

        Returns:

            200: List of styles.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StylesView'
              examples:
                ExampleResponse:
                  value:
                    - id: 1
                      description: Sympathetic
                  summary: Example Response
          description: ''
    post:
      operationId: ai_prompt_orgs_users_styles_create
      description: |-
        Endpoint for Adding prompt style.

        Accessible to tenant admins only.

        Returns:

            201: style Object.

            400: When data is not valid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StylesView'
            examples:
              CreateStyle:
                value:
                  description: Sympathetic
                summary: create style
          application/scim+json:
            schema:
              $ref: '#/components/schemas/StylesView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StylesView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StylesView'
          '*/*':
            schema:
              $ref: '#/components/schemas/StylesView'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StylesView'
              examples:
                ExampleResponse:
                  value:
                    id: 1
                    description: Sympathetic
                  summary: Example Response
          description: ''
  /api/ai-prompt/orgs/{org}/users/{user_id}/styles/{style_id}/:
    put:
      operationId: ai_prompt_orgs_users_styles_update
      description: |-
        Endpoint for Adding prompt style.

        Accessible to tenant admins only.

        Returns:

            200: style Object.

            400: When data is not valid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: style_id
          schema:
            type: integer
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StylesView'
            examples:
              CreateStyle:
                value:
                  description: Sympathetic
                summary: create style
          application/scim+json:
            schema:
              $ref: '#/components/schemas/StylesView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StylesView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StylesView'
          '*/*':
            schema:
              $ref: '#/components/schemas/StylesView'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StylesView'
              examples:
                ExampleResponse:
                  value:
                    id: 1
                    description: Sympathetic
                  summary: Example Response
          description: ''
    delete:
      operationId: ai_prompt_orgs_users_styles_destroy
      description: |-
        Endpoint for deleting prompt style.

        Accessible to tenant admins and students.

        Returns:

            204: No response data.

            400: When data is not valid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: style_id
          schema:
            type: integer
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-prompt/orgs/{org}/users/{user_id}/tags/:
    get:
      operationId: ai_prompt_orgs_users_tags_retrieve
      description: |-
        Endpoint for getting prompt tags.

        Accessible to tenant admins and students.

        Returns:

            200: List of tags.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TagsView'
              examples:
                Response:
                  value:
                    - id: 1
                      name: Programming
                      description: tags for programing prompts
          description: ''
    post:
      operationId: ai_prompt_orgs_users_tags_create
      description: |-
        Endpoint for Adding prompt tag.

        Accessible to tenant admins and students.

        Returns:

            201: tag Object.

            400: When data is not valid.



        Example:

            POST: /api/ai-prompt/orgs/main/users/johndoe/tags/

            Request:        Response:       {
                                "name": "Programming",
                                "description": "tags for programing prompts"
                            }

            Response:       {
                                "id": 1,
                                "name": "Programming",
                                "description": "tags for programing prompts"
                            }
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TagsView'
            examples:
              Request:
                value:
                  name: Programming
                  description: tags for programing prompts
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TagsView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TagsView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TagsView'
          '*/*':
            schema:
              $ref: '#/components/schemas/TagsView'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TagsView'
              examples:
                Response:
                  value:
                    id: 1
                    name: Programming
                    description: tags for programing prompts
          description: ''
  /api/ai-prompt/orgs/{org}/users/{user_id}/tags/{tag_id}/:
    put:
      operationId: ai_prompt_orgs_users_tags_update
      description: |-
        Endpoint for updating prompt tag.

        Accessible to tenant admins and students.

        Returns:

            200: tag Object.

            400: When data is not valid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: tag_id
          schema:
            type: integer
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TagsView'
            examples:
              SampleRequest:
                value:
                  name: Programming
                  description: tags for programing prompts
                summary: Sample Request
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TagsView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TagsView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TagsView'
          '*/*':
            schema:
              $ref: '#/components/schemas/TagsView'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TagsView'
              examples:
                SampleResponse:
                  value:
                    id: 1
                    name: Programming
                    description: tags for programing prompts
                  summary: Sample Response
          description: ''
    delete:
      operationId: ai_prompt_orgs_users_tags_destroy
      description: |-
        Endpoint for deleting prompt tag.

        Accessible to tenant admins and students.

        Returns:

            204: No response data.

            400: When data is not valid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: tag_id
          schema:
            type: integer
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-prompt/orgs/{org}/users/{user_id}/tones/:
    get:
      operationId: ai_prompt_orgs_users_tones_retrieve
      description: |-
        Endpoint for getting prompt tones.

        Accessible to tenant admins and students.

        Returns:

            200: List of tones.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TonesView'
              examples:
                SampleResponse:
                  value:
                    - id: 1
                      description: Sympathetic
                  summary: Sample Response
          description: ''
    post:
      operationId: ai_prompt_orgs_users_tones_create
      description: |-
        Endpoint for Adding prompt tone.

        Accessible to tenant admins only.

        Returns:

            201: tone Object.

            400: When data is not valid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TonesView'
            examples:
              SampleRequest:
                value:
                  description: Sympathetic
                summary: Sample Request
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TonesView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TonesView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TonesView'
          '*/*':
            schema:
              $ref: '#/components/schemas/TonesView'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TonesView'
              examples:
                SampleResponse:
                  value:
                    id: 1
                    description: Sympathetic
                  summary: Sample Response
          description: ''
  /api/ai-prompt/orgs/{org}/users/{user_id}/tones/{tone_id}/:
    put:
      operationId: ai_prompt_orgs_users_tones_update
      description: |-
        Endpoint for updating prompt tone.

        Accessible to tenant admins only.

        Returns:

            200: tone Object.

            400: When data is not valid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: tone_id
          schema:
            type: integer
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TonesView'
            examples:
              SampleRequest:
                value:
                  description: Sympathetic
                summary: Sample Request
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TonesView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TonesView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TonesView'
          '*/*':
            schema:
              $ref: '#/components/schemas/TonesView'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TonesView'
              examples:
                SampleResponse:
                  value:
                    id: 1
                    description: Sympathetic
                  summary: Sample Response
          description: ''
    delete:
      operationId: ai_prompt_orgs_users_tones_destroy
      description: |-
        Endpoint for deleting prompt tone.

        Accessible to tenant admins and students.

        Returns:

            204: No response data.

            400: When data is not valid.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: tone_id
          schema:
            type: integer
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-prompt
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-search/mentors/:
    get:
      operationId: v2_global_mentor_search
      description: |2-

                Search and filter AI mentors with support for comprehensive filtering, pagination, and detailed mentor information.
                This endpoint supports both anonymous and authenticated users with different access levels.

                **Anonymous Users:**
                - Access to public mentors only (VIEWABLE_BY_ANYONE)
                - Limited search capabilities
                - No personalization

                **Authenticated Users:**
                - Full access based on platform permissions (scoped to requested platform)
                - Personalized results
                - Access to tenant-specific mentors

                **Available Filters:**
                - `query`: Search term to filter mentors by name or description
                - `tenant`: Filter by tenant/organization platform key(s)
                - `category`: Filter by mentor category (comma-separated)
                - `subjects`: Filter by mentor subject (comma-separated)
                - `types`: Filter by mentor type (comma-separated)
                - `llm`: Filter by LLM provider (comma-separated, e.g., GPT-4, Claude)
                - `visibility`: Filter by visibility level (comma-separated: viewable_by_anyone, viewable_by_tenant_students, viewable_by_tenant_admins)
                - `created_by`: Filter mentors created by specific user (for personalized search)
                - `include_main_public_mentors`: Include main tenant public mentors

                **Facets:**
                The response includes facets with aggregated counts for all filterable attributes:
                - categories, subjects, types, llm_providers, visibility
                All facet values can be used as filter parameters in subsequent requests.

                Notes:
                - Detail view is removed; use the ibl_ai_mentor app for mentor details
                - include_main_public_mentors=true shows only VIEWABLE_BY_ANYONE mentors from the main tenant across tenants
                - For authenticated requests, platform_key is required when username is provided
                - Frontend uses `llm` parameter name (backend maps to `llm_provider` automatically)
                
      summary: Search and filter AI mentors across the platform
      parameters:
        - in: query
          name: category
          schema:
            type: string
            minLength: 1
          description: Mentor category filter
        - in: query
          name: created_by
          schema:
            type: string
            minLength: 1
          description: Filter mentors created by specific user (for personalized search)
        - in: query
          name: include_main_public_mentors
          schema:
            type: boolean
            default: false
          description: Include main tenant public mentors (VIEWABLE_BY_ANYONE) when true
        - in: query
          name: limit
          schema:
            type: integer
            maximum: 100
            minimum: 1
          description: Number of results per page
        - in: query
          name: llm
          schema:
            type: string
            minLength: 1
          description: LLM provider filter
        - in: query
          name: offset
          schema:
            type: integer
            minimum: 0
          description: Number of results to skip
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key for RBAC enforcement
          required: true
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search query for mentors
        - in: query
          name: subjects
          schema:
            type: string
            minLength: 1
          description: Mentor subject filter
        - in: query
          name: tenant
          schema:
            type: string
            minLength: 1
          description: Tenant key(s) (CSV)
        - in: query
          name: types
          schema:
            type: string
            minLength: 1
          description: Mentor type filter
        - in: query
          name: visibility
          schema:
            type: string
            minLength: 1
          description: >-
            Mentor visibility filter (viewable_by_anyone,
            viewable_by_tenant_students, viewable_by_tenant_admins)
      tags:
        - ai-search
      security:
        - PlatformApiKeyAuthentication: []
        - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2GlobalMentorSearchResponse'
              examples:
                AnonymousUserSearch:
                  value:
                    query: computer science
                    category:
                      - Computer Science
                    limit: 10
                  summary: Anonymous user search
                  description: Search for computer science mentors as an anonymous user
                AuthenticatedUserSearch:
                  value:
                    username: john.doe
                    platform_key: example-university
                    query: data science
                    category:
                      - Computer Science
                    subjects:
                      - Mathematics
                      - Physics
                    types:
                      - Academic
                    llm:
                      - GPT-4
                    visibility:
                      - viewable_by_anyone
                      - viewable_by_tenant_students
                    limit: 20
                  summary: Authenticated user search
                  description: >-
                    Search for data science mentors as an authenticated user
                    with multiple filters
          description: ''
        '400':
          description: Bad request - invalid parameters
        '500':
          description: Internal server error
  /api/ai-search/orgs/{org}/users/{username}/my-mentors/:
    get:
      operationId: ai_search_orgs_users_my_mentors_retrieve
      description: Handle GET requests for my mentors.
      parameters:
        - in: query
          name: audience
          schema:
            type: array
            items:
              type: string
          description: Filter by target audience
        - in: query
          name: category
          schema:
            type: array
            items:
              type: string
          description: Filter by mentor category
        - in: query
          name: created_by
          schema:
            type: string
            minLength: 1
          description: Filter mentors created by specific user
        - in: query
          name: featured
          schema:
            type: boolean
          description: Filter by featured status
        - in: query
          name: id
          schema:
            type: integer
          description: Retrieve a specific mentor by ID
        - in: query
          name: include_main_public_mentors
          schema:
            type: boolean
            default: false
          description: Include public mentors from main tenant
        - in: query
          name: limit
          schema:
            type: integer
            default: 12
          description: Number of results per page
        - in: query
          name: llm
          schema:
            type: array
            items:
              type: string
          description: Filter by language model type
        - in: query
          name: offset
          schema:
            type: integer
            default: 0
          description: Starting position for pagination
        - in: query
          name: order_by
          schema:
            type: string
            minLength: 1
          description: Field to sort results by ('created_at', 'recently_accessed_at')
        - in: query
          name: order_direction
          schema:
            type: string
            default: desc
            minLength: 1
          description: Sort direction ('asc' or 'desc')
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter mentors by name or description
        - in: query
          name: tags
          schema:
            type: array
            items:
              type: string
          description: Filter by tags
        - in: query
          name: tenant
          schema:
            type: string
            minLength: 1
          description: Filter by tenant/organization
        - in: query
          name: unique_id
          schema:
            type: string
            format: uuid
          description: Retrieve a specific mentor by UUID
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - ai-search
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSearchResponse'
          description: ''
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '500':
          description: Server error
  /api/ai-search/personalized-mentors/:
    get:
      operationId: v2_personalized_mentors
      description: |2-

                Get mentors created by a specific user within a given organization/platform.
                This endpoint provides a personalized view of the user's own mentors with
                support for filtering, pagination, and detailed mentor information.

                **Authentication Required:**
                - username: Required for personalized mentor access
                - platform_key: Required for tenant-specific content

                **Features:**
                - User's own mentors only
                - Personalization data (access counts, last used)
                - Filtering and faceted search
                - Pagination support
                - Detail and list views
                
      summary: Get mentors created by a specific user
      parameters:
        - in: query
          name: audience
          schema:
            type: array
            items:
              type: string
          description: Filter by audience
        - in: query
          name: category
          schema:
            type: string
            minLength: 1
          description: Mentor category filter
        - in: query
          name: limit
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: llm_providers
          schema:
            type: array
            items:
              type: string
          description: Filter by LLM provider
        - in: query
          name: offset
          schema:
            type: integer
          description: Number of results to skip
        - in: query
          name: order_by
          schema:
            type: string
            minLength: 1
          description: Field to sort by
        - in: query
          name: order_direction
          schema:
            enum:
              - asc
              - desc
            type: string
            minLength: 1
          description: |-
            Sort direction

            * `asc` - asc
            * `desc` - desc
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key for authentication
          required: true
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search query for personalized mentors
        - in: query
          name: return_facet
          schema:
            type: boolean
          description: Include facet data in response
        - in: query
          name: tags
          schema:
            type: array
            items:
              type: string
          description: Filter by tags
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username for authentication (required for unauthenticated requests)
        - in: query
          name: visibility
          schema:
            type: array
            items:
              type: string
          description: Filter by visibility
      tags:
        - ai-search
      security:
        - PlatformApiKeyAuthentication: []
        - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2PersonalizedMentorsResponse'
              examples:
                GetUser'sMentors:
                  value:
                    username: john.doe
                    platform_key: example-university
                    limit: 20
                  summary: Get user's mentors
                  description: Get all mentors created by john.doe
                FilterByCategory:
                  value:
                    username: jane.smith
                    platform_key: tech-institute
                    category:
                      - Computer Science
                    visibility:
                      - public
                    return_facet: true
                  summary: Filter by category
                  description: Filter user's mentors by category and visibility
                DetailViewByUUID:
                  value:
                    username: john.doe
                    platform_key: example-university
                    unique_id: 550e8400-e29b-41d4-a716-446655440000
                  summary: Detail view by UUID
                  description: Retrieve a specific mentor by UUID
          description: ''
        '400':
          description: Bad request - invalid parameters
        '401':
          description: Unauthorized - missing credentials
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Mentor not found
        '500':
          description: Internal server error
  /api/ai-search/prompts/:
    get:
      operationId: list_platform_prompts
      description: >-
        Get all recommendation prompts for a specific platform. Optionally
        filter by SPA URL or recommendation type.
      summary: List recommendation prompts for a platform
      tags:
        - ai-search
      security:
        - PlatformApiKeyAuthentication: []
        - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PlatformPromptResponse'
          description: ''
        '400':
          description: Invalid parameters
        '401':
          description: Authentication required
        '403':
          description: Admin permissions required
    post:
      operationId: create_platform_prompt
      description: Create a new recommendation prompt for a platform and SPA.
      summary: Create a new recommendation prompt
      tags:
        - ai-search
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
            examples:
              CreateCoursePrompt:
                value:
                  platform_key: acme-corp
                  recommendation_type: courses
                  spa_url: catalog.acme-corp.com
                  prompt_text: Focus on technical skills and certifications...
                  active: true
                summary: Create course prompt
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
      security:
        - PlatformApiKeyAuthentication: []
        - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPromptResponse'
              examples:
                CreateCoursePrompt:
                  value:
                    platform_key: acme-corp
                    recommendation_type: courses
                    spa_url: catalog.acme-corp.com
                    prompt_text: Focus on technical skills and certifications...
                    active: true
                  summary: Create course prompt
          description: ''
        '400':
          description: Invalid data
        '401':
          description: Authentication required
        '403':
          description: Admin permissions required
        '409':
          description: Prompt already exists for this combination
    put:
      operationId: update_platform_prompt
      description: >-
        Update an existing prompt by ID. Must provide platform_key to verify
        ownership.
      summary: Update an existing recommendation prompt
      tags:
        - ai-search
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
      security:
        - PlatformApiKeyAuthentication: []
        - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPromptResponse'
          description: ''
        '400':
          description: Invalid data
        '401':
          description: Authentication required
        '403':
          description: Admin permissions required or platform mismatch
        '404':
          description: Prompt not found
    delete:
      operationId: delete_platform_prompt
      description: >-
        Delete a recommendation prompt by ID. Must provide platform_key to
        verify ownership. This permanently removes the prompt.
      summary: Delete a recommendation prompt
      tags:
        - ai-search
      security:
        - PlatformApiKeyAuthentication: []
        - {}
      responses:
        '204':
          description: Prompt deleted successfully
        '401':
          description: Authentication required
        '403':
          description: Admin permissions required or platform mismatch
        '404':
          description: Prompt not found
  /api/ai-search/recommendation/prompts/:
    get:
      operationId: list_platform_prompts_2
      description: >-
        Get all recommendation prompts for a specific platform. Optionally
        filter by SPA URL or recommendation type.
      summary: List recommendation prompts for a platform
      tags:
        - ai-search
      security:
        - PlatformApiKeyAuthentication: []
        - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PlatformPromptResponse'
          description: ''
        '400':
          description: Invalid parameters
        '401':
          description: Authentication required
        '403':
          description: Admin permissions required
    post:
      operationId: create_platform_prompt_2
      description: Create a new recommendation prompt for a platform and SPA.
      summary: Create a new recommendation prompt
      tags:
        - ai-search
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
            examples:
              CreateCoursePrompt:
                value:
                  platform_key: acme-corp
                  recommendation_type: courses
                  spa_url: catalog.acme-corp.com
                  prompt_text: Focus on technical skills and certifications...
                  active: true
                summary: Create course prompt
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
      security:
        - PlatformApiKeyAuthentication: []
        - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPromptResponse'
              examples:
                CreateCoursePrompt:
                  value:
                    platform_key: acme-corp
                    recommendation_type: courses
                    spa_url: catalog.acme-corp.com
                    prompt_text: Focus on technical skills and certifications...
                    active: true
                  summary: Create course prompt
          description: ''
        '400':
          description: Invalid data
        '401':
          description: Authentication required
        '403':
          description: Admin permissions required
        '409':
          description: Prompt already exists for this combination
    put:
      operationId: update_platform_prompt_2
      description: >-
        Update an existing prompt by ID. Must provide platform_key to verify
        ownership.
      summary: Update an existing recommendation prompt
      tags:
        - ai-search
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformPrompt'
      security:
        - PlatformApiKeyAuthentication: []
        - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPromptResponse'
          description: ''
        '400':
          description: Invalid data
        '401':
          description: Authentication required
        '403':
          description: Admin permissions required or platform mismatch
        '404':
          description: Prompt not found
    delete:
      operationId: delete_platform_prompt_2
      description: >-
        Delete a recommendation prompt by ID. Must provide platform_key to
        verify ownership. This permanently removes the prompt.
      summary: Delete a recommendation prompt
      tags:
        - ai-search
      security:
        - PlatformApiKeyAuthentication: []
        - {}
      responses:
        '204':
          description: Prompt deleted successfully
        '401':
          description: Authentication required
        '403':
          description: Admin permissions required or platform mismatch
        '404':
          description: Prompt not found
  /api/ai-search/recommendations/:
    get:
      operationId: v2_course_recommendations
      description: |2-

                Generate personalized course recommendations using AI that considers the user's
                learning history, organizational goals, and available courses.

                **Authentication Required:**
                - User must be authenticated
                - Platform key must be provided
                - User must have access to the specified platform

                **How It Works:**
                1. Fetches tenant's custom recommendation prompt (if configured)
                2. Analyzes user's course completion history and performance
                3. Reviews available course catalog
                4. Uses AI to match courses to user's needs and organizational goals
                5. Returns 3-5 courses with clear explanations

                **Tenant Prompts:**
                Each organization can configure custom prompts that guide recommendations.
                For example: "Prioritize leadership for sales roles" or "Focus on technical skills."

                **Use Cases:**
                - Manual recommendation requests by users
                - Post-assessment recommendations
                - Milestone-triggered suggestions
                - Learning path planning
                
      summary: Generate AI-driven course recommendations
      parameters:
        - in: query
          name: assessment_id
          schema:
            type: string
            minLength: 1
          description: Assessment ID if triggered by assessment completion
        - in: query
          name: context_type
          schema:
            type: string
            minLength: 1
          description: >-
            Context type for recommendation (e.g., 'assessment_completed',
            'milestone_reached')
        - in: query
          name: difficulty_levels
          schema:
            type: string
            minLength: 1
          description: Filter recommendations to specific difficulty levels (CSV)
        - in: query
          name: domains
          schema:
            type: string
            minLength: 1
          description: Filter recommendations to specific domains (CSV)
        - in: query
          name: include_main_catalog
          schema:
            type: boolean
            default: false
          description: >-
            Include items from 'main' tenant catalog IN ADDITION TO
            platform-specific catalog. By default, only platform-specific data
            is returned (tenant isolation). Set to True to also include shared
            'main' tenant resources.
        - in: query
          name: include_user_history
          schema:
            type: boolean
            default: false
          description: >-
            Include user's learning history (completed courses, topics) in the
            RAG search query. Helps find content that builds on their
            background.
        - in: query
          name: include_user_skills
          schema:
            type: boolean
            default: false
          description: >-
            Include user's skills and badges in the RAG search query. Helps
            personalize results based on what the user already knows.
        - in: query
          name: k
          schema:
            type: integer
            maximum: 100
            minimum: 5
            default: 20
          description: >-
            Number of similar items to retrieve via RAG per tenant (before
            filtering). Higher values give more options but may be slower.
        - in: query
          name: limit
          schema:
            type: integer
            maximum: 20
            minimum: 1
            default: 5
          description: Number of course recommendations to return (max 20)
        - in: query
          name: page
          schema:
            type: integer
            minimum: 1
            default: 1
          description: Page number for pagination (starts at 1)
        - in: query
          name: page_size
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 10
          description: Number of recommendations per page (max 100)
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key for tenant-scoped recommendations
        - in: query
          name: platform_org
          schema:
            type: string
            nullable: true
            minLength: 1
          description: >-
            Platform org identifier (optional - avoids database lookup if
            provided)
        - in: query
          name: ranking_prompt
          schema:
            type: string
          description: >-
            Custom prompt for LLM ranking (only if ranking_strategy='custom').
            Define how the LLM should evaluate and order the recommendations.
        - in: query
          name: ranking_strategy
          schema:
            enum:
              - relevance
              - difficulty
              - personalized
              - custom
            type: string
            minLength: 1
          description: |-
            Strategy for LLM ranking. Only used if use_llm_ranking=True.

            * `relevance` - Rank by relevance and value (default)
            * `difficulty` - Rank by difficulty progression
            * `personalized` - Personalize to user context and goals
            * `custom` - Use custom ranking prompt
        - in: query
          name: recommendation_type
          schema:
            enum:
              - mentors
              - courses
              - programs
              - resources
              - pathways
            type: string
            default: courses
            minLength: 1
          description: >-
            Type of resource to recommend. Catalog types
            (courses/programs/resources/pathways) will use the platform's
            'catalog' prompt category if configured.


            * `mentors` - Mentor Recommendations

            * `courses` - Course Recommendations

            * `programs` - Program Recommendations

            * `resources` - Resource Recommendations

            * `pathways` - Pathway Recommendations
        - in: query
          name: search_terms
          schema:
            type: string
          description: >-
            Search terms to find similar content (e.g., 'leadership', 'data
            science'). Used to build the RAG query.
        - in: query
          name: spa_url
          schema:
            type: string
            minLength: 1
          description: >-
            Frontend/SPA identifier (e.g., 'catalog.example.com',
            'mentor-ai.ibl.com'). Used to retrieve the correct prompt for that
            specific frontend. Auto-detected from HTTP_REFERER if not provided.
        - in: query
          name: trigger_source
          schema:
            type: string
            default: manual
            minLength: 1
          description: What triggered this recommendation request
        - in: query
          name: use_llm_ranking
          schema:
            type: boolean
            default: false
          description: >-
            Use LLM to rank and personalize RAG results. Adds AI-generated
            reasoning but increases cost and latency. Only applies if
            use_rag_search=True.
        - in: query
          name: use_rag_search
          schema:
            type: boolean
            default: true
          description: >-
            Use RAG similarity search instead of full LLM catalog review. Faster
            and more cost-effective. Set to False for legacy LLM-only behavior.
      tags:
        - ai-search
      security:
        - PlatformApiKeyAuthentication: []
        - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2RecommendationResponse'
              examples:
                BasicRecommendationRequest:
                  value:
                    platform_key: sba-university
                    limit: 5
                  summary: Basic recommendation request
                  description: Request 5 course recommendations for authenticated user
                Post-assessmentRecommendation:
                  value:
                    platform_key: acme-corp
                    context_type: assessment_completed
                    assessment_id: lead-assessment-2024
                    trigger_source: assessment_completed
                    domains:
                      - Leadership
                      - Communication
                    limit: 3
                  summary: Post-assessment recommendation
                  description: Request recommendations after completing an assessment
          description: ''
        '400':
          description: Bad request - invalid parameters or missing required fields
        '401':
          description: Unauthorized - authentication required
        '500':
          description: Internal server error
  /api/analytics/content/:
    get:
      operationId: get_content_analytics
      description: |2-

                Retrieve aggregated analytics for catalog content (courses, programs, pathways, skills).
                
                Returns both summary statistics and paginated list of content items with individual analytics.
                When a platform_key is provided, results are filtered to show only content consumed by 
                learners associated with that platform.
                
                **Metrics supported:**
                - `course` or `courses`: Course analytics with time spent
                - `program` or `programs`: Program analytics  
                - `pathway` or `pathways`: Pathway analytics
                - `skill` or `skills`: Skill analytics
                
                **Platform Filtering:**
                - Without platform_key: Shows global analytics across all platforms
                - With platform_key: Shows analytics filtered by platform learners only
                
                **Time Spent Analytics:**
                - Platform-level: Total time spent across all content and average per learner
                - Course-level: Total time spent per course and average per enrolled learner
                - Time values are provided in seconds for precision
                - Overtime: Time series data showing platform time spent over last 7 days (courses only, and include_overtime=true)
                
                **External Content:**
                - Content not owned by the requesting platform but used by its learners is marked as "external"
                - External content has limited metadata exposure for privacy
                
      summary: Get Content Analytics
      parameters:
        - in: query
          name: date_filter
          schema:
            enum:
              - today
              - 7d
              - 30d
              - 90d
              - all_time
              - custom
            type: string
            default: today
            minLength: 1
          description: |-
            * `today` - Today only
            * `7d` - Last 7 days
            * `30d` - Last 30 days
            * `90d` - Last 90 days
            * `all_time` - All time
            * `custom` - Custom date range
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: granularity
          schema:
            enum:
              - day
              - hour
              - week
              - month
            type: string
            default: hour
            minLength: 1
          description: |-
            * `day` - day
            * `hour` - hour
            * `week` - week
            * `month` - month
        - in: query
          name: include_overtime
          schema:
            type: boolean
            default: false
          description: Include time spent over time data
        - in: query
          name: limit
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
          description: Number of items per page (max 100)
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: metric
          schema:
            enum:
              - course
              - courses
              - program
              - programs
              - pathway
              - pathways
              - skill
              - skills
            type: string
            minLength: 1
          description: |-
            The type of content to retrieve (course, program, pathway, skill)

            * `course` - course
            * `courses` - courses
            * `program` - program
            * `programs` - programs
            * `pathway` - pathway
            * `pathways` - pathways
            * `skill` - skill
            * `skills` - skills
          required: true
        - in: query
          name: page
          schema:
            type: integer
            minimum: 1
            default: 1
          description: Page number for pagination
        - in: query
          name: platform_key
          schema:
            type: string
            nullable: true
          description: Optional platform key to filter results by platform
        - in: query
          name: start_date
          schema:
            type: string
            format: date
      tags:
        - ai-analytics
        - analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                description: Invalid metric or parameters
          description: ''
        '404':
          content:
            application/json:
              schema:
                description: Page out of range
          description: ''
        '500':
          content:
            application/json:
              schema:
                description: Internal server error
          description: ''
  /api/analytics/content/details/{content_id}/:
    get:
      operationId: get_content_details
      description: >-
        Retrieve detailed analytics for a specific content item including
        summary statistics, learner-level data, and optional time series
        information.
      summary: Get Content Details
      parameters:
        - in: path
          name: content_id
          schema:
            type: string
          required: true
        - in: query
          name: date_filter
          schema:
            enum:
              - today
              - 7d
              - 30d
              - 90d
              - all_time
              - custom
            type: string
            default: today
            minLength: 1
          description: |-
            * `today` - Today only
            * `7d` - Last 7 days
            * `30d` - Last 30 days
            * `90d` - Last 90 days
            * `all_time` - All time
            * `custom` - Custom date range
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: limit
          schema:
            type: integer
            maximum: 30
            minimum: 1
            default: 10
          description: Number of learner records per page
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: metric
          schema:
            enum:
              - course
              - courses
              - program
              - programs
              - pathway
              - pathways
              - skill
              - skills
            type: string
            minLength: 1
          description: |-
            Content type to fetch (course, program, pathway, skill)

            * `course` - course
            * `courses` - courses
            * `program` - program
            * `programs` - programs
            * `pathway` - pathway
            * `pathways` - pathways
            * `skill` - skill
            * `skills` - skills
          required: true
        - in: query
          name: page
          schema:
            type: integer
            minimum: 1
            default: 1
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
        - in: query
          name: search
          schema:
            type: string
        - in: query
          name: start_date
          schema:
            type: string
            format: date
        - in: query
          name: time_metric
          schema:
            type: string
            nullable: true
          description: >-
            Optional time series metric (enrollments, completions, ratings,
            time_spent)
      tags:
        - ai-analytics
        - analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentDetailsResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                description: Invalid request parameters
          description: ''
        '404':
          content:
            application/json:
              schema:
                description: Content not found or page out of range
          description: ''
        '500':
          content:
            application/json:
              schema:
                description: Internal server error
          description: ''
  /api/analytics/conversations/:
    get:
      operationId: analytics_conversations_retrieve
      parameters:
        - in: query
          name: date_filter
          schema:
            enum:
              - today
              - 7d
              - 30d
              - 90d
              - all_time
              - custom
            type: string
            default: today
            minLength: 1
          description: |-
            * `today` - Today only
            * `7d` - Last 7 days
            * `30d` - Last 30 days
            * `90d` - Last 90 days
            * `all_time` - All time
            * `custom` - Custom date range
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: granularity
          schema:
            enum:
              - day
              - hour
              - week
              - month
            type: string
            default: hour
            minLength: 1
          description: |-
            * `day` - day
            * `hour` - hour
            * `week` - week
            * `month` - month
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: metric
          schema:
            enum:
              - conversations
              - headline
            type: string
            default: conversations
            minLength: 1
          description: >-
            * `conversations` - Conversations over time

            * `headline` - Headline metrics for conversations (avg messages per
            conversation, avg rating)
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
        - in: query
          name: start_date
          schema:
            type: string
            format: date
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationsChart'
          description: ''
  /api/analytics/financial/:
    get:
      operationId: analytics_financial_retrieve
      description: >-
        Financial Analytics API - Get comprehensive cost metrics with comparison
        analysis.


        This endpoint provides period-based cost analysis (not cumulative) with
        support for:

        - Multiple time granularities and metrics

        - Cross-dimensional filtering

        - Percentage change vs comparison periods

        - Forward-filled time series


        **Examples:**


        **Basic Weekly Costs:**

        ```

        GET /api/analytics/financial/?metric=weekly_costs&comparison_days=10

        ```


        **Platform & Mentor Filtered:**

        ```

        # Get total costs for a specific platform and mentor

        GET
        /api/analytics/financial/?metric=total_costs&platform_key=web-app&mentor_unique_id=mentor-123&comparison_days=14

        ```


        **Monthly Costs by Provider:**

        ```

        GET
        /api/analytics/financial/?metric=monthly_costs&provider=openai&granularity=month&comparison_days=30

        ```


        **Daily Costs for Specific User:**

        ```

        GET
        /api/analytics/financial/?metric=total_costs&username=user-456&granularity=day&start_date=2025-01-15&end_date=2025-01-21&comparison_days=7

        ```



        **Response Structure:**

        ```json

        {
            "metric": "weekly_costs",
            "value": 12.47,
            "percentage_change": 8.5,
            "overtime": [
                {"date": "2025-01-06", "value": 2.89},
                {"date": "2025-01-13", "value": 3.12}
            ],
            "period_info": {
                "start_date": "2025-01-01",
                "end_date": "2025-01-31",
                "period_days": 31
            },
            "comparison_info": {
                "previous_period_value": 11.50,
                ...
            }
        }

        ```
      parameters:
        - in: query
          name: comparison_days
          schema:
            type: integer
            minimum: 1
          description: >-
            Number of days for comparison period to calculate percentage change
            (e.g., 10 for 10-day comparison)
        - in: query
          name: date_filter
          schema:
            enum:
              - today
              - 7d
              - 30d
              - 90d
              - all_time
              - custom
            type: string
            default: today
            minLength: 1
          description: |-
            * `today` - Today only
            * `7d` - Last 7 days
            * `30d` - Last 30 days
            * `90d` - Last 90 days
            * `all_time` - All time
            * `custom` - Custom date range
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: fill_method
          schema:
            enum:
              - zero
              - previous
            type: string
            default: zero
            minLength: 1
          description: |-
            Method for filling missing time periods in overtime data

            * `zero` - Fill missing periods with zero
            * `previous` - Fill missing periods with previous value
        - in: query
          name: granularity
          schema:
            enum:
              - day
              - week
              - month
            type: string
            default: day
            minLength: 1
          description: |-
            Time granularity for overtime series data

            * `day` - Daily data points
            * `week` - Weekly data points
            * `month` - Monthly data points
        - in: query
          name: llm_model
          schema:
            type: string
            minLength: 1
          description: Filter by specific LLM model (e.g., gpt-4o, claude-3-5-sonnet)
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: metric
          schema:
            enum:
              - total_costs
              - weekly_costs
              - monthly_costs
            type: string
            minLength: 1
          description: |-
            Type of financial metric to retrieve

            * `total_costs` - Total costs for selected timeframe
            * `weekly_costs` - Costs for current/selected week
            * `monthly_costs` - Costs for current/selected month
          required: true
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
        - in: query
          name: provider
          schema:
            enum:
              - openai
              - anthropic
              - azure
              - google
              - meta
              - other
            type: string
            minLength: 1
          description: |-
            Filter by AI provider

            * `openai` - OpenAI
            * `anthropic` - Anthropic
            * `azure` - Azure
            * `google` - Google
            * `meta` - Meta
            * `other` - Other
        - in: query
          name: show_overtime
          schema:
            type: boolean
            default: true
          description: Whether to include overtime series data in response
        - in: query
          name: start_date
          schema:
            type: string
            format: date
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Filter by specific username - returns costs for this user only
      tags:
        - ai-analytics
        - analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseFinanceResponse'
              examples:
                TotalCostsResponse:
                  value:
                    metric: total_costs
                    filters:
                      start_date: '2025-01-01'
                      end_date: '2025-01-31'
                      granularity: day
                      comparison_days: 10
                    value: 45.789
                    percentage_change: 15.2
                    overtime:
                      - date: '2025-01-01'
                        value: 1.23
                      - date: '2025-01-02'
                        value: 1.45
                      - date: '2025-01-03'
                        value: 1.67
                      - date: '2025-01-04'
                        value: 1.34
                      - date: '2025-01-05'
                        value: 1.89
                    period_info:
                      start_date: '2025-01-01'
                      end_date: '2025-01-31'
                      period_days: 31
                      range_type: custom
                    comparison_info:
                      previous_period_count: 10
                      previous_period_value: 39.654
                      comparison_start: '2024-12-22'
                      comparison_end: '2024-12-31'
                      comparison_days: 10
                      recent_period_value: 45.789
                  summary: Total Costs Response
                  description: Response for total_costs metric.
                WeeklyCostsResponse:
                  value:
                    metric: weekly_costs
                    filters:
                      granularity: week
                      comparison_days: 10
                    value: 12.47
                    percentage_change: 8.5
                    overtime:
                      - date: '2025-01-06'
                        value: 2.89
                      - date: '2025-01-13'
                        value: 3.12
                      - date: '2025-01-20'
                        value: 3.46
                      - date: '2025-01-27'
                        value: 3
                    period_info:
                      start_date: '2025-01-01'
                      end_date: '2025-01-31'
                      period_days: 31
                      range_type: default
                    comparison_info:
                      previous_period_count: 10
                      previous_period_value: 11.5
                      comparison_start: '2024-12-22'
                      comparison_end: '2024-12-31'
                      comparison_days: 10
                      recent_period_value: 12.47
                  summary: Weekly Costs Response
                  description: Response for weekly_costs metric.
                MonthlyCostsResponse:
                  value:
                    metric: monthly_costs
                    filters:
                      granularity: month
                      comparison_days: 30
                      provider: openai
                    value: 156.23
                    percentage_change: -5.2
                    overtime:
                      - date: '2025-01-01'
                        value: 45.67
                      - date: '2025-02-01'
                        value: 52.34
                      - date: '2025-03-01'
                        value: 58.22
                    period_info:
                      start_date: '2025-01-01'
                      end_date: '2025-03-31'
                      period_days: 90
                      range_type: custom
                    comparison_info:
                      previous_period_count: 30
                      previous_period_value: 164.78
                      comparison_start: '2024-12-01'
                      comparison_end: '2024-12-31'
                      comparison_days: 30
                      recent_period_value: 156.23
                  summary: Monthly Costs Response
                  description: Response for monthly_costs metric.
          description: Successful financial metrics response with period-based cost data
        '400':
          description: Bad Request - Invalid query parameters
        '403':
          description: Forbidden - Insufficient permissions
        '500':
          description: Internal Server Error
  /api/analytics/financial/details/:
    get:
      operationId: analytics_financial_details_retrieve
      description: >-
        Financial Details Analytics API – paginated cost tables with flexible
        grouping.


        This endpoint returns tabular cost metrics aggregated by the dimension

        specified via the `group_by` query parameter.  One or more KPI columns

        can be requested through the comma-separated `metrics` list while

        typical filters (date range, provider, platform_key, user, etc.) narrow
        the

        dataset.  Results are paginated with `page` / `limit`.


        **Required query parameters**

        - group_by – provider | llm_model | username | mentor | platform

        - metrics – csv list of KPI names, e.g. total_cost, sessions


        **Shared optional filters**

        - start_date, end_date   – ISO yyyy-mm-dd (ignored when all_time=true)

        - platform_key           – tenant isolation

        - mentor_unique_id       – filter to one mentor

        - username               – filter to a learner

        - provider / llm_model   – filter to LLM provider / model

        - all_time               – true → lifetime totals

        - page (default 1), limit (default 50)


        **Examples**

        --------

        1. Cost by provider for the last week

        ```
           GET /api/v2/analytics/financial/details?
               group_by=provider&
               metrics=total_cost&
               start_date=2025-01-01&
               end_date=2025-01-07&
               page=1&limit=10
        ```


        2. Lifetime cost per user with extra KPIs
           ```
           GET /api/v2/analytics/financial/details?
               group_by=username&
               metrics=total_cost,sessions&
               all_time=true&page=1&limit=50
           ```
        3. Cost by LLM model with tenant filter

        ```
           GET /api/v2/analytics/financial/details?
               group_by=llm_model&
               metrics=total_cost&
               platform_key=web-app&
               start_date=2025-01-01&end_date=2025-01-31
        ```

        Response structure

        -------------------

        ```

        {
          "page": 1,
          "limit": 10,
          "total_pages": 1,
          "total_records": 3,
          "rows": [
            {"provider": "openai", "total_cost": "2.50000"},
            {"provider": "anthropic", "total_cost": "1.00000"},
            {"provider": "azure",    "total_cost": "0.50000"}
          ],
          "metrics": [
            {
              "name": "total_cost",
              "unit": "$",
              "description": "Cost for this entity in period"
            }
          ],
          "total_cost": "4.00000"   // optional grand-total when available
        }

        ``
      parameters:
        - in: query
          name: date_filter
          schema:
            enum:
              - today
              - 7d
              - 30d
              - 90d
              - all_time
              - custom
            type: string
            default: today
            minLength: 1
          description: |-
            * `today` - Today only
            * `7d` - Last 7 days
            * `30d` - Last 30 days
            * `90d` - Last 90 days
            * `all_time` - All time
            * `custom` - Custom date range
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: group_by
          schema:
            enum:
              - provider
              - llm_model
              - username
              - mentor
              - platform
              - action
            type: string
            minLength: 1
          description: |-
            Dimension to group by

            * `provider` - Group by provider
            * `llm_model` - Group by LLM model
            * `username` - Group by username
            * `mentor` - Group by mentor
            * `platform` - Group by platform
            * `action` - Group by actions
          required: true
        - in: query
          name: limit
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
        - in: query
          name: llm_model
          schema:
            type: string
            minLength: 1
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: metrics
          schema:
            type: string
            default: total_cost
            minLength: 1
          description: >-
            Comma-separated list of metrics (e.g. total_cost,sessions,
            last_active)
        - in: query
          name: page
          schema:
            type: integer
            minimum: 1
            default: 1
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
        - in: query
          name: provider
          schema:
            type: string
            minLength: 1
        - in: query
          name: search
          schema:
            type: string
        - in: query
          name: start_date
          schema:
            type: string
            format: date
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
      tags:
        - ai-analytics
        - analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FinanceDetailsResponse'
          description: ''
        '400':
          description: Bad Request – invalid query params
        '500':
          description: Internal Server Error
  /api/analytics/financial/invoice/:
    get:
      operationId: analytics_financial_invoice_retrieve
      description: >-
        Flexible Invoice Report API – Billing summary with username and platform
        filtering.


        This endpoint generates invoice reports with flexible filtering options:

        - Platform admins can view their platform's data and filter by username
        within their platform

        - Super admins can view any combination of username/platform or global
        summaries


        **Key Features:**

        - Flexible filtering by username and/or platform_key

        - Essential metrics: total cost, sessions, usage period

        - Provider breakdown (OpenAI, Anthropic, etc.)

        - Top mentors/actions by cost

        - Clean, invoice-ready format


        **Query Parameters:**

        - username: Filter by specific username (optional)

        - platform_key: Filter by platform (optional, but required for platform
        admins)

        - start_date, end_date: billing period (defaults to last 30 days)

        - include_breakdown: show provider/mentor details (default: true)


        **Permission Logic:**

        - Platform admins: Must include platform_key matching their permission
        scope

        - Super admins: Can use any combination of filters or none (global
        summary)


        **Examples:**

        ```

        # Platform admin viewing their platform

        GET /api/analytics/financial/invoice?platform_key=web-app


        # Platform admin viewing specific user in their platform

        GET
        /api/analytics/financial/invoice?platform_key=web-app&username=john.doe


        # Super admin viewing specific user across all platforms

        GET /api/analytics/financial/invoice?username=john.doe


        # Super admin viewing global summary

        GET /api/analytics/financial/invoice

        ```


        **Response Structure:**

        ```json

        {
          "entity": {
            "type": "user|platform|global",
            "username": "john.doe",
            "platform_key": "web-app",
            "platform_name": "Web Application",
            "display_name": "John Doe on Web Application"
          },
          "billing_period": {
            "start_date": "2025-01-01",
            "end_date": "2025-01-31",
            "days": 31
          },
          "summary": {
            "total_cost": 245.750,
            "total_sessions": 1250,
            "active_users": 85,
            "cost_per_session": 0.196
          },
          "breakdown": {
            "by_provider": [...],
            "by_mentor": [...],
            "by_action": [...]
          }
        }

        ```
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date
          description: End date for billing period (defaults to today)
        - in: query
          name: include_breakdown
          schema:
            type: boolean
            default: true
          description: Whether to include provider and mentor breakdown
        - in: query
          name: platform_key
          schema:
            type: string
            maxLength: 255
            minLength: 1
          description: Platform key to filter by (optional, required for platform admins)
        - in: query
          name: start_date
          schema:
            type: string
            format: date
          description: Start date for billing period (defaults to 30 days ago)
        - in: query
          name: username
          schema:
            type: string
            maxLength: 255
            minLength: 1
          description: Username to generate invoice for (optional)
      tags:
        - ai-analytics
        - analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceReportResponse'
              examples:
                PlatformInvoiceReport:
                  value:
                    entity:
                      type: platform
                      platform_key: web-app
                      platform_name: Web Application
                      display_name: Web Application
                    billing_period:
                      start_date: '2025-01-01'
                      end_date: '2025-01-31'
                      days: 31
                    summary:
                      total_cost: '245.750'
                      total_sessions: 1250
                      active_users: 85
                      cost_per_session: '0.196'
                    breakdown:
                      by_provider:
                        - provider: openai
                          cost: '180.250'
                          percentage: '73.3'
                        - provider: anthropic
                          cost: '65.500'
                          percentage: '26.7'
                      by_mentor:
                        - mentor: AI Tutor
                          cost: '120.500'
                          sessions: 650
                        - mentor: Code Helper
                          cost: '85.250'
                          sessions: 420
                  summary: Platform Invoice Report
          description: ''
        '400':
          description: Bad Request – invalid parameters
        '403':
          description: Forbidden – insufficient permissions
        '404':
          description: No data found
        '500':
          description: Internal Server Error
  /api/analytics/learner/details:
    get:
      operationId: analytics_learner_details_retrieve
      description: |2-

                Retrieve a holistic snapshot of a learner across catalog enrollments, mentor
                engagement, skills, credentials, and time spent data. The `metrics` query parameter controls
                which sections are returned and defaults to `courses` when omitted.
                
      parameters:
        - in: query
          name: date_filter
          schema:
            enum:
              - today
              - 7d
              - 30d
              - 90d
              - all_time
              - custom
            type: string
            default: today
            minLength: 1
          description: |-
            * `today` - Today only
            * `7d` - Last 7 days
            * `30d` - Last 30 days
            * `90d` - Last 90 days
            * `all_time` - All time
            * `custom` - Custom date range
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: granularity
          schema:
            enum:
              - day
              - hour
              - week
              - month
            type: string
            default: hour
            minLength: 1
          description: |-
            * `day` - day
            * `hour` - hour
            * `week` - week
            * `month` - month
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: metrics
          schema:
            type: string
        - in: query
          name: overtime
          schema:
            type: boolean
            default: false
          description: 'Include overtime metrics for time_spent data (default: false)'
        - in: query
          name: platform_key
          schema:
            type: string
        - in: query
          name: start_date
          schema:
            type: string
            format: date
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LearnerDetailsResponse'
              examples:
                LearnerDetails:
                  value:
                    user:
                      user_id: 42
                      username: learner123
                      email: learner@example.com
                      name: Learner Example
                      date_joined: '2024-01-01T00:00:00Z'
                      last_active: '2024-02-01T12:30:00Z'
                    data:
                      courses:
                        - course_id: course-v1:edX+Demo+2024
                          name: Demo Course
                          platform: key_org1
                          enrollment:
                            created: '2024-01-05T00:00:00Z'
                            started: '2024-01-06T00:00:00Z'
                            ended: null
                            active: true
                          completion:
                            completed: true
                            completion_percentage: 92.5
                            passed: true
                            passed_date: '2024-01-18T00:00:00Z'
                      mentors:
                        - mentor_id: b451624c-ef13-4f9f-8cc6-2a0e8c781f12
                          name: AI Math Tutor
                          slug: ai-math-tutor
                          platform_key: key_org1
                          categories:
                            - Mathematics
                          subjects:
                            - Algebra
                          interactions:
                            total_messages: 12
                            latest_interaction: '2024-02-01T12:30:00Z'
                            rating: 4.5
                      time_spent:
                        courses:
                          - course_id: course-v1:edX+Demo+2024
                            course_name: Demo Course
                            platform: key_org1
                            time_spent: 2h 30m
                            time_spent_secs: 9000
                        total_time_spent: 2h 30m
                        total_time_spent_secs: 9000
                  summary: Learner details
                  description: Example learner detail payload
          description: Learner profile with requested analytics data
        '400':
          description: Bad Request - Invalid parameters supplied
        '404':
          description: Learner not found
        '500':
          description: Unexpected error
  /api/analytics/learners/:
    get:
      operationId: analytics_learners_retrieve
      description: >-
        Unified API endpoint for learner analytics.


        This endpoint provides either:

        1. Cross-platform summary (when only username is provided)

        2. Platform-specific detailed data (when username + platform_key are
        provided)


        Query params:

        - username (required): Username of the learner

        - platform_key (optional): Platform key for platform-specific data

        - page (optional): Page number (default: 1)

        - limit (optional): Records per page (default: 20, max: 100)


        Returns:

        - If platform_key provided: Detailed platform metrics

        - If no platform_key: Cross-platform summary with pagination
      parameters:
        - in: query
          name: date_filter
          schema:
            enum:
              - today
              - 7d
              - 30d
              - 90d
              - all_time
              - custom
            type: string
            default: today
            minLength: 1
          description: |-
            * `today` - Today only
            * `7d` - Last 7 days
            * `30d` - Last 30 days
            * `90d` - Last 90 days
            * `all_time` - All time
            * `custom` - Custom date range
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: granularity
          schema:
            enum:
              - day
              - hour
              - week
              - month
            type: string
            default: hour
            minLength: 1
          description: |-
            * `day` - day
            * `hour` - hour
            * `week` - week
            * `month` - month
        - in: query
          name: limit
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
          description: 'Number of records per page (default: 20, max: 100)'
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: overtime
          schema:
            type: boolean
            default: false
          description: >-
            Include overtime metrics for the user in the platform (default:
            false)
        - in: query
          name: page
          schema:
            type: integer
            minimum: 1
            default: 1
          description: 'Page number (default: 1)'
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: >-
            Optional platform key - if provided, returns platform-specific
            detailed data
        - in: query
          name: start_date
          schema:
            type: string
            format: date
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: >-
            Username of the learner to get analytics for. Defaults to self if
            not provided.
      tags:
        - ai-analytics
        - analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LearnerAnalyticsResponse'
          description: ''
  /api/analytics/learners/list/:
    get:
      operationId: analytics_learners_list_retrieve
      description: |2-

                Retrieve a paginated list of learners for a specific platform with their comprehensive
                metrics from the UserPlatformSummary materialized view. This endpoint is accessible only
                to platform administrators and supports search, sorting, and pagination.
                
      parameters:
        - in: query
          name: date_filter
          schema:
            enum:
              - today
              - 7d
              - 30d
              - 90d
              - all_time
              - custom
            type: string
            default: today
            minLength: 1
          description: |-
            * `today` - Today only
            * `7d` - Last 7 days
            * `30d` - Last 30 days
            * `90d` - Last 90 days
            * `all_time` - All time
            * `custom` - Custom date range
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: granularity
          schema:
            enum:
              - day
              - hour
              - week
              - month
            type: string
            default: hour
            minLength: 1
          description: |-
            * `day` - day
            * `hour` - hour
            * `week` - week
            * `month` - month
        - in: query
          name: limit
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
          description: 'Number of learners per page (default: 20, max: 100)'
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: page
          schema:
            type: integer
            minimum: 1
            default: 1
          description: 'Page number for pagination (default: 1)'
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key to filter learners by platform
          required: true
        - in: query
          name: search
          schema:
            type: string
          description: Search term to filter learners by username, email, or name
        - in: query
          name: sort_by
          schema:
            enum:
              - username
              - name
              - last_activity
              - total_points
              - total_time_spent_seconds
              - total_enrollments
              - total_skills_count
            type: string
            default: last_activity
            minLength: 1
          description: |-
            Field to sort learners by (default: last_activity)

            * `username` - Username
            * `name` - Name
            * `last_activity` - Last Activity
            * `total_points` - Total Points
            * `total_time_spent_seconds` - Time Spent
            * `total_enrollments` - Enrollments
            * `total_skills_count` - Skills Count
        - in: query
          name: sort_order
          schema:
            enum:
              - asc
              - desc
            type: string
            default: desc
            minLength: 1
          description: |-
            Sort order (default: desc)

            * `asc` - Ascending
            * `desc` - Descending
        - in: query
          name: start_date
          schema:
            type: string
            format: date
      tags:
        - ai-analytics
        - analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LearnerListResponse'
              examples:
                LearnerList:
                  value:
                    platform:
                      platform_id: 1
                      platform_name: Test Platform
                      platform_key: test-platform
                    learners:
                      - user_id: 42
                        username: learner123
                        email: learner@example.com
                        name: Learner Example
                        is_active: true
                        platform_id: 1
                        platform_name: Test Platform
                        platform_key: test-platform
                        metrics:
                          enrollments: 5
                          programs: 2
                          pathways: 1
                          resources: 10
                          reported_skills: 3
                          desired_skills: 2
                          assigned_skills: 4
                          total_skills: 9
                          credentials: 2
                          points: 150.5
                          total_time_spent_seconds: 7200
                          top_content:
                            course_id: 1
                            course_identifier: course-v1:edX+Demo+2024
                            course_name: Demo Course
                            time_spent_seconds: 3600
                        first_activity: '2024-01-01T00:00:00Z'
                        last_activity: '2024-02-01T12:30:00Z'
                    pagination:
                      page: 1
                      limit: 20
                      total_pages: 1
                      total_records: 1
                      has_next: false
                      has_previous: false
                      next_page: null
                      previous_page: null
                    generated_at: '2024-02-01T12:30:00Z'
                  summary: Learner list
                  description: Example learner list payload
          description: Paginated list of learners with their metrics
        '400':
          description: Bad Request - Invalid parameters supplied
        '403':
          description: Forbidden - Platform admin access required
        '500':
          description: Unexpected error
  /api/analytics/messages/:
    get:
      operationId: analytics_messages_retrieve
      description: >-
        Conversation list endpoint for analytics.


        Query params (all optional unless specified by permissions):

        - platform_key: filter by platform

        - mentor_unique_id: filter by mentor

        - page: page number (default 1)

        - limit: page size (default 20, max 100)

        - search: search in user name and first user message

        - min_messages, max_messages: message_count range

        - sentiment: positive|negative|neutral

        - topic: topic name contains

        - start_date, end_date: date filter on conversation date


        Returns: summary totals, results list (paginated), and pagination
        metadata.
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: limit
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
        - in: query
          name: max_messages
          schema:
            type: integer
            minimum: 0
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: min_messages
          schema:
            type: integer
            minimum: 0
        - in: query
          name: page
          schema:
            type: integer
            minimum: 1
            default: 1
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
        - in: query
          name: search
          schema:
            type: string
        - in: query
          name: sentiment
          schema:
            enum:
              - positive
              - negative
              - neutral
            type: string
            minLength: 1
          description: |-
            * `positive` - positive
            * `negative` - negative
            * `neutral` - neutral
        - in: query
          name: start_date
          schema:
            type: string
            format: date
        - in: query
          name: topic
          schema:
            type: string
            minLength: 1
      tags:
        - ai-analytics
        - analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationListResponse'
          description: ''
  /api/analytics/messages/details/:
    get:
      operationId: analytics_messages_details_retrieve
      description: |-
        Conversation detail endpoint for analytics.

        Query params:
        - session_id (required): UUID of the session to fetch
        - platform_key, mentor_unique_id (optional): further scope
        - start_date, end_date (optional): date filter on message timestamps

        Returns: summary metadata from conversation_list MV, and a list of
        human/ai message pairs in chronological order.
      parameters:
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
        - in: query
          name: session_id
          schema:
            type: string
            minLength: 1
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            format: date
      tags:
        - ai-analytics
        - analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationDetailResponse'
          description: ''
  /api/analytics/orgs/{org}/time/update/:
    post:
      operationId: analytics_orgs_time_update_create
      description: >-
        Update time spent tracking data from client-side events.


        This endpoint receives time spent data collected on the client side and

        stores it in the analytics database. It requires a valid authentication
        token.


        Methods:
            POST: Submit time spent tracking data



        Returns:
            A response indicating success or failure:
            {
                "success": true|false,
                "message": "Error message if failed" (optional)
            }

        Error Responses:
            400 Bad Request: If the request data is invalid or the API is disabled

        Notes:
            This API must be enabled via the ENABLE_TIME_SPENT_UPDATE_API setting.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TimeSpentUpdateRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TimeSpentUpdateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TimeSpentUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TimeSpentUpdateRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/TimeSpentUpdateRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimeSpentUpdateResponse'
          description: ''
  /api/analytics/ratings/:
    get:
      operationId: analytics_ratings_retrieve
      description: >-
        Ratings overtime endpoint.


        Query params:

        - metric: only 'ratings' is supported (default)

        - platform_key, mentor_unique_id: optional filters

        - granularity: 'day' (default) or 'hour' (hour only for today)

        - start_date, end_date: optional date range; defaults applied if not
        provided


        Returns: { metric: 'ratings', points: [{date, value}, ...] }
      parameters:
        - in: query
          name: date_filter
          schema:
            enum:
              - today
              - 7d
              - 30d
              - 90d
              - all_time
              - custom
            type: string
            default: today
            minLength: 1
          description: |-
            * `today` - Today only
            * `7d` - Last 7 days
            * `30d` - Last 30 days
            * `90d` - Last 90 days
            * `all_time` - All time
            * `custom` - Custom date range
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: granularity
          schema:
            enum:
              - day
              - hour
              - week
              - month
            type: string
            default: hour
            minLength: 1
          description: |-
            * `day` - day
            * `hour` - hour
            * `week` - week
            * `month` - month
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: metric
          schema:
            enum:
              - ratings
            type: string
            default: ratings
            minLength: 1
          description: '* `ratings` - Ratings over time'
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
        - in: query
          name: start_date
          schema:
            type: string
            format: date
      tags:
        - ai-analytics
        - analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RatingsOvertime'
          description: ''
  /api/analytics/sessions/:
    get:
      operationId: analytics_sessions_retrieve
      parameters:
        - in: query
          name: date_filter
          schema:
            enum:
              - today
              - 7d
              - 30d
              - 90d
              - all_time
              - custom
            type: string
            default: today
            minLength: 1
          description: |-
            * `today` - Today only
            * `7d` - Last 7 days
            * `30d` - Last 30 days
            * `90d` - Last 90 days
            * `all_time` - All time
            * `custom` - Custom date range
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: granularity
          schema:
            enum:
              - day
              - hour
              - week
              - month
            type: string
            default: hour
            minLength: 1
          description: |-
            * `day` - day
            * `hour` - hour
            * `week` - week
            * `month` - month
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: metric
          schema:
            enum:
              - sessions
              - headline
            type: string
            default: sessions
            minLength: 1
          description: >-
            * `sessions` - Sessions over time

            * `headline` - Headline metrics for sessions (avg messages per
            session, avg rating)
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
        - in: query
          name: start_date
          schema:
            type: string
            format: date
      tags:
        - ai-analytics
        - analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionsChart'
          description: ''
  /api/analytics/sessions/details/:
    get:
      operationId: analytics_sessions_details_retrieve
      parameters:
        - in: query
          name: date_filter
          schema:
            enum:
              - today
              - 7d
              - 30d
              - 90d
              - all_time
              - custom
            type: string
            default: today
            minLength: 1
          description: |-
            * `today` - Today only
            * `7d` - Last 7 days
            * `30d` - Last 30 days
            * `90d` - Last 90 days
            * `all_time` - All time
            * `custom` - Custom date range
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: limit
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: page
          schema:
            type: integer
            minimum: 1
            default: 1
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
        - in: query
          name: search
          schema:
            type: string
          description: Search by topic name
        - in: query
          name: start_date
          schema:
            type: string
            format: date
      tags:
        - ai-analytics
        - analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopicDetails'
          description: ''
  /api/analytics/time/:
    get:
      operationId: analytics_time_retrieve
      description: |2-

                Time Analytics API - User activity patterns by time of day and day of week.
                
                Provides heatmap data showing when users are most active, useful for:
                - Understanding peak usage times
                - Capacity planning and resource allocation
                - User behavior analysis
                - Support scheduling optimization
                
                **Key Features:**
                - Day of week patterns (0=Sunday through 6=Saturday)
                - Hour of day activity levels (0-23)
                - Flexible date range filtering
                - Platform and mentor-specific filtering
                - Message count aggregation
                
                **Data Structure:**
                - `day_of_week`: 0-6 (Sunday-Saturday)
                - `hour`: 0-23 (24-hour format)
                - `value`: Message count for that time slot
                
      parameters:
        - in: query
          name: date_filter
          schema:
            enum:
              - today
              - 7d
              - 30d
              - 90d
              - all_time
              - custom
            type: string
            default: today
            minLength: 1
          description: |-
            * `today` - Today only
            * `7d` - Last 7 days
            * `30d` - Last 30 days
            * `90d` - Last 90 days
            * `all_time` - All time
            * `custom` - Custom date range
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: granularity
          schema:
            enum:
              - day
              - hour
              - week
              - month
            type: string
            default: hour
            minLength: 1
          description: |-
            * `day` - day
            * `hour` - hour
            * `week` - week
            * `month` - month
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
        - in: query
          name: start_date
          schema:
            type: string
            format: date
      tags:
        - ai-analytics
        - analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessTimesHeatmap'
              examples:
                AccessTimesHeatmap:
                  value:
                    metric: access_times
                    data:
                      - day_of_week: 1
                        hour: 9
                        value: 45
                      - day_of_week: 1
                        hour: 10
                        value: 52
                      - day_of_week: 1
                        hour: 11
                        value: 48
                      - day_of_week: 2
                        hour: 9
                        value: 38
                      - day_of_week: 2
                        hour: 10
                        value: 44
                  summary: Access Times Heatmap
                  description: >-
                    Hourly activity patterns by day of week (0=Sunday, 1=Monday,
                    etc.)
          description: Access times heatmap data with day/hour patterns
        '400':
          description: Bad Request - Invalid parameters
        '403':
          description: Forbidden - Insufficient permissions
        '500':
          description: Internal Server Error
  /api/analytics/time-spent/user/:
    get:
      operationId: analytics_time_spent_user_retrieve
      description: |2-

                Returns the total time spent (in seconds) for the current authenticated user.
                Can be filtered by platform, date range, course ID, URL, mentor UUID, and session UUID.
                
      summary: Get total time spent for current user
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: Course ID to filter by (can be partial)
        - in: query
          name: end_date
          schema:
            type: string
            format: date
          description: End date for time range (YYYY-MM-DD)
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Whether to include main platform data
        - in: query
          name: learner_id
          schema:
            type: string
            minLength: 1
          description: Username to get data for (admin users only)
        - in: query
          name: mentor_uuid
          schema:
            type: string
            minLength: 1
          description: Mentor UUID to filter by
        - in: query
          name: platform
          schema:
            type: string
            nullable: true
            minLength: 1
          description: Platform name or key to filter by
        - in: query
          name: session_uuid
          schema:
            type: string
            minLength: 1
          description: Session UUID to filter by
        - in: query
          name: start_date
          schema:
            type: string
            format: date
          description: Start date for time range (YYYY-MM-DD)
        - in: query
          name: url
          schema:
            type: string
            minLength: 1
          description: URL to filter by (can be partial)
      tags:
        - ai-analytics
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimeSpentPerUserResponse'
          description: ''
        '400':
          description: Bad request
        '401':
          description: Unauthorized
  /api/analytics/topics/:
    get:
      operationId: analytics_topics_retrieve
      parameters:
        - in: query
          name: date_filter
          schema:
            enum:
              - today
              - 7d
              - 30d
              - 90d
              - all_time
              - custom
            type: string
            default: today
            minLength: 1
          description: |-
            * `today` - Today only
            * `7d` - Last 7 days
            * `30d` - Last 30 days
            * `90d` - Last 90 days
            * `all_time` - All time
            * `custom` - Custom date range
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: granularity
          schema:
            enum:
              - day
              - hour
              - week
              - month
            type: string
            default: hour
            minLength: 1
          description: |-
            * `day` - day
            * `hour` - hour
            * `week` - week
            * `month` - month
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: metric
          schema:
            enum:
              - overview
              - sessions
              - ratings
              - highlighted
            type: string
            default: overview
            minLength: 1
          description: |-
            * `overview` - Overall topic metrics
            * `sessions` - Sessions over time
            * `ratings` - Ratings over time
            * `highlighted` - Highlighted topics
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
        - in: query
          name: start_date
          schema:
            type: string
            format: date
      tags:
        - ai-analytics
        - analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopicsOverview'
          description: ''
  /api/analytics/topics/details/:
    get:
      operationId: analytics_topics_details_retrieve
      parameters:
        - in: query
          name: date_filter
          schema:
            enum:
              - today
              - 7d
              - 30d
              - 90d
              - all_time
              - custom
            type: string
            default: today
            minLength: 1
          description: |-
            * `today` - Today only
            * `7d` - Last 7 days
            * `30d` - Last 30 days
            * `90d` - Last 90 days
            * `all_time` - All time
            * `custom` - Custom date range
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: limit
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: page
          schema:
            type: integer
            minimum: 1
            default: 1
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
        - in: query
          name: search
          schema:
            type: string
          description: Search by topic name
        - in: query
          name: start_date
          schema:
            type: string
            format: date
      tags:
        - ai-analytics
        - analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopicDetails'
          description: ''
  /api/analytics/users/:
    get:
      operationId: analytics_users_retrieve
      description: |2-

                User Analytics API - Comprehensive user activity metrics and trends.
                
                Provides real-time and historical user analytics including:
                - Currently active users (last hour)
                - Active users over time periods (7d, 30d, 90d)
                - Registered user counts and growth
                - Time series charts with customizable granularity
                
                **Key Features:**
                - Real-time active user counting
                - Percentage change calculations vs previous periods
                - Flexible date filtering and granularity
                - Platform and mentor-specific filtering
                - Forward-filled time series data
                
                **Supported Metrics:**
                - `currently_active`: Users active in last hour
                - `active_users`: Unique users in specified period
                - `registered_users`: Total and new user counts
                
      parameters:
        - in: query
          name: date_filter
          schema:
            enum:
              - today
              - 7d
              - 30d
              - 90d
              - all_time
              - custom
            type: string
            default: today
            minLength: 1
          description: |-
            * `today` - Today only
            * `7d` - Last 7 days
            * `30d` - Last 30 days
            * `90d` - Last 90 days
            * `all_time` - All time
            * `custom` - Custom date range
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: granularity
          schema:
            enum:
              - day
              - hour
              - week
              - month
            type: string
            default: hour
            minLength: 1
          description: |-
            * `day` - day
            * `hour` - hour
            * `week` - week
            * `month` - month
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: metric
          schema:
            enum:
              - currently_active
              - active_users
              - registered_users
              - active_users_last_30d
            type: string
            minLength: 1
          description: |-
            * `currently_active` - Users logged in right now
            * `active_users` - Active users in a period
            * `registered_users` - Registered users
            * `active_users_last_30d` - Active users in the last 30 days
          required: true
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
        - in: query
          name: start_date
          schema:
            type: string
            format: date
      tags:
        - ai-analytics
        - analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrentUsersResponse'
              examples:
                CurrentlyActiveUsers:
                  value:
                    metric: currently_active
                    count: 45
                    change: 12
                  summary: Currently Active Users
                  description: Users currently active in the last hour
                ActiveUsers30Days:
                  value:
                    metric: active_users
                    count: 1250
                    change: 150
                    percentage_change: 13.6
                    prev_count: 1100
                  summary: Active Users 30 Days
                  description: Unique active users in the last 30 days with comparison
                RegisteredUsers:
                  value:
                    metric: registered_users
                    count: 5000
                    new_users: 125
                  summary: Registered Users
                  description: Total registered users and new users this month
                ActiveUsersChart:
                  value:
                    metric: active_users
                    points:
                      - date: '2025-01-01T10:00:00Z'
                        value: 45
                      - date: '2025-01-01T11:00:00Z'
                        value: 52
                      - date: '2025-01-01T12:00:00Z'
                        value: 48
                  summary: Active Users Chart
                  description: Time series of active users with forward-filled gaps
          description: User analytics metrics with comparison data
        '400':
          description: Bad Request - Invalid parameters
        '403':
          description: Forbidden - Insufficient permissions
        '500':
          description: Internal Server Error
  /api/analytics/users/details/:
    get:
      operationId: analytics_users_details_retrieve
      description: |2-

                User Details API - Comprehensive user activity details with search and filtering.
                
                Provides detailed user information including:
                - User contact information (email, full name)
                - Activity metrics (message count, last activity)
                - Search functionality across multiple fields
                - Flexible date range filtering
                - CSV export capability
                
                **Key Features:**
                - Full-text search across email, name, and user ID
                - Date range filtering for activity periods
                - Platform and mentor-specific filtering
                - Comprehensive pagination with metadata
                - CSV export for data analysis
                - User aggregation across platforms/mentors
                
                **Search Capabilities:**
                - Email address matching
                - Full name search
                - User ID lookup
                - Partial string matching (case-insensitive)
                
                **Export Options:**
                - JSON response (default)
                - CSV export (?export=csv)
                - Includes all user fields in export
                
      parameters:
        - in: query
          name: date_filter
          schema:
            enum:
              - today
              - 7d
              - 30d
              - 90d
              - all_time
              - custom
            type: string
            default: today
            minLength: 1
          description: |-
            * `today` - Today only
            * `7d` - Last 7 days
            * `30d` - Last 30 days
            * `90d` - Last 90 days
            * `all_time` - All time
            * `custom` - Custom date range
        - in: query
          name: end_date
          schema:
            type: string
            format: date
        - in: query
          name: limit
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
        - in: query
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
        - in: query
          name: page
          schema:
            type: integer
            minimum: 1
            default: 1
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
        - in: query
          name: search
          schema:
            type: string
          description: Search by email, full name, or user ID
        - in: query
          name: start_date
          schema:
            type: string
            format: date
      tags:
        - ai-analytics
        - analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDetail'
              examples:
                UserDetailsResponse:
                  value:
                    results:
                      - email: john.doe@example.com
                        full_name: John Doe
                        messages: 1250
                        last_activity: '2025-01-15T14:30:00Z'
                      - email: jane.smith@example.com
                        full_name: Jane Smith
                        messages: 890
                        last_activity: '2025-01-15T13:45:00Z'
                    total: 1250
                    pagination:
                      page: 1
                      limit: 50
                      total_pages: 25
                      has_next: true
                      has_previous: false
                      start_index: 1
                      end_index: 50
                  summary: User Details Response
                  description: Paginated list of users with activity details
                CSVExport:
                  value: |-
                    email,full_name,messages,last_activity
                    john.doe@example.com,John Doe,1250,2025-01-15T14:30:00Z
                    jane.smith@example.com,Jane Smith,890,2025-01-15T13:45:00Z
                  summary: CSV Export
                  description: CSV export format when ?export=csv is specified
          description: Paginated user details with activity metrics
        '400':
          description: Bad Request - Invalid parameters
        '403':
          description: Forbidden - Insufficient permissions
        '500':
          description: Internal Server Error
  /api/audience/orgs/{org}/active-users/over-time:
    get:
      operationId: audience_orgs_active_users_over_time_retrieve
      description: >-
        Get active user counts over time.


        This endpoint provides daily counts of active users (users with known
        activity)

        over a specified time period.


        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)

        Returns:
            Daily active user counts over the specified time period, with change metrics
            compared to previous periods.

        Default time range is the last 7 days if no dates are specified.


        An active user is defined as a user with any activity within the past 30
        days.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/audience/orgs/{org}/active-users/per-course:
    get:
      operationId: audience_orgs_active_users_per_course_retrieve
      description: |-
        Get active user counts on a per-course basis.

        This endpoint provides counts of active users for each course within
        the specified date range.

        Query Parameters:
            start_date (str, optional): Start date for filtering (ISO format)
            end_date (str, optional): End date for filtering (ISO format)

        Returns:
            A list of courses with their active user counts.

        Default time range is the last 7 days if no dates are specified.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActiveUsersPerCourse'
          description: ''
  /api/audience/orgs/{org}/active-users/users:
    get:
      operationId: audience_orgs_active_users_users_retrieve
      description: |-
        Get a list of active users with activity metrics.

        This endpoint provides a paginated list of users who have had activity
        within the specified date range.

        Query Parameters:
            start_date (str, optional): Start date for filtering (ISO format)
            end_date (str, optional): End date for filtering (ISO format)
            course_id (str, optional): Filter by course ID
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page

        Returns:
            A paginated list of active users with their activity metrics.

        Default time range is the last 7 days if no dates are specified.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActiveUsersList'
          description: ''
  /api/audience/orgs/{org}/enrollments/courses/{course_id}/over-time:
    get:
      operationId: audience_orgs_enrollments_courses_over_time_retrieve
      description: |-
        Get enrollment or unenrollment counts over time.

        This endpoint provides daily counts of new enrollments or unenrollments
        over a specified time period.

        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)
            course_id (str, optional): Filter by course ID
            active (bool): Get enrollments when true, unenrollments when false

        Returns:
            Daily counts over the specified time period, with change metrics
            compared to previous periods.

        Default time range is the last 7 days if no dates are specified.
      parameters:
        - in: query
          name: active
          schema:
            enum:
              - 'y'
              - 'yes'
              - 'true'
              - 'True'
              - 'n'
              - 'no'
              - 'false'
              - 'False'
            type: string
            default: 'y'
            minLength: 1
          description: |-
            Any of `y`, `yes`, `true`. set to false or no for unenrollments 

            * `y` - y
            * `yes` - yes
            * `true` - true
            * `True` - True
            * `n` - n
            * `no` - no
            * `false` - false
            * `False` - False
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/audience/orgs/{org}/enrollments/courses/{course_id}/users:
    get:
      operationId: audience_orgs_enrollments_courses_users_retrieve
      description: |-
        List users enrolled in a specific course.

        This endpoint provides a list of users who are enrolled or unenrolled
        in a specified course.

        Query Parameters:
            course_id (str): The course ID to get enrollments for
            active (bool): Filter for active enrollments when true, inactive when false
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page

        Returns:
            A paginated list of users with:
            - Username
            - Full name
            - Email
            - Enrollment timestamp
      parameters:
        - in: query
          name: active
          schema:
            enum:
              - 'y'
              - 'yes'
              - 'true'
              - 'True'
              - 'n'
              - 'no'
              - 'false'
              - 'False'
            type: string
            default: 'y'
            minLength: 1
          description: |-
            Any of `y`, `yes`, `true`. set to false or no for unenrollments 

            * `y` - y
            * `yes` - yes
            * `true` - true
            * `True` - True
            * `n` - n
            * `no` - no
            * `false` - false
            * `False` - False
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrollmentsPerUser'
          description: ''
  /api/audience/orgs/{org}/enrollments/over-time:
    get:
      operationId: audience_orgs_enrollments_over_time_retrieve
      description: |-
        Get enrollment or unenrollment counts over time.

        This endpoint provides daily counts of new enrollments or unenrollments
        over a specified time period.

        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)
            course_id (str, optional): Filter by course ID
            active (bool): Get enrollments when true, unenrollments when false

        Returns:
            Daily counts over the specified time period, with change metrics
            compared to previous periods.

        Default time range is the last 7 days if no dates are specified.
      parameters:
        - in: query
          name: active
          schema:
            enum:
              - 'y'
              - 'yes'
              - 'true'
              - 'True'
              - 'n'
              - 'no'
              - 'false'
              - 'False'
            type: string
            default: 'y'
            minLength: 1
          description: |-
            Any of `y`, `yes`, `true`. set to false or no for unenrollments 

            * `y` - y
            * `yes` - yes
            * `true` - true
            * `True` - True
            * `n` - n
            * `no` - no
            * `false` - false
            * `False` - False
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/audience/orgs/{org}/enrollments/per-course:
    get:
      operationId: audience_orgs_enrollments_per_course_retrieve
      description: >-
        List enrollment statistics on a per-course basis.


        This endpoint provides enrollment counts for all courses, with options

        to filter for active or inactive enrollments and to include time-based
        data.


        Query Parameters:
            active (bool): Filter for active enrollments when true, inactive when false
            start_date (str, optional): Start date for time-based filtering (ISO format)
            end_date (str, optional): End date for time-based filtering (ISO format)
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page

        Returns:
            A paginated list of courses with their enrollment counts and percentages.
      parameters:
        - in: query
          name: active
          schema:
            enum:
              - 'y'
              - 'yes'
              - 'true'
              - 'True'
              - 'n'
              - 'no'
              - 'false'
              - 'False'
            type: string
            default: 'y'
            minLength: 1
          description: |-
            Any of `y`, `yes`, `true`. set to false or no for unenrollments 

            * `y` - y
            * `yes` - yes
            * `true` - true
            * `True` - True
            * `n` - n
            * `no` - no
            * `false` - false
            * `False` - False
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Enrollments'
          description: ''
  /api/audience/orgs/{org}/registered-users/:
    get:
      operationId: audience_orgs_registered_users_retrieve
      description: >-
        List all learners on the platform with aggregated metrics.


        This endpoint returns a paginated list of all learners with key metrics
        including:

        - Enrollment counts

        - Completion counts

        - Time spent on platform


        Query Parameters:
            page (int): Page number for pagination
            length (int): Number of items per page
            search (str): Filter learners by username, email, or name

        Returns:
            A paginated list of learners with their associated metrics.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: search
          schema:
            type: string
            minLength: 1
          description: Search string for learner
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerlearnerUserList'
          description: ''
  /api/audience/orgs/{org}/registered-users/over-time:
    get:
      operationId: audience_orgs_registered_users_over_time_retrieve
      description: |-
        Get registered user counts over time.

        This endpoint provides daily counts of new user registrations over a
        specified time period.

        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)

        Returns:
            Daily registration counts over the specified time period, with change metrics
            compared to previous periods.

        Default time range is the last 7 days if no dates are specified.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/audience/orgs/{org}/registered-users/per-course:
    get:
      operationId: audience_orgs_registered_users_per_course_retrieve
      description: >-
        List enrollment statistics on a per-course basis.


        This endpoint provides enrollment counts for all courses, with options

        to filter for active or inactive enrollments and to include time-based
        data.


        Query Parameters:
            active (bool): Filter for active enrollments when true, inactive when false
            start_date (str, optional): Start date for time-based filtering (ISO format)
            end_date (str, optional): End date for time-based filtering (ISO format)
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page

        Returns:
            A paginated list of courses with their enrollment counts and percentages.
      parameters:
        - in: query
          name: active
          schema:
            enum:
              - 'y'
              - 'yes'
              - 'true'
              - 'True'
              - 'n'
              - 'no'
              - 'false'
              - 'False'
            type: string
            default: 'y'
            minLength: 1
          description: |-
            Any of `y`, `yes`, `true`. set to false or no for unenrollments 

            * `y` - y
            * `yes` - yes
            * `true` - true
            * `True` - True
            * `n` - n
            * `no` - no
            * `false` - false
            * `False` - False
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Enrollments'
          description: ''
  /api/career/location/orgs/{org}/users/{username}/:
    get:
      operationId: career_location_orgs_users_retrieve
      description: API endpoint for managing user base locations
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    post:
      operationId: career_location_orgs_users_create
      description: API endpoint for managing user base locations
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    put:
      operationId: career_location_orgs_users_update
      description: API endpoint for managing user base locations
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/career/locations/orgs/{org}/:
    get:
      operationId: career_locations_orgs_retrieve
      description: Platform-wide location statistics (GET only)
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - career
      responses:
        '200':
          description: No response body
  /api/career/orgs/{org}/companies/users/{username}/:
    get:
      operationId: career_orgs_companies_users_retrieve
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
          description: ''
    post:
      operationId: career_orgs_companies_users_create
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Company'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Company'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Company'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Company'
          '*/*':
            schema:
              $ref: '#/components/schemas/Company'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
          description: ''
    put:
      operationId: career_orgs_companies_users_update
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Company'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Company'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Company'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Company'
          '*/*':
            schema:
              $ref: '#/components/schemas/Company'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
          description: ''
    delete:
      operationId: career_orgs_companies_users_destroy
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/career/orgs/{org}/education/users/{username}/:
    get:
      operationId: career_orgs_education_users_retrieve
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Education'
          description: ''
    post:
      operationId: career_orgs_education_users_create
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Education'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Education'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Education'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Education'
          '*/*':
            schema:
              $ref: '#/components/schemas/Education'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Education'
          description: ''
    put:
      operationId: career_orgs_education_users_update
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Education'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Education'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Education'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Education'
          '*/*':
            schema:
              $ref: '#/components/schemas/Education'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Education'
          description: ''
    delete:
      operationId: career_orgs_education_users_destroy
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/career/orgs/{org}/experience/users/{username}/:
    get:
      operationId: career_orgs_experience_users_retrieve
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experience'
          description: ''
    post:
      operationId: career_orgs_experience_users_create
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Experience'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Experience'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Experience'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Experience'
          '*/*':
            schema:
              $ref: '#/components/schemas/Experience'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experience'
          description: ''
    put:
      operationId: career_orgs_experience_users_update
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Experience'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Experience'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Experience'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Experience'
          '*/*':
            schema:
              $ref: '#/components/schemas/Experience'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experience'
          description: ''
    delete:
      operationId: career_orgs_experience_users_destroy
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/career/orgs/{org}/institutions/users/{username}/:
    get:
      operationId: career_orgs_institutions_users_retrieve
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Institution'
          description: ''
    post:
      operationId: career_orgs_institutions_users_create
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Institution'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Institution'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Institution'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Institution'
          '*/*':
            schema:
              $ref: '#/components/schemas/Institution'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Institution'
          description: ''
    put:
      operationId: career_orgs_institutions_users_update
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Institution'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Institution'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Institution'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Institution'
          '*/*':
            schema:
              $ref: '#/components/schemas/Institution'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Institution'
          description: ''
    delete:
      operationId: career_orgs_institutions_users_destroy
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/career/orgs/{org}/programs/users/{username}/:
    get:
      operationId: career_orgs_programs_users_retrieve
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Program'
          description: ''
    post:
      operationId: career_orgs_programs_users_create
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Program'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Program'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Program'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Program'
          '*/*':
            schema:
              $ref: '#/components/schemas/Program'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Program'
          description: ''
    put:
      operationId: career_orgs_programs_users_update
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Program'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Program'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Program'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Program'
          '*/*':
            schema:
              $ref: '#/components/schemas/Program'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Program'
          description: ''
    delete:
      operationId: career_orgs_programs_users_destroy
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/career/resume/orgs/{org}/users/{username}/:
    get:
      operationId: career_resume_orgs_users_retrieve
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    post:
      operationId: career_resume_orgs_users_create
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    put:
      operationId: career_resume_orgs_users_update
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - career
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/catalog/access_requests/course/manage/:
    get:
      operationId: catalog_access_requests_course_manage_retrieve
      description: Retrieve a paginated list of access requests
      parameters:
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: reviewed
          schema:
            type: boolean
          description: Filter by reviewed status
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCourseAccessRequest'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - platform doesn't exist
        '500':
          description: Internal server error
    post:
      operationId: catalog_access_requests_course_manage_create
      description: Update an existing access request (approve/reject)
      parameters:
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: reviewed
          schema:
            type: boolean
          description: Filter by reviewed status
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseAccessRequestUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseAccessRequestUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseAccessRequestUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseAccessRequestUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseAccessRequestUpdate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseAccessRequestDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - platform or access request doesn't exist
        '500':
          description: Internal server error
  /api/catalog/access_requests/course/request/:
    get:
      operationId: catalog_access_requests_course_request_retrieve
      description: Check if the user has an active access request for a course
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the course
          required: true
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseAccessRequestStatusResponse'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - platform or course doesn't exist
    post:
      operationId: catalog_access_requests_course_request_create
      description: Create a new access request for a course
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the course
          required: true
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseAccessRequestCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseAccessRequestCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseAccessRequestCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseAccessRequestCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseAccessRequestCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseAccessRequestDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - platform or course doesn't exist
        '500':
          description: Internal server error
  /api/catalog/conditionals/course/eligibility/:
    get:
      operationId: catalog_conditionals_course_eligibility_retrieve
      description: |-
        GET
        Retrieve prerequisite eligibility info for user/course

        Params:
        user_id/username
        course_id
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/catalog/conditionals/course/prerequisites/manage/:
    get:
      operationId: catalog_conditionals_course_prerequisites_manage_retrieve
      description: |-
        GET
        Retrieve prerequisite info for course

        Params:
        course_id

        key_only
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/catalog/conditionals/course/prerequisites/manage/bulk/:
    post:
      operationId: catalog_conditionals_course_prerequisites_manage_bulk_create
      description: |-
        Prerequisite bulk management view

        Params:
        course_id

        rules
        key_only
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/catalog/courses/:
    get:
      operationId: catalog_courses_list
      description: Retrieve courses matching specified filters.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: Filter courses by their unique identifier
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Filter courses by their associated organization
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Filter courses by their slug (case-insensitive)
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Course'
          description: ''
        '400':
          description: No response body
    post:
      operationId: catalog_courses_create
      description: Add or update a course in the database.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: Filter courses by their unique identifier
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Filter courses by their associated organization
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Filter courses by their slug (case-insensitive)
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseCreateUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseCreateUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseCreateUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseCreateUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseCreateUpdate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Course'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Course'
          description: ''
        '400':
          description: No response body
    delete:
      operationId: catalog_courses_destroy
      description: Remove a course from the database.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the course to be deleted
          required: true
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Filter courses by their associated organization
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Filter courses by their slug (case-insensitive)
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseDeleteResponse'
          description: ''
        '400':
          description: No response body
  /api/catalog/eligibility/courses/:
    get:
      operationId: catalog_eligibility_courses_list
      description: List courses that a user is eligible for.
      parameters:
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Filter eligible courses by organization
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter eligible courses
        - in: query
          name: user_id
          schema:
            type: string
            minLength: 1
          description: User ID to check eligibility for
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username to check eligibility for
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Course'
          description: ''
        '400':
          description: No response body
  /api/catalog/eligibility/courses/check/:
    get:
      operationId: catalog_eligibility_courses_check_retrieve
      description: Check whether a user is eligible to enroll in a specific course.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: Course ID to check eligibility for
          required: true
        - in: query
          name: local_only
          schema:
            type: boolean
          description: Whether to check eligibility only within the local organization
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Organization of the course
        - in: query
          name: user_id
          schema:
            type: string
            minLength: 1
          description: User ID to check eligibility for
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username to check eligibility for
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '400':
          description: No response body
        '500':
          description: No response body
  /api/catalog/enrollment/courses/search/:
    get:
      operationId: catalog_enrollment_courses_search_retrieve
      description: >-
        API View for searching course enrollments.


        This endpoint allows searching for course enrollments based on various
        filters such as user ID,

        username, email, course ID, slug, organization, and platform key.
        Results are paginated and

        include detailed enrollment information.


        Query Parameters:
            user_id (str, optional): Filter enrollments by user ID
            username (str, optional): Filter enrollments by username
            email (str, optional): Filter enrollments by user email
            course_id (str, optional): Filter enrollments by course ID
            slug (str, optional): Filter enrollments by course slug
            org (str, optional): Filter enrollments by organization
            platform_key (str, optional): Filter enrollments by platform key
            course_name (str, optional): Filter enrollments by course name (partial match)
            include_default_platform (bool, optional): Include enrollments from default platform
            sort (str, optional): Field to sort results by (default: '-id')
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Search for course enrollments with filtering and pagination

        Returns:
            GET: A paginated JSON response containing course enrollments:
                {
                    "count": 42,
                    "next": "https://api.example.com/api/catalog/enrollment/courses/search/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "user_id": 123,
                            "username": "student1",
                            "email": "student1@example.com",
                            "course_id": "course-v1:org+course+run",
                            "active": true,
                            "created": "2023-01-15T10:30:00Z",
                            "started": "2023-01-15T10:30:00Z",
                            "ended": null,
                            "expired": null,
                            "metadata": {},
                            "name": "John Doe",
                            "course_name": "Introduction to Data Science"
                        },
                        ...
                    ]
                }

        Error Responses:
            400 Bad Request: If required parameters are missing or if enrollment search fails
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsEdxUserReadOnly, or IsPlatformAdminOfUserReadOnly permission
            - Users can view their own enrollments
            - Platform admins can view enrollments for users in their platform
            - DM admins can view all enrollments
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: Filter enrollments by course ID
        - in: query
          name: course_name
          schema:
            type: string
            minLength: 1
          description: Filter enrollments by course name (partial match)
        - in: query
          name: email
          schema:
            type: string
            minLength: 1
          description: Filter enrollments by user email
        - in: query
          name: include_default_platform
          schema:
            type: boolean
          description: Include enrollments from default platform
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Filter enrollments by organization
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Filter enrollments by platform key
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Filter enrollments by course slug
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: user_id
          schema:
            type: string
            minLength: 1
          description: Filter enrollments by user ID
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Filter enrollments by username
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseEnrollmentSearchResponse'
          description: ''
  /api/catalog/enrollment/pathways/:
    get:
      operationId: catalog_enrollment_pathways_retrieve
      description: >-
        Search pathway enrollments. Requires user_id or username and pathway_id
        or slug.
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
            default: true
          description: Whether the enrollment should be active
        - in: query
          name: include_default_platform
          schema:
            type: boolean
          description: Include enrollments from default platform
        - in: query
          name: include_metadata
          schema:
            type: boolean
            default: true
          description: Include metadata in the response
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Organization for the pathway
        - in: query
          name: pathway_id
          schema:
            type: string
            minLength: 1
          description: Pathway ID for enrollment
        - in: query
          name: pathway_key
          schema:
            type: string
            minLength: 1
          description: Pathway key for enrollment
        - in: query
          name: pathway_uuid
          schema:
            type: string
            minLength: 1
          description: Pathway UUID for enrollment
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key for the pathway
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Pathway slug for enrollment
        - in: query
          name: user_id
          schema:
            type: string
            minLength: 1
          description: User ID for enrollment
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username for enrollment
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PathwayEnrollmentPlus'
          description: ''
    post:
      operationId: catalog_enrollment_pathways_create
      description: Log user enrollment with a pathway.
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
            default: true
          description: Whether the enrollment should be active
        - in: query
          name: include_default_platform
          schema:
            type: boolean
          description: Include enrollments from default platform
        - in: query
          name: include_metadata
          schema:
            type: boolean
            default: true
          description: Include metadata in the response
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Organization for the pathway
        - in: query
          name: pathway_id
          schema:
            type: string
            minLength: 1
          description: Pathway ID for enrollment
        - in: query
          name: pathway_key
          schema:
            type: string
            minLength: 1
          description: Pathway key for enrollment
        - in: query
          name: pathway_uuid
          schema:
            type: string
            minLength: 1
          description: Pathway UUID for enrollment
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key for the pathway
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Pathway slug for enrollment
        - in: query
          name: user_id
          schema:
            type: string
            minLength: 1
          description: User ID for enrollment
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username for enrollment
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PathwayEnrollmentRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PathwayEnrollmentRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PathwayEnrollmentRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PathwayEnrollmentRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PathwayEnrollmentRequest'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PathwayEnrollment'
          description: ''
    delete:
      operationId: catalog_enrollment_pathways_destroy
      description: Unenroll from a pathway. Deactivates enrollment.
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
            default: true
          description: Whether the enrollment should be active
        - in: query
          name: include_default_platform
          schema:
            type: boolean
          description: Include enrollments from default platform
        - in: query
          name: include_metadata
          schema:
            type: boolean
            default: true
          description: Include metadata in the response
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Organization for the pathway
        - in: query
          name: pathway_id
          schema:
            type: string
            minLength: 1
          description: Pathway ID for enrollment
        - in: query
          name: pathway_key
          schema:
            type: string
            minLength: 1
          description: Pathway key for enrollment
        - in: query
          name: pathway_uuid
          schema:
            type: string
            minLength: 1
          description: Pathway UUID for enrollment
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key for the pathway
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Pathway slug for enrollment
        - in: query
          name: user_id
          schema:
            type: string
            minLength: 1
          description: User ID for enrollment
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username for enrollment
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PathwayEnrollment'
          description: ''
  /api/catalog/enrollment/pathways/search/:
    get:
      operationId: catalog_enrollment_pathways_search_retrieve
      description: >-
        Search pathway enrollments based on user or pathway identifiers. Returns
        paginated enrollment results.
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PathwayEnrollmentPlus'
          description: ''
  /api/catalog/enrollment/pathways/self/:
    post:
      operationId: catalog_enrollment_pathways_self_create
      description: Log user enrollment with a pathway.
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
            default: true
          description: Whether the enrollment should be active
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Organization for the pathway
        - in: query
          name: pathway_id
          schema:
            type: string
            minLength: 1
          description: Pathway ID for self-enrollment
        - in: query
          name: pathway_key
          schema:
            type: string
            minLength: 1
          description: Pathway key for self-enrollment
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key for the pathway
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Pathway slug for self-enrollment
        - in: query
          name: user_id
          schema:
            type: string
            minLength: 1
          description: User ID for self-enrollment
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username for self-enrollment
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PathwaySelfEnrollmentRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PathwaySelfEnrollmentRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PathwaySelfEnrollmentRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PathwaySelfEnrollmentRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PathwaySelfEnrollmentRequest'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PathwayEnrollment'
          description: ''
    delete:
      operationId: catalog_enrollment_pathways_self_destroy
      description: Unenroll from a pathway. Deactivates enrollment.
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
            default: true
          description: Whether the enrollment should be active
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Organization for the pathway
        - in: query
          name: pathway_id
          schema:
            type: string
            minLength: 1
          description: Pathway ID for self-enrollment
        - in: query
          name: pathway_key
          schema:
            type: string
            minLength: 1
          description: Pathway key for self-enrollment
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key for the pathway
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Pathway slug for self-enrollment
        - in: query
          name: user_id
          schema:
            type: string
            minLength: 1
          description: User ID for self-enrollment
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username for self-enrollment
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PathwayEnrollment'
          description: ''
  /api/catalog/enrollment/programs/:
    get:
      operationId: catalog_enrollment_programs_retrieve
      description: >-
        Search program enrollments. Requires user_id or username and program_id
        or slug.
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
            default: true
          description: Whether the enrollment should be active
        - in: query
          name: expired
          schema:
            type: string
            format: date-time
          description: Date when enrollment expires
        - in: query
          name: ignore_expiration
          schema:
            type: boolean
            default: false
          description: Whether to ignore expiration during unenrollment
        - in: query
          name: include_default_platform
          schema:
            type: boolean
          description: Include enrollments from default platform
        - in: query
          name: include_metadata
          schema:
            type: boolean
            default: true
          description: Include metadata in the response
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Organization for the program
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key for the program
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: Program ID for enrollment
        - in: query
          name: program_key
          schema:
            type: string
            minLength: 1
          description: Program key for enrollment
        - in: query
          name: program_type
          schema:
            type: string
            minLength: 1
          description: Program type (standard, platform, custom)
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Program slug for enrollment
        - in: query
          name: started
          schema:
            type: string
            format: date-time
          description: Date when enrollment started
        - in: query
          name: user_id
          schema:
            type: string
            minLength: 1
          description: User ID for enrollment
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username for enrollment
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramEnrollmentPlus'
          description: ''
    post:
      operationId: catalog_enrollment_programs_create
      description: Log user enrollment with a program.
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
            default: true
          description: Whether the enrollment should be active
        - in: query
          name: expired
          schema:
            type: string
            format: date-time
          description: Date when enrollment expires
        - in: query
          name: ignore_expiration
          schema:
            type: boolean
            default: false
          description: Whether to ignore expiration during unenrollment
        - in: query
          name: include_default_platform
          schema:
            type: boolean
          description: Include enrollments from default platform
        - in: query
          name: include_metadata
          schema:
            type: boolean
            default: true
          description: Include metadata in the response
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Organization for the program
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key for the program
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: Program ID for enrollment
        - in: query
          name: program_key
          schema:
            type: string
            minLength: 1
          description: Program key for enrollment
        - in: query
          name: program_type
          schema:
            type: string
            minLength: 1
          description: Program type (standard, platform, custom)
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Program slug for enrollment
        - in: query
          name: started
          schema:
            type: string
            format: date-time
          description: Date when enrollment started
        - in: query
          name: user_id
          schema:
            type: string
            minLength: 1
          description: User ID for enrollment
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username for enrollment
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProgramEnrollmentPlus'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ProgramEnrollmentPlus'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProgramEnrollmentPlus'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProgramEnrollmentPlus'
          '*/*':
            schema:
              $ref: '#/components/schemas/ProgramEnrollmentPlus'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramEnrollment'
          description: ''
    delete:
      operationId: catalog_enrollment_programs_destroy
      description: Unenroll from a program. Deactivates enrollment.
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
            default: true
          description: Whether the enrollment should be active
        - in: query
          name: expired
          schema:
            type: string
            format: date-time
          description: Date when enrollment expires
        - in: query
          name: ignore_expiration
          schema:
            type: boolean
            default: false
          description: Whether to ignore expiration during unenrollment
        - in: query
          name: include_default_platform
          schema:
            type: boolean
          description: Include enrollments from default platform
        - in: query
          name: include_metadata
          schema:
            type: boolean
            default: true
          description: Include metadata in the response
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Organization for the program
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key for the program
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: Program ID for enrollment
        - in: query
          name: program_key
          schema:
            type: string
            minLength: 1
          description: Program key for enrollment
        - in: query
          name: program_type
          schema:
            type: string
            minLength: 1
          description: Program type (standard, platform, custom)
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Program slug for enrollment
        - in: query
          name: started
          schema:
            type: string
            format: date-time
          description: Date when enrollment started
        - in: query
          name: user_id
          schema:
            type: string
            minLength: 1
          description: User ID for enrollment
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username for enrollment
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramEnrollment'
          description: ''
  /api/catalog/enrollment/programs/search/:
    get:
      operationId: catalog_enrollment_programs_search_retrieve
      description: >-
        Search program enrollments based on user or program identifiers. Returns
        paginated enrollment results.
      parameters:
        - in: query
          name: include_default_platform
          schema:
            type: boolean
          description: Include enrollments from default platform
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Filter enrollments by organization
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Filter enrollments by platform key
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: Filter enrollments by program ID
        - in: query
          name: program_type
          schema:
            type: string
            minLength: 1
          description: Filter by program type (standard, platform, custom)
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Filter enrollments by program slug
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: user_id
          schema:
            type: string
            minLength: 1
          description: Filter enrollments by user ID
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Filter enrollments by username
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramEnrollmentSearchResponse'
          description: ''
  /api/catalog/enrollment/programs/self/:
    post:
      operationId: catalog_enrollment_programs_self_create
      description: Log user enrollment with a program.
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
            default: true
          description: Whether the enrollment should be active
        - in: query
          name: expired
          schema:
            type: string
            format: date-time
          description: Date when enrollment expires
        - in: query
          name: ignore_expiration
          schema:
            type: boolean
            default: false
          description: Whether to ignore expiration during unenrollment
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Organization for the program
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key for the program
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: Program ID for self-enrollment
        - in: query
          name: program_key
          schema:
            type: string
            minLength: 1
          description: Program key for self-enrollment
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Program slug for self-enrollment
        - in: query
          name: started
          schema:
            type: string
            format: date-time
          description: Date when enrollment started
        - in: query
          name: user_id
          schema:
            type: string
            minLength: 1
          description: User ID for self-enrollment
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username for self-enrollment
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProgramEnrollment'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ProgramEnrollment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProgramEnrollment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProgramEnrollment'
          '*/*':
            schema:
              $ref: '#/components/schemas/ProgramEnrollment'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramEnrollment'
          description: ''
    delete:
      operationId: catalog_enrollment_programs_self_destroy
      description: Unenroll from a program. Deactivates enrollment.
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
            default: true
          description: Whether the enrollment should be active
        - in: query
          name: expired
          schema:
            type: string
            format: date-time
          description: Date when enrollment expires
        - in: query
          name: ignore_expiration
          schema:
            type: boolean
            default: false
          description: Whether to ignore expiration during unenrollment
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Organization for the program
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key for the program
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: Program ID for self-enrollment
        - in: query
          name: program_key
          schema:
            type: string
            minLength: 1
          description: Program key for self-enrollment
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Program slug for self-enrollment
        - in: query
          name: started
          schema:
            type: string
            format: date-time
          description: Date when enrollment started
        - in: query
          name: user_id
          schema:
            type: string
            minLength: 1
          description: User ID for self-enrollment
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username for self-enrollment
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/catalog/increment/:
    get:
      operationId: catalog_increment_retrieve
      description: Retrieve auto increment information for a specific platform.
      parameters:
        - in: query
          name: key
          schema:
            type: string
            minLength: 1
          description: Platform key identifier
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Platform organization identifier
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CatalogAutoIncrementResponse'
          description: ''
        '404':
          description: No response body
    post:
      operationId: catalog_increment_create
      description: >-
        Update auto increment information and retrieve a new ID for a specific
        platform.
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CatalogAutoIncrementUpdateRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CatalogAutoIncrementUpdateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CatalogAutoIncrementUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CatalogAutoIncrementUpdateRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/CatalogAutoIncrementUpdateRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: integer
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '500':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
  /api/catalog/invitations/course/:
    get:
      operationId: catalog_invitations_course_retrieve
      description: Retrieve a paginated list of course invitations
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by active status
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: Filter by course ID
        - in: query
          name: email
          schema:
            type: string
            minLength: 1
          description: Filter by user email
        - in: query
          name: key
          schema:
            type: string
            minLength: 1
          description: Alternative filter by platform key
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Alternative filter by platform organization
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Filter by platform key
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: Filter by platform organization
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: source
          schema:
            type: string
            minLength: 1
          description: Filter by invitation source
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Filter by username
        - in: query
          name: verbose
          schema:
            type: boolean
          description: Whether to include verbose output
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCourseInvitation'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
    post:
      operationId: catalog_invitations_course_create
      description: Create a new course invitation
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by active status
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: Filter by course ID
        - in: query
          name: email
          schema:
            type: string
            minLength: 1
          description: Filter by user email
        - in: query
          name: key
          schema:
            type: string
            minLength: 1
          description: Alternative filter by platform key
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Alternative filter by platform organization
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Filter by platform key
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: Filter by platform organization
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: source
          schema:
            type: string
            minLength: 1
          description: Filter by invitation source
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Filter by username
        - in: query
          name: verbose
          schema:
            type: boolean
          description: Whether to include verbose output
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseInvitationCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseInvitationCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseInvitationCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseInvitationCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseInvitationCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseInvitationDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - course doesn't exist
        '500':
          description: Internal server error
    delete:
      operationId: catalog_invitations_course_destroy
      description: 'Remove a course invitation: TBD'
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by active status
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: Filter by course ID
        - in: query
          name: email
          schema:
            type: string
            minLength: 1
          description: Filter by user email
        - in: query
          name: key
          schema:
            type: string
            minLength: 1
          description: Alternative filter by platform key
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Alternative filter by platform organization
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Filter by platform key
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: Filter by platform organization
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: source
          schema:
            type: string
            minLength: 1
          description: Filter by invitation source
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Filter by username
        - in: query
          name: verbose
          schema:
            type: boolean
          description: Whether to include verbose output
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Invitation successfully deleted
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - invitation doesn't exist
        '500':
          description: Internal server error
  /api/catalog/invitations/course/blank/:
    post:
      operationId: catalog_invitations_course_blank_create
      description: Create multiple blank course invitations
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BlankCourseInvitationCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/BlankCourseInvitationCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BlankCourseInvitationCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BlankCourseInvitationCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/BlankCourseInvitationCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkCourseInvitationResponse'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - course doesn't exist
        '500':
          description: Internal server error
  /api/catalog/invitations/course/bulk/:
    post:
      operationId: catalog_invitations_course_bulk_create
      description: Create multiple course invitations
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkCourseInvitationCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/BulkCourseInvitationCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BulkCourseInvitationCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BulkCourseInvitationCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/BulkCourseInvitationCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkCourseInvitationResponse'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
  /api/catalog/invitations/course/redeem/:
    post:
      operationId: catalog_invitations_course_redeem_create
      description: Redeem a blank course invitation
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseInvitationRedemption'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseInvitationRedemption'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseInvitationRedemption'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseInvitationRedemption'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseInvitationRedemption'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseInvitationDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - no blank invitation available
        '500':
          description: Internal server error
  /api/catalog/invitations/platform/:
    get:
      operationId: catalog_invitations_platform_retrieve
      description: >-
        API View for managing platform invitations.


        This endpoint allows querying, creating, and deleting platform
        invitations for users.


        Query/Request Parameters:
            For GET:
                platform_key (str, optional): Filter by platform key
                org (str, optional): Filter by platform organization
                email (str, optional): Filter by user email
                source (str, optional): Filter by invitation source
                active (bool, optional): Filter by active status
                sort (str, optional): Field to sort results by (default: '-id')
                metadata fields: Any additional parameters will be treated as metadata filters

            For POST:
                platform_key (str, required): The platform to create an invitation for
                email (str, required): The email address to invite
                active (bool, optional): Whether the invitation is active
                metadata fields: Any additional parameters will be added as metadata

            For DELETE:
                id (int, required): The ID of the invitation to delete
                org (str, required): The platform organization for verification

        Methods:
            GET: Retrieve a paginated list of platform invitations
            POST: Create a new platform invitation
            DELETE: Remove a platform invitation

        Returns:
            GET: A paginated JSON response containing platform invitations:
                {
                    "count": 10,
                    "next": "https://example.com/api/catalog/invitations/platform/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "user_id": 456,
                            "username": "username",
                            "email": "user@example.com",
                            "created": "2023-06-15T14:30:00Z",
                            "started": "2023-06-15T14:30:00Z",
                            "source": "source",
                            "redirect_to": "https://example.com",
                            "expired": null,
                            "active": true,
                            "metadata": {},
                            "platform_key": "platform1"
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created invitation:
                {
                    "id": 123,
                    "user_id": 456,
                    "username": "username",
                    "email": "user@example.com",
                    "created": "2023-06-15T14:30:00Z",
                    "started": "2023-06-15T14:30:00Z",
                    "source": "source",
                    "redirect_to": "https://example.com",
                    "expired": null,
                    "active": true,
                    "metadata": {},
                    "platform_key": "platform1"
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the platform or invitation doesn't exist
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin or IsPlatformAdmin permission
            - Available to platform administrators and DM admins
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by active status
        - in: query
          name: email
          schema:
            type: string
            minLength: 1
          description: Filter by user email
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Filter by platform organization
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Filter by platform key
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: source
          schema:
            type: string
            minLength: 1
          description: Filter by invitation source
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Filter by username
        - in: query
          name: verbose
          schema:
            type: boolean
          description: Whether to include verbose output
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPlatformInvitation'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
    post:
      operationId: catalog_invitations_platform_create
      description: Create a new platform invitation
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by active status
        - in: query
          name: email
          schema:
            type: string
            minLength: 1
          description: Filter by user email
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Filter by platform organization
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Filter by platform key
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: source
          schema:
            type: string
            minLength: 1
          description: Filter by invitation source
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Filter by username
        - in: query
          name: verbose
          schema:
            type: boolean
          description: Whether to include verbose output
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformInvitationCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformInvitationCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformInvitationCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformInvitationCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformInvitationCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformInvitationDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - platform doesn't exist
        '500':
          description: Internal server error
    delete:
      operationId: catalog_invitations_platform_destroy
      description: 'Remove a platform invitation: TBD'
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by active status
        - in: query
          name: email
          schema:
            type: string
            minLength: 1
          description: Filter by user email
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Filter by platform organization
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Filter by platform key
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: source
          schema:
            type: string
            minLength: 1
          description: Filter by invitation source
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Filter by username
        - in: query
          name: verbose
          schema:
            type: boolean
          description: Whether to include verbose output
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Invitation successfully deleted
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - invitation doesn't exist
        '500':
          description: Internal server error
  /api/catalog/invitations/platform/blank/:
    post:
      operationId: catalog_invitations_platform_blank_create
      description: Create multiple blank platform invitations
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BlankPlatformInvitationCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/BlankPlatformInvitationCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BlankPlatformInvitationCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BlankPlatformInvitationCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/BlankPlatformInvitationCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkPlatformInvitationResponse'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - platform doesn't exist
        '500':
          description: Internal server error
  /api/catalog/invitations/platform/bulk/:
    post:
      operationId: catalog_invitations_platform_bulk_create
      description: >-
        API View for bulk creating platform invitations.


        This endpoint allows creating multiple platform invitations in a single
        request.


        Request Parameters:
            invitation_data (list, required): List of invitation data objects, each containing:
                platform_key (str, required): The platform to create an invitation for
                email (str, required): The email address to invite
                active (bool, optional): Whether the invitation is active
                metadata fields: Any additional parameters will be added as metadata
            platform_key (str, required for platform admins): The platform key for permission validation

        Methods:
            POST: Create multiple platform invitations

        Returns:
            POST: A JSON response containing the creation results:
                {
                    "successes": 5,
                    "error_codes": []
                }

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            500 Internal Server Error: If an unexpected error occurs during creation

        Access Control:
            - Requires IsDMAdmin or IsPlatformAdmin permission
            - Available to platform administrators and DM admins
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkPlatformInvitationCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/BulkPlatformInvitationCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BulkPlatformInvitationCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BulkPlatformInvitationCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/BulkPlatformInvitationCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkPlatformInvitationResponse'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
  /api/catalog/invitations/platform/check/:
    get:
      operationId: catalog_invitations_platform_check_retrieve
      description: Check if a user has an active platform invitation
      parameters:
        - in: query
          name: email
          schema:
            type: string
            format: email
            minLength: 1
          description: The email address to check for active invitations
          required: true
      tags:
        - catalog
      responses:
        '200':
          description: Active invitation exists for the email
        '400':
          description: Bad request - missing or invalid parameters
        '404':
          description: No active invitation exists for the email
  /api/catalog/invitations/platform/redeem/:
    post:
      operationId: catalog_invitations_platform_redeem_create
      description: Redeem a blank platform invitation
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformInvitationRedemption'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformInvitationRedemption'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformInvitationRedemption'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformInvitationRedemption'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformInvitationRedemption'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformInvitationDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - no blank invitation available
        '500':
          description: Internal server error
  /api/catalog/invitations/program/:
    get:
      operationId: catalog_invitations_program_retrieve
      description: >-
        API View for managing program invitations.


        This endpoint allows querying, creating, and deleting program
        invitations for users.


        Query/Request Parameters:
            For GET:
                program_key (str, optional): Filter by program key
                org (str, optional): Filter by platform organization
                email (str, optional): Filter by user email
                source (str, optional): Filter by invitation source
                active (bool, optional): Filter by active status
                sort (str, optional): Field to sort results by (default: '-id')
                metadata fields: Any additional parameters will be treated as metadata filters

            For POST:
                program_key (str, required): The program to create an invitation for
                email (str, required): The email address to invite
                active (bool, optional): Whether the invitation is active
                metadata fields: Any additional parameters will be added as metadata

            For DELETE:
                id (int, required): The ID of the invitation to delete
                org (str, required): The platform organization for verification

        Methods:
            GET: Retrieve a paginated list of program invitations
            POST: Create a new program invitation
            DELETE: Remove a program invitation

        Returns:
            GET: A paginated JSON response containing program invitations:
                {
                    "count": 10,
                    "next": "https://example.com/api/catalog/invitations/program/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "user_id": 456,
                            "username": "username",
                            "email": "user@example.com",
                            "created": "2023-06-15T14:30:00Z",
                            "started": "2023-06-15T14:30:00Z",
                            "source": "source",
                            "redirect_to": "https://example.com",
                            "expired": null,
                            "active": true,
                            "metadata": {},
                            "program_key": "org+program1"
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created invitation:
                {
                    "id": 123,
                    "user_id": 456,
                    "username": "username",
                    "email": "user@example.com",
                    "created": "2023-06-15T14:30:00Z",
                    "started": "2023-06-15T14:30:00Z",
                    "source": "source",
                    "redirect_to": "https://example.com",
                    "expired": null,
                    "active": true,
                    "metadata": {},
                    "program_key": "org+program1"
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the program or invitation doesn't exist
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdminReadOnly, or IsPlatformAdminForProgram permission
            - Read-only access for platform admins, full access for DM admins and program-specific admins
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by active status
        - in: query
          name: email
          schema:
            type: string
            minLength: 1
          description: Filter by user email
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Filter by platform organization
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: program_key
          schema:
            type: string
            minLength: 1
          description: Filter by program key
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: source
          schema:
            type: string
            minLength: 1
          description: Filter by invitation source
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Filter by username
        - in: query
          name: verbose
          schema:
            type: boolean
          description: Whether to include verbose output
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProgramInvitation'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
    post:
      operationId: catalog_invitations_program_create
      description: >-
        API View for managing program invitations.


        This endpoint allows querying, creating, and deleting program
        invitations for users.


        Query/Request Parameters:
            For GET:
                program_key (str, optional): Filter by program key
                org (str, optional): Filter by platform organization
                email (str, optional): Filter by user email
                source (str, optional): Filter by invitation source
                active (bool, optional): Filter by active status
                sort (str, optional): Field to sort results by (default: '-id')
                metadata fields: Any additional parameters will be treated as metadata filters

            For POST:
                program_key (str, required): The program to create an invitation for
                email (str, required): The email address to invite
                active (bool, optional): Whether the invitation is active
                metadata fields: Any additional parameters will be added as metadata

            For DELETE:
                id (int, required): The ID of the invitation to delete
                org (str, required): The platform organization for verification

        Methods:
            GET: Retrieve a paginated list of program invitations
            POST: Create a new program invitation
            DELETE: Remove a program invitation

        Returns:
            GET: A paginated JSON response containing program invitations:
                {
                    "count": 10,
                    "next": "https://example.com/api/catalog/invitations/program/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "user_id": 456,
                            "username": "username",
                            "email": "user@example.com",
                            "created": "2023-06-15T14:30:00Z",
                            "started": "2023-06-15T14:30:00Z",
                            "source": "source",
                            "redirect_to": "https://example.com",
                            "expired": null,
                            "active": true,
                            "metadata": {},
                            "program_key": "org+program1"
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created invitation:
                {
                    "id": 123,
                    "user_id": 456,
                    "username": "username",
                    "email": "user@example.com",
                    "created": "2023-06-15T14:30:00Z",
                    "started": "2023-06-15T14:30:00Z",
                    "source": "source",
                    "redirect_to": "https://example.com",
                    "expired": null,
                    "active": true,
                    "metadata": {},
                    "program_key": "org+program1"
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the program or invitation doesn't exist
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdminReadOnly, or IsPlatformAdminForProgram permission
            - Read-only access for platform admins, full access for DM admins and program-specific admins
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by active status
        - in: query
          name: email
          schema:
            type: string
            minLength: 1
          description: Filter by user email
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Filter by platform organization
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: program_key
          schema:
            type: string
            minLength: 1
          description: Filter by program key
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: source
          schema:
            type: string
            minLength: 1
          description: Filter by invitation source
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Filter by username
        - in: query
          name: verbose
          schema:
            type: boolean
          description: Whether to include verbose output
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProgramInvitationCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ProgramInvitationCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProgramInvitationCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProgramInvitationCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/ProgramInvitationCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramInvitationDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - program doesn't exist
        '500':
          description: Internal server error
    delete:
      operationId: catalog_invitations_program_destroy
      description: 'Remove a program invitation: TBD'
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by active status
        - in: query
          name: email
          schema:
            type: string
            minLength: 1
          description: Filter by user email
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Filter by platform organization
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: program_key
          schema:
            type: string
            minLength: 1
          description: Filter by program key
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: source
          schema:
            type: string
            minLength: 1
          description: Filter by invitation source
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Filter by username
        - in: query
          name: verbose
          schema:
            type: boolean
          description: Whether to include verbose output
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Invitation successfully deleted
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - invitation doesn't exist
        '500':
          description: Internal server error
  /api/catalog/invitations/program/blank/:
    post:
      operationId: catalog_invitations_program_blank_create
      description: >-
        API View for creating blank program invitations.


        This endpoint allows creating multiple blank program invitations
        (without user association)

        that can be redeemed later.


        Request Parameters:
            program_key (str, required): The program to create invitations for
            source (str, required): The source identifier for the invitations
            count (int, required): The number of blank invitations to create
            metadata fields: Any additional parameters will be added as metadata

        Methods:
            POST: Create multiple blank program invitations

        Returns:
            POST: A JSON response containing the creation results:
                {
                    "successes": 10,
                    "error_codes": []
                }

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            500 Internal Server Error: If an unexpected error occurs during creation

        Access Control:
            - Requires IsDMAdmin or IsPlatformAdminForProgram permission
            - Available to DM admins and platform admins for the specific program
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BlankProgramInvitationCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/BlankProgramInvitationCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BlankProgramInvitationCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BlankProgramInvitationCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/BlankProgramInvitationCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkProgramInvitationResponse'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - program doesn't exist
        '500':
          description: Internal server error
  /api/catalog/invitations/program/bulk/:
    post:
      operationId: catalog_invitations_program_bulk_create
      description: |-
        API View for bulk creation of program invitations.

        This endpoint allows creating multiple program invitations at once.

        Request Parameters:
            invitation_data (list, required): List of invitation data objects, each containing:
                program_key (str, required): The program to create an invitation for
                email (str, required): The email address to invite
                active (bool, optional): Whether the invitation is active
                metadata fields: Any additional parameters will be added as metadata
            platform_key (str, required for platform admins): The platform key for permission validation

        Methods:
            POST: Create multiple program invitations

        Returns:
            POST: A JSON response containing the creation results:
                {
                    "successes": 5,
                    "error_codes": []
                }

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            500 Internal Server Error: If an unexpected error occurs during creation

        Access Control:
            - Requires IsDMAdmin or IsPlatformAdmin permission
            - Available to platform administrators and DM admins
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkProgramInvitationCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/BulkProgramInvitationCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BulkProgramInvitationCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BulkProgramInvitationCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/BulkProgramInvitationCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkProgramInvitationResponse'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
  /api/catalog/invitations/program/redeem/:
    post:
      operationId: catalog_invitations_program_redeem_create
      description: >-
        API View for redeeming blank program invitations.


        This endpoint allows redeeming a blank program invitation by associating
        it with a user.


        Request Parameters:
            program_key (str, required): The program key for the invitation
            source (str, required): The source identifier for the invitation
            email (str, optional): The email to associate with the invitation
            username (str, optional): The username to associate with the invitation
            metadata fields: Any additional parameters will be added as metadata

        Methods:
            POST: Redeem a blank program invitation

        Returns:
            POST: A JSON response containing the redeemed invitation:
                {
                    "id": 123,
                    "user_id": 456,
                    "username": "username",
                    "email": "user@example.com",
                    "created": "2023-06-15T14:30:00Z",
                    "started": "2023-06-15T14:30:00Z",
                    "source": "source",
                    "redirect_to": "https://example.com",
                    "expired": null,
                    "active": true,
                    "metadata": {},
                    "program_key": "org+program1"
                }

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If no blank invitation is available
            500 Internal Server Error: If an unexpected error occurs during redemption

        Access Control:
            - Requires IsDMAdmin or IsPlatformAdminForProgram permission
            - Available to DM admins and platform admins for the specific program
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProgramInvitationRedemption'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ProgramInvitationRedemption'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProgramInvitationRedemption'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProgramInvitationRedemption'
          '*/*':
            schema:
              $ref: '#/components/schemas/ProgramInvitationRedemption'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramInvitationDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - no blank invitation available
        '500':
          description: Internal server error
  /api/catalog/licenses/course/:
    get:
      operationId: catalog_licenses_course_retrieve
      description: Retrieve a paginated list of course licenses
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by active status
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: Filter by course ID
        - in: query
          name: external_id
          schema:
            type: string
            minLength: 1
          description: Filter by external identifier
        - in: query
          name: key
          schema:
            type: string
            minLength: 1
          description: Alternative filter by platform key
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Filter by license name (exact match)
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Alternative filter by platform organization
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search license names (contains)
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: source
          schema:
            type: string
            minLength: 1
          description: Filter by license source
        - in: query
          name: verbose
          schema:
            type: boolean
            default: false
          description: Include detailed assignment data in the response
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCourseLicense'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
  /api/catalog/licenses/course/assignment/:
    get:
      operationId: catalog_licenses_course_assignment_retrieve
      description: Retrieve a paginated list of course license assignments
      parameters:
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the course license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCourseLicenseAssignment'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
    post:
      operationId: catalog_licenses_course_assignment_create
      description: Create or update a course license assignment
      parameters:
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the course license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseLicenseAssignmentCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseLicenseAssignmentCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseLicenseAssignmentCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseLicenseAssignmentCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseLicenseAssignmentCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseLicenseAssignmentDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - license or user doesn't exist
        '500':
          description: Internal server error
    delete:
      operationId: catalog_licenses_course_assignment_destroy
      description: Remove a course license assignment
      parameters:
        - in: query
          name: assignment_id
          schema:
            type: integer
          description: The ID of the assignment to delete
          required: true
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the course license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Assignment successfully deleted
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - assignment doesn't exist
        '500':
          description: Internal server error
  /api/catalog/licenses/course/assignment/group/:
    get:
      operationId: catalog_licenses_course_assignment_group_retrieve
      description: Retrieve a paginated list of course license group assignments
      parameters:
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the course license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCourseLicenseGroupAssignment'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
    post:
      operationId: catalog_licenses_course_assignment_group_create
      description: Create or update a course license group assignment
      parameters:
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the course license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseLicenseGroupAssignmentCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseLicenseGroupAssignmentCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseLicenseGroupAssignmentCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseLicenseGroupAssignmentCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseLicenseGroupAssignmentCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseLicenseGroupAssignmentDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - license or group doesn't exist
        '500':
          description: Internal server error
    delete:
      operationId: catalog_licenses_course_assignment_group_destroy
      description: Remove a course license group assignment
      parameters:
        - in: query
          name: assignment_id
          schema:
            type: integer
          description: The ID of the assignment to delete
          required: true
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the course license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Assignment successfully deleted
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - assignment doesn't exist
        '500':
          description: Internal server error
  /api/catalog/licenses/course/create/:
    post:
      operationId: catalog_licenses_course_create_create
      description: Create a new course license
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseLicenseCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseLicenseCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseLicenseCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseLicenseCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseLicenseCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseLicenseDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - course or platform doesn't exist
        '500':
          description: Internal server error
  /api/catalog/licenses/course/update/:
    post:
      operationId: catalog_licenses_course_update_create
      description: Update an existing course license
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseLicenseUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseLicenseUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseLicenseUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseLicenseUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseLicenseUpdate'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseLicenseDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - license doesn't exist
        '500':
          description: Internal server error
  /api/catalog/licenses/platform/:
    get:
      operationId: catalog_licenses_platform_retrieve
      description: Retrieve a paginated list of platform licenses
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by active status
        - in: query
          name: external_id
          schema:
            type: string
            minLength: 1
          description: Filter by external identifier
        - in: query
          name: key
          schema:
            type: string
            minLength: 1
          description: Alternative filter by platform key
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Filter by license name (exact match)
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search license names (contains)
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: source
          schema:
            type: string
            minLength: 1
          description: Filter by license source
        - in: query
          name: verbose
          schema:
            type: boolean
            default: false
          description: Include detailed assignment data in the response
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPlatformLicense'
          description: ''
        '400':
          description: Bad request - invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
  /api/catalog/licenses/platform/create/:
    post:
      operationId: catalog_licenses_platform_create_create
      description: Create a new platform license
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformLicenseCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformLicenseCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformLicenseCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformLicenseCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformLicenseCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformLicenseDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
  /api/catalog/licenses/platform/update/:
    post:
      operationId: catalog_licenses_platform_update_create
      description: Update an existing platform license
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformLicenseUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformLicenseUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformLicenseUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformLicenseUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformLicenseUpdate'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformLicenseDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - license doesn't exist
        '500':
          description: Internal server error
  /api/catalog/licenses/program/:
    get:
      operationId: catalog_licenses_program_retrieve
      description: >-
        API View for managing program licenses.


        This endpoint allows retrieving program licenses with filtering and
        pagination support.


        Query Parameters:
            platform_key (str, optional): The unique identifier for the platform
            name (str, optional): Filter by license name (exact match)
            source (str, optional): Filter by license source
            active (bool, optional): Filter by active status
            program_id (str, optional): Filter by program ID
            query (str, optional): Search licenses by name (contains)
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page
            verbose (bool, optional): Include additional details in response
            sort (str, optional): Field to sort results by (default: '-id')

        Methods:
            GET: Retrieve a paginated list of program licenses

        Returns:
            GET: A paginated JSON response containing program licenses:
                {
                    "count": 10,
                    "next": "https://example.com/api/catalog/licenses/program/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "created": "2023-06-15T14:30:00Z",
                            "started": "2023-06-15T14:30:00Z",
                            "expired": null,
                            "name": "Program License 2023",
                            "count": 100,
                            "active": true,
                            "metadata": {},
                            "source": "source",
                            "external_id": "ext-123",
                            "platform_key": "platform1",
                            "program_id": "program-v1:org+program+run",
                            "assignments": {
                                "total": 50,
                                "active": 45,
                                "pending": 5
                            }
                        },
                        ...
                    ]
                }

        Error Responses:
            400 Bad Request: If query parameters are invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin or IsPlatformAdminReadOnly permission
            - Available to platform administrators (read-only) and DM admins
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by active status
        - in: query
          name: external_id
          schema:
            type: string
            minLength: 1
          description: Filter by external identifier
        - in: query
          name: key
          schema:
            type: string
            minLength: 1
          description: Alternative filter by platform key
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Filter by license name (exact match)
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Alternative filter by platform organization
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: Filter by program ID
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search license names (contains)
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by (e.g., '-id', 'created', '-created')
        - in: query
          name: source
          schema:
            type: string
            minLength: 1
          description: Filter by license source
        - in: query
          name: verbose
          schema:
            type: boolean
            default: false
          description: Include detailed assignment data in the response
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProgramLicense'
          description: ''
        '400':
          description: Bad request - invalid parameters
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
  /api/catalog/licenses/program/assignment/:
    get:
      operationId: catalog_licenses_program_assignment_retrieve
      description: Retrieve a paginated list of program license assignments
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by the active status of assignments
        - in: query
          name: email
          schema:
            type: string
            format: email
            minLength: 1
          description: Filter assignments for a specific email
        - in: query
          name: fulfilled
          schema:
            type: boolean
          description: Filter by the fulfilled status of assignments
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the program license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by (e.g., 'id', '-id', 'created', '-created')
        - in: query
          name: user_id
          schema:
            type: integer
          description: Filter assignments for a specific user ID
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProgramLicenseAssignment'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
    post:
      operationId: catalog_licenses_program_assignment_create
      description: Create or update a program license assignment
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by the active status of assignments
        - in: query
          name: email
          schema:
            type: string
            format: email
            minLength: 1
          description: Filter assignments for a specific email
        - in: query
          name: fulfilled
          schema:
            type: boolean
          description: Filter by the fulfilled status of assignments
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the program license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by (e.g., 'id', '-id', 'created', '-created')
        - in: query
          name: user_id
          schema:
            type: integer
          description: Filter assignments for a specific user ID
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProgramLicenseAssignmentCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ProgramLicenseAssignmentCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProgramLicenseAssignmentCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProgramLicenseAssignmentCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/ProgramLicenseAssignmentCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramLicenseAssignmentDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - license or user doesn't exist
        '500':
          description: Internal server error
    delete:
      operationId: catalog_licenses_program_assignment_destroy
      description: Unassign single user from license
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by the active status of assignments
        - in: query
          name: assignment_id
          schema:
            type: integer
          description: The ID of the assignment to delete
          required: true
        - in: query
          name: email
          schema:
            type: string
            format: email
            minLength: 1
          description: Filter assignments for a specific email
        - in: query
          name: fulfilled
          schema:
            type: boolean
          description: Filter by the fulfilled status of assignments
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the program license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform (for permission validation)
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: >-
            The organization identifier for the platform (for permission
            validation)
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by (e.g., 'id', '-id', 'created', '-created')
        - in: query
          name: user_id
          schema:
            type: integer
          description: Filter assignments for a specific user ID
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Assignment successfully deleted
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - assignment doesn't exist
        '500':
          description: Internal server error
  /api/catalog/licenses/program/assignment/group/:
    get:
      operationId: catalog_licenses_program_assignment_group_retrieve
      description: Retrieve a paginated list of program license group assignments
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by the active status of group assignments
        - in: query
          name: fulfilled
          schema:
            type: boolean
          description: Filter by the fulfilled status of group assignments
        - in: query
          name: group_id
          schema:
            type: integer
          description: Filter assignments for a specific user group ID
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the program license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by (e.g., 'id', '-id', 'created', '-created')
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProgramLicenseGroupAssignment'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
    post:
      operationId: catalog_licenses_program_assignment_group_create
      description: Create or update a program license group assignment
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by the active status of group assignments
        - in: query
          name: fulfilled
          schema:
            type: boolean
          description: Filter by the fulfilled status of group assignments
        - in: query
          name: group_id
          schema:
            type: integer
          description: Filter assignments for a specific user group ID
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the program license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by (e.g., 'id', '-id', 'created', '-created')
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProgramLicenseGroupAssignmentCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ProgramLicenseGroupAssignmentCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProgramLicenseGroupAssignmentCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProgramLicenseGroupAssignmentCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/ProgramLicenseGroupAssignmentCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramLicenseGroupAssignmentDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - license or group doesn't exist
        '500':
          description: Internal server error
    delete:
      operationId: catalog_licenses_program_assignment_group_destroy
      description: Remove a program license group assignment
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by the active status of group assignments
        - in: query
          name: assignment_id
          schema:
            type: integer
          description: The ID of the assignment to delete
          required: true
        - in: query
          name: fulfilled
          schema:
            type: boolean
          description: Filter by the fulfilled status of group assignments
        - in: query
          name: group_id
          schema:
            type: integer
          description: Filter assignments for a specific user group ID
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the program license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform (for permission validation)
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: >-
            The organization identifier for the platform (for permission
            validation)
        - in: query
          name: remove_user_assignments
          schema:
            type: boolean
            default: true
          description: >-
            Whether to also remove individual user assignments that were created
            by this group assignment
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by (e.g., 'id', '-id', 'created', '-created')
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Assignment successfully deleted
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - assignment doesn't exist
        '500':
          description: Internal server error
  /api/catalog/licenses/program/create/:
    post:
      operationId: catalog_licenses_program_create_create
      description: >-
        API View for creating program licenses.


        This endpoint allows administrators to create new program licenses with
        various configurations.


        Methods:
            POST: Create a new program license

        Request Body:
            A JSON object containing:
            - platform_key (str, required): The platform to create a license for
            - program_id (str, required): The program ID to create a license for
            - name (str, optional): Display name for the license
            - count (int, optional): Number of seats purchased (default: 0)
            - started (datetime, optional): Date when license should begin
            - expired (datetime, optional): Date when license should expire
            - active (bool, optional): Whether the license is active (default: true)
            - metadata (dict, optional): Additional license metadata
            - enrollment_config (dict, optional): Additional enrollment configuration
            - source (str, optional): Source identifier
            - external_id (str, optional): External identifier (must be unique)

        Returns:
            POST: A JSON response containing the created license:
                {
                    "id": 123,
                    "created": "2023-06-15T14:30:00Z",
                    "started": "2023-06-15T14:30:00Z",
                    "expired": null,
                    "name": "Program License 2023",
                    "count": 100,
                    "active": true,
                    "metadata": {},
                    "source": "source",
                    "external_id": "ext-123",
                    "platform_key": "platform1",
                    "program_id": "program-v1:org+program+run"
                }

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to create licenses
            500 Internal Server Error: If an unexpected error occurs during license creation

        Access Control:
            - Requires IsDMAdmin permission
            - Available only to DM administrators
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProgramLicenseCreateDetail'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ProgramLicenseCreateDetail'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProgramLicenseCreateDetail'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProgramLicenseCreateDetail'
          '*/*':
            schema:
              $ref: '#/components/schemas/ProgramLicenseCreateDetail'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramLicenseDetail'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
  /api/catalog/licenses/program/update/:
    post:
      operationId: catalog_licenses_program_update_create
      description: >-
        API View for updating existing program licenses.


        This endpoint allows administrators to update the properties of an
        existing program license.


        Methods:
            POST: Update an existing program license

        Request Body:
            A JSON object containing:
            - license_id (int, optional): The ID of the license to update (required if external_id not provided)
            - external_id (str, optional): External identifier of the license to update (required if license_id not provided)
            - name (str, optional): Updated display name for the license
            - count (int, optional): Updated number of seats purchased
            - started (datetime, optional): Updated date when license should begin
            - expired (datetime, optional): Updated date when license should expire
            - active (bool, optional): Updated active status
            - metadata (dict, optional): Updated additional license metadata
            - enrollment_config (dict, optional): Updated enrollment configuration
            - source (str, optional): Updated source identifier
            - change_type (str, optional): Type of change being made (default: "update")

        Returns:
            POST: A JSON response containing the updated license:
                {
                    "id": 123,
                    "created": "2023-06-15T14:30:00Z",
                    "started": "2023-06-15T14:30:00Z",
                    "expired": "2024-06-15T14:30:00Z",
                    "name": "Updated Program License 2023",
                    "count": 150,
                    "active": true,
                    "metadata": {"updated": true},
                    "source": "updated-source",
                    "external_id": "ext-123",
                    "platform_key": "platform1",
                    "program_id": "program-v1:org+program+run"
                }

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to update licenses
            404 Not Found: If the specified license doesn't exist
            500 Internal Server Error: If an unexpected error occurs during license update

        Access Control:
            - Requires IsDMAdmin permission
            - Available only to DM administrators

        Notes:
            - Cannot update the platform or program associated with a license
            - A license history record is automatically created for each update
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProgramLicenseUpdateDetail'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ProgramLicenseUpdateDetail'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProgramLicenseUpdateDetail'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProgramLicenseUpdateDetail'
          '*/*':
            schema:
              $ref: '#/components/schemas/ProgramLicenseUpdateDetail'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramLicenseDetail'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - license does not exist
        '500':
          description: Internal server error
  /api/catalog/licenses/user/:
    get:
      operationId: catalog_licenses_user_retrieve
      description: Retrieve a paginated list of user licenses
      parameters:
        - in: query
          name: active
          schema:
            type: boolean
          description: Filter by active status
        - in: query
          name: external_id
          schema:
            type: string
            minLength: 1
          description: Filter by external identifier
        - in: query
          name: key
          schema:
            type: string
            minLength: 1
          description: Alternative filter by platform key
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Filter by license name (exact match)
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search license names (contains)
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: source
          schema:
            type: string
            minLength: 1
          description: Filter by license source
        - in: query
          name: verbose
          schema:
            type: boolean
            default: false
          description: Include detailed assignment data in the response
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedUserLicense'
          description: ''
        '400':
          description: Bad request - invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
  /api/catalog/licenses/user/assignment/:
    get:
      operationId: catalog_licenses_user_assignment_retrieve
      description: Retrieve a paginated list of user license assignments
      parameters:
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the user license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedUserLicenseAssignment'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
    post:
      operationId: catalog_licenses_user_assignment_create
      description: Create or update a user license assignment
      parameters:
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the user license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserLicenseAssignmentCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserLicenseAssignmentCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserLicenseAssignmentCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserLicenseAssignmentCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserLicenseAssignmentCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserLicenseAssignmentDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - license or user doesn't exist
        '500':
          description: Internal server error
    delete:
      operationId: catalog_licenses_user_assignment_destroy
      description: Remove a user license assignment
      parameters:
        - in: query
          name: assignment_id
          schema:
            type: integer
          description: The ID of the assignment to delete
          required: true
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the user license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Assignment successfully deleted
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - assignment doesn't exist
        '500':
          description: Internal server error
  /api/catalog/licenses/user/assignment/check/:
    get:
      operationId: catalog_licenses_user_assignment_check_retrieve
      description: Check if a user has an active user license assignment
      parameters:
        - in: query
          name: email
          schema:
            type: string
            format: email
            minLength: 1
          description: The email address to check for active license assignments
          required: true
      tags:
        - catalog
      responses:
        '200':
          description: Active license assignment exists for the email
        '400':
          description: Bad request - missing or invalid parameters
        '404':
          description: No active license assignment exists for the email
  /api/catalog/licenses/user/assignment/group/:
    get:
      operationId: catalog_licenses_user_assignment_group_retrieve
      description: Retrieve a paginated list of user license group assignments
      parameters:
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the user license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedUserLicenseGroupAssignment'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
    post:
      operationId: catalog_licenses_user_assignment_group_create
      description: Create or update a user license group assignment
      parameters:
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the user license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserLicenseGroupAssignmentCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserLicenseGroupAssignmentCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserLicenseGroupAssignmentCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserLicenseGroupAssignmentCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserLicenseGroupAssignmentCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserLicenseGroupAssignmentDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - license or group doesn't exist
        '500':
          description: Internal server error
    delete:
      operationId: catalog_licenses_user_assignment_group_destroy
      description: Remove a user license group assignment
      parameters:
        - in: query
          name: assignment_id
          schema:
            type: integer
          description: The ID of the assignment to delete
          required: true
        - in: query
          name: license_id
          schema:
            type: integer
          description: The ID of the user license
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the platform
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Assignment successfully deleted
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - assignment doesn't exist
        '500':
          description: Internal server error
  /api/catalog/licenses/user/create/:
    post:
      operationId: catalog_licenses_user_create_create
      description: Create a new user license
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserLicenseCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserLicenseCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserLicenseCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserLicenseCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserLicenseCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserLicenseDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
  /api/catalog/licenses/user/update/:
    post:
      operationId: catalog_licenses_user_update_create
      description: >-
        API View for updating existing user licenses.


        This endpoint allows administrators to update the properties of an
        existing user license.


        Methods:
            POST: Update an existing user license

        Request Body:
            A JSON object containing:
            - license_id (int, optional): The ID of the license to update (required if external_id not provided)
            - external_id (str, optional): External identifier of the license to update (required if license_id not provided)
            - name (str, optional): Updated display name for the license
            - count (int, optional): Updated number of seats purchased
            - started (datetime, optional): Updated date when license should begin
            - expired (datetime, optional): Updated date when license should expire
            - active (bool, optional): Updated active status
            - metadata (dict, optional): Updated additional license metadata
            - enrollment_config (dict, optional): Updated enrollment configuration
            - source (str, optional): Updated source identifier
            - change_type (str, optional): Type of change being made (default: "update")

        Returns:
            POST: A JSON response containing the updated license:
                {
                    "id": 123,
                    "created": "2023-06-15T14:30:00Z",
                    "started": "2023-06-15T14:30:00Z",
                    "expired": "2024-06-15T14:30:00Z",
                    "name": "Updated User License 2023",
                    "count": 150,
                    "active": true,
                    "metadata": {"updated": true},
                    "source": "updated-source",
                    "external_id": "ext-123",
                    "platform_key": "platform1"
                }

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to update licenses
            404 Not Found: If the specified license doesn't exist
            500 Internal Server Error: If an unexpected error occurs during license update

        Access Control:
            - Requires IsDMAdmin permission
            - Available only to DM administrators

        Notes:
            - Cannot update the platform associated with a license
            - A license history record is automatically created for each update
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserLicenseUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserLicenseUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserLicenseUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserLicenseUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserLicenseUpdate'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserLicenseDetail'
          description: ''
        '400':
          description: Bad request - missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found - license doesn't exist
        '500':
          description: Internal server error
  /api/catalog/metadata/choices/:
    get:
      operationId: catalog_metadata_choices_retrieve
      description: Query metadata choices based on field_key, scope, and org parameters.
      parameters:
        - in: query
          name: field_key
          schema:
            type: string
            minLength: 1
          description: The key of the field for which choices are being queried
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: The organization context for the metadata choices
        - in: query
          name: scope
          schema:
            type: string
            minLength: 1
          description: >-
            The scope within which to query the metadata choices (course,
            program, pathway, resource)
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/catalog/metadata/course/:
    get:
      operationId: catalog_metadata_course_retrieve
      description: Retrieve metadata for a course.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: The course ID to get metadata for
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
        '400':
          description: No response body
        '404':
          description: No response body
    post:
      operationId: catalog_metadata_course_create
      description: Update metadata for a course.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: The course ID to get metadata for
          required: true
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseMetadataUpdateRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseMetadataUpdateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseMetadataUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseMetadataUpdateRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseMetadataUpdateRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
        '400':
          description: No response body
        '404':
          description: No response body
  /api/catalog/metadata/course-public/:
    get:
      operationId: catalog_metadata_course_public_retrieve
      description: Retrieve public metadata for a course.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: The course ID to get metadata for
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
        '400':
          description: No response body
        '404':
          description: No response body
  /api/catalog/metadata/course-public/{field}/:
    get:
      operationId: catalog_metadata_course_public_retrieve_2
      description: Retrieve public metadata for a course.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: The course ID to get metadata for
          required: true
        - in: path
          name: field
          schema:
            type: string
            pattern: ^\w+$
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
        '400':
          description: No response body
        '404':
          description: No response body
  /api/catalog/metadata/course-search/:
    post:
      operationId: catalog_metadata_course_search_create
      description: Search for courses matching specified metadata filters.
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseMetadataSearchRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseMetadataSearchRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseMetadataSearchRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseMetadataSearchRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseMetadataSearchRequest'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: Unspecified response body
          description: ''
        '400':
          description: No response body
        '500':
          description: No response body
  /api/catalog/metadata/course/{field}/:
    get:
      operationId: catalog_metadata_course_retrieve_2
      description: Retrieve metadata for a course.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: The course ID to get metadata for
          required: true
        - in: path
          name: field
          schema:
            type: string
            pattern: ^\w+$
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
        '400':
          description: No response body
        '404':
          description: No response body
    post:
      operationId: catalog_metadata_course_create_2
      description: Update metadata for a course.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: The course ID to get metadata for
          required: true
        - in: path
          name: field
          schema:
            type: string
            pattern: ^\w+$
          required: true
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseMetadataUpdateRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseMetadataUpdateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseMetadataUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseMetadataUpdateRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseMetadataUpdateRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
        '400':
          description: No response body
        '404':
          description: No response body
  /api/catalog/metadata/program/:
    get:
      operationId: catalog_metadata_program_retrieve
      description: Retrieve metadata for a specified program
      parameters:
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: The organization associated with the program
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key identifier (alternative to org)
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the program
          required: true
        - in: query
          name: program_key
          schema:
            type: string
            minLength: 1
          description: Program key (alternative to program_id + org)
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramMetadataResponse'
          description: ''
        '400':
          description: Missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '404':
          description: Program not found
    post:
      operationId: catalog_metadata_program_create
      description: Update metadata for a specified program
      parameters:
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: The organization associated with the program
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key identifier (alternative to org)
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the program
          required: true
        - in: query
          name: program_key
          schema:
            type: string
            minLength: 1
          description: Program key (alternative to program_id + org)
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProgramMetadataRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ProgramMetadataRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProgramMetadataRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProgramMetadataRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/ProgramMetadataRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramMetadataResponse'
          description: ''
        '400':
          description: Missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '404':
          description: Program not found
  /api/catalog/metadata/program-public/:
    get:
      operationId: catalog_metadata_program_public_retrieve
      description: Retrieve public metadata for a specified program
      parameters:
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: The organization associated with the program
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key identifier (alternative to org)
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the program
          required: true
        - in: query
          name: program_key
          schema:
            type: string
            minLength: 1
          description: Program key (alternative to program_id + org)
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramMetadataResponse'
          description: ''
        '400':
          description: Missing or invalid parameters
        '404':
          description: Program not found or no public metadata available
  /api/catalog/metadata/program-public/{field}/:
    get:
      operationId: catalog_metadata_program_public_retrieve_2
      description: Retrieve public metadata for a specified program
      parameters:
        - in: path
          name: field
          schema:
            type: string
            pattern: ^\w+$
          required: true
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: The organization associated with the program
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key identifier (alternative to org)
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the program
          required: true
        - in: query
          name: program_key
          schema:
            type: string
            minLength: 1
          description: Program key (alternative to program_id + org)
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramMetadataResponse'
          description: ''
        '400':
          description: Missing or invalid parameters
        '404':
          description: Program not found or no public metadata available
  /api/catalog/metadata/program/{field}/:
    get:
      operationId: catalog_metadata_program_retrieve_2
      description: Retrieve metadata for a specified program
      parameters:
        - in: path
          name: field
          schema:
            type: string
            pattern: ^\w+$
          required: true
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: The organization associated with the program
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key identifier (alternative to org)
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the program
          required: true
        - in: query
          name: program_key
          schema:
            type: string
            minLength: 1
          description: Program key (alternative to program_id + org)
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramMetadataResponse'
          description: ''
        '400':
          description: Missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '404':
          description: Program not found
    post:
      operationId: catalog_metadata_program_create_2
      description: Update metadata for a specified program
      parameters:
        - in: path
          name: field
          schema:
            type: string
            pattern: ^\w+$
          required: true
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: The organization associated with the program
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key identifier (alternative to org)
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the program
          required: true
        - in: query
          name: program_key
          schema:
            type: string
            minLength: 1
          description: Program key (alternative to program_id + org)
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProgramMetadataRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ProgramMetadataRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProgramMetadataRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProgramMetadataRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/ProgramMetadataRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramMetadataResponse'
          description: ''
        '400':
          description: Missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '404':
          description: Program not found
  /api/catalog/milestones/completions/course/catalog/:
    get:
      operationId: catalog_milestones_completions_course_catalog_retrieve
      description: Retrieve catalog-compatible completion info for user
      parameters:
        - in: query
          name: field_key
          schema:
            type: string
            minLength: 1
          description: Specific field to include in the response
        - in: query
          name: user_id
          schema:
            type: integer
          description: The user identifier
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '400':
          description: Missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '404':
          description: User not found or no completions found
  /api/catalog/milestones/completions/course/manage/:
    get:
      operationId: catalog_milestones_completions_course_manage_retrieve
      description: Retrieve completion information for a specific user and course
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: The course identifier (e.g., 'course-v1:org+code+run')
          required: true
        - in: query
          name: user_id
          schema:
            type: integer
          description: The user identifier
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '400':
          description: Missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '404':
          description: User, course, or completion record not found
    post:
      operationId: catalog_milestones_completions_course_manage_create
      description: Create or update completion information for a specific user and course
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: The course identifier (e.g., 'course-v1:org+code+run')
          required: true
        - in: query
          name: user_id
          schema:
            type: integer
          description: The user identifier
          required: true
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseCompletion'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseCompletion'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseCompletion'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseCompletion'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseCompletion'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '201':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '400':
          description: Missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '404':
          description: User or course not found
        '500':
          description: Server error
  /api/catalog/milestones/completions/pathway/query/:
    get:
      operationId: catalog_milestones_completions_pathway_query_retrieve
      description: Retrieve pathway completion information
      parameters:
        - in: query
          name: pathway_uuid
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the pathway
          required: true
        - in: query
          name: user_id
          schema:
            type: integer
          description: The user identifier (either user_id or username required)
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: The username (either user_id or username required)
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PathwayCompletionResponse'
          description: ''
        '400':
          description: Missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '404':
          description: Pathway, user, or completion information not found
  /api/catalog/milestones/completions/program/query/:
    get:
      operationId: catalog_milestones_completions_program_query_retrieve
      description: Retrieve program completion information
      parameters:
        - in: query
          name: program_key
          schema:
            type: string
            minLength: 1
          description: The unique identifier for the program
          required: true
        - in: query
          name: user_id
          schema:
            type: integer
          description: The user identifier (either user_id or username required)
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: The username (either user_id or username required)
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramCompletionResponse'
          description: ''
        '400':
          description: Missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '404':
          description: Program, user, or completion information not found
  /api/catalog/milestones/completions/resource/manage/:
    get:
      operationId: catalog_milestones_completions_resource_manage_retrieve
      description: Retrieve completion info for resource/user
      parameters:
        - in: query
          name: resource_id
          schema:
            type: integer
          description: The unique identifier for the resource
          required: true
        - in: query
          name: user_id
          schema:
            type: integer
          description: The ID of the user
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceCompletion'
          description: ''
        '400':
          description: Missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '404':
          description: Resource, user, or completion record not found
    post:
      operationId: catalog_milestones_completions_resource_manage_create
      description: Create or update completion information for a specific resource and user
      parameters:
        - in: query
          name: resource_id
          schema:
            type: integer
          description: The unique identifier for the resource
          required: true
        - in: query
          name: user_id
          schema:
            type: integer
          description: The ID of the user
          required: true
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceCompletionRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ResourceCompletionRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ResourceCompletionRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ResourceCompletionRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/ResourceCompletionRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceCompletion'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceCompletion'
          description: ''
        '400':
          description: Missing or invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '404':
          description: Resource or user not found
        '500':
          description: Server error during completion creation/update
  /api/catalog/milestones/skill_points/block/:
    get:
      operationId: catalog_milestones_skill_points_block_retrieve
      description: Retrieve skill point information for a specific block
      parameters:
        - in: query
          name: block_id
          schema:
            type: string
            minLength: 1
          description: ID of the block to retrieve skill point information for
          required: true
        - in: query
          name: get_obj
          schema:
            type: boolean
            default: false
          description: If True, returns skill objects instead of skill names as keys
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '404':
          description: Block not found
    post:
      operationId: catalog_milestones_skill_points_block_create
      description: Update skill point information for a specific block
      parameters:
        - in: query
          name: block_id
          schema:
            type: string
            minLength: 1
          description: ID of the block to retrieve skill point information for
          required: true
        - in: query
          name: get_obj
          schema:
            type: boolean
            default: false
          description: If True, returns skill objects instead of skill names as keys
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BlockSkillPointInfoRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/BlockSkillPointInfoRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BlockSkillPointInfoRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BlockSkillPointInfoRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/BlockSkillPointInfoRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Successfully updated skill points
        '400':
          description: Invalid request data
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '404':
          description: Block not found
        '500':
          description: Server error
  /api/catalog/milestones/skill_points/course/:
    get:
      operationId: catalog_milestones_skill_points_course_retrieve
      description: Retrieve skill point information for a specific course
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: ID of the course to retrieve skill point information for
          required: true
        - in: query
          name: get_obj
          schema:
            type: boolean
            default: false
          description: If True, returns skill objects instead of skill names as keys
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '400':
          description: Course not found
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '404':
          description: No skill points found
    post:
      operationId: catalog_milestones_skill_points_course_create
      description: Update skill point information for a specific course
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: ID of the course to retrieve skill point information for
          required: true
        - in: query
          name: get_obj
          schema:
            type: boolean
            default: false
          description: If True, returns skill objects instead of skill names as keys
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseSkillPointInfoRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseSkillPointInfoRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseSkillPointInfoRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseSkillPointInfoRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseSkillPointInfoRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Successfully updated skill points
        '400':
          description: Course not found or invalid request data
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '500':
          description: Server error
  /api/catalog/milestones/skill_points/platform/:
    get:
      operationId: catalog_milestones_skill_points_platform_retrieve
      description: Retrieve paginated list of platform skill points
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
          description: If True, filters results by department user permissions
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key identifier
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: Platform organization identifier
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search query for filtering skill points by user or skill name
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: 'Sort field for results. Default: ''-id'''
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformSkillPointResponse'
          description: ''
        '400':
          description: Missing platform parameters or retrieval failed
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
    post:
      operationId: catalog_milestones_skill_points_platform_create
      description: Update platform skill points for a user
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
          description: If True, filters results by department user permissions
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key identifier
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: Platform organization identifier
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search query for filtering skill points by user or skill name
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: 'Sort field for results. Default: ''-id'''
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformSkillPointRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformSkillPointRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformSkillPointRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformSkillPointRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformSkillPointRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Successfully updated skill points
        '400':
          description: Invalid request data
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
    delete:
      operationId: catalog_milestones_skill_points_platform_destroy
      description: Delete a platform skill point entry
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
          description: If True, filters results by department user permissions
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key identifier
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: Platform organization identifier
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search query for filtering skill points by user or skill name
        - in: query
          name: skill_point_id
          schema:
            type: integer
          description: ID of the skill point to delete
          required: true
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: 'Sort field for results. Default: ''-id'''
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Successfully deleted skill point
        '400':
          description: Invalid request or deletion failed
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
  /api/catalog/milestones/skill_points/platform/bulk/:
    post:
      operationId: catalog_milestones_skill_points_platform_bulk_create
      description: Bulk create/update platform skill points
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformSkillPointBulkRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformSkillPointBulkRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformSkillPointBulkRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformSkillPointBulkRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformSkillPointBulkRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformSkillPointBulkResponse'
          description: ''
        '400':
          description: Invalid request data
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '500':
          description: Server error
  /api/catalog/milestones/skill_points/platform/group/:
    post:
      operationId: catalog_milestones_skill_points_platform_group_create
      description: Update skill points for all users in a group
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformSkillPointGroupRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformSkillPointGroupRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformSkillPointGroupRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformSkillPointGroupRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformSkillPointGroupRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Successfully updated group skill points
        '400':
          description: Invalid request data
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
  /api/catalog/milestones/skill_points/user/:
    get:
      operationId: catalog_milestones_skill_points_user_retrieve
      description: Retrieve skill point information for a specific user
      parameters:
        - in: query
          name: user_id
          schema:
            type: integer
          description: ID of the user to retrieve skill point information for
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username to retrieve skill point information for
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '404':
          description: User not found
  /api/catalog/pathways/:
    get:
      operationId: catalog_pathways_list
      description: Retrieve pathways matching query. Limited parameters.
      parameters:
        - in: query
          name: item_id
          schema:
            type: string
            minLength: 1
          description: Item ID associated with the pathway
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Pathway name
        - in: query
          name: pathway_id
          schema:
            type: string
            minLength: 1
          description: Pathway ID
        - in: query
          name: pathway_uuid
          schema:
            type: string
            minLength: 1
          description: Pathway UUID
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Pathway slug (case-insensitive)
        - in: query
          name: user_id
          schema:
            type: integer
          description: User ID of the pathway owner
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username of the pathway owner
        - in: query
          name: visible
          schema:
            type: boolean
          description: Whether the pathway is visible
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Pathway'
          description: ''
    post:
      operationId: catalog_pathways_create
      description: Add or update a pathway.
      parameters:
        - in: query
          name: item_id
          schema:
            type: string
            minLength: 1
          description: Item ID associated with the pathway
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Pathway name
        - in: query
          name: pathway_id
          schema:
            type: string
            minLength: 1
          description: Pathway ID
        - in: query
          name: pathway_uuid
          schema:
            type: string
            minLength: 1
          description: Pathway UUID
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Pathway slug (case-insensitive)
        - in: query
          name: user_id
          schema:
            type: integer
          description: User ID of the pathway owner
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username of the pathway owner
        - in: query
          name: visible
          schema:
            type: boolean
          description: Whether the pathway is visible
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PathwayCreateUpdateRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PathwayCreateUpdateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PathwayCreateUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PathwayCreateUpdateRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PathwayCreateUpdateRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Pathway'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Pathway'
          description: ''
        '400':
          description: No response body
    delete:
      operationId: catalog_pathways_destroy
      description: Remove a pathway from the database.
      parameters:
        - in: query
          name: item_id
          schema:
            type: string
            minLength: 1
          description: Item ID associated with the pathway
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Pathway name
        - in: query
          name: pathway_id
          schema:
            type: string
            minLength: 1
          description: Pathway ID to delete
          required: true
        - in: query
          name: pathway_uuid
          schema:
            type: string
            minLength: 1
          description: Pathway UUID
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Pathway slug (case-insensitive)
        - in: query
          name: user_id
          schema:
            type: integer
          description: User ID of the pathway owner
          required: true
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username of the pathway owner
        - in: query
          name: visible
          schema:
            type: boolean
          description: Whether the pathway is visible
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PathwayDeleteResponse'
          description: ''
        '400':
          description: No response body
  /api/catalog/programs/:
    get:
      operationId: catalog_programs_list
      description: >-
        Retrieve programs matching query parameters. Limited parameters include
        program_id, name, slug, enabled, and org.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: Course ID contained in the program
        - in: query
          name: enabled
          schema:
            type: boolean
          description: Whether the program is enabled
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Program name
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Organization of the program
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: Program ID
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Program slug (case-insensitive)
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Program'
          description: ''
    post:
      operationId: catalog_programs_create
      description: >-
        Add or update a program. Accepts a list of courses and updates or
        creates a program.
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProgramCreateUpdateRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ProgramCreateUpdateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProgramCreateUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProgramCreateUpdateRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/ProgramCreateUpdateRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Program'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Program'
          description: ''
        '400':
          description: No response body
    delete:
      operationId: catalog_programs_destroy
      description: >-
        Remove a program from the database. Requires program_id and org as
        parameters.
      parameters:
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Organization of the program
          required: true
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: Program ID to delete
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramDeleteResponse'
          description: ''
        '400':
          description: No response body
  /api/catalog/recommendation/courses/:
    get:
      operationId: catalog_recommendation_courses_retrieve
      description: >-
        GET

        Get a 'next' course


        This method retrieves the next recommended course for a user based on
        the provided parameters.

        It expects the following parameters in the request query:

        - user_id: The ID of the user for whom the next course is being
        recommended.

        - course_id: The ID of the current course.

        - org: The organization associated with the course.


        Returns:

        - A serialized representation of the next course if found, with a status
        code of 200.

        - A status code of 400 if the course_id is not provided.

        - A status code of 200 with a None response if no next course is found.


        Error Conditions:

        - Returns a 400 status code if the course_id is missing from the request
        parameters.


        Side Effects:

        - None
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: Current course ID
          required: true
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Organization to filter recommendations
        - in: query
          name: user_id
          schema:
            type: string
            minLength: 1
          description: User ID for personalized recommendations
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Course'
          description: ''
  /api/catalog/resources/:
    get:
      operationId: catalog_resources_list
      description: Retrieve resources matching query. Limited parameters.
      parameters:
        - in: query
          name: id
          schema:
            type: integer
          description: Resource ID
        - in: query
          name: item_id
          schema:
            type: string
            minLength: 1
          description: Item ID associated with the resource
        - in: query
          name: key
          schema:
            type: string
            minLength: 1
          description: Platform key
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Resource name
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Platform organization
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key (alternative to key)
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: Platform organization (alternative to org)
        - in: query
          name: resource_type
          schema:
            type: string
            minLength: 1
          description: Type of resource
        - in: query
          name: user_id
          schema:
            type: integer
          description: User ID who owns the resource
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username who owns the resource
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Resource'
          description: ''
    post:
      operationId: catalog_resources_create
      description: Create or update a resource. For updates, include the resource ID.
      summary: Create or update a resource with optional image upload
      parameters:
        - in: query
          name: id
          schema:
            type: integer
          description: Resource ID
        - in: query
          name: item_id
          schema:
            type: string
            minLength: 1
          description: Item ID associated with the resource
        - in: query
          name: key
          schema:
            type: string
            minLength: 1
          description: Platform key
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Resource name
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Platform organization
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key (alternative to key)
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: Platform organization (alternative to org)
        - in: query
          name: resource_type
          schema:
            type: string
            minLength: 1
          description: Type of resource
        - in: query
          name: user_id
          schema:
            type: integer
          description: User ID who owns the resource
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username who owns the resource
      tags:
        - catalog
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ResourceCreateUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ResourceCreateUpdate'
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceCreateUpdate'
            examples:
              CreateResourceExample:
                value:
                  name: Sample Video
                  resource_type: video
                  url: https://example.com/video
                  user_id: 1
                  description: A detailed description of the resource
                  skills:
                    - Python
                    - Django
                  data:
                    duration: '10:00'
                    author: John Doe
                summary: Creating a new resource
              UpdateResourceExample:
                value:
                  id: 123
                  user_id: 1
                  name: Updated Video Title
                  description: Updated description of the resource
                  skills:
                    - Python
                    - Django
                    - REST APIs
                summary: Updating an existing resource
              UpdateResourceImageExample:
                value:
                  id: 123
                  user_id: 1
                  image: file_upload
                summary: Updating a resource's image
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Resource'
              examples:
                CreateResourceExample:
                  value:
                    name: Sample Video
                    resource_type: video
                    url: https://example.com/video
                    user_id: 1
                    description: A detailed description of the resource
                    skills:
                      - Python
                      - Django
                    data:
                      duration: '10:00'
                      author: John Doe
                  summary: Creating a new resource
                UpdateResourceExample:
                  value:
                    id: 123
                    user_id: 1
                    name: Updated Video Title
                    description: Updated description of the resource
                    skills:
                      - Python
                      - Django
                      - REST APIs
                  summary: Updating an existing resource
                UpdateResourceImageExample:
                  value:
                    id: 123
                    user_id: 1
                    image: file_upload
                  summary: Updating a resource's image
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
    delete:
      operationId: catalog_resources_destroy
      description: Remove a resource from the database.
      parameters:
        - in: query
          name: id
          schema:
            type: integer
          description: Resource ID to delete
          required: true
        - in: query
          name: item_id
          schema:
            type: string
            minLength: 1
          description: Item ID associated with the resource
        - in: query
          name: key
          schema:
            type: string
            minLength: 1
          description: Platform key
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Resource name
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Platform organization
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: Platform organization (alternative to org)
        - in: query
          name: resource_type
          schema:
            type: string
            minLength: 1
          description: Type of resource
        - in: query
          name: user_id
          schema:
            type: integer
          description: User ID who owns the resource
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username who owns the resource
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceDeleteResponse'
          description: ''
  /api/catalog/reviews/course/:
    get:
      operationId: catalog_reviews_course_retrieve
      description: Retrieve a paginated list of course reviews with filtering options
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: Filter reviews by course ID
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Alias for platform_org
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Filter reviews by platform key
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: Filter reviews by platform organization
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: 'Field to sort results by (default: ''-id'')'
        - in: query
          name: user_id
          schema:
            type: string
            minLength: 1
          description: Filter reviews by user ID
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseReviewPaginatedResponse'
          description: ''
        '400':
          description: Invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '500':
          description: Internal server error
  /api/catalog/reviews/course/info/:
    get:
      operationId: catalog_reviews_course_info_retrieve
      description: Retrieve aggregate review information for a course.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: The course ID to get review information for
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseReviewInfoResponse'
          description: ''
        '400':
          description: No response body
        '404':
          description: No response body
  /api/catalog/reviews/course/update/:
    post:
      operationId: catalog_reviews_course_update_create
      description: Create or update a course review
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseReviewRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseReviewRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseReviewRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseReviewRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseReviewRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseReviewResponse'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseReviewResponse'
          description: ''
        '400':
          description: Invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '500':
          description: Review could not be saved
    delete:
      operationId: catalog_reviews_course_update_destroy
      description: Delete a course review
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: The course ID of the review to delete
          required: true
        - in: query
          name: user_id
          schema:
            type: integer
          description: The user ID of the reviewer (alternative to username)
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: The username of the reviewer
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Review successfully deleted
        '400':
          description: Invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '500':
          description: Review could not be deleted
  /api/catalog/reviews/program/:
    get:
      operationId: catalog_reviews_program_retrieve
      description: Retrieve a paginated list of program reviews with filtering options
      parameters:
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: Alias for platform_org
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Filter reviews by platform key
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: Filter reviews by platform organization
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: Filter reviews by program ID
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: 'Field to sort results by (default: ''-id'')'
        - in: query
          name: user_id
          schema:
            type: string
            minLength: 1
          description: Filter reviews by user ID
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramReviewPaginatedResponse'
          description: ''
        '400':
          description: Invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '500':
          description: Internal server error
  /api/catalog/reviews/program/info/:
    get:
      operationId: catalog_reviews_program_info_retrieve
      description: Retrieve aggregate review information for a program.
      parameters:
        - in: query
          name: program_key
          schema:
            type: string
            minLength: 1
          description: The program key to get review information for
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramReviewInfoResponse'
          description: ''
        '400':
          description: No response body
        '404':
          description: No response body
  /api/catalog/reviews/program/update/:
    post:
      operationId: catalog_reviews_program_update_create
      description: Create or update a program review
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProgramReviewRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ProgramReviewRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProgramReviewRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProgramReviewRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/ProgramReviewRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramReview'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramReview'
          description: ''
        '400':
          description: Invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '500':
          description: Review could not be saved
    delete:
      operationId: catalog_reviews_program_update_destroy
      description: Delete a program review
      parameters:
        - in: query
          name: program_key
          schema:
            type: string
            minLength: 1
          description: The program key of the review to delete
          required: true
        - in: query
          name: user_id
          schema:
            type: integer
          description: The user ID of the reviewer (alternative to username)
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: The username of the reviewer
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Review successfully deleted
        '400':
          description: Invalid parameters
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
        '500':
          description: Review could not be deleted
  /api/catalog/roles/:
    get:
      operationId: catalog_roles_retrieve
      description: >-
        Retrieve roles matching query parameters. Supports filtering by name,
        id, and slug.
      parameters:
        - in: query
          name: id
          schema:
            type: integer
          description: Role ID
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Role name
        - in: query
          name: name__iexact
          schema:
            type: string
            minLength: 1
          description: Exact match for role name (case insensitive)
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Role slug
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Role'
          description: ''
    post:
      operationId: catalog_roles_create
      description: Add a new role or update an existing role based on provided data.
      parameters:
        - in: query
          name: id
          schema:
            type: integer
          description: Role ID
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Role name
        - in: query
          name: name__iexact
          schema:
            type: string
            minLength: 1
          description: Exact match for role name (case insensitive)
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Role slug
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleCreateUpdateRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/RoleCreateUpdateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RoleCreateUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RoleCreateUpdateRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/RoleCreateUpdateRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Role'
          description: ''
  /api/catalog/roles/desired/:
    get:
      operationId: catalog_roles_desired_retrieve
      description: Retrieve desired roles for a user.
      parameters:
        - in: query
          name: user_id
          schema:
            type: integer
          description: User ID
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DesiredRole'
          description: ''
        '400':
          description: No response body
    post:
      operationId: catalog_roles_desired_create
      description: Add or update desired roles for a user.
      parameters:
        - in: query
          name: user_id
          schema:
            type: integer
          description: User ID
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DesiredRoleCreateUpdateRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/DesiredRoleCreateUpdateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DesiredRoleCreateUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DesiredRoleCreateUpdateRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/DesiredRoleCreateUpdateRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DesiredRole'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DesiredRole'
          description: ''
        '400':
          description: No response body
  /api/catalog/roles/public/:
    post:
      operationId: catalog_roles_public_create
      description: Add or update a role through the public API (when enabled).
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleCreateUpdateRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/RoleCreateUpdateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RoleCreateUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RoleCreateUpdateRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/RoleCreateUpdateRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Role'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Role'
          description: ''
        '404':
          description: No response body
  /api/catalog/roles/reported/:
    get:
      operationId: catalog_roles_reported_retrieve
      description: Retrieve reported roles for a user.
      parameters:
        - in: query
          name: user_id
          schema:
            type: integer
          description: User ID
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportedRole'
          description: ''
        '400':
          description: No response body
    post:
      operationId: catalog_roles_reported_create
      description: Add or update reported roles for a user.
      parameters:
        - in: query
          name: user_id
          schema:
            type: integer
          description: User ID
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportedRoleCreateUpdateRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ReportedRoleCreateUpdateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ReportedRoleCreateUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ReportedRoleCreateUpdateRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/ReportedRoleCreateUpdateRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportedRole'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportedRole'
          description: ''
        '400':
          description: No response body
  /api/catalog/search/programs/:
    post:
      operationId: catalog_search_programs_create
      description: >-
        POST

        Retrieve programs matching query.


        Params:

        query: The search term used to filter programs.

        org: The organization to which the programs belong.


        Returns:

        A JSON response containing a list of programs that match the search
        criteria.


        Error Conditions:

        - If the request data is malformed or missing required fields, a 400 Bad
        Request may be returned.

        - If there is an issue with the database query, a 500 Internal Server
        Error may be returned.


        Side Effects:

        - None


        Special Return Codes:

        - A 200 status code indicates successful retrieval of programs matching
        the query.
      parameters:
        - in: query
          name: org
          schema:
            type: string
            minLength: 1
          description: The organization to which the programs belong
        - in: query
          name: query
          schema:
            type: string
            default: ''
            minLength: 1
          description: The search term used to filter programs
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProgramSearch'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ProgramSearch'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProgramSearch'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProgramSearch'
          '*/*':
            schema:
              $ref: '#/components/schemas/ProgramSearch'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramSearch'
          description: ''
  /api/catalog/skills/:
    get:
      operationId: catalog_skills_retrieve
      description: Retrieve skills matching query. Limited parameters.
      parameters:
        - in: query
          name: id
          schema:
            type: integer
          description: Skill ID
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Skill name
        - in: query
          name: name__iexact
          schema:
            type: string
            minLength: 1
          description: Exact match for skill name (case insensitive)
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Skill slug
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedSkill'
          description: ''
    post:
      operationId: catalog_skills_create
      description: Add or update a skill.
      parameters:
        - in: query
          name: id
          schema:
            type: integer
          description: Skill ID
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Skill name
        - in: query
          name: name__iexact
          schema:
            type: string
            minLength: 1
          description: Exact match for skill name (case insensitive)
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key
        - in: query
          name: slug
          schema:
            type: string
            minLength: 1
          description: Skill slug
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaginatedSkill'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PaginatedSkill'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PaginatedSkill'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PaginatedSkill'
          '*/*':
            schema:
              $ref: '#/components/schemas/PaginatedSkill'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedSkill'
          description: ''
  /api/catalog/skills/desired/:
    get:
      operationId: catalog_skills_desired_retrieve
      description: Retrieve desired skills for a user.
      parameters:
        - in: query
          name: user_id
          schema:
            type: integer
          description: User ID
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DesiredSkill'
          description: ''
    post:
      operationId: catalog_skills_desired_create
      description: Add or update desired skills for a user.
      parameters:
        - in: query
          name: user_id
          schema:
            type: integer
          description: User ID
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DesiredSkillCreateUpdateRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/DesiredSkillCreateUpdateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DesiredSkillCreateUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DesiredSkillCreateUpdateRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/DesiredSkillCreateUpdateRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DesiredSkill'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DesiredSkill'
          description: ''
  /api/catalog/skills/public/:
    post:
      operationId: catalog_skills_public_create
      description: Add or update a skill.
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SkillCreateUpdateRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SkillCreateUpdateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SkillCreateUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SkillCreateUpdateRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/SkillCreateUpdateRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Skill'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Skill'
          description: ''
  /api/catalog/skills/reported/:
    get:
      operationId: catalog_skills_reported_retrieve
      description: Retrieve reported skills for a user.
      parameters:
        - in: query
          name: user_id
          schema:
            type: integer
          description: User ID
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportedSkill'
          description: ''
    post:
      operationId: catalog_skills_reported_create
      description: Add or update reported skills for a user.
      parameters:
        - in: query
          name: user_id
          schema:
            type: integer
          description: User ID
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportedSkillCreateUpdateRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ReportedSkillCreateUpdateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ReportedSkillCreateUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ReportedSkillCreateUpdateRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/ReportedSkillCreateUpdateRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportedSkill'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportedSkill'
          description: ''
  /api/catalog/suggestions/course/manage/:
    get:
      operationId: catalog_suggestions_course_manage_retrieve
      description: >-
        API View for managing course suggestions.


        This endpoint allows administrators to view, create, update, and delete
        course suggestions

        for users within a platform.


        Query Parameters (GET):
            platform_key (str, required): The platform to retrieve suggestions for
            platform_org (str, optional): The organization identifier for the platform
            query (str, optional): Search term to filter suggestions
            sort (str, optional): Field to sort results by (default: '-id')
            department_mode (bool, optional): Filter suggestions by department admin access
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of course suggestions for a platform
            POST: Create or update a course suggestion
            DELETE: Remove a course suggestion

        Request Body (POST):
            A JSON object containing:
            - platform_key (str, required): The platform for the suggestion
            - course_id (str, required): The course ID to suggest
            - user_id (str/int, required): The user to suggest the course to
            - accepted (bool, optional): Whether the suggestion is accepted
            - visible (bool, optional): Whether the suggestion is visible
            - metadata (dict, optional): Additional suggestion metadata

        Query Parameters (DELETE):
            suggestion_id (int, required): The ID of the suggestion to delete

        Returns:
            GET: A paginated JSON response containing course suggestions:
                {
                    "count": 10,
                    "next": "https://example.com/api/catalog/suggestions/course/manage/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "user_id": 456,
                            "username": "student1",
                            "name": "Student Name",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "course_id": "course-v1:org+course+run",
                            "course_name": "Introduction to Programming"
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created/updated suggestion:
                {
                    "id": 123,
                    "user_id": 456,
                    "username": "student1",
                    "name": "Student Name",
                    "platform_key": "platform1",
                    "accepted": false,
                    "visible": true,
                    "created": "2023-06-15T14:30:00Z",
                    "modified": "2023-06-15T14:30:00Z",
                    "metadata": {},
                    "course_id": "course-v1:org+course+run",
                    "course_name": "Introduction to Programming"
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if suggestion operations fail
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage suggestions
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can manage suggestions for their platform
            - Department admins can manage suggestions for their departments
            - DM admins can manage all suggestions
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
          description: Filter suggestions by department admin access
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to retrieve suggestions for
          required: true
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCourseSuggestion'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
    post:
      operationId: catalog_suggestions_course_manage_create
      description: >-
        API View for managing course suggestions.


        This endpoint allows administrators to view, create, update, and delete
        course suggestions

        for users within a platform.


        Query Parameters (GET):
            platform_key (str, required): The platform to retrieve suggestions for
            platform_org (str, optional): The organization identifier for the platform
            query (str, optional): Search term to filter suggestions
            sort (str, optional): Field to sort results by (default: '-id')
            department_mode (bool, optional): Filter suggestions by department admin access
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of course suggestions for a platform
            POST: Create or update a course suggestion
            DELETE: Remove a course suggestion

        Request Body (POST):
            A JSON object containing:
            - platform_key (str, required): The platform for the suggestion
            - course_id (str, required): The course ID to suggest
            - user_id (str/int, required): The user to suggest the course to
            - accepted (bool, optional): Whether the suggestion is accepted
            - visible (bool, optional): Whether the suggestion is visible
            - metadata (dict, optional): Additional suggestion metadata

        Query Parameters (DELETE):
            suggestion_id (int, required): The ID of the suggestion to delete

        Returns:
            GET: A paginated JSON response containing course suggestions:
                {
                    "count": 10,
                    "next": "https://example.com/api/catalog/suggestions/course/manage/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "user_id": 456,
                            "username": "student1",
                            "name": "Student Name",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "course_id": "course-v1:org+course+run",
                            "course_name": "Introduction to Programming"
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created/updated suggestion:
                {
                    "id": 123,
                    "user_id": 456,
                    "username": "student1",
                    "name": "Student Name",
                    "platform_key": "platform1",
                    "accepted": false,
                    "visible": true,
                    "created": "2023-06-15T14:30:00Z",
                    "modified": "2023-06-15T14:30:00Z",
                    "metadata": {},
                    "course_id": "course-v1:org+course+run",
                    "course_name": "Introduction to Programming"
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if suggestion operations fail
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage suggestions
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can manage suggestions for their platform
            - Department admins can manage suggestions for their departments
            - DM admins can manage all suggestions
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
          description: Filter suggestions by department admin access
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to retrieve suggestions for
          required: true
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseSuggestionCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseSuggestionCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseSuggestionCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseSuggestionCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseSuggestionCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseSuggestionDetail'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
    delete:
      operationId: catalog_suggestions_course_manage_destroy
      description: Delete single suggestion
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
            default: false
          description: Flag to ensure department admins can call the API
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to retrieve suggestions for
          required: true
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: suggestion_id
          schema:
            type: integer
          description: The ID of the suggestion to delete
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Success - suggestion deleted
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - suggestion does not exist
        '500':
          description: Internal server error
  /api/catalog/suggestions/course/manage/bulk/:
    post:
      operationId: catalog_suggestions_course_manage_bulk_create
      description: >-
        API View for bulk management of course suggestions.


        This endpoint allows administrators to create multiple course
        suggestions at once.


        Methods:
            POST: Create multiple course suggestions in bulk

        Request Body:
            A JSON object containing:
            - platform_key (str, required): The platform for the suggestions
            - suggestion_data (list, required): List of suggestion objects, each containing:
              - course_id (str, required): The course ID to suggest
              - user_id (str/int, required): The user to suggest the course to
              - accepted (bool, optional): Whether the suggestion is accepted
              - visible (bool, optional): Whether the suggestion is visible
              - metadata (dict, optional): Additional suggestion metadata

        Returns:
            POST: A JSON response containing the operation results:
                {
                    "successes": 15,
                    "error_codes": []
                }

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage suggestions
            500 Internal Server Error: If an unexpected error occurs during bulk creation

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can create suggestions for their platform
            - Department admins can create suggestions for their departments
            - DM admins can create suggestions for any platform
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseSuggestionBulkCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseSuggestionBulkCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseSuggestionBulkCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseSuggestionBulkCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseSuggestionBulkCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkSuggestionResponse'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
  /api/catalog/suggestions/course/manage/group/:
    get:
      operationId: catalog_suggestions_course_manage_group_retrieve
      description: >-
        API View for managing course group suggestions.


        This endpoint allows administrators to view, create, and delete course
        suggestions

        for groups of users within a platform.


        Query Parameters (GET):
            platform_key (str, required): The platform to retrieve group suggestions for
            platform_org (str, optional): The organization identifier for the platform
            query (str, optional): Search term to filter group suggestions
            sort (str, optional): Field to sort results by (default: 'id')
            department_mode (bool, optional): Filter suggestions by department admin access
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of course group suggestions for a platform
            POST: Create or update a course group suggestion
            DELETE: Remove a course group suggestion

        Request Body (POST):
            A JSON object containing:
            - platform_key (str, required): The platform for the group suggestion
            - course_id (str, required): The course ID to suggest
            - group_id (str/int, required): The group to suggest the course to
            - accepted (bool, optional): Whether the suggestion is accepted
            - visible (bool, optional): Whether the suggestion is visible
            - metadata (dict, optional): Additional suggestion metadata

        Query Parameters (DELETE):
            suggestion_id (int, required): The ID of the group suggestion to delete

        Returns:
            GET: A paginated JSON response containing course group suggestions:
                {
                    "count": 5,
                    "next": "https://example.com/api/catalog/suggestions/course/group/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "group_id": 789,
                            "group_name": "Engineering Team",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "course_id": "course-v1:org+course+run",
                            "course_name": "Introduction to Programming",
                            "user_count": 25
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created/updated group suggestion:
                {
                    "id": 123,
                    "group_id": 789,
                    "group_name": "Engineering Team",
                    "platform_key": "platform1",
                    "accepted": false,
                    "visible": true,
                    "created": "2023-06-15T14:30:00Z",
                    "modified": "2023-06-15T14:30:00Z",
                    "metadata": {},
                    "course_id": "course-v1:org+course+run",
                    "course_name": "Introduction to Programming",
                    "user_count": 25
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage group suggestions
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can manage group suggestions for their platform
            - Department admins can manage group suggestions for their departments
            - DM admins can manage all group suggestions
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
          description: Filter suggestions by department admin access
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to retrieve group suggestions for
          required: true
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter group suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCourseGroupSuggestion'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
    post:
      operationId: catalog_suggestions_course_manage_group_create
      description: >-
        API View for managing course group suggestions.


        This endpoint allows administrators to view, create, and delete course
        suggestions

        for groups of users within a platform.


        Query Parameters (GET):
            platform_key (str, required): The platform to retrieve group suggestions for
            platform_org (str, optional): The organization identifier for the platform
            query (str, optional): Search term to filter group suggestions
            sort (str, optional): Field to sort results by (default: 'id')
            department_mode (bool, optional): Filter suggestions by department admin access
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of course group suggestions for a platform
            POST: Create or update a course group suggestion
            DELETE: Remove a course group suggestion

        Request Body (POST):
            A JSON object containing:
            - platform_key (str, required): The platform for the group suggestion
            - course_id (str, required): The course ID to suggest
            - group_id (str/int, required): The group to suggest the course to
            - accepted (bool, optional): Whether the suggestion is accepted
            - visible (bool, optional): Whether the suggestion is visible
            - metadata (dict, optional): Additional suggestion metadata

        Query Parameters (DELETE):
            suggestion_id (int, required): The ID of the group suggestion to delete

        Returns:
            GET: A paginated JSON response containing course group suggestions:
                {
                    "count": 5,
                    "next": "https://example.com/api/catalog/suggestions/course/group/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "group_id": 789,
                            "group_name": "Engineering Team",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "course_id": "course-v1:org+course+run",
                            "course_name": "Introduction to Programming",
                            "user_count": 25
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created/updated group suggestion:
                {
                    "id": 123,
                    "group_id": 789,
                    "group_name": "Engineering Team",
                    "platform_key": "platform1",
                    "accepted": false,
                    "visible": true,
                    "created": "2023-06-15T14:30:00Z",
                    "modified": "2023-06-15T14:30:00Z",
                    "metadata": {},
                    "course_id": "course-v1:org+course+run",
                    "course_name": "Introduction to Programming",
                    "user_count": 25
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage group suggestions
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can manage group suggestions for their platform
            - Department admins can manage group suggestions for their departments
            - DM admins can manage all group suggestions
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
          description: Filter suggestions by department admin access
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to retrieve group suggestions for
          required: true
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter group suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseGroupSuggestionCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseGroupSuggestionCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseGroupSuggestionCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseGroupSuggestionCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseGroupSuggestionCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseGroupSuggestionDetail'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
    delete:
      operationId: catalog_suggestions_course_manage_group_destroy
      description: >-
        API View for managing course group suggestions.


        This endpoint allows administrators to view, create, and delete course
        suggestions

        for groups of users within a platform.


        Query Parameters (GET):
            platform_key (str, required): The platform to retrieve group suggestions for
            platform_org (str, optional): The organization identifier for the platform
            query (str, optional): Search term to filter group suggestions
            sort (str, optional): Field to sort results by (default: 'id')
            department_mode (bool, optional): Filter suggestions by department admin access
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of course group suggestions for a platform
            POST: Create or update a course group suggestion
            DELETE: Remove a course group suggestion

        Request Body (POST):
            A JSON object containing:
            - platform_key (str, required): The platform for the group suggestion
            - course_id (str, required): The course ID to suggest
            - group_id (str/int, required): The group to suggest the course to
            - accepted (bool, optional): Whether the suggestion is accepted
            - visible (bool, optional): Whether the suggestion is visible
            - metadata (dict, optional): Additional suggestion metadata

        Query Parameters (DELETE):
            suggestion_id (int, required): The ID of the group suggestion to delete

        Returns:
            GET: A paginated JSON response containing course group suggestions:
                {
                    "count": 5,
                    "next": "https://example.com/api/catalog/suggestions/course/group/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "group_id": 789,
                            "group_name": "Engineering Team",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "course_id": "course-v1:org+course+run",
                            "course_name": "Introduction to Programming",
                            "user_count": 25
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created/updated group suggestion:
                {
                    "id": 123,
                    "group_id": 789,
                    "group_name": "Engineering Team",
                    "platform_key": "platform1",
                    "accepted": false,
                    "visible": true,
                    "created": "2023-06-15T14:30:00Z",
                    "modified": "2023-06-15T14:30:00Z",
                    "metadata": {},
                    "course_id": "course-v1:org+course+run",
                    "course_name": "Introduction to Programming",
                    "user_count": 25
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage group suggestions
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can manage group suggestions for their platform
            - Department admins can manage group suggestions for their departments
            - DM admins can manage all group suggestions
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
            default: false
          description: Flag to ensure department admins can call the API
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to retrieve group suggestions for
          required: true
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter group suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
        - in: query
          name: suggestion_id
          schema:
            type: integer
          description: The ID of the group suggestion to delete
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Success - group suggestion deleted
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - group suggestion does not exist
        '500':
          description: Internal server error
  /api/catalog/suggestions/course/user/:
    get:
      operationId: catalog_suggestions_course_user_retrieve
      description: >-
        API View for retrieving course suggestions for a specific user.


        This endpoint allows users to view course suggestions that have been
        made for them,

        with support for filtering by platform and pagination.


        Query Parameters:
            user (str, required): Username or user ID to retrieve suggestions for
            platform_key (str, optional): Filter suggestions by platform key
            platform_org (str, optional): Filter suggestions by platform organization
            sort (str, optional): Field to sort results by (default: '-id')
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of course suggestions for a user

        Returns:
            GET: A paginated JSON response containing course suggestions:
                {
                    "count": 10,
                    "next": "https://example.com/api/catalog/suggestions/course/user/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "user_id": 456,
                            "username": "student1",
                            "name": "Student Name",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "course_id": "course-v1:org+course+run",
                            "course_name": "Introduction to Programming"
                        },
                        ...
                    ]
                }

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if suggestion retrieval fails
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdminReadOnly, or IsEdxUserReadOnly permission
            - Users can view their own suggestions
            - Platform admins can view suggestions for users in their platform (read-only)
            - DM admins can view all suggestions
      parameters:
        - in: query
          name: email
          schema:
            type: string
            format: email
            minLength: 1
          description: Email to retrieve suggestions for
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Filter suggestions by platform key
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: Filter suggestions by platform organization
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: user
          schema:
            type: string
            minLength: 1
          description: Username or user ID to retrieve suggestions for
          required: true
        - in: query
          name: user_id
          schema:
            type: integer
          description: User ID to retrieve suggestions for
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCourseSuggestion'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
  /api/catalog/suggestions/pathway/manage/:
    get:
      operationId: catalog_suggestions_pathway_manage_retrieve
      description: >-
        API View for managing pathway suggestions.


        This endpoint allows administrators to view, create, update, and delete
        pathway suggestions

        for users within a platform.


        Query Parameters (GET):
            platform_key (str, required): The platform to retrieve suggestions for
            platform_org (str, optional): The organization identifier for the platform
            query (str, optional): Search term to filter suggestions
            sort (str, optional): Field to sort results by (default: '-id')
            department_mode (bool, optional): Filter suggestions by department admin access
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of pathway suggestions for a platform
            POST: Create or update a pathway suggestion
            DELETE: Remove a pathway suggestion

        Request Body (POST):
            A JSON object containing:
            - platform_key (str, required): The platform for the suggestion
            - pathway_id (str, required): The pathway ID to suggest
            - user_id (str/int, required): The user to suggest the pathway to
            - accepted (bool, optional): Whether the suggestion is accepted
            - visible (bool, optional): Whether the suggestion is visible
            - metadata (dict, optional): Additional suggestion metadata

        Query Parameters (DELETE):
            suggestion_id (int, required): The ID of the suggestion to delete

        Returns:
            GET: A paginated JSON response containing pathway suggestions:
                {
                    "count": 10,
                    "next": "https://example.com/api/catalog/suggestions/pathway/manage/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "user_id": 456,
                            "username": "student1",
                            "name": "Student Name",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "pathway_id": "pathway-v1:org+pathway+run",
                            "pathway_uuid": "12345678-1234-5678-1234-567812345678",
                            "pathway_name": "Data Science Pathway",
                            "pathway_platform_key": "platform1"
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created/updated suggestion:
                {
                    "id": 123,
                    "user_id": 456,
                    "username": "student1",
                    "name": "Student Name",
                    "platform_key": "platform1",
                    "accepted": false,
                    "visible": true,
                    "created": "2023-06-15T14:30:00Z",
                    "modified": "2023-06-15T14:30:00Z",
                    "metadata": {},
                    "pathway_id": "pathway-v1:org+pathway+run",
                    "pathway_uuid": "12345678-1234-5678-1234-567812345678",
                    "pathway_name": "Data Science Pathway",
                    "pathway_platform_key": "platform1"
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if suggestion operations fail
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage suggestions
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can manage suggestions for their platform
            - Department admins can manage suggestions for their departments
            - DM admins can manage all suggestions
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
          description: Filter suggestions by department admin access
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to retrieve suggestions for
          required: true
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPathwaySuggestion'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
    post:
      operationId: catalog_suggestions_pathway_manage_create
      description: >-
        API View for managing pathway suggestions.


        This endpoint allows administrators to view, create, update, and delete
        pathway suggestions

        for users within a platform.


        Query Parameters (GET):
            platform_key (str, required): The platform to retrieve suggestions for
            platform_org (str, optional): The organization identifier for the platform
            query (str, optional): Search term to filter suggestions
            sort (str, optional): Field to sort results by (default: '-id')
            department_mode (bool, optional): Filter suggestions by department admin access
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of pathway suggestions for a platform
            POST: Create or update a pathway suggestion
            DELETE: Remove a pathway suggestion

        Request Body (POST):
            A JSON object containing:
            - platform_key (str, required): The platform for the suggestion
            - pathway_id (str, required): The pathway ID to suggest
            - user_id (str/int, required): The user to suggest the pathway to
            - accepted (bool, optional): Whether the suggestion is accepted
            - visible (bool, optional): Whether the suggestion is visible
            - metadata (dict, optional): Additional suggestion metadata

        Query Parameters (DELETE):
            suggestion_id (int, required): The ID of the suggestion to delete

        Returns:
            GET: A paginated JSON response containing pathway suggestions:
                {
                    "count": 10,
                    "next": "https://example.com/api/catalog/suggestions/pathway/manage/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "user_id": 456,
                            "username": "student1",
                            "name": "Student Name",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "pathway_id": "pathway-v1:org+pathway+run",
                            "pathway_uuid": "12345678-1234-5678-1234-567812345678",
                            "pathway_name": "Data Science Pathway",
                            "pathway_platform_key": "platform1"
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created/updated suggestion:
                {
                    "id": 123,
                    "user_id": 456,
                    "username": "student1",
                    "name": "Student Name",
                    "platform_key": "platform1",
                    "accepted": false,
                    "visible": true,
                    "created": "2023-06-15T14:30:00Z",
                    "modified": "2023-06-15T14:30:00Z",
                    "metadata": {},
                    "pathway_id": "pathway-v1:org+pathway+run",
                    "pathway_uuid": "12345678-1234-5678-1234-567812345678",
                    "pathway_name": "Data Science Pathway",
                    "pathway_platform_key": "platform1"
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if suggestion operations fail
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage suggestions
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can manage suggestions for their platform
            - Department admins can manage suggestions for their departments
            - DM admins can manage all suggestions
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
          description: Filter suggestions by department admin access
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to retrieve suggestions for
          required: true
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PathwaySuggestionCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PathwaySuggestionCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PathwaySuggestionCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PathwaySuggestionCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PathwaySuggestionCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PathwaySuggestionDetail'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
    delete:
      operationId: catalog_suggestions_pathway_manage_destroy
      description: Delete single suggestion
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
            default: false
          description: Flag to ensure department admins can call the API
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to retrieve suggestions for
          required: true
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: suggestion_id
          schema:
            type: integer
          description: The ID of the suggestion to delete
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Success - suggestion deleted
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - suggestion does not exist
        '500':
          description: Internal server error
  /api/catalog/suggestions/pathway/manage/bulk/:
    post:
      operationId: catalog_suggestions_pathway_manage_bulk_create
      description: >-
        API View for bulk creation of pathway suggestions.


        This endpoint allows administrators to create multiple pathway
        suggestions at once.


        Methods:
            POST: Create multiple pathway suggestions in a single request

        Request Body:
            A JSON object containing:
            - platform_key (str, required): The platform for the suggestions
            - suggestion_data (list, required): List of suggestion objects, each containing:
              - pathway_id (str, required): The pathway ID to suggest
              - user_id (str/int, required): The user to suggest the pathway to
              - accepted (bool, optional): Whether the suggestion is accepted
              - visible (bool, optional): Whether the suggestion is visible
              - metadata (dict, optional): Additional suggestion metadata

        Returns:
            POST: A JSON response containing the operation results:
                {
                    "successes": 15,
                    "error_codes": []
                }

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage suggestions
            500 Internal Server Error: If an unexpected error occurs during bulk creation

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can create suggestions for their platform
            - Department admins can create suggestions for their departments
            - DM admins can create suggestions for any platform
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PathwaySuggestionBulkCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PathwaySuggestionBulkCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PathwaySuggestionBulkCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PathwaySuggestionBulkCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PathwaySuggestionBulkCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkSuggestionResponse'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
  /api/catalog/suggestions/pathway/manage/group/:
    get:
      operationId: catalog_suggestions_pathway_manage_group_retrieve
      description: >-
        API View for managing pathway group suggestions.


        This endpoint allows administrators to view, create, and delete pathway
        suggestions

        for groups of users within a platform.


        Query Parameters (GET):
            platform_key (str, required): The platform to retrieve group suggestions for
            platform_org (str, optional): The organization identifier for the platform
            query (str, optional): Search term to filter group suggestions
            sort (str, optional): Field to sort results by (default: 'id')
            department_mode (bool, optional): Filter suggestions by department admin access
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of pathway group suggestions for a platform
            POST: Create or update a pathway group suggestion
            DELETE: Remove a pathway group suggestion

        Request Body (POST):
            A JSON object containing:
            - platform_key (str, required): The platform for the group suggestion
            - pathway_id (str, required): The pathway ID to suggest
            - group_id (str/int, required): The group to suggest the pathway to
            - accepted (bool, optional): Whether the suggestion is accepted
            - visible (bool, optional): Whether the suggestion is visible
            - metadata (dict, optional): Additional suggestion metadata

        Query Parameters (DELETE):
            suggestion_id (int, required): The ID of the group suggestion to delete

        Returns:
            GET: A paginated JSON response containing pathway group suggestions:
                {
                    "count": 5,
                    "next": "https://example.com/api/catalog/suggestions/pathway/group/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "group_id": 789,
                            "group_name": "Engineering Team",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "pathway_id": "pathway-v1:org+pathway+run",
                            "pathway_uuid": "12345678-1234-5678-1234-567812345678",
                            "pathway_name": "Data Science Pathway",
                            "pathway_platform_key": "platform1",
                            "user_count": 25
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created/updated group suggestion:
                {
                    "id": 123,
                    "group_id": 789,
                    "group_name": "Engineering Team",
                    "platform_key": "platform1",
                    "accepted": false,
                    "visible": true,
                    "created": "2023-06-15T14:30:00Z",
                    "modified": "2023-06-15T14:30:00Z",
                    "metadata": {},
                    "pathway_id": "pathway-v1:org+pathway+run",
                    "pathway_uuid": "12345678-1234-5678-1234-567812345678",
                    "pathway_name": "Data Science Pathway",
                    "pathway_platform_key": "platform1",
                    "user_count": 25
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage group suggestions
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can manage group suggestions for their platform
            - Department admins can manage group suggestions for their departments
            - DM admins can manage all group suggestions
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
          description: Filter suggestions by department admin access
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to retrieve group suggestions for
          required: true
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter group suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPathwayGroupSuggestion'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
    post:
      operationId: catalog_suggestions_pathway_manage_group_create
      description: >-
        API View for managing pathway group suggestions.


        This endpoint allows administrators to view, create, and delete pathway
        suggestions

        for groups of users within a platform.


        Query Parameters (GET):
            platform_key (str, required): The platform to retrieve group suggestions for
            platform_org (str, optional): The organization identifier for the platform
            query (str, optional): Search term to filter group suggestions
            sort (str, optional): Field to sort results by (default: 'id')
            department_mode (bool, optional): Filter suggestions by department admin access
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of pathway group suggestions for a platform
            POST: Create or update a pathway group suggestion
            DELETE: Remove a pathway group suggestion

        Request Body (POST):
            A JSON object containing:
            - platform_key (str, required): The platform for the group suggestion
            - pathway_id (str, required): The pathway ID to suggest
            - group_id (str/int, required): The group to suggest the pathway to
            - accepted (bool, optional): Whether the suggestion is accepted
            - visible (bool, optional): Whether the suggestion is visible
            - metadata (dict, optional): Additional suggestion metadata

        Query Parameters (DELETE):
            suggestion_id (int, required): The ID of the group suggestion to delete

        Returns:
            GET: A paginated JSON response containing pathway group suggestions:
                {
                    "count": 5,
                    "next": "https://example.com/api/catalog/suggestions/pathway/group/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "group_id": 789,
                            "group_name": "Engineering Team",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "pathway_id": "pathway-v1:org+pathway+run",
                            "pathway_uuid": "12345678-1234-5678-1234-567812345678",
                            "pathway_name": "Data Science Pathway",
                            "pathway_platform_key": "platform1",
                            "user_count": 25
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created/updated group suggestion:
                {
                    "id": 123,
                    "group_id": 789,
                    "group_name": "Engineering Team",
                    "platform_key": "platform1",
                    "accepted": false,
                    "visible": true,
                    "created": "2023-06-15T14:30:00Z",
                    "modified": "2023-06-15T14:30:00Z",
                    "metadata": {},
                    "pathway_id": "pathway-v1:org+pathway+run",
                    "pathway_uuid": "12345678-1234-5678-1234-567812345678",
                    "pathway_name": "Data Science Pathway",
                    "pathway_platform_key": "platform1",
                    "user_count": 25
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage group suggestions
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can manage group suggestions for their platform
            - Department admins can manage group suggestions for their departments
            - DM admins can manage all group suggestions
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
          description: Filter suggestions by department admin access
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to retrieve group suggestions for
          required: true
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter group suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PathwayGroupSuggestionCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PathwayGroupSuggestionCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PathwayGroupSuggestionCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PathwayGroupSuggestionCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PathwayGroupSuggestionCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PathwayGroupSuggestionDetail'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
    delete:
      operationId: catalog_suggestions_pathway_manage_group_destroy
      description: >-
        API View for managing pathway group suggestions.


        This endpoint allows administrators to view, create, and delete pathway
        suggestions

        for groups of users within a platform.


        Query Parameters (GET):
            platform_key (str, required): The platform to retrieve group suggestions for
            platform_org (str, optional): The organization identifier for the platform
            query (str, optional): Search term to filter group suggestions
            sort (str, optional): Field to sort results by (default: 'id')
            department_mode (bool, optional): Filter suggestions by department admin access
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of pathway group suggestions for a platform
            POST: Create or update a pathway group suggestion
            DELETE: Remove a pathway group suggestion

        Request Body (POST):
            A JSON object containing:
            - platform_key (str, required): The platform for the group suggestion
            - pathway_id (str, required): The pathway ID to suggest
            - group_id (str/int, required): The group to suggest the pathway to
            - accepted (bool, optional): Whether the suggestion is accepted
            - visible (bool, optional): Whether the suggestion is visible
            - metadata (dict, optional): Additional suggestion metadata

        Query Parameters (DELETE):
            suggestion_id (int, required): The ID of the group suggestion to delete

        Returns:
            GET: A paginated JSON response containing pathway group suggestions:
                {
                    "count": 5,
                    "next": "https://example.com/api/catalog/suggestions/pathway/group/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "group_id": 789,
                            "group_name": "Engineering Team",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "pathway_id": "pathway-v1:org+pathway+run",
                            "pathway_uuid": "12345678-1234-5678-1234-567812345678",
                            "pathway_name": "Data Science Pathway",
                            "pathway_platform_key": "platform1",
                            "user_count": 25
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created/updated group suggestion:
                {
                    "id": 123,
                    "group_id": 789,
                    "group_name": "Engineering Team",
                    "platform_key": "platform1",
                    "accepted": false,
                    "visible": true,
                    "created": "2023-06-15T14:30:00Z",
                    "modified": "2023-06-15T14:30:00Z",
                    "metadata": {},
                    "pathway_id": "pathway-v1:org+pathway+run",
                    "pathway_uuid": "12345678-1234-5678-1234-567812345678",
                    "pathway_name": "Data Science Pathway",
                    "pathway_platform_key": "platform1",
                    "user_count": 25
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage group suggestions
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can manage group suggestions for their platform
            - Department admins can manage group suggestions for their departments
            - DM admins can manage all group suggestions
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
            default: false
          description: Flag to ensure department admins can call the API
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to retrieve group suggestions for
          required: true
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter group suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
        - in: query
          name: suggestion_id
          schema:
            type: integer
          description: The ID of the group suggestion to delete
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Success - group suggestion deleted
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - group suggestion does not exist
        '500':
          description: Internal server error
  /api/catalog/suggestions/pathway/user/:
    get:
      operationId: catalog_suggestions_pathway_user_retrieve
      description: >-
        API View for retrieving pathway suggestions for a specific user.


        This endpoint allows users to view pathway suggestions that have been
        made for them,

        with support for filtering by platform and pagination.


        Query Parameters:
            user (str, required): Username or user ID to retrieve suggestions for
            platform_key (str, optional): Filter suggestions by platform key
            platform_org (str, optional): Filter suggestions by platform organization
            sort (str, optional): Field to sort results by (default: '-id')
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of pathway suggestions for a user

        Returns:
            GET: A paginated JSON response containing pathway suggestions:
                {
                    "count": 10,
                    "next": "https://example.com/api/catalog/suggestions/pathway/user/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "user_id": 456,
                            "username": "student1",
                            "name": "Student Name",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "pathway_id": "pathway-v1:org+pathway+run",
                            "pathway_uuid": "12345678-1234-5678-1234-567812345678",
                            "pathway_name": "Data Science Pathway",
                            "pathway_platform_key": "platform1"
                        },
                        ...
                    ]
                }

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if suggestion retrieval fails
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdminReadOnly, or IsEdxUserReadOnly permission
            - Users can view their own suggestions
            - Platform admins can view suggestions for users in their platform (read-only)
            - DM admins can view all suggestions
      parameters:
        - in: query
          name: email
          schema:
            type: string
            format: email
            minLength: 1
          description: Email to retrieve suggestions for
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Filter suggestions by platform key
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: Filter suggestions by platform organization
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: user_id
          schema:
            type: integer
          description: User ID to retrieve suggestions for
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username or user ID to retrieve suggestions for
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPathwaySuggestion'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
  /api/catalog/suggestions/program/manage/:
    get:
      operationId: catalog_suggestions_program_manage_retrieve
      description: >-
        API View for managing program suggestions.


        This endpoint allows administrators to view, create, update, and delete
        program suggestions

        for users within a platform.


        Query Parameters (GET):
            platform_key (str, required): The platform to retrieve suggestions for
            platform_org (str, optional): The organization identifier for the platform
            query (str, optional): Search term to filter suggestions
            sort (str, optional): Field to sort results by (default: '-id')
            department_mode (bool, optional): Filter suggestions by department admin access
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of program suggestions for a platform
            POST: Create or update a program suggestion
            DELETE: Remove a program suggestion

        Request Body (POST):
            A JSON object containing:
            - platform_key (str, required): The platform for the suggestion
            - program_key (str, required): The program key to suggest
            - user_id (str/int, required): The user to suggest the program to
            - accepted (bool, optional): Whether the suggestion is accepted
            - visible (bool, optional): Whether the suggestion is visible
            - metadata (dict, optional): Additional suggestion metadata

        Query Parameters (DELETE):
            suggestion_id (int, required): The ID of the suggestion to delete

        Returns:
            GET: A paginated JSON response containing program suggestions:
                {
                    "count": 10,
                    "next": "https://example.com/api/catalog/suggestions/program/manage/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "user_id": 456,
                            "username": "student1",
                            "name": "Student Name",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "program_key": "program-v1:org+program+run",
                            "program_name": "Data Science Program"
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created/updated suggestion:
                {
                    "id": 123,
                    "user_id": 456,
                    "username": "student1",
                    "name": "Student Name",
                    "platform_key": "platform1",
                    "accepted": false,
                    "visible": true,
                    "created": "2023-06-15T14:30:00Z",
                    "modified": "2023-06-15T14:30:00Z",
                    "metadata": {},
                    "program_key": "program-v1:org+program+run",
                    "program_name": "Data Science Program"
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if suggestion operations fail
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage suggestions
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can manage suggestions for their platform
            - Department admins can manage suggestions for their departments
            - DM admins can manage all suggestions
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
          description: Filter suggestions by department admin access
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to retrieve suggestions for
          required: true
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProgramSuggestion'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
    post:
      operationId: catalog_suggestions_program_manage_create
      description: >-
        API View for managing program suggestions.


        This endpoint allows administrators to view, create, update, and delete
        program suggestions

        for users within a platform.


        Query Parameters (GET):
            platform_key (str, required): The platform to retrieve suggestions for
            platform_org (str, optional): The organization identifier for the platform
            query (str, optional): Search term to filter suggestions
            sort (str, optional): Field to sort results by (default: '-id')
            department_mode (bool, optional): Filter suggestions by department admin access
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of program suggestions for a platform
            POST: Create or update a program suggestion
            DELETE: Remove a program suggestion

        Request Body (POST):
            A JSON object containing:
            - platform_key (str, required): The platform for the suggestion
            - program_key (str, required): The program key to suggest
            - user_id (str/int, required): The user to suggest the program to
            - accepted (bool, optional): Whether the suggestion is accepted
            - visible (bool, optional): Whether the suggestion is visible
            - metadata (dict, optional): Additional suggestion metadata

        Query Parameters (DELETE):
            suggestion_id (int, required): The ID of the suggestion to delete

        Returns:
            GET: A paginated JSON response containing program suggestions:
                {
                    "count": 10,
                    "next": "https://example.com/api/catalog/suggestions/program/manage/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "user_id": 456,
                            "username": "student1",
                            "name": "Student Name",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "program_key": "program-v1:org+program+run",
                            "program_name": "Data Science Program"
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created/updated suggestion:
                {
                    "id": 123,
                    "user_id": 456,
                    "username": "student1",
                    "name": "Student Name",
                    "platform_key": "platform1",
                    "accepted": false,
                    "visible": true,
                    "created": "2023-06-15T14:30:00Z",
                    "modified": "2023-06-15T14:30:00Z",
                    "metadata": {},
                    "program_key": "program-v1:org+program+run",
                    "program_name": "Data Science Program"
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if suggestion operations fail
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage suggestions
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can manage suggestions for their platform
            - Department admins can manage suggestions for their departments
            - DM admins can manage all suggestions
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
          description: Filter suggestions by department admin access
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to retrieve suggestions for
          required: true
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProgramSuggestionCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ProgramSuggestionCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProgramSuggestionCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProgramSuggestionCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/ProgramSuggestionCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramSuggestionDetail'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
    delete:
      operationId: catalog_suggestions_program_manage_destroy
      description: >-
        API View for managing program suggestions.


        This endpoint allows administrators to view, create, update, and delete
        program suggestions

        for users within a platform.


        Query Parameters (GET):
            platform_key (str, required): The platform to retrieve suggestions for
            platform_org (str, optional): The organization identifier for the platform
            query (str, optional): Search term to filter suggestions
            sort (str, optional): Field to sort results by (default: '-id')
            department_mode (bool, optional): Filter suggestions by department admin access
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of program suggestions for a platform
            POST: Create or update a program suggestion
            DELETE: Remove a program suggestion

        Request Body (POST):
            A JSON object containing:
            - platform_key (str, required): The platform for the suggestion
            - program_key (str, required): The program key to suggest
            - user_id (str/int, required): The user to suggest the program to
            - accepted (bool, optional): Whether the suggestion is accepted
            - visible (bool, optional): Whether the suggestion is visible
            - metadata (dict, optional): Additional suggestion metadata

        Query Parameters (DELETE):
            suggestion_id (int, required): The ID of the suggestion to delete

        Returns:
            GET: A paginated JSON response containing program suggestions:
                {
                    "count": 10,
                    "next": "https://example.com/api/catalog/suggestions/program/manage/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "user_id": 456,
                            "username": "student1",
                            "name": "Student Name",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "program_key": "program-v1:org+program+run",
                            "program_name": "Data Science Program"
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created/updated suggestion:
                {
                    "id": 123,
                    "user_id": 456,
                    "username": "student1",
                    "name": "Student Name",
                    "platform_key": "platform1",
                    "accepted": false,
                    "visible": true,
                    "created": "2023-06-15T14:30:00Z",
                    "modified": "2023-06-15T14:30:00Z",
                    "metadata": {},
                    "program_key": "program-v1:org+program+run",
                    "program_name": "Data Science Program"
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if suggestion operations fail
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage suggestions
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can manage suggestions for their platform
            - Department admins can manage suggestions for their departments
            - DM admins can manage all suggestions
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
          description: Filter suggestions by department admin access
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to delete the suggestion from
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: suggestion_id
          schema:
            type: integer
          description: The ID of the suggestion to delete
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Success - suggestion deleted
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - suggestion does not exist
        '500':
          description: Internal server error
  /api/catalog/suggestions/program/manage/bulk/:
    post:
      operationId: catalog_suggestions_program_manage_bulk_create
      description: >-
        API View for bulk creation of program suggestions.


        This endpoint allows administrators to create multiple program
        suggestions at once.


        Methods:
            POST: Create multiple program suggestions in bulk

        Request Body:
            A JSON object containing:
            - platform_key (str, required): The platform for the suggestions
            - suggestion_data (array, required): Array of suggestion objects with:
              - program_key (str, required): The program key to suggest
              - user_id (str/int, required): The user to suggest the program to
              - accepted (bool, optional): Whether the suggestion is accepted
              - visible (bool, optional): Whether the suggestion is visible
              - metadata (dict, optional): Additional suggestion metadata

        Returns:
            POST: A JSON response containing the results of the bulk operation:
                {
                    "successes": 15,
                    "error_codes": []
                }

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to create suggestions
            500 Internal Server Error: If an unexpected error occurs during bulk creation

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can create suggestions for their platform
            - Department admins can create suggestions for their departments
            - DM admins can create suggestions for all platforms
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProgramSuggestionBulkCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ProgramSuggestionBulkCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProgramSuggestionBulkCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProgramSuggestionBulkCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/ProgramSuggestionBulkCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkSuggestionResponse'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
  /api/catalog/suggestions/program/manage/group/:
    get:
      operationId: catalog_suggestions_program_manage_group_retrieve
      description: >-
        API View for managing program group suggestions.


        This endpoint allows administrators to view, create, and delete program
        suggestions

        for groups of users within a platform.


        Query Parameters (GET):
            platform_key (str, required): The platform to retrieve group suggestions for
            platform_org (str, optional): The organization identifier for the platform
            query (str, optional): Search term to filter group suggestions
            sort (str, optional): Field to sort results by (default: 'id')
            department_mode (bool, optional): Filter suggestions by department admin access
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of program group suggestions for a platform
            POST: Create or update a program group suggestion
            DELETE: Remove a program group suggestion

        Request Body (POST):
            A JSON object containing:
            - platform_key (str, required): The platform for the group suggestion
            - program_key (str, required): The program key to suggest
            - group_id (str/int, required): The group to suggest the program to
            - accepted (bool, optional): Whether the suggestion is accepted
            - visible (bool, optional): Whether the suggestion is visible
            - metadata (dict, optional): Additional suggestion metadata

        Query Parameters (DELETE):
            suggestion_id (int, required): The ID of the group suggestion to delete

        Returns:
            GET: A paginated JSON response containing program group suggestions:
                {
                    "count": 5,
                    "next": "https://example.com/api/catalog/suggestions/program/group/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "group_id": 789,
                            "group_name": "Engineering Team",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "program_key": "program-v1:org+program+run",
                            "program_name": "Data Science Program",
                            "user_count": 25
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created/updated group suggestion:
                {
                    "id": 123,
                    "group_id": 789,
                    "group_name": "Engineering Team",
                    "platform_key": "platform1",
                    "accepted": false,
                    "visible": true,
                    "created": "2023-06-15T14:30:00Z",
                    "modified": "2023-06-15T14:30:00Z",
                    "metadata": {},
                    "program_key": "program-v1:org+program+run",
                    "program_name": "Data Science Program",
                    "user_count": 25
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage group suggestions
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can manage group suggestions for their platform
            - Department admins can manage group suggestions for their departments
            - DM admins can manage all group suggestions
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
          description: Filter suggestions by department admin access
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to retrieve group suggestions for
          required: true
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter group suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProgramGroupSuggestion'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
    post:
      operationId: catalog_suggestions_program_manage_group_create
      description: >-
        API View for managing program group suggestions.


        This endpoint allows administrators to view, create, and delete program
        suggestions

        for groups of users within a platform.


        Query Parameters (GET):
            platform_key (str, required): The platform to retrieve group suggestions for
            platform_org (str, optional): The organization identifier for the platform
            query (str, optional): Search term to filter group suggestions
            sort (str, optional): Field to sort results by (default: 'id')
            department_mode (bool, optional): Filter suggestions by department admin access
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of program group suggestions for a platform
            POST: Create or update a program group suggestion
            DELETE: Remove a program group suggestion

        Request Body (POST):
            A JSON object containing:
            - platform_key (str, required): The platform for the group suggestion
            - program_key (str, required): The program key to suggest
            - group_id (str/int, required): The group to suggest the program to
            - accepted (bool, optional): Whether the suggestion is accepted
            - visible (bool, optional): Whether the suggestion is visible
            - metadata (dict, optional): Additional suggestion metadata

        Query Parameters (DELETE):
            suggestion_id (int, required): The ID of the group suggestion to delete

        Returns:
            GET: A paginated JSON response containing program group suggestions:
                {
                    "count": 5,
                    "next": "https://example.com/api/catalog/suggestions/program/group/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "group_id": 789,
                            "group_name": "Engineering Team",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "program_key": "program-v1:org+program+run",
                            "program_name": "Data Science Program",
                            "user_count": 25
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created/updated group suggestion:
                {
                    "id": 123,
                    "group_id": 789,
                    "group_name": "Engineering Team",
                    "platform_key": "platform1",
                    "accepted": false,
                    "visible": true,
                    "created": "2023-06-15T14:30:00Z",
                    "modified": "2023-06-15T14:30:00Z",
                    "metadata": {},
                    "program_key": "program-v1:org+program+run",
                    "program_name": "Data Science Program",
                    "user_count": 25
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage group suggestions
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can manage group suggestions for their platform
            - Department admins can manage group suggestions for their departments
            - DM admins can manage all group suggestions
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
          description: Filter suggestions by department admin access
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to retrieve group suggestions for
          required: true
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter group suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
      tags:
        - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProgramGroupSuggestionCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ProgramGroupSuggestionCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ProgramGroupSuggestionCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ProgramGroupSuggestionCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/ProgramGroupSuggestionCreate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProgramGroupSuggestionDetail'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
    delete:
      operationId: catalog_suggestions_program_manage_group_destroy
      description: >-
        API View for managing program group suggestions.


        This endpoint allows administrators to view, create, and delete program
        suggestions

        for groups of users within a platform.


        Query Parameters (GET):
            platform_key (str, required): The platform to retrieve group suggestions for
            platform_org (str, optional): The organization identifier for the platform
            query (str, optional): Search term to filter group suggestions
            sort (str, optional): Field to sort results by (default: 'id')
            department_mode (bool, optional): Filter suggestions by department admin access
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of program group suggestions for a platform
            POST: Create or update a program group suggestion
            DELETE: Remove a program group suggestion

        Request Body (POST):
            A JSON object containing:
            - platform_key (str, required): The platform for the group suggestion
            - program_key (str, required): The program key to suggest
            - group_id (str/int, required): The group to suggest the program to
            - accepted (bool, optional): Whether the suggestion is accepted
            - visible (bool, optional): Whether the suggestion is visible
            - metadata (dict, optional): Additional suggestion metadata

        Query Parameters (DELETE):
            suggestion_id (int, required): The ID of the group suggestion to delete

        Returns:
            GET: A paginated JSON response containing program group suggestions:
                {
                    "count": 5,
                    "next": "https://example.com/api/catalog/suggestions/program/group/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "group_id": 789,
                            "group_name": "Engineering Team",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "program_key": "program-v1:org+program+run",
                            "program_name": "Data Science Program",
                            "user_count": 25
                        },
                        ...
                    ]
                }

            POST: A JSON response containing the created/updated group suggestion:
                {
                    "id": 123,
                    "group_id": 789,
                    "group_name": "Engineering Team",
                    "platform_key": "platform1",
                    "accepted": false,
                    "visible": true,
                    "created": "2023-06-15T14:30:00Z",
                    "modified": "2023-06-15T14:30:00Z",
                    "metadata": {},
                    "program_key": "program-v1:org+program+run",
                    "program_name": "Data Science Program",
                    "user_count": 25
                }

            DELETE: A success response with status 200

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if group suggestion operations fail
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to manage group suggestions
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdmin, or IsDepartmentModeAdminInPlatform permission
            - Platform admins can manage group suggestions for their platform
            - Department admins can manage group suggestions for their departments
            - DM admins can manage all group suggestions
      parameters:
        - in: query
          name: department_mode
          schema:
            type: boolean
            default: false
          description: Flag to ensure department admins can call the API
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: The platform to retrieve group suggestions for
          required: true
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: The organization identifier for the platform
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter group suggestions
        - in: query
          name: sort
          schema:
            type: string
            default: id
            minLength: 1
          description: Field to sort results by
        - in: query
          name: suggestion_id
          schema:
            type: integer
          description: The ID of the group suggestion to delete
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Success - group suggestion deleted
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '404':
          description: Not found - group suggestion does not exist
        '500':
          description: Internal server error
  /api/catalog/suggestions/program/user/:
    get:
      operationId: catalog_suggestions_program_user_retrieve
      description: >-
        API View for retrieving program suggestions for a specific user.


        This endpoint allows users to view program suggestions that have been
        made for them,

        with support for filtering by platform and pagination.


        Query Parameters:
            user (str, required): Username or user ID to retrieve suggestions for
            platform_key (str, optional): Filter suggestions by platform key
            platform_org (str, optional): Filter suggestions by platform organization
            sort (str, optional): Field to sort results by (default: '-id')
            page (int, optional): Page number for pagination
            page_size (int, optional): Number of items per page

        Methods:
            GET: Retrieve a paginated list of program suggestions for a user

        Returns:
            GET: A paginated JSON response containing program suggestions:
                {
                    "count": 10,
                    "next": "https://example.com/api/catalog/suggestions/program/user/?page=2",
                    "previous": null,
                    "results": [
                        {
                            "id": 123,
                            "user_id": 456,
                            "username": "student1",
                            "name": "Student Name",
                            "platform_key": "platform1",
                            "accepted": false,
                            "visible": true,
                            "created": "2023-06-15T14:30:00Z",
                            "modified": "2023-06-15T14:30:00Z",
                            "metadata": {},
                            "program_key": "program-v1:org+program+run",
                            "program_name": "Data Science Program"
                        },
                        ...
                    ]
                }

        Error Responses:
            400 Bad Request: If required parameters are missing or invalid, or if suggestion retrieval fails
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsDMAdmin, IsPlatformAdminReadOnly, or IsEdxUserReadOnly permission
            - Users can view their own suggestions
            - Platform admins can view suggestions for users in their platform (read-only)
            - DM admins can view all suggestions
      parameters:
        - in: query
          name: email
          schema:
            type: string
            format: email
            minLength: 1
          description: Email to retrieve suggestions for
        - in: query
          name: page
          schema:
            type: integer
          description: Page number for pagination
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Filter suggestions by platform key
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
          description: Filter suggestions by platform organization
        - in: query
          name: sort
          schema:
            type: string
            default: '-id'
            minLength: 1
          description: Field to sort results by
        - in: query
          name: user_id
          schema:
            type: integer
          description: User ID to retrieve suggestions for
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Username or user ID to retrieve suggestions for
          required: true
      tags:
        - catalog
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedProgramSuggestion'
          description: ''
        '400':
          description: Bad request - required parameters missing or invalid
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - insufficient permissions
        '500':
          description: Internal server error
  /api/core/consolidated-token/proxy/:
    post:
      operationId: core_consolidated_token_proxy_create
      description: |-
        Create DM and AXD Tokens for user and platform_key

        Params:
        - Any of user_id, username, or email (choose one only, required)
        - platform_key: str (required)
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenProxyInput'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TokenProxyInput'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TokenProxyInput'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TokenProxyInput'
          '*/*':
            schema:
              $ref: '#/components/schemas/TokenProxyInput'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenProxyOutput'
          description: ''
  /api/core/departments/:
    get:
      operationId: core_departments_retrieve
      description: Show (active) departments associated with a platform
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    post:
      operationId: core_departments_create
      description: Create/update a department
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    delete:
      operationId: core_departments_destroy
      description: Delete department
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/core/departments/members/:
    get:
      operationId: core_departments_members_retrieve
      description: Show active users in department (paginated)
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    post:
      operationId: core_departments_members_create
      description: Add single user to department, or update status
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    delete:
      operationId: core_departments_members_destroy
      description: Delete department member
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/core/departments/members/bulk/:
    post:
      operationId: core_departments_members_bulk_create
      description: Add users to department, or update status
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/core/departments/members/check/:
    get:
      operationId: core_departments_members_check_retrieve
      description: Get department member admin info of requesting user
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/core/domains/whitelist/:
    get:
      operationId: core_domains_whitelist_retrieve
      description: Check if a domain is whitelisted
      parameters:
        - in: query
          name: is_active
          schema:
            type: boolean
        - in: query
          name: url
          schema:
            type: string
            minLength: 1
          required: true
      tags:
        - core
      responses:
        '200':
          description: No response body
    post:
      operationId: core_domains_whitelist_create
      description: Add a new domain to whitelist
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhitelistedDomain'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/WhitelistedDomain'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/WhitelistedDomain'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WhitelistedDomain'
          '*/*':
            schema:
              $ref: '#/components/schemas/WhitelistedDomain'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhitelistedDomain'
          description: ''
  /api/core/heartbeat/celery/:
    get:
      operationId: core_heartbeat_celery_retrieve
      description: |-
        **Use Case**

            Celery heartbeat endpoint.

        **Example Request**

            GET /api/core/heartbeat/celery/

        **Response Values**

            * 200 on success.
            * 500 on failure.
      tags:
        - core
      responses:
        '200':
          description: No response body
  /api/core/heartbeat/celery-beat/:
    get:
      operationId: core_heartbeat_celery_beat_retrieve
      description: |-
        **Use Case**

            Celery Beat heartbeat endpoint.

        **Example Request**

            GET /api/core/heartbeat/celery-beat/

        **Response Values**

            * 200 on success.
            * 500 on failure.
      tags:
        - core
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CeleryHeartbeat'
          description: ''
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CeleryHeartbeatFail'
          description: ''
  /api/core/launcher/:
    get:
      operationId: core_launcher_retrieve
      description: |-
        GET Launch status

        Params:
        key
        user_id: Optional
      parameters:
        - in: query
          name: key
          schema:
            type: string
            minLength: 1
          required: true
        - in: query
          name: user_id
          schema:
            type: integer
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformList'
          description: ''
    post:
      operationId: core_launcher_create
      description: |-
        POST: Launch a new edX platform

        Params:
        user_id: The ID of the requesting user (required)
        key: The Deep LMS subdomain (required)
        name: The edX platform name ("optional")
        org: The edX organization ("optional")
        lms_url: LMS URL ("optional")
        cms_url: CMS URL ("optional")
        portal_url: Portal URL ("optional")
        use_default_hosts: Use Django settings for LMS/CMS hosts ("optional")
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LauncherViewPostRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/LauncherViewPostRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/LauncherViewPostRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/LauncherViewPostRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/LauncherViewPostRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformList'
          description: ''
  /api/core/lti/1p3/provider/lti-keys/:
    get:
      operationId: core_lti_1p3_provider_lti_keys_list
      description: List your LTI Provider Key's
      parameters:
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform Key
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LtiKey'
          description: ''
    post:
      operationId: core_lti_1p3_provider_lti_keys_create
      description: Create a new LTI Provider Key
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LtiKey'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/LtiKey'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/LtiKey'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/LtiKey'
          '*/*':
            schema:
              $ref: '#/components/schemas/LtiKey'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LtiKey'
          description: ''
  /api/core/lti/1p3/provider/lti-keys/{id}/:
    get:
      operationId: core_lti_1p3_provider_lti_keys_retrieve
      description: Get details about a specific LTI Provider Key
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform Key
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LtiKey'
          description: ''
    put:
      operationId: core_lti_1p3_provider_lti_keys_update
      description: Update an LTI Provider Key
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LtiKey'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/LtiKey'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/LtiKey'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/LtiKey'
          '*/*':
            schema:
              $ref: '#/components/schemas/LtiKey'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LtiKey'
          description: ''
    delete:
      operationId: core_lti_1p3_provider_lti_keys_destroy
      description: Delete an LTI Provider Key
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform Key
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/core/lti/1p3/provider/lti-mentors/:
    get:
      operationId: core_lti_1p3_provider_lti_mentors_list
      description: List your LTI Mentor's
      parameters:
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform Key
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LtiMentor'
          description: ''
    post:
      operationId: core_lti_1p3_provider_lti_mentors_create
      description: Create a new LTI Mentor
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LtiMentor'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/LtiMentor'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/LtiMentor'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/LtiMentor'
          '*/*':
            schema:
              $ref: '#/components/schemas/LtiMentor'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LtiMentor'
          description: ''
  /api/core/lti/1p3/provider/lti-mentors/{id}/:
    get:
      operationId: core_lti_1p3_provider_lti_mentors_retrieve
      description: Get details about a specific LTI Mentor
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform Key
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LtiMentor'
          description: ''
    put:
      operationId: core_lti_1p3_provider_lti_mentors_update
      description: Update an LTI Mentor
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LtiMentor'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/LtiMentor'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/LtiMentor'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/LtiMentor'
          '*/*':
            schema:
              $ref: '#/components/schemas/LtiMentor'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LtiMentor'
          description: ''
    delete:
      operationId: core_lti_1p3_provider_lti_mentors_destroy
      description: Delete an LTI Mentor
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform Key
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/core/lti/1p3/provider/lti-tools/:
    get:
      operationId: core_lti_1p3_provider_lti_tools_list
      description: List your LTI Tool's
      parameters:
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform Key
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LtiTool'
          description: ''
    post:
      operationId: core_lti_1p3_provider_lti_tools_create
      description: Create a new LTI Tool
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LtiTool'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/LtiTool'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/LtiTool'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/LtiTool'
          '*/*':
            schema:
              $ref: '#/components/schemas/LtiTool'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LtiTool'
          description: ''
  /api/core/lti/1p3/provider/lti-tools/{id}/:
    get:
      operationId: core_lti_1p3_provider_lti_tools_retrieve
      description: Get details about a specific LTI Tool
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform Key
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LtiTool'
          description: ''
    put:
      operationId: core_lti_1p3_provider_lti_tools_update
      description: Update an LTI Tool
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LtiTool'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/LtiTool'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/LtiTool'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/LtiTool'
          '*/*':
            schema:
              $ref: '#/components/schemas/LtiTool'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LtiTool'
          description: ''
    delete:
      operationId: core_lti_1p3_provider_lti_tools_destroy
      description: Delete an LTI Tool
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform Key
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/core/orgs/{org}/dark-mode-logo/:
    get:
      operationId: core_orgs_dark_mode_logo_retrieve
      description: Get platform logo
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - core
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: Unspecified response body
          description: ''
  /api/core/orgs/{org}/dark-mode-logo/create/:
    post:
      operationId: core_orgs_dark_mode_logo_create_create
      description: Upload a new platform logo
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageUpload'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ImageUpload'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ImageUpload'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ImageUpload'
          '*/*':
            schema:
              $ref: '#/components/schemas/ImageUpload'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageUpload'
          description: ''
  /api/core/orgs/{org}/favicon/:
    get:
      operationId: core_orgs_favicon_retrieve
      description: Get platform logo
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - core
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: Unspecified response body
          description: ''
  /api/core/orgs/{org}/favicon/create/:
    post:
      operationId: core_orgs_favicon_create_create
      description: Upload a new platform logo
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageUpload'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ImageUpload'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ImageUpload'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ImageUpload'
          '*/*':
            schema:
              $ref: '#/components/schemas/ImageUpload'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageUpload'
          description: ''
  /api/core/orgs/{org}/logo/:
    get:
      operationId: core_orgs_logo_retrieve
      description: Get platform logo
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - core
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: Unspecified response body
          description: ''
  /api/core/orgs/{org}/logo/create/:
    post:
      operationId: core_orgs_logo_create_create
      description: Upload a new platform logo
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageUpload'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ImageUpload'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ImageUpload'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ImageUpload'
          '*/*':
            schema:
              $ref: '#/components/schemas/ImageUpload'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageUpload'
          description: ''
  /api/core/orgs/{org}/metadata/:
    get:
      operationId: core_orgs_metadata_retrieve
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPublicMetadata'
          description: ''
    put:
      operationId: core_orgs_metadata_update
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformPublicMetadata'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformPublicMetadata'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformPublicMetadata'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformPublicMetadata'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformPublicMetadata'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPublicMetadata'
          description: ''
    patch:
      operationId: core_orgs_metadata_partial_update
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPlatformPublicMetadata'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedPlatformPublicMetadata'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPlatformPublicMetadata'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPlatformPublicMetadata'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedPlatformPublicMetadata'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPublicMetadata'
          description: ''
  /api/core/orgs/{org}/redirect-tokens/:
    post:
      operationId: core_orgs_redirect_tokens_create
      description: Creates redirect tokens for a URL specified by for a platform
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RedirectTokenRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/RedirectTokenRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RedirectTokenRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RedirectTokenRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/RedirectTokenRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedirectTokenResponse'
          description: ''
  /api/core/orgs/{org}/redirect-tokens/{redirect_token}/:
    get:
      operationId: core_orgs_redirect_tokens_retrieve
      description: |-
        Returns Redirect URL for the token specified.

        ```
        Requires user to be a member of the platform with the token passed
        ```
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: redirect_token
          schema:
            type: string
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedirectTokenResponse'
          description: ''
  /api/core/orgs/{org}/redirect-tokens/{redirect_token}/delete:
    delete:
      operationId: core_orgs_redirect_tokens_delete_destroy
      description: Delete specific token
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: redirect_token
          schema:
            type: string
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/core/orgs/{org}/thumbnail/:
    get:
      operationId: core_orgs_thumbnail_retrieve
      description: Get platform logo
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - core
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: Unspecified response body
          description: ''
  /api/core/orgs/{org}/thumbnail/create/:
    post:
      operationId: core_orgs_thumbnail_create_create
      description: Upload a new platform logo
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageUpload'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ImageUpload'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ImageUpload'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ImageUpload'
          '*/*':
            schema:
              $ref: '#/components/schemas/ImageUpload'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageUpload'
          description: ''
  /api/core/platform/:
    get:
      operationId: core_platform_retrieve
      description: |-
        GET /api/core/platform/
        Get main platform info.

        POST /api/core/platform/
        Save main platform settings.

        Params:
        user_id (optional)
        key
        field_key (POST)
        value (POST)
      parameters:
        - in: query
          name: key
          schema:
            type: string
            minLength: 1
          required: true
        - in: query
          name: user_id
          schema:
            type: integer
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformList'
          description: ''
    post:
      operationId: core_platform_create
      description: |-
        Update platform object

        Params:
        user_id

        key
        new_key (If changing platform key)
        name

        Advanced Params (Don't expose these to users)
        lms_url
        cms_url
        portal_url
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformUpdatePostRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformUpdatePostRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformUpdatePostRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformUpdatePostRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformUpdatePostRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformList'
          description: ''
  /api/core/platform/api-tokens/:
    get:
      operationId: core_platform_api_tokens_list
      description: List Platform API Key's belonging to the target platform
      parameters:
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key of target platform
          required: true
      tags:
        - core
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PlatformApiKey'
          description: ''
    post:
      operationId: core_platform_api_tokens_create
      description: Create a new Platform Api Key for the target platform
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformApiKey'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformApiKey'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformApiKey'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformApiKey'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformApiKey'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformApiKey'
          description: ''
  /api/core/platform/api-tokens/{name}:
    delete:
      operationId: core_platform_api_tokens_destroy
      description: Delete Platform Api Key by name in the target platform
      parameters:
        - in: path
          name: name
          schema:
            type: string
          required: true
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key of target platform
          required: true
      tags:
        - core
      responses:
        '204':
          description: No response body
  /api/core/platform/config/site/:
    get:
      operationId: core_platform_config_site_retrieve
      description: |-
        GET /site
        Get site settings.

        POST /site
        Save site settings.

        Params:
        user_id
        key
        field_key (POST)
        value (POST)
      parameters:
        - in: query
          name: key
          schema:
            type: string
            minLength: 1
          required: true
        - in: query
          name: user_id
          schema:
            type: integer
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
    post:
      operationId: core_platform_config_site_create
      description: |-
        GET /site
        Get site settings.

        POST /site
        Save site settings.

        Params:
        user_id
        key
        field_key (POST)
        value (POST)
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: {}
              description: Unspecified request body
          application/scim+json:
            schema:
              type: object
              additionalProperties: {}
              description: Unspecified request body
          application/x-www-form-urlencoded:
            schema:
              type: object
              additionalProperties: {}
              description: Unspecified request body
          multipart/form-data:
            schema:
              type: object
              additionalProperties: {}
              description: Unspecified request body
          '*/*':
            schema:
              type: object
              additionalProperties: {}
              description: Unspecified request body
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
  /api/core/platform/configurations/:
    get:
      operationId: core_platform_configurations_list
      description: Get all configuration values for a platform with proper type casting.
      summary: List Platform Configurations
      parameters:
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Platform key to get/set configurations for
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PlatformConfigurationList'
          description: ''
    post:
      operationId: core_platform_configurations_create
      description: >-
        Set or update multiple platform configuration values.Values will be
        automatically normalized for storage and cast appropriately on
        retrieval.
      summary: Set Platform Configurations
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformConfigurationSet'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformConfigurationSet'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformConfigurationSet'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformConfigurationSet'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformConfigurationSet'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformConfigurationSetResponse'
          description: ''
  /api/core/platform/configurations/available-settings/:
    get:
      operationId: core_platform_configurations_available_settings_retrieve
      description: >-
        Get all available settings that can be configured with current platform
        values
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformConfigurationList'
          description: ''
  /api/core/platform/configurations/delete-config/:
    delete:
      operationId: core_platform_configurations_delete_config_destroy
      description: |-
        Delete a specific platform configuration

        Query Parameters:
        - platform_key: Platform key
        - key: Configuration key to delete
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/core/platform/configurations/public/:
    get:
      operationId: core_platform_configurations_public_retrieve
      description: |-
        Get public platform configurations for platform members

        Query Parameters:
        - platform_key: Platform key to get public configurations for

        Returns:
        - platform_key: The platform key
        - configurations: Dictionary of public config key-value pairs
        - count: Number of public configurations returned
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformConfigurationList'
          description: ''
  /api/core/platform/users/:
    get:
      operationId: core_platform_users_retrieve
      description: >-
        Retrieve users associated with platform and optionally their policies
        when return_policies is set
      parameters:
        - in: query
          name: page
          schema:
            type: integer
        - in: query
          name: page_size
          schema:
            type: integer
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
        - in: query
          name: platform_org
          schema:
            type: string
            minLength: 1
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
        - in: query
          name: return_policies
          schema:
            type: string
            minLength: 1
        - in: query
          name: sort
          schema:
            type: string
            minLength: 1
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserPlatformManagementListViewGetResponse'
              examples:
                ResponseExample(withoutPolicies):
                  value:
                    count: 35
                    next_page: 4
                    previous_page: 2
                    results:
                      - username: student001
                        user_id: 36
                        name: Student One
                        platform_org: IBLTEST
                        expired_on: null
                        is_admin: false
                        is_staff: false
                        platform_key: ibltest
                        active: true
                        email: student001@example.com
                        added_on: '2020-12-16T08:03:22.895299Z'
                      - username: instructor000
                        user_id: 42
                        name: Instructor One
                        platform_org: IBLTEST
                        expired_on: null
                        is_admin: false
                        is_staff: true
                        platform_key: ibltest
                        active: true
                        email: instructor000@example.com
                        added_on: '2021-01-04T22:16:51.326865Z'
                  summary: Example response when return_policies is not provided
                ResponseExample(withPolicies):
                  value:
                    count: 35
                    next_page: 4
                    previous_page: 2
                    results:
                      allowed_policies:
                        - Analytics Viewer
                        - Platform Admin
                        - Content Creator
                      data:
                        - username: student001
                          user_id: 36
                          name: Student One
                          platform_org: IBLTEST
                          expired_on: null
                          is_admin: false
                          is_staff: false
                          platform_key: ibltest
                          active: true
                          email: student001@example.com
                          added_on: '2020-12-16T08:03:22.895299Z'
                          policies: []
                        - username: instructor000
                          user_id: 42
                          name: Instructor One
                          platform_org: IBLTEST
                          expired_on: null
                          is_admin: false
                          is_staff: true
                          platform_key: ibltest
                          active: true
                          email: instructor000@example.com
                          added_on: '2021-01-04T22:16:51.326865Z'
                          policies:
                            - Analytics Viewer
                        - username: student005
                          user_id: 40
                          name: First Last
                          platform_org: IBLTEST
                          expired_on: null
                          is_admin: false
                          is_staff: false
                          platform_key: ibltest
                          active: true
                          email: student005@example.com
                          added_on: '2021-01-12T18:08:01.641071Z'
                          policies: []
                  summary: Example response when return_policies is provided
          description: ''
  /api/core/platform/users/policies/:
    put:
      operationId: core_platform_users_policies_update
      description: >-
        Bulk update user policies on a platform. Requires
        Ibl.Core/UserPolicies/write permission.


        Policy removals are processed before policy additions.
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/UserPolicyUpdate'
            examples:
              RequestExample-Add/Remove:
                value:
                  - - user_id: 42
                      platform_key: ibltest
                      policies_to_add:
                        - Analytics Viewer
                      policies_to_remove:
                        - Mentor Chat
                    - user_id: 43
                      platform_key: ibltest
                      policies_to_add:
                        - Mentor Viewer
                        - Mentor Editor
                summary: Example request using policies_to_add and policies_to_remove
              RequestExample-Set:
                value:
                  - - user_id: 42
                      platform_key: ibltest
                      policies_to_set:
                        - Analytics Viewer
                        - Content Creator
                    - user_id: 43
                      platform_key: ibltest
                      policies_to_set: []
                summary: Example request using policies_to_set to replace all policies
          application/scim+json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/UserPolicyUpdate'
          application/x-www-form-urlencoded:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/UserPolicyUpdate'
          multipart/form-data:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/UserPolicyUpdate'
          '*/*':
            schema:
              type: array
              items:
                $ref: '#/components/schemas/UserPolicyUpdate'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserPolicyUpdateResponse'
              examples:
                ResponseExample:
                  value:
                    '42':
                      - Analytics Viewer
                      - Mentor Viewer
                    '43':
                      - Mentor Editor
                      - Mentor Viewer
                    '44': []
                  summary: Example response showing user IDs mapped to their policies
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserPolicyUpdateError'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserPolicyUpdateForbidden'
          description: ''
  /api/core/platforms/{platform_key}/public-image-assets/:
    get:
      operationId: core_platforms_public_image_assets_list
      description: Shared functionality for platform public image asset views.
      parameters:
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PlatformPublicImageAsset'
          description: ''
    post:
      operationId: core_platforms_public_image_assets_create
      description: Shared functionality for platform public image asset views.
      parameters:
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformPublicImageAsset'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformPublicImageAsset'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformPublicImageAsset'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformPublicImageAsset'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformPublicImageAsset'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPublicImageAsset'
          description: ''
  /api/core/platforms/{platform_key}/public-image-assets/{asset_id}/:
    get:
      operationId: core_platforms_public_image_assets_retrieve
      description: Shared functionality for platform public image asset views.
      parameters:
        - in: path
          name: asset_id
          schema:
            type: integer
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPublicImageAsset'
          description: ''
    put:
      operationId: core_platforms_public_image_assets_update
      description: Shared functionality for platform public image asset views.
      parameters:
        - in: path
          name: asset_id
          schema:
            type: integer
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformPublicImageAsset'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformPublicImageAsset'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformPublicImageAsset'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformPublicImageAsset'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformPublicImageAsset'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPublicImageAsset'
          description: ''
    patch:
      operationId: core_platforms_public_image_assets_partial_update
      description: Shared functionality for platform public image asset views.
      parameters:
        - in: path
          name: asset_id
          schema:
            type: integer
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPlatformPublicImageAsset'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedPlatformPublicImageAsset'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPlatformPublicImageAsset'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPlatformPublicImageAsset'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedPlatformPublicImageAsset'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPublicImageAsset'
          description: ''
    delete:
      operationId: core_platforms_public_image_assets_destroy
      description: Shared functionality for platform public image asset views.
      parameters:
        - in: path
          name: asset_id
          schema:
            type: integer
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/core/platforms/{platform_key}/public-image-assets/{asset_id}/file/:
    get:
      operationId: core_platforms_public_image_assets_file_retrieve
      description: Shared functionality for platform public image asset views.
      parameters:
        - in: path
          name: asset_id
          schema:
            type: integer
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - core
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: Unspecified response body
          description: ''
  /api/core/rbac/groups/:
    get:
      operationId: core_rbac_groups_list
      description: >-
        Retrieve a list of RBAC groups. Can be filtered by platform_key, owner,
        name, username, or email. Use include_users to control response payload.
      summary: List RBAC groups
      parameters:
        - in: query
          name: email
          schema:
            type: string
            minLength: 1
          description: Filter groups by email (exact match, case-insensitive)
        - in: query
          name: include_users
          schema:
            type: boolean
            default: true
          description: 'Include user information in response (default: true)'
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Filter groups by name (case-insensitive partial match)
        - in: query
          name: owner
          schema:
            type: string
            minLength: 1
          description: Filter groups by owner username
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Filter groups by platform key
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: Filter groups by username (exact match, case-insensitive)
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedRbacGroupList'
          description: ''
        '403':
          description: Permission denied - insufficient RBAC permissions
    post:
      operationId: core_rbac_groups_create
      description: >-
        Create a new RBAC group for a platform. Users can be assigned during
        creation.
      summary: Create RBAC group
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RbacGroup'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/RbacGroup'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RbacGroup'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RbacGroup'
          '*/*':
            schema:
              $ref: '#/components/schemas/RbacGroup'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RbacGroup'
          description: ''
        '400':
          description: |-
            Invalid input data. Common errors include:
            - Users do not belong to the specified platform
            - Invalid user IDs provided
        '403':
          description: Permission denied - insufficient RBAC permissions
  /api/core/rbac/groups/{id}/:
    get:
      operationId: core_rbac_groups_retrieve
      description: Retrieve details of a specific RBAC group including assigned users.
      summary: Retrieve RBAC group
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this RBAC Group.
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RbacGroup'
          description: ''
        '403':
          description: Permission denied - insufficient RBAC permissions
        '404':
          description: Group not found
    put:
      operationId: core_rbac_groups_update
      description: >-
        Update an existing RBAC group. Platform validation applies for user
        assignments. Cannot update internal system groups.
      summary: Update RBAC group
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this RBAC Group.
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RbacGroup'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/RbacGroup'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RbacGroup'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RbacGroup'
          '*/*':
            schema:
              $ref: '#/components/schemas/RbacGroup'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RbacGroup'
          description: ''
        '400':
          description: |-
            Invalid input data. Common errors include:
            - Users do not belong to the specified platform
            - Invalid user IDs provided
        '403':
          description: >-
            Permission denied - insufficient RBAC permissions or attempting to
            edit internal system group
        '404':
          description: Group not found
    patch:
      operationId: core_rbac_groups_partial_update
      description: >-
        Partially update an existing RBAC group. Platform validation applies for
        user assignments. Cannot update internal system groups.
      summary: Partially update RBAC group
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this RBAC Group.
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedRbacGroup'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedRbacGroup'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedRbacGroup'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedRbacGroup'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedRbacGroup'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RbacGroup'
          description: ''
        '400':
          description: |-
            Invalid input data. Common errors include:
            - Users do not belong to the specified platform
            - Invalid user IDs provided
        '403':
          description: >-
            Permission denied - insufficient RBAC permissions or attempting to
            edit internal system group
        '404':
          description: Group not found
    delete:
      operationId: core_rbac_groups_destroy
      description: >-
        Delete an RBAC group and all associated group role assignments. Cannot
        delete internal system groups.
      summary: Delete RBAC group
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this RBAC Group.
          required: true
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: platform key for authorization check
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Group deleted successfully
        '403':
          description: >-
            Permission denied - insufficient RBAC permissions or attempting to
            delete internal system group
        '404':
          description: Group not found
  /api/core/rbac/mentor-access/:
    get:
      operationId: core_rbac_mentor_access_list
      description: >-
        Retrieve current access information for a specific mentor, including all
        groups and users that have access with their respective roles.
      summary: Get mentor access status
      parameters:
        - in: query
          name: mentor_id
          schema:
            type: integer
          description: ID of the mentor to get access information for
          required: true
        - in: query
          name: platform_key
          schema:
            type: string
          description: Platform key where the mentor belongs
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MentorPolicy'
          description: ''
        '400':
          description: Missing or invalid query parameters
        '403':
          description: Permission denied - ShareMentor permission required
        '404':
          description: Platform not found
        '500':
          description: Internal server error
    post:
      operationId: core_rbac_mentor_access_create
      description: >-
        Create or update RBAC policies to manage group and user access to
        specific mentors. Creates role-specific policies and handles
        adding/removing groups and users.
      summary: >-
        Control which RbacGroups and/or Users have access to a mentor and with
        what Role
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorPolicy'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorPolicy'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorPolicy'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorPolicy'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorPolicy'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorPolicy'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorPolicy'
          description: ''
        '400':
          description: Invalid request data or validation errors
        '403':
          description: Permission denied - ShareMentor permission required
        '404':
          description: Platform or mentor not found
  /api/core/rbac/permissions/check/:
    post:
      operationId: core_rbac_permissions_check_create
      description: Check user permissions for specified resources
      summary: Check user permissions
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PermissionCheckRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PermissionCheckRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PermissionCheckRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PermissionCheckRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PermissionCheckRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
        '400':
          description: Invalid request data
        '401':
          description: Authentication required
        '403':
          description: Permission denied
  /api/core/rbac/policies/:
    get:
      operationId: core_rbac_policies_list
      description: >-
        Retrieve a list of RBAC policies. Can be filtered by platform_key,
        role_id, name, username, email, or group. Use include_users and
        include_groups to control response payload.
      summary: List RBAC policies
      parameters:
        - in: query
          name: email
          schema:
            type: string
            minLength: 1
          description: >-
            Filter policies by email (exact match, case-insensitive) - includes
            users in policy or in policy's groups
        - in: query
          name: group
          schema:
            type: string
            minLength: 1
          description: Filter policies by group name (exact match, case-insensitive)
        - in: query
          name: include_groups
          schema:
            type: boolean
            default: true
          description: 'Include group information in response (default: true)'
        - in: query
          name: include_users
          schema:
            type: boolean
            default: true
          description: 'Include user information in response (default: true)'
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Filter policies by name (case-insensitive partial match)
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Filter policies by platform key
        - in: query
          name: role_id
          schema:
            type: integer
          description: Filter policies by role ID
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
          description: >-
            Filter policies by username (exact match, case-insensitive) -
            includes users in policy or in policy's groups
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedRbacPolicyList'
          description: ''
        '403':
          description: Permission denied - insufficient RBAC permissions
    post:
      operationId: core_rbac_policies_create
      description: Create a new RBAC policy that defines resource access for a role
      summary: Create RBAC policy
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RbacPolicy'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/RbacPolicy'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RbacPolicy'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RbacPolicy'
          '*/*':
            schema:
              $ref: '#/components/schemas/RbacPolicy'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RbacPolicy'
          description: ''
        '400':
          description: >-
            Invalid input data. Common errors include: invalid user/group IDs,
            users/groups not belonging to the platform, or invalid resource
            paths.
        '403':
          description: Permission denied - insufficient RBAC permissions
  /api/core/rbac/policies/{id}/:
    get:
      operationId: core_rbac_policies_retrieve
      description: >-
        Retrieve details of a specific RBAC policy, including role, platform,
        resources, users, and groups.
      summary: Retrieve RBAC policy
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this RBAC Policy.
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RbacPolicy'
          description: ''
        '403':
          description: Permission denied - insufficient RBAC permissions
        '404':
          description: Policy not found
    put:
      operationId: core_rbac_policies_update
      description: Update an existing RBAC policy.
      summary: Update RBAC policy
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this RBAC Policy.
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RbacPolicy'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/RbacPolicy'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RbacPolicy'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RbacPolicy'
          '*/*':
            schema:
              $ref: '#/components/schemas/RbacPolicy'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RbacPolicy'
          description: ''
        '400':
          description: >-
            Invalid input data. Common errors include: invalid user/group IDs,
            users/groups not belonging to the platform, or invalid resource
            paths.
        '403':
          description: Permission denied - insufficient RBAC permissions
        '404':
          description: Policy not found
    patch:
      operationId: core_rbac_policies_partial_update
      description: >-
        Partially update an existing RBAC policy. Only provided fields will be
        updated.
      summary: Partially update RBAC policy
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this RBAC Policy.
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedRbacPolicy'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedRbacPolicy'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedRbacPolicy'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedRbacPolicy'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedRbacPolicy'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RbacPolicy'
          description: ''
        '400':
          description: >-
            Invalid input data. Common errors include: invalid user/group IDs,
            users/groups not belonging to the platform, or invalid resource
            paths.
        '403':
          description: Permission denied - insufficient RBAC permissions
        '404':
          description: Policy not found
    delete:
      operationId: core_rbac_policies_destroy
      description: Delete an RBAC policy.
      summary: Delete RBAC policy
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this RBAC Policy.
          required: true
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: platform key for authorization check
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Policy deleted successfully
        '403':
          description: Permission denied - insufficient RBAC permissions
        '404':
          description: Policy not found
  /api/core/rbac/roles/:
    get:
      operationId: core_rbac_roles_list
      description: Retrieve a list of RBAC roles. Can be filtered by platform_key and name.
      summary: List RBAC roles
      parameters:
        - in: query
          name: name
          schema:
            type: string
            minLength: 1
          description: Filter roles by name (case-insensitive partial match)
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Filter roles by platform key
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedRbacRoleList'
          description: ''
        '403':
          description: Permission denied - insufficient RBAC permissions
    post:
      operationId: core_rbac_roles_create
      description: Create a new RBAC role for a platform.
      summary: Create RBAC role
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RbacRole'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/RbacRole'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RbacRole'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RbacRole'
          '*/*':
            schema:
              $ref: '#/components/schemas/RbacRole'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RbacRole'
          description: ''
        '400':
          description: Invalid input data
        '403':
          description: Permission denied - insufficient RBAC permissions
  /api/core/rbac/roles/{id}/:
    get:
      operationId: core_rbac_roles_retrieve
      description: Retrieve details of a specific RBAC role.
      summary: Retrieve RBAC role
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this RBAC Role.
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RbacRole'
          description: ''
        '403':
          description: Permission denied - insufficient RBAC permissions
        '404':
          description: Role not found
    put:
      operationId: core_rbac_roles_update
      description: Update an existing RBAC role.
      summary: Update RBAC role
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this RBAC Role.
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RbacRole'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/RbacRole'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RbacRole'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RbacRole'
          '*/*':
            schema:
              $ref: '#/components/schemas/RbacRole'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RbacRole'
          description: ''
        '400':
          description: Invalid input data
        '403':
          description: Permission denied - insufficient RBAC permissions
        '404':
          description: Role not found
    patch:
      operationId: core_rbac_roles_partial_update
      description: Partially update an existing RBAC role.
      summary: Partially update RBAC role
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this RBAC Role.
          required: true
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedRbacRole'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedRbacRole'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedRbacRole'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedRbacRole'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedRbacRole'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RbacRole'
          description: ''
        '400':
          description: Invalid input data
        '403':
          description: Permission denied - insufficient RBAC permissions
        '404':
          description: Role not found
    delete:
      operationId: core_rbac_roles_destroy
      description: >-
        Delete an RBAC role. WARNING: Deleting a role will remove all policies
        referencing it.
      summary: Delete RBAC role
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this RBAC Role.
          required: true
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: platform key for authorization check
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Role deleted successfully
        '403':
          description: Permission denied - insufficient RBAC permissions
        '404':
          description: Role not found
  /api/core/rbac/student-llm-access/set/:
    post:
      operationId: core_rbac_student_llm_access_set_create
      description: >-
        Configure which LLM resources students can access on a platform by
        replacing the LLM Users policy resources
      summary: Set student LLM access permissions
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetStudentLLMAccess'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SetStudentLLMAccess'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SetStudentLLMAccess'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SetStudentLLMAccess'
          '*/*':
            schema:
              $ref: '#/components/schemas/SetStudentLLMAccess'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StudentLLMAccessResponse'
          description: ''
        '400':
          description: Invalid request data
        '403':
          description: Permission denied - Tenant Admin access required
        '404':
          description: Platform or LLM Users policy not found
  /api/core/rbac/student-llm-access/status/:
    get:
      operationId: core_rbac_student_llm_access_status_retrieve
      description: >-
        Check which LLM resources students are currently allowed to access on a
        platform
      summary: Get student LLM access permissions
      parameters:
        - in: query
          name: platform_key
          schema:
            type: string
            maxLength: 255
            minLength: 1
          description: The platform key to check
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StudentLLMAccessResponse'
          description: ''
        '400':
          description: Missing platform_key parameter
        '403':
          description: Permission denied - Tenant Admin access required
        '404':
          description: Platform not found
  /api/core/rbac/student-mentor-creation/set/:
    post:
      operationId: core_rbac_student_mentor_creation_set_create
      description: >-
        Enable or disable the ability for students to create mentors on a
        platform
      summary: Set student mentor creation permission
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetStudentMentorCreationPermission'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SetStudentMentorCreationPermission'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SetStudentMentorCreationPermission'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SetStudentMentorCreationPermission'
          '*/*':
            schema:
              $ref: '#/components/schemas/SetStudentMentorCreationPermission'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StudentMentorCreationPermissionResponse'
          description: ''
        '400':
          description: Invalid request data
        '403':
          description: Permission denied - Tenant Admin access required
        '404':
          description: Platform, students group, or mentor creators policy not found
  /api/core/rbac/student-mentor-creation/status/:
    get:
      operationId: core_rbac_student_mentor_creation_status_retrieve
      description: >-
        Check whether students are currently allowed to create mentors on a
        platform
      summary: Get student mentor creation permission status
      parameters:
        - in: query
          name: platform_key
          schema:
            type: string
            maxLength: 255
            minLength: 1
          description: The platform key to check
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StudentMentorCreationPermissionResponse'
          description: ''
        '400':
          description: Missing platform_key parameter
        '403':
          description: Permission denied - Tenant Admin access required
        '404':
          description: Platform not found
  /api/core/rbac/user-group-access/:
    get:
      operationId: core_rbac_user_group_access_retrieve
      description: >-
        Retrieve current group access information for a specific user, including
        all groups the user has access to and whether they have mentor
        management permissions.
      summary: Get user group access status
      parameters:
        - in: query
          name: platform_key
          schema:
            type: string
          description: Platform key where the groups exist
          required: true
        - in: query
          name: user_id
          schema:
            type: integer
          description: ID of the user to check group access for
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserGroupAccess'
          description: ''
        '400':
          description: Missing or invalid query parameters
        '404':
          description: Platform or user not found
        '500':
          description: Internal server error
    post:
      operationId: core_rbac_user_group_access_create
      description: >-
        Create or update user access to groups by adding/removing group access.
        Creates one policy per user with GROUP_MENTOR_MANAGER role for managing
        mentor access.
      summary: Manage user access to groups
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserGroupAccess'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserGroupAccess'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserGroupAccess'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserGroupAccess'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserGroupAccess'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserGroupAccess'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserGroupAccess'
          description: ''
        '400':
          description: Invalid request data or validation errors
        '404':
          description: Platform or user not found
        '500':
          description: Internal server error
  /api/core/session/logout/:
    post:
      operationId: core_session_logout_create
      description: Invalidate all tokens for the authenticated user
      tags:
        - core
      responses:
        '200':
          description: No response body
  /api/core/signals/edx/:
    post:
      operationId: core_signals_edx_create
      description: POST signals/edx/
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EdxSignalReceiverRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/EdxSignalReceiverRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/EdxSignalReceiverRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/EdxSignalReceiverRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/EdxSignalReceiverRequest'
        required: true
      responses:
        '200':
          description: No response body
  /api/core/token/proxy/:
    post:
      operationId: core_token_proxy_create
      description: |-
        Param:
        Any of user_id/username/email
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/core/token/verify/:
    get:
      operationId: core_token_verify_retrieve
      description: Check token user
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/core/user_groups/:
    get:
      operationId: core_user_groups_retrieve
      description: Show (active) user groups associated with a platform
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    post:
      operationId: core_user_groups_create
      description: Create/update a user group
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    delete:
      operationId: core_user_groups_destroy
      description: Delete user group
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/core/user_groups/link/:
    get:
      operationId: core_user_groups_link_retrieve
      description: |-
        Show active users in user group (paginated)

        group_id is numeric ID of group
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    post:
      operationId: core_user_groups_link_create
      description: Add single user to user group, or update status
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    delete:
      operationId: core_user_groups_link_destroy
      description: Delete user group link
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/core/user_groups/link/bulk/:
    post:
      operationId: core_user_groups_link_bulk_create
      description: Add users to user group, or update status
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/core/users/delete/:
    post:
      operationId: core_users_delete_create
      description: >-
        Initiates the account deletion process for the authenticated user or
        specified username.
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserDeleteAPIRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserDeleteAPIRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserDeleteAPIRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserDeleteAPIRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserDeleteAPIRequest'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDeleteAPIResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDeleteAPIError'
          description: ''
  /api/core/users/metadata/proxy/:
    get:
      operationId: core_users_metadata_proxy_retrieve
      description: |-
        Get detailed user information.

        Make permission check for platform admins here,
        then proxy request to edx.
      parameters:
        - in: query
          name: email
          schema:
            type: string
            format: email
            minLength: 1
        - in: query
          name: user_id
          schema:
            type: integer
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/core/users/platforms/:
    get:
      operationId: core_users_platforms_list
      description: |-
        Retrieve platforms associated with user_id

        Params:
        user_id
        username
        email
      parameters:
        - in: query
          name: email
          schema:
            type: string
            format: email
            minLength: 1
        - in: query
          name: user_id
          schema:
            type: integer
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserPlatformLink'
          description: ''
    post:
      operationId: core_users_platforms_create
      description: |-
        Explicitly link platform to user_id

        Params:
        user_id
        platform_key
        added_on (optional)
        expired_on (optional)
        is_admin (optional)
        active (optional)
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserPlatformViewPostRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserPlatformViewPostRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserPlatformViewPostRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserPlatformViewPostRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserPlatformViewPostRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          description: No response body
  /api/core/users/platforms/config/:
    get:
      operationId: core_users_platforms_config_retrieve
      description: |-
        Get platform self-linking configuration

        Params:
        platform_key: The key of the platform to get configuration for
      parameters:
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformMembershipConfig'
          description: ''
    post:
      operationId: core_users_platforms_config_create
      description: |-
        Set platform self-linking configuration

        Params:
        platform_key: The key of the platform to configure
        allow_self_linking: Whether to allow self-linking for this platform
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformMembershipConfigPostRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformMembershipConfigPostRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformMembershipConfigPostRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformMembershipConfigPostRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformMembershipConfigPostRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformMembershipConfig'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformMembershipConfig'
          description: ''
  /api/core/users/platforms/self-link/:
    post:
      operationId: core_users_platforms_self_link_create
      description: >-
        Allow authenticated users to self-link to platforms that have
        self-linking enabled


        Params:

        platform_key: The key of the platform to link to
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserPlatformSelfLinkRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserPlatformSelfLinkRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserPlatformSelfLinkRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserPlatformSelfLinkRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserPlatformSelfLinkRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserPlatformSelfLinkResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserPlatformSelfLinkError'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserPlatformSelfLinkForbidden'
          description: ''
  /api/core/users/proxy/:
    get:
      operationId: core_users_proxy_retrieve
      description: Retrieve proxy user information by user_id
      parameters:
        - in: query
          name: email
          schema:
            type: string
            format: email
            minLength: 1
        - in: query
          name: user_id
          schema:
            type: integer
        - in: query
          name: username
          schema:
            type: string
            minLength: 1
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserProxyGetResponse'
          description: ''
    post:
      operationId: core_users_proxy_create
      description: |-
        Add proxy user

        Params:
        user_id
        username
        email
        edx_data
        data
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserProxyPostRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserProxyPostRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserProxyPostRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserProxyPostRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserProxyPostRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserProxyPostResponse'
          description: ''
  /api/core/users/proxy/bulk/:
    post:
      operationId: core_users_proxy_bulk_create
      description: |-
        Add proxy users by bulk

        Params:
        users: list of user objects
        ```
        [
            {"user_id": 1, ...},
            {"user_id": 2, ...}
        ]
        ```
      tags:
        - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserProxyBulkRequest'
            examples:
              RequestExample:
                value:
                  users:
                    - user_id: 1
                      username: test_user1
                      email: test_user1@example.com
                    - user_id: 2
                      username: test_user2
                      email: test_user2@example.com
                summary: Example request
                description: Simple request
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserProxyBulkRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserProxyBulkRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserProxyBulkRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserProxyBulkRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  additionalProperties:
                    type: string
              examples:
                ResponseExample:
                  value:
                    - - user_id: 1
                        created: true
                        success: true
                      - user_id: 2
                        created: true
                        success: true
                  summary: Example response
          description: ''
  /api/core/users/search/:
    get:
      operationId: core_users_search_retrieve
      description: |-
        Retrieve users based on query
        Not intended for public use with multitenant platforms

        Params:
        query
        sort
      parameters:
        - in: query
          name: page
          schema:
            type: integer
        - in: query
          name: page_size
          schema:
            type: integer
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
        - in: query
          name: sort
          schema:
            type: string
            minLength: 1
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserSearchViewGetResponse'
              examples:
                ResponseExample:
                  value:
                    count: 35
                    next_page: 4
                    previous_page: 2
                    results:
                      - username: student001
                        user_id: 36
                        active: true
                        email: student001@example.com
                        edx_data:
                          name: Stu Dent
                      - username: instructor000
                        user_id: 42
                        active: true
                        email: instructor000@example.com
                        edx_data:
                          name: ''
                      - username: student005
                        user_id: 40
                        active: true
                        email: student005@example.com
                        edx_data:
                          name: Stu Five
                  summary: Example response
          description: ''
  /api/credentials/exim/credentials/course/{course_id}/export/:
    get:
      operationId: credentials_exim_credentials_course_export_retrieve
      description: |-
        Export credential information for a specific course.

        Args:
            request: The HTTP request object
            course_id: Course ID to export credentials for

        Returns:
            Response: JSON response with credential data
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/credentials/exim/credentials/course/{course_id}/import/:
    post:
      operationId: credentials_exim_credentials_course_import_create
      description: |-
        Import credential information for a specific course.

        Args:
            request: The HTTP request object
            course_id: Course ID to import credentials for

        Returns:
            Response: JSON response with import results
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/credentials/orgs/{org}/users/{user_id}/:
    get:
      operationId: credentials_orgs_users_retrieve
      description: |-
        Get all credentials for a platform with search and pagination support.

        Query Parameters:
        - platform_org: Platform org ID (takes precedence over URL org)
        - page: Page number (default: 1)
        - page_size: Items per page (default: 10, max: 100)
        - search: Search term to filter credentials
        - course: Course ID to filter credentials
        - program: Program ID to filter credentials
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Credential'
          description: ''
    post:
      operationId: credentials_orgs_users_create
      description: >-
        API View for managing credentials across a platform.


        This endpoint allows creating and retrieving credentials for a specific
        organization/tenant,

        with support for filtering, searching, and pagination.


        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID making the request

        Query Parameters:
            # Platform identification
            platform_org (str, optional): Alternative platform identifier (takes precedence over URL org)

            # Pagination
            page (int, optional): Page number (default: 1)
            page_size (int, optional): Items per page (default: 10, max: 100)

            # Filtering and search
            search (str, optional): Search term to filter credentials by name or description
            course (str, optional): Course ID to filter credentials associated with a specific course
            program (str, optional): Program ID to filter credentials associated with a specific program

        Methods:
            GET: Retrieve credentials with filtering and pagination
            POST: Create a new credential

        POST Request Body:
            A JSON object containing credential details:
            - name (str): Credential name
            - description (str, optional): Credential description
            - issuer (str): Issuer entity ID
            - credential_type (str, optional): Type of credential
            - html_template (str, optional): HTML template for credential rendering
            - css_template (str, optional): CSS template for credential styling
            - icon_image (str, optional): URL to credential icon
            - background_image (str, optional): URL to credential background
            - thumbnail_image (str, optional): URL to credential thumbnail
            - criteria_url (str, optional): URL to credential criteria
            - criteria_text (str, optional): Text description of credential criteria
            - issuing_signal (str, optional): Signal that triggers credential issuance

        Returns:
            GET: A JSON response containing:
                {
                    "status": {"success": true, "description": "Ok"},
                    "result": {
                        "next": "URL to next page",
                        "previous": "URL to previous page",
                        "count": 42,
                        "data": [
                            {credential object},
                            {credential object},
                            ...
                        ],
                        "num_pages": 5,
                        "page_number": 1,
                        "max_page_size": 100
                    }
                }

            POST: A JSON response containing:
                {
                    "status": {"success": true, "description": "Created"},
                    "result": {credential object}
                }

        Error Responses:
            400 Bad Request: If the request data is invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the platform doesn't exist
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires CredentialAssignmentPermission
            - Only public credentials are returned by default
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Credential'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Credential'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Credential'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Credential'
          '*/*':
            schema:
              $ref: '#/components/schemas/Credential'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Credential'
          description: ''
  /api/credentials/orgs/{org}/users/{user_id}/{entity_id}:
    get:
      operationId: credentials_orgs_users_retrieve_2
      description: >-
        API View for managing individual credentials.


        This endpoint allows retrieving, updating, and deleting specific
        credentials

        identified by their entity_id.


        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID making the request
            entity_id (str): The credential entity ID

        Methods:
            GET: Retrieve a specific credential
            PUT: Update a specific credential
            DELETE: Delete a specific credential

        PUT Request Body:
            A JSON object containing credential details to update:
            - name (str, optional): Credential name
            - description (str, optional): Credential description
            - credential_type (str, optional): Type of credential
            - html_template (str, optional): HTML template for credential rendering
            - css_template (str, optional): CSS template for credential styling
            - icon_image (str, optional): URL to credential icon
            - background_image (str, optional): URL to credential background
            - thumbnail_image (str, optional): URL to credential thumbnail
            - criteria_url (str, optional): URL to credential criteria
            - criteria_text (str, optional): Text description of credential criteria
            - issuing_signal (str, optional): Signal that triggers credential issuance

        Returns:
            GET: A JSON response containing:
                {
                    "status": {"success": true, "description": "Ok"},
                    "result": {credential object}
                }

            PUT: A JSON response containing:
                {
                    "status": {"success": true, "description": "Updated"},
                    "result": {credential object}
                }

            DELETE: No content (204)

        Error Responses:
            400 Bad Request: If the request data is invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the credential doesn't exist
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires CredentialAssignmentPermission
            - Users can only manage credentials they have permission to access
      parameters:
        - in: path
          name: entity_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Credential'
          description: ''
    put:
      operationId: credentials_orgs_users_update
      description: >-
        API View for managing individual credentials.


        This endpoint allows retrieving, updating, and deleting specific
        credentials

        identified by their entity_id.


        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID making the request
            entity_id (str): The credential entity ID

        Methods:
            GET: Retrieve a specific credential
            PUT: Update a specific credential
            DELETE: Delete a specific credential

        PUT Request Body:
            A JSON object containing credential details to update:
            - name (str, optional): Credential name
            - description (str, optional): Credential description
            - credential_type (str, optional): Type of credential
            - html_template (str, optional): HTML template for credential rendering
            - css_template (str, optional): CSS template for credential styling
            - icon_image (str, optional): URL to credential icon
            - background_image (str, optional): URL to credential background
            - thumbnail_image (str, optional): URL to credential thumbnail
            - criteria_url (str, optional): URL to credential criteria
            - criteria_text (str, optional): Text description of credential criteria
            - issuing_signal (str, optional): Signal that triggers credential issuance

        Returns:
            GET: A JSON response containing:
                {
                    "status": {"success": true, "description": "Ok"},
                    "result": {credential object}
                }

            PUT: A JSON response containing:
                {
                    "status": {"success": true, "description": "Updated"},
                    "result": {credential object}
                }

            DELETE: No content (204)

        Error Responses:
            400 Bad Request: If the request data is invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the credential doesn't exist
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires CredentialAssignmentPermission
            - Users can only manage credentials they have permission to access
      parameters:
        - in: path
          name: entity_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Credential'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Credential'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Credential'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Credential'
          '*/*':
            schema:
              $ref: '#/components/schemas/Credential'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Credential'
          description: ''
    delete:
      operationId: credentials_orgs_users_destroy
      description: >-
        API View for managing individual credentials.


        This endpoint allows retrieving, updating, and deleting specific
        credentials

        identified by their entity_id.


        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID making the request
            entity_id (str): The credential entity ID

        Methods:
            GET: Retrieve a specific credential
            PUT: Update a specific credential
            DELETE: Delete a specific credential

        PUT Request Body:
            A JSON object containing credential details to update:
            - name (str, optional): Credential name
            - description (str, optional): Credential description
            - credential_type (str, optional): Type of credential
            - html_template (str, optional): HTML template for credential rendering
            - css_template (str, optional): CSS template for credential styling
            - icon_image (str, optional): URL to credential icon
            - background_image (str, optional): URL to credential background
            - thumbnail_image (str, optional): URL to credential thumbnail
            - criteria_url (str, optional): URL to credential criteria
            - criteria_text (str, optional): Text description of credential criteria
            - issuing_signal (str, optional): Signal that triggers credential issuance

        Returns:
            GET: A JSON response containing:
                {
                    "status": {"success": true, "description": "Ok"},
                    "result": {credential object}
                }

            PUT: A JSON response containing:
                {
                    "status": {"success": true, "description": "Updated"},
                    "result": {credential object}
                }

            DELETE: No content (204)

        Error Responses:
            400 Bad Request: If the request data is invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the credential doesn't exist
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires CredentialAssignmentPermission
            - Users can only manage credentials they have permission to access
      parameters:
        - in: path
          name: entity_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/credentials/orgs/{org}/users/{user_id}/{entity_id}/assertions/:
    get:
      operationId: credentials_orgs_users_assertions_retrieve_3
      description: >-
        Endpoint to issue and retrieve credential assertions for a specific
        credential.


        This endpoint allows issuing new credential assertions and retrieving
        existing

        assertions for a specific credential.


        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID making the request
            entity_id (str): The credential entity ID

        Methods:
            POST: Issue a new credential assertion
            GET: Retrieve assertions for a specific credential

        POST Request Body:
            A JSON object containing recipient information and any additional metadata
            required for issuing the credential.

        Returns:
            POST: A JSON response containing the created assertion using the AssertionSerializer format
            GET: A paginated list of assertions using the AssertionSerializer format

        Error Responses:
            400 Bad Request: If the request data is invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the credential doesn't exist
            500 Internal Server Error: If an unexpected error occurs
      parameters:
        - in: path
          name: entity_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAssertionsResponse'
          description: ''
    post:
      operationId: credentials_orgs_users_assertions_create
      description: >-
        Endpoint to issue and retrieve credential assertions for a specific
        credential.


        This endpoint allows issuing new credential assertions and retrieving
        existing

        assertions for a specific credential.


        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID making the request
            entity_id (str): The credential entity ID

        Methods:
            POST: Issue a new credential assertion
            GET: Retrieve assertions for a specific credential

        POST Request Body:
            A JSON object containing recipient information and any additional metadata
            required for issuing the credential.

        Returns:
            POST: A JSON response containing the created assertion using the AssertionSerializer format
            GET: A paginated list of assertions using the AssertionSerializer format

        Error Responses:
            400 Bad Request: If the request data is invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the credential doesn't exist
            500 Internal Server Error: If an unexpected error occurs
      parameters:
        - in: path
          name: entity_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Assertion'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Assertion'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Assertion'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Assertion'
          '*/*':
            schema:
              $ref: '#/components/schemas/Assertion'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Assertion'
          description: ''
  /api/credentials/orgs/{org}/users/{user_id}/{entity_id}/assertions/bulk/:
    post:
      operationId: credentials_orgs_users_assertions_bulk_create
      description: >-
        Endpoint to issue credential assertions in bulk for a specific
        credential.


        This endpoint allows issuing credential assertions to multiple users at
        once.


        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID making the request
            entity_id (str): The credential entity ID

        POST Request Body:
            A JSON object containing:
            - users (list): List of usernames to issue the credential to
            - Additional metadata required for issuing the credential

        Returns:
            A JSON response containing:
            {
                "skipped": ["username1", "username3"],  // Users that were skipped (e.g., already have the credential)
                "issued": ["username2", "username4"]    // Users that were successfully issued the credential
            }

        Error Responses:
            400 Bad Request: If the request data is invalid or missing required fields
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the credential doesn't exist
            500 Internal Server Error: If an unexpected error occurs
      parameters:
        - in: path
          name: entity_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkCreateAssertion'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/BulkCreateAssertion'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BulkCreateAssertion'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BulkCreateAssertion'
          '*/*':
            schema:
              $ref: '#/components/schemas/BulkCreateAssertion'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkCreateAssertion'
          description: ''
  /api/credentials/orgs/{org}/users/{user_id}/assertions/:
    get:
      operationId: credentials_orgs_users_assertions_retrieve
      description: >-
        Endpoint to retrieve all credential assertions for a user within an
        organization.


        This endpoint provides access to all credential assertions (issued
        credentials)

        for a specific user within an organization, with support for filtering.


        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID to retrieve assertions for

        Query Parameters:
            course (str, optional): Filter by course ID
            include_revoked (bool, optional): Include revoked assertions (default: false)
            include_expired (bool, optional): Include expired assertions (default: false)
            exclude_main_tenant_assertions (bool, optional): Exclude assertions from the main tenant (default: false)

        Returns:
            A paginated response using the AssertionSerializer format

        Error Responses:
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the user or organization doesn't exist
            500 Internal Server Error: If an unexpected error occurs
      parameters:
        - in: query
          name: course
          schema:
            type: string
            minLength: 1
        - in: query
          name: exclude_main_tenant_assertions
          schema:
            type: boolean
        - in: query
          name: include_expired
          schema:
            type: boolean
        - in: query
          name: include_revoked
          schema:
            type: boolean
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
            minimum: 1
        - in: query
          name: page_size
          schema:
            type: integer
            maximum: 1000
            minimum: 1
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAssertionsResponse'
          description: ''
  /api/credentials/orgs/{org}/users/{user_id}/assertions-over-time/:
    get:
      operationId: credentials_orgs_users_assertions_over_time_retrieve
      description: Get all credentials of a given tenant
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/credentials/orgs/{org}/users/{user_id}/assertions/{entity_id}:
    get:
      operationId: credentials_orgs_users_assertions_retrieve_2
      description: >-
        Endpoint to retrieve and update a specific credential assertion.


        This endpoint allows retrieving details of a specific credential
        assertion

        and updating its status (e.g., revoking it).


        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID making the request
            entity_id (str): The assertion entity ID

        Methods:
            GET: Retrieve assertion details
            PUT: Update assertion status (e.g., revoke)

        PUT Request Body:
            A JSON object containing:
            - revoked (bool): Set to true to revoke the assertion
            - revocationReason (str): Reason for revocation (required when revoking)

        Returns:
            GET: A JSON response containing the assertion details using the AssertionSerializer format
            PUT: A JSON response containing the updated assertion using the AssertionSerializer format

        Error Responses:
            400 Bad Request: If the request data is invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the assertion doesn't exist
            500 Internal Server Error: If an unexpected error occurs
      parameters:
        - in: path
          name: entity_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Assertion'
          description: ''
    put:
      operationId: credentials_orgs_users_assertions_update
      description: >-
        Endpoint to retrieve and update a specific credential assertion.


        This endpoint allows retrieving details of a specific credential
        assertion

        and updating its status (e.g., revoking it).


        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID making the request
            entity_id (str): The assertion entity ID

        Methods:
            GET: Retrieve assertion details
            PUT: Update assertion status (e.g., revoke)

        PUT Request Body:
            A JSON object containing:
            - revoked (bool): Set to true to revoke the assertion
            - revocationReason (str): Reason for revocation (required when revoking)

        Returns:
            GET: A JSON response containing the assertion details using the AssertionSerializer format
            PUT: A JSON response containing the updated assertion using the AssertionSerializer format

        Error Responses:
            400 Bad Request: If the request data is invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the assertion doesn't exist
            500 Internal Server Error: If an unexpected error occurs
      parameters:
        - in: path
          name: entity_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Assertion'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Assertion'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Assertion'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Assertion'
          '*/*':
            schema:
              $ref: '#/components/schemas/Assertion'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Assertion'
          description: ''
  /api/credentials/orgs/{org}/users/{user_id}/assignments/{assignment_id}:
    delete:
      operationId: credentials_orgs_users_assignments_destroy
      description: |-
        Delete a credential assignment using its entity_id.
        Only platform admins and department admins can delete assignments.
      parameters:
        - in: path
          name: assignment_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/credentials/orgs/{org}/users/{user_id}/assignments/groups/:
    get:
      operationId: credentials_orgs_users_assignments_groups_retrieve
      description: Get group assignments with department-aware filtering
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    post:
      operationId: credentials_orgs_users_assignments_groups_create
      description: Create group assignment with department access validation
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/credentials/orgs/{org}/users/{user_id}/assignments/users/:
    get:
      operationId: credentials_orgs_users_assignments_users_retrieve
      description: >-
        Get assignments and their corresponding assertions based on user role:

        - Regular users: get only their own assignments

        - Platform admins: get assignments for all users in their platform

        - Department admins: get assignments for users in their department
        groups
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    post:
      operationId: credentials_orgs_users_assignments_users_create
      description: Create assignments with department access validation
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/credentials/orgs/{org}/users/{user_id}/course-assertions-over-time/:
    get:
      operationId: credentials_orgs_users_course_assertions_over_time_retrieve
      description: Get all credentials of a given tenant
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTime'
          description: ''
  /api/credentials/orgs/{org}/users/{user_id}/course-credentials/:
    get:
      operationId: credentials_orgs_users_course_credentials_list
      description: >-
        Endpoint to retrieve the credentials of a given tenant grouped by
        course.


        This endpoint provides access to credential data grouped by course for a
        specific

        organization/tenant, with support for pagination and filtering.


        Path Parameters:
            org (str): The organization/tenant identifier

        Query Parameters:
            limit (int, optional): Number of results per page (default: 10)
            offset (int, optional): Starting position for pagination
            search (str, optional): Search term e.g course_id

        Returns:
            A paginated response using the CourseCredentialSerializer format.

        Error Responses:
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this data
            404 Not Found: If the organization doesn't exist
            500 Internal Server Error: If an unexpected error occurs
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/credentials/orgs/{org}/users/{user_id}/credentials-over-time/:
    get:
      operationId: credentials_orgs_users_credentials_over_time_retrieve
      description: Get all credentials of a given tenant
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTime'
          description: ''
  /api/credentials/orgs/{org}/users/{user_id}/images/:
    get:
      operationId: credentials_orgs_users_images_retrieve
      description: |-
        API View for managing uploaded images for credentials.

        This endpoint allows uploading new images and retrieving existing images
        for use with credentials (icons, backgrounds, thumbnails, etc.).

        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID making the request

        Query Parameters:
            query (str, required for GET): Search term to filter images by name

        Methods:
            GET: Retrieve images matching a search query
            POST: Upload a new image

        POST Request Body:
            Multipart form data containing:
            - image (file, required): The image file to upload
            - name (str, optional): A descriptive name for the image

        Returns:
            GET: A JSON array of image objects:
                [
                    {
                        "id": 123,
                        "name": "Logo",
                        "image": "https://example.com/media/uploaded_images/logo.png"
                    },
                    {
                        "id": 124,
                        "name": "Background",
                        "image": "https://example.com/media/uploaded_images/background.jpg"
                    },
                    ...
                ]

            POST: A JSON object containing the uploaded image details:
                {
                    "id": 125,
                    "name": "Certificate Icon",
                    "image": "https://example.com/media/uploaded_images/certificate-icon.png"
                }

        Error Responses:
            400 Bad Request: If the request data is invalid or missing required parameters
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsAdminUserOrStudentDRFMixin
            - Only authenticated users with appropriate permissions can upload and retrieve images
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadedImage'
          description: ''
    post:
      operationId: credentials_orgs_users_images_create
      description: |-
        API View for managing uploaded images for credentials.

        This endpoint allows uploading new images and retrieving existing images
        for use with credentials (icons, backgrounds, thumbnails, etc.).

        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID making the request

        Query Parameters:
            query (str, required for GET): Search term to filter images by name

        Methods:
            GET: Retrieve images matching a search query
            POST: Upload a new image

        POST Request Body:
            Multipart form data containing:
            - image (file, required): The image file to upload
            - name (str, optional): A descriptive name for the image

        Returns:
            GET: A JSON array of image objects:
                [
                    {
                        "id": 123,
                        "name": "Logo",
                        "image": "https://example.com/media/uploaded_images/logo.png"
                    },
                    {
                        "id": 124,
                        "name": "Background",
                        "image": "https://example.com/media/uploaded_images/background.jpg"
                    },
                    ...
                ]

            POST: A JSON object containing the uploaded image details:
                {
                    "id": 125,
                    "name": "Certificate Icon",
                    "image": "https://example.com/media/uploaded_images/certificate-icon.png"
                }

        Error Responses:
            400 Bad Request: If the request data is invalid or missing required parameters
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsAdminUserOrStudentDRFMixin
            - Only authenticated users with appropriate permissions can upload and retrieve images
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadedImage'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UploadedImage'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UploadedImage'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UploadedImage'
          '*/*':
            schema:
              $ref: '#/components/schemas/UploadedImage'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadedImage'
          description: ''
  /api/credentials/orgs/{org}/users/{user_id}/issuers/:
    get:
      operationId: credentials_orgs_users_issuers_retrieve
      description: >-
        API View for managing credential issuers.


        This endpoint allows creating and retrieving issuers for a specific
        organization/tenant,

        with support for filtering and pagination.


        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID making the request

        Query Parameters:
            q (str, optional): Search term to filter issuers by name
            limit (int, optional): Number of results per page (default: 50)
            offset (int, optional): Starting position for pagination

        Methods:
            GET: Retrieve issuers with filtering and pagination
            POST: Create a new issuer

        POST Request Body:
            A JSON object containing issuer details:
            - name (str): Issuer name
            - iconImage (str, optional): URL to issuer icon
            - email (str, optional): Contact email for the issuer
            - url (str, optional): Website URL for the issuer
            - allowed_template_tags (array, optional): List of allowed template tags

        Returns:
            GET: A JSON response containing:
                {
                    "status": {"success": true, "description": "Ok"},
                    "result": {
                        "next": "URL to next page",
                        "previous": "URL to previous page",
                        "count": 10,
                        "data": [
                            {issuer object},
                            {issuer object},
                            ...
                        ],
                        "num_pages": 1,
                        "page_number": 1,
                        "max_page_size": 1000
                    }
                }

            POST: A JSON response containing:
                {
                    "status": {"success": true, "description": "Created"},
                    "result": {issuer object}
                }

        Error Responses:
            400 Bad Request: If the request data is invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the platform doesn't exist
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsAdminUserOrStudentDRFMixin
            - Only authenticated users with appropriate permissions can manage issuers
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: q
          schema:
            type: string
            minLength: 1
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Issuer'
          description: ''
    post:
      operationId: credentials_orgs_users_issuers_create
      description: >-
        API View for managing credential issuers.


        This endpoint allows creating and retrieving issuers for a specific
        organization/tenant,

        with support for filtering and pagination.


        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID making the request

        Query Parameters:
            q (str, optional): Search term to filter issuers by name
            limit (int, optional): Number of results per page (default: 50)
            offset (int, optional): Starting position for pagination

        Methods:
            GET: Retrieve issuers with filtering and pagination
            POST: Create a new issuer

        POST Request Body:
            A JSON object containing issuer details:
            - name (str): Issuer name
            - iconImage (str, optional): URL to issuer icon
            - email (str, optional): Contact email for the issuer
            - url (str, optional): Website URL for the issuer
            - allowed_template_tags (array, optional): List of allowed template tags

        Returns:
            GET: A JSON response containing:
                {
                    "status": {"success": true, "description": "Ok"},
                    "result": {
                        "next": "URL to next page",
                        "previous": "URL to previous page",
                        "count": 10,
                        "data": [
                            {issuer object},
                            {issuer object},
                            ...
                        ],
                        "num_pages": 1,
                        "page_number": 1,
                        "max_page_size": 1000
                    }
                }

            POST: A JSON response containing:
                {
                    "status": {"success": true, "description": "Created"},
                    "result": {issuer object}
                }

        Error Responses:
            400 Bad Request: If the request data is invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the platform doesn't exist
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsAdminUserOrStudentDRFMixin
            - Only authenticated users with appropriate permissions can manage issuers
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: q
          schema:
            type: string
            minLength: 1
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Issuer'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Issuer'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Issuer'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Issuer'
          '*/*':
            schema:
              $ref: '#/components/schemas/Issuer'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Issuer'
          description: ''
  /api/credentials/orgs/{org}/users/{user_id}/issuers/{entity_id}:
    get:
      operationId: credentials_orgs_users_issuers_retrieve_2
      description: |-
        API View for managing individual issuers.

        This endpoint allows retrieving, updating, and deleting specific issuers
        identified by their entity_id or org identifier.

        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID making the request
            entity_id (str): The issuer entity ID or org identifier

        Methods:
            GET: Retrieve a specific issuer
            PUT: Update a specific issuer
            DELETE: Delete a specific issuer

        PUT Request Body:
            A JSON object containing issuer details to update:
            - name (str, optional): Issuer name
            - iconImage (str, optional): URL to issuer icon
            - email (str, optional): Contact email for the issuer
            - url (str, optional): Website URL for the issuer
            - allowed_template_tags (array, optional): List of allowed template tags

        Returns:
            GET: A JSON response containing the issuer details:
                [
                    {
                        "name": "Example University",
                        "org": "example-university",
                        "entityId": "abc123",
                        "signatories": [...],
                        "url": "https://example.com",
                        "iconImage": "https://example.com/logo.png",
                        "allowed_template_tags": [...]
                    }
                ]

            PUT: A JSON response containing the updated issuer details:
                [
                    {
                        "name": "Example University",
                        "org": "example-university",
                        "entityId": "abc123",
                        "signatories": [...],
                        "url": "https://example.com",
                        "iconImage": "https://example.com/new-logo.png",
                        "allowed_template_tags": [...]
                    }
                ]

            DELETE: A JSON response indicating success:
                {
                    "status": {"success": true, "description": "Deleted"}
                }

        Error Responses:
            400 Bad Request: If the request data is invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the issuer doesn't exist
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsAdminUserOrStudentDRFMixin
            - Only authenticated users with appropriate permissions can manage issuers
      parameters:
        - in: path
          name: entity_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Issuer'
          description: ''
    put:
      operationId: credentials_orgs_users_issuers_update
      description: |-
        API View for managing individual issuers.

        This endpoint allows retrieving, updating, and deleting specific issuers
        identified by their entity_id or org identifier.

        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID making the request
            entity_id (str): The issuer entity ID or org identifier

        Methods:
            GET: Retrieve a specific issuer
            PUT: Update a specific issuer
            DELETE: Delete a specific issuer

        PUT Request Body:
            A JSON object containing issuer details to update:
            - name (str, optional): Issuer name
            - iconImage (str, optional): URL to issuer icon
            - email (str, optional): Contact email for the issuer
            - url (str, optional): Website URL for the issuer
            - allowed_template_tags (array, optional): List of allowed template tags

        Returns:
            GET: A JSON response containing the issuer details:
                [
                    {
                        "name": "Example University",
                        "org": "example-university",
                        "entityId": "abc123",
                        "signatories": [...],
                        "url": "https://example.com",
                        "iconImage": "https://example.com/logo.png",
                        "allowed_template_tags": [...]
                    }
                ]

            PUT: A JSON response containing the updated issuer details:
                [
                    {
                        "name": "Example University",
                        "org": "example-university",
                        "entityId": "abc123",
                        "signatories": [...],
                        "url": "https://example.com",
                        "iconImage": "https://example.com/new-logo.png",
                        "allowed_template_tags": [...]
                    }
                ]

            DELETE: A JSON response indicating success:
                {
                    "status": {"success": true, "description": "Deleted"}
                }

        Error Responses:
            400 Bad Request: If the request data is invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the issuer doesn't exist
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsAdminUserOrStudentDRFMixin
            - Only authenticated users with appropriate permissions can manage issuers
      parameters:
        - in: path
          name: entity_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Issuer'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Issuer'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Issuer'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Issuer'
          '*/*':
            schema:
              $ref: '#/components/schemas/Issuer'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Issuer'
          description: ''
    delete:
      operationId: credentials_orgs_users_issuers_destroy
      description: |-
        API View for managing individual issuers.

        This endpoint allows retrieving, updating, and deleting specific issuers
        identified by their entity_id or org identifier.

        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID making the request
            entity_id (str): The issuer entity ID or org identifier

        Methods:
            GET: Retrieve a specific issuer
            PUT: Update a specific issuer
            DELETE: Delete a specific issuer

        PUT Request Body:
            A JSON object containing issuer details to update:
            - name (str, optional): Issuer name
            - iconImage (str, optional): URL to issuer icon
            - email (str, optional): Contact email for the issuer
            - url (str, optional): Website URL for the issuer
            - allowed_template_tags (array, optional): List of allowed template tags

        Returns:
            GET: A JSON response containing the issuer details:
                [
                    {
                        "name": "Example University",
                        "org": "example-university",
                        "entityId": "abc123",
                        "signatories": [...],
                        "url": "https://example.com",
                        "iconImage": "https://example.com/logo.png",
                        "allowed_template_tags": [...]
                    }
                ]

            PUT: A JSON response containing the updated issuer details:
                [
                    {
                        "name": "Example University",
                        "org": "example-university",
                        "entityId": "abc123",
                        "signatories": [...],
                        "url": "https://example.com",
                        "iconImage": "https://example.com/new-logo.png",
                        "allowed_template_tags": [...]
                    }
                ]

            DELETE: A JSON response indicating success:
                {
                    "status": {"success": true, "description": "Deleted"}
                }

        Error Responses:
            400 Bad Request: If the request data is invalid
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the issuer doesn't exist
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsAdminUserOrStudentDRFMixin
            - Only authenticated users with appropriate permissions can manage issuers
      parameters:
        - in: path
          name: entity_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/credentials/orgs/{org}/users/{user_id}/issuers/authority/:
    post:
      operationId: credentials_orgs_users_issuers_authority_create
      description: >-
        API View for managing issuer authorities (signatories).


        This endpoint allows creating authorities/signatories that can be
        associated

        with issuers or specific credentials.


        Path Parameters:
            org (str): The organization/tenant identifier
            user_id (str): The user ID making the request

        Methods:
            POST: Create a new issuer authority

        POST Request Body:
            A JSON object containing authority details:
            - name (str, required): Name of the signatory
            - title (str, required): Title of the signatory
            - signature (str, required): URL to the signature image
            - org (str, optional): Organization identifier to associate with an issuer
            - entityId (str, optional): Issuer entity ID to associate with
            - credential (str, optional): Credential entity ID to associate with

        Returns:
            POST: A JSON response containing the created authority:
                {
                    "data": {
                        "name": "John Smith",
                        "title": "President",
                        "signature": "https://example.com/signatures/john-smith.png"
                    }
                }

        Error Responses:
            400 Bad Request: If the request data is invalid or missing required fields
            401 Unauthorized: If the user is not authenticated
            403 Forbidden: If the user does not have permission to access this resource
            404 Not Found: If the issuer or credential doesn't exist
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Requires IsAdminUserOrStudentDRFMixin
            - Only authenticated users with appropriate permissions can manage authorities
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IssuerAuthority'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/IssuerAuthority'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/IssuerAuthority'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/IssuerAuthority'
          '*/*':
            schema:
              $ref: '#/components/schemas/IssuerAuthority'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IssuerAuthority'
          description: ''
  /api/credentials/public/assertions/{entity_id}/:
    get:
      operationId: credentials_public_assertions_retrieve
      description: >-
        Public endpoint to retrieve a specific credential assertion by its
        entity ID.


        This endpoint allows public access to view a specific credential
        assertion

        without authentication.


        Path Parameters:
            entity_id (str): The assertion entity ID

        Returns:
            A JSON response containing the assertion details using the AssertionSerializer format

        Error Responses:
            404 Not Found:
                - If the assertion doesn't exist: Empty response with 404 status
                - If the assertion has been revoked: JSON with error detail and revocation reason
            500 Internal Server Error: If an unexpected error occurs
      parameters:
        - in: path
          name: entity_id
          schema:
            type: string
          required: true
      tags:
        - credentials
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Assertion'
          description: ''
  /api/custom-domains/:
    get:
      operationId: custom_domains_retrieve
      description: >-
        API endpoint to get custom domains (public, no authentication or
        permission checks)
      tags:
        - custom-domains
      responses:
        '200':
          description: No response body
  /api/custom-domains/{domain_id}/delete/:
    delete:
      operationId: custom_domains_delete_destroy
      description: API endpoint to hard delete a custom domain
      parameters:
        - in: path
          name: domain_id
          schema:
            type: integer
          required: true
      tags:
        - custom-domains
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/custom-domains/{domain_id}/deleted-status/:
    post:
      operationId: custom_domains_deleted_status_create
      description: API endpoint to update the is_deleted status of a custom domain
      parameters:
        - in: path
          name: domain_id
          schema:
            type: integer
          required: true
      tags:
        - custom-domains
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/custom-domains/{domain_id}/status/:
    put:
      operationId: custom_domains_status_update
      description: API endpoint to update custom domain SPA type
      parameters:
        - in: path
          name: domain_id
          schema:
            type: integer
          required: true
      tags:
        - custom-domains
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/custom-domains/by-name/{domain_name}/status/:
    put:
      operationId: custom_domains_by_name_status_update
      description: API endpoint to update custom domain SPA type by domain name
      parameters:
        - in: path
          name: domain_name
          schema:
            type: string
          required: true
      tags:
        - custom-domains
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/custom-domains/create/:
    post:
      operationId: custom_domains_create_create
      description: API endpoint to create a custom domain
      tags:
        - custom-domains
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/departments/orgs/{org}/:
    get:
      operationId: departments_orgs_retrieve
      description: >-
        Get a list of departments with metrics and filtering options.


        This endpoint provides a paginated list of departments with aggregated
        metrics

        about learner performance, course completions, and skill acquisition.


        Query Parameters:
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page
            program (str, optional): Filter by program
            pathway (str, optional): Filter by pathway
            departments (list, optional): Filter by department ids
            department_id (str, optional): Filter by department id
            location (str, optional): Filter by location
            is_enrolled (bool, optional): Filter for departments with enrolled users
            start_date (date, optional): Filter by learner join date (start range)
            end_date (date, optional): Filter by learner join date (end range)

        Returns:
            A paginated list of departments with comprehensive metrics.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: departments
          schema:
            type: array
            items:
              type: string
          description: >-
            Departments search string. Single string or list of strings. e.g
            'sample_department' or `['department', 'another department']` 
        - in: query
          name: end_date
          schema:
            type: string
            format: date
          description: Filter by learners date_joined. Start date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: is_enrolled
          schema:
            type: boolean
            nullable: true
          description: Filter for users who have at least an enro;lment
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: query
          name: location
          schema:
            type: string
            minLength: 1
          description: Location search string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: pathway
          schema:
            type: string
            minLength: 1
          description: Pathway string
        - in: query
          name: program
          schema:
            type: string
            minLength: 1
          description: Program search string
        - in: query
          name: start_date
          schema:
            type: string
            format: date
          description: Filter by learners date_joined. Start date. ISO 8601
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupList'
          description: ''
  /api/engagement/orgs/{org}/activity:
    get:
      operationId: engagement_orgs_activity_retrieve
      description: >-
        Get engagement metrics on a per-course basis.


        This endpoint provides a paginated list of courses with engagement
        metrics

        including activity counts, time spent, and interaction data.


        Query Parameters:
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page

        Returns:
            A paginated list of courses with their engagement metrics.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EngagementPerCourse'
          description: ''
  /api/engagement/orgs/{org}/course_completion/over-time:
    get:
      operationId: engagement_orgs_course_completion_over_time_retrieve
      description: >-
        Completion count per user per course across the platform


        Query Params

        1. start_date e.g 2020-10-01

        2. end_date e.g 2020-10-10


        Default result when no query param is added is last_7_days (today
        inclusive)
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/engagement/orgs/{org}/course_completion/per-course:
    get:
      operationId: engagement_orgs_course_completion_per_course_retrieve
      description: |-
        List course completion metrics on a per-course basis.

        This endpoint provides a paginated table of courses with enrollment and
        completion statistics for each course.

        Returns:
            A paginated list of courses with:
            - Course identification (ID and name)
            - Enrollment count
            - Completion count
            - Average completion rate
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCompletionPerCourse'
          description: ''
  /api/engagement/orgs/{org}/courses/{course_id}/time/average:
    get:
      operationId: engagement_orgs_courses_time_average_retrieve
      description: >-
        Average time spent in secs on a per-day basis


        Query Params

        1. start_date e.g 2020-10-01

        2. end_date e.g 2020-10-10

        3. course_id <optional>


        Default result when no query param is added is last_7_days (today
        inclusive)
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AverageOvertime'
          description: ''
  /api/engagement/orgs/{org}/courses/{course_id}/time/detail:
    get:
      operationId: engagement_orgs_courses_time_detail_retrieve
      description: |-
        Time spent per course in secs in a tree like form

        Kwargs
        course_id e.g course-v1:Org+Course4+Run

        Query Params
        1. start_date <optional> e.g 2020-10-01
        2. end_date <optional> e.g 2020-10-10
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimeDetail'
          description: ''
  /api/engagement/orgs/{org}/courses/{course_id}/time/over-time:
    get:
      operationId: engagement_orgs_courses_time_over_time_retrieve
      description: >-
        Time spent per course in secs on a per-day basis


        Query Params

        1. start_date e.g 2020-10-01

        2. end_date e.g 2020-10-10

        Kwargs

        3. course_id


        Default result when no query param is added is last_7_days (today
        inclusive)
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/engagement/orgs/{org}/courses/{course_id}/time/users:
    get:
      operationId: engagement_orgs_courses_time_users_retrieve
      description: |-
        Time spent by users in a course

        Query Params
        course_id  e.g course-v1:Org+Course4+Run
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimeSpentByUsersInCourse'
          description: ''
  /api/engagement/orgs/{org}/courses/{course_id}/time/users/{user_id}/detail:
    get:
      operationId: engagement_orgs_courses_time_users_detail_retrieve
      description: |-
        Time spent within a course in ordered hierarchical format

        Kwargs
        1. course_id  e.g course-v1:Org+Course4+Run
        2. user_id e.g developer@ibleducation.com or dev123 (username|email)
        Query Params
        3. start_date <optional> e.g 2020-10-01
        4. end_date <optional> e.g 2020-10-10
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerLearnerTimeSpentInCourseTree'
          description: ''
  /api/engagement/orgs/{org}/courses/{course_id}/time/users/{user_id}/over-time:
    get:
      operationId: engagement_orgs_courses_time_users_over_time_retrieve
      description: >-
        Time spent in secs on a per-day basis


        Query Params

        1. course_id <optional> e.g course-v1:Org+Course4+Run

        2. user_id <optional> e.g developer@ibleducation.com or dev123
        (username|email)

        3. start_date e.g 2020-10-01

        4. end_date e.g 2020-10-10


        Default result when no query param is added is last_7_days (today
        inclusive)
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/engagement/orgs/{org}/courses/{course_id}/videos/:
    get:
      operationId: engagement_orgs_courses_videos_retrieve
      description: >-
        Get video engagement metrics for a specific course.


        This endpoint provides detailed video engagement statistics for a single
        course,

        including view counts, completion rates, and time spent on videos.


        Query Parameters:
            course_id (str): The course ID to get video engagement data for

        Returns:
            Detailed video engagement metrics for the specified course.
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideosSpecificCourse'
          description: ''
  /api/engagement/orgs/{org}/courses/{course_id}/videos/over-time:
    get:
      operationId: engagement_orgs_courses_videos_over_time_retrieve
      description: >-
        Get video watch counts over time.


        This endpoint provides daily counts of videos watched over a specified
        time period,

        with options to filter by course or user.


        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)
            course_id (str, optional): Filter by course ID
            user_id (str, optional): Filter by username or email

        Returns:
            Daily video watch counts over the specified time period.

        Default time range is the last 7 days if no dates are specified.


        Access Control:
            - Platform admins can access any video watch data
            - Learners can access their own video watch data
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/engagement/orgs/{org}/courses/{course_id}/videos/summary:
    get:
      operationId: engagement_orgs_courses_videos_summary_retrieve
      description: >-
        Get a summary of video watch statistics for a specific course.


        This endpoint provides a structured summary of video watch data for a
        course,

        organized in a tree-like format by course sections and subsections.


        Query Parameters:
            course_id (str): The course ID to get video summary for

        Returns:
            A hierarchical structure of video watch data for the course, including:
            - Section and subsection organization
            - Video identification and metadata
            - Watch counts and completion rates
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideosInCourseSummary'
          description: ''
  /api/engagement/orgs/{org}/courses/{course_id}/videos/users:
    get:
      operationId: engagement_orgs_courses_videos_users_retrieve
      description: |-
        List of users' videos completed records for a specific course

        Kwargs
        course_id  e.g course-v1:Org+Course4+Run
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatchedVideosPerUser'
          description: ''
  /api/engagement/orgs/{org}/time/average-perlearner-percourse:
    get:
      operationId: engagement_orgs_time_average_perlearner_percourse_retrieve
      description: >-
        Average time spent by a learner in enrolled courses. Gives a rough
        estimate of whats the average time

        that would be spent by a learner in a course


        Query Params

        1. start_date e.g 2020-10-01

        2. end_date e.g 2020-10-10
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AverageOvertime'
          description: ''
  /api/engagement/orgs/{org}/time/average-with-over-time:
    get:
      operationId: engagement_orgs_time_average_with_over_time_retrieve
      description: >-
        Average time spent in secs on a per-day basis


        Query Params

        1. start_date e.g 2020-10-01

        2. end_date e.g 2020-10-10

        3. course_id <optional>


        Default result when no query param is added is last_7_days (today
        inclusive)
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AverageOvertime'
          description: ''
  /api/engagement/orgs/{org}/time/over-time:
    get:
      operationId: engagement_orgs_time_over_time_retrieve
      description: |-
        Get time spent on the platform over time.

        This endpoint provides daily time spent values (in seconds) across the
        platform over a specified time period.

        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)

        Returns:
            Daily time spent values over the specified time period, with change metrics
            compared to previous periods.

        Default time range is the last 7 days if no dates are specified.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/engagement/orgs/{org}/time/per-course:
    get:
      operationId: engagement_orgs_time_per_course_retrieve
      description: |-
        Get time spent statistics on a per-course basis.

        This endpoint provides a paginated list of courses with the total time
        spent by users in each course.

        Query Parameters:
            start_date (str, optional): Start date for filtering (ISO format)
            end_date (str, optional): End date for filtering (ISO format)
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page

        Returns:
            A paginated list of courses with:
            - Course identification (ID and name)
            - Total time spent (in seconds)
            - Formatted time spent (human-readable)
            - Percentage of total platform time
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimeSpentPerCourse'
          description: ''
  /api/engagement/orgs/{org}/videos/:
    get:
      operationId: engagement_orgs_videos_retrieve
      description: >-
        Get video engagement metrics on a per-course basis.


        This endpoint provides a paginated list of courses with video engagement
        metrics

        including view counts, completion rates, and time spent on videos.


        Query Parameters:
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page

        Returns:
            A paginated list of courses with their video engagement metrics.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoEngagementPerCourse'
          description: ''
  /api/engagement/orgs/{org}/videos/over-time:
    get:
      operationId: engagement_orgs_videos_over_time_retrieve
      description: >-
        Get video watch counts over time.


        This endpoint provides daily counts of videos watched over a specified
        time period,

        with options to filter by course or user.


        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)
            course_id (str, optional): Filter by course ID
            user_id (str, optional): Filter by username or email

        Returns:
            Daily video watch counts over the specified time period.

        Default time range is the last 7 days if no dates are specified.


        Access Control:
            - Platform admins can access any video watch data
            - Learners can access their own video watch data
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/features/apps/:
    get:
      operationId: features_apps_list
      description: Returns a list of the apps that the user has access to.
      parameters:
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
      tags:
        - features
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedUserAppList'
          description: ''
  /api/features/apps/update/:
    post:
      operationId: features_apps_update_create
      description: Updates the user onboarding completed status
      tags:
        - features
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OnboardingStatusUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/OnboardingStatusUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/OnboardingStatusUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/OnboardingStatusUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/OnboardingStatusUpdate'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OnboardingStatusUpdate'
          description: ''
  /api/features/apps/update-trial-status/:
    post:
      operationId: features_apps_update_trial_status_create
      description: |-
        Activates free trial for the user

        Set free_trial_started to True| false for the user app

        App URL or ID is required as well as the platform key
      tags:
        - features
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivateUserFreeTrial'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ActivateUserFreeTrial'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ActivateUserFreeTrial'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ActivateUserFreeTrial'
          '*/*':
            schema:
              $ref: '#/components/schemas/ActivateUserFreeTrial'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivateUserFreeTrial'
          description: ''
  /api/features/bulk-config/:
    post:
      operationId: features_bulk_config_create
      description: |-
        POST
        Bulk update user feature config

        NOTE: Will not create user feature configs

        Params:
        platform_key

        config
        (OR)
        feature
        values
      tags:
        - features
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/features/config/:
    get:
      operationId: features_config_retrieve
      description: |-
        Query user feature config

        Params:
        user_id/username/email
        platform_key
      tags:
        - features
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    post:
      operationId: features_config_create
      description: |-
        POST
        Update user feature config

        Params:
        user_id/username/email
        platform_key

        config
        (OR)
        feature
        values
      tags:
        - features
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/media/orgs/{org}/users/{user_id}/media/media-resources/:
    get:
      operationId: media_orgs_users_media_media_resources_list
      description: >-
        List and filter media resources. Supports filtering by course_id,
        unit_id, item_id and searching across multiple fields.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
          description: Filter by course ID (e.g., course-v1:main+NB101+2025-T1)
        - in: query
          name: item_id
          schema:
            type: string
          description: Filter by item ID
        - in: path
          name: org
          schema:
            type: string
          description: Organization identifier
          required: true
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: page_size
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: search
          schema:
            type: string
          description: >-
            Search across title, description, course_id, unit_id, item_id, and
            file_url
        - in: query
          name: unit_id
          schema:
            type: string
          description: >-
            Filter by unit ID (e.g.,
            block-v1:main+NB101+2025-T1+type@vertical+block@12345)
        - in: path
          name: user_id
          schema:
            type: string
          description: User identifier
          required: true
      tags:
        - media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Successfully retrieved media resources
    post:
      operationId: media_orgs_users_media_media_resources_create
      description: >-
        List and filter media resources. Supports filtering by course_id,
        unit_id, item_id and searching across multiple fields.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
          description: Filter by course ID (e.g., course-v1:main+NB101+2025-T1)
        - in: query
          name: item_id
          schema:
            type: string
          description: Filter by item ID
        - in: path
          name: org
          schema:
            type: string
          description: Organization identifier
          required: true
        - in: query
          name: search
          schema:
            type: string
          description: >-
            Search across title, description, course_id, unit_id, item_id, and
            file_url
        - in: query
          name: unit_id
          schema:
            type: string
          description: >-
            Filter by unit ID (e.g.,
            block-v1:main+NB101+2025-T1+type@vertical+block@12345)
        - in: path
          name: user_id
          schema:
            type: string
          description: User identifier
          required: true
      tags:
        - media
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MediaResource'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MediaResource'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MediaResource'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MediaResource'
          '*/*':
            schema:
              $ref: '#/components/schemas/MediaResource'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Successfully retrieved media resources
  /api/media/orgs/{org}/users/{user_id}/media/media-resources/{id}/:
    get:
      operationId: media_orgs_users_media_media_resources_retrieve
      description: >-
        List and filter media resources. Supports filtering by course_id,
        unit_id, item_id and searching across multiple fields.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
          description: Filter by course ID (e.g., course-v1:main+NB101+2025-T1)
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this Media Resource.
          required: true
        - in: query
          name: item_id
          schema:
            type: string
          description: Filter by item ID
        - in: path
          name: org
          schema:
            type: string
          description: Organization identifier
          required: true
        - in: query
          name: search
          schema:
            type: string
          description: >-
            Search across title, description, course_id, unit_id, item_id, and
            file_url
        - in: query
          name: unit_id
          schema:
            type: string
          description: >-
            Filter by unit ID (e.g.,
            block-v1:main+NB101+2025-T1+type@vertical+block@12345)
        - in: path
          name: user_id
          schema:
            type: string
          description: User identifier
          required: true
      tags:
        - media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Successfully retrieved media resources
    put:
      operationId: media_orgs_users_media_media_resources_update
      description: >-
        List and filter media resources. Supports filtering by course_id,
        unit_id, item_id and searching across multiple fields.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
          description: Filter by course ID (e.g., course-v1:main+NB101+2025-T1)
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this Media Resource.
          required: true
        - in: query
          name: item_id
          schema:
            type: string
          description: Filter by item ID
        - in: path
          name: org
          schema:
            type: string
          description: Organization identifier
          required: true
        - in: query
          name: search
          schema:
            type: string
          description: >-
            Search across title, description, course_id, unit_id, item_id, and
            file_url
        - in: query
          name: unit_id
          schema:
            type: string
          description: >-
            Filter by unit ID (e.g.,
            block-v1:main+NB101+2025-T1+type@vertical+block@12345)
        - in: path
          name: user_id
          schema:
            type: string
          description: User identifier
          required: true
      tags:
        - media
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MediaResource'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MediaResource'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MediaResource'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MediaResource'
          '*/*':
            schema:
              $ref: '#/components/schemas/MediaResource'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Successfully retrieved media resources
    patch:
      operationId: media_orgs_users_media_media_resources_partial_update
      description: >-
        List and filter media resources. Supports filtering by course_id,
        unit_id, item_id and searching across multiple fields.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
          description: Filter by course ID (e.g., course-v1:main+NB101+2025-T1)
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this Media Resource.
          required: true
        - in: query
          name: item_id
          schema:
            type: string
          description: Filter by item ID
        - in: path
          name: org
          schema:
            type: string
          description: Organization identifier
          required: true
        - in: query
          name: search
          schema:
            type: string
          description: >-
            Search across title, description, course_id, unit_id, item_id, and
            file_url
        - in: query
          name: unit_id
          schema:
            type: string
          description: >-
            Filter by unit ID (e.g.,
            block-v1:main+NB101+2025-T1+type@vertical+block@12345)
        - in: path
          name: user_id
          schema:
            type: string
          description: User identifier
          required: true
      tags:
        - media
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedMediaResource'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedMediaResource'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMediaResource'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedMediaResource'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedMediaResource'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Successfully retrieved media resources
    delete:
      operationId: media_orgs_users_media_media_resources_destroy
      description: >-
        List and filter media resources. Supports filtering by course_id,
        unit_id, item_id and searching across multiple fields.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
          description: Filter by course ID (e.g., course-v1:main+NB101+2025-T1)
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this Media Resource.
          required: true
        - in: query
          name: item_id
          schema:
            type: string
          description: Filter by item ID
        - in: path
          name: org
          schema:
            type: string
          description: Organization identifier
          required: true
        - in: query
          name: search
          schema:
            type: string
          description: >-
            Search across title, description, course_id, unit_id, item_id, and
            file_url
        - in: query
          name: unit_id
          schema:
            type: string
          description: >-
            Filter by unit ID (e.g.,
            block-v1:main+NB101+2025-T1+type@vertical+block@12345)
        - in: path
          name: user_id
          schema:
            type: string
          description: User identifier
          required: true
      tags:
        - media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Successfully retrieved media resources
  /api/media/orgs/{org}/users/{user_id}/media/media-resources/by_item/:
    get:
      operationId: media_orgs_users_media_media_resources_by_item_retrieve
      description: >-
        Get media resources for a specific item. The item_type determines which
        resources are returned based on the provided item_id.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
          description: Filter by course ID (e.g., course-v1:main+NB101+2025-T1)
        - in: query
          name: item_id
          schema:
            type: string
          description: ID of the item
          required: true
        - in: query
          name: item_type
          schema:
            type: string
            enum:
              - all
              - course
              - course_resource
              - course_unit
              - resource
              - unit
              - unit_resource
          description: >-
            Type of item. Valid values: course, unit, resource, course_unit,
            course_resource, unit_resource, all
          required: true
        - in: path
          name: org
          schema:
            type: string
          description: Organization identifier
          required: true
        - in: query
          name: search
          schema:
            type: string
          description: >-
            Search across title, description, course_id, unit_id, item_id, and
            file_url
        - in: query
          name: unit_id
          schema:
            type: string
          description: >-
            Filter by unit ID (e.g.,
            block-v1:main+NB101+2025-T1+type@vertical+block@12345)
        - in: path
          name: user_id
          schema:
            type: string
          description: User identifier
          required: true
      tags:
        - media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Successfully retrieved media resources for item
  /api/media/orgs/{org}/users/{user_id}/media/media-resources/search/:
    get:
      operationId: media_orgs_users_media_media_resources_search_retrieve
      description: >-
        Search media resources by title, description, or IDs. Supports filtering
        results by course_id, unit_id, and item_id.
      parameters:
        - in: query
          name: course_id
          schema:
            type: string
          description: Filter results by course ID
        - in: query
          name: item_id
          schema:
            type: string
          description: Filter results by item ID
        - in: path
          name: org
          schema:
            type: string
          description: Organization identifier
          required: true
        - in: query
          name: q
          schema:
            type: string
          description: Search query string
          required: true
        - in: query
          name: search
          schema:
            type: string
          description: >-
            Search across title, description, course_id, unit_id, item_id, and
            file_url
        - in: query
          name: unit_id
          schema:
            type: string
          description: Filter results by unit ID
        - in: path
          name: user_id
          schema:
            type: string
          description: User identifier
          required: true
      tags:
        - media
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Successfully searched media resources
  /api/notification/v1/campaigns/unsubscribe/{unsubscribe_hash}/:
    get:
      operationId: notification_v1_campaigns_unsubscribe_retrieve
      description: Unsubscribe from a campaign using a hash
      parameters:
        - in: path
          name: unsubscribe_hash
          schema:
            type: string
          required: true
      tags:
        - notifications
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
          description: ''
  /api/notification/v1/orgs/{org}/notifications/:
    get:
      operationId: notification_v1_orgs_notifications_retrieve
      description: Get notifications for a user
      parameters:
        - in: query
          name: channel
          schema:
            type: string
            minLength: 1
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
        - in: query
          name: exclude_channel
          schema:
            type: string
            minLength: 1
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
        - in: query
          name: status
          schema:
            type: string
            minLength: 1
      tags:
        - notifications
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Notification'
          description: ''
    put:
      operationId: notification_v1_orgs_notifications_update
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Notification'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Notification'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Notification'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Notification'
          '*/*':
            schema:
              $ref: '#/components/schemas/Notification'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Notification'
          description: ''
  /api/notification/v1/orgs/{org}/notifications/bulk-update/:
    patch:
      operationId: notification_v1_orgs_notifications_bulk_update_partial_update
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedNotification'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedNotification'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedNotification'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedNotification'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedNotification'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Notification'
          description: ''
  /api/notification/v1/orgs/{org}/users/{user_id}/notifications/:
    get:
      operationId: notification_v1_orgs_users_notifications_retrieve
      description: Get notifications for a user
      parameters:
        - in: query
          name: channel
          schema:
            type: string
            minLength: 1
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
        - in: query
          name: exclude_channel
          schema:
            type: string
            minLength: 1
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
        - in: query
          name: status
          schema:
            type: string
            minLength: 1
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - notifications
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Notification'
          description: ''
    put:
      operationId: notification_v1_orgs_users_notifications_update
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Notification'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Notification'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Notification'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Notification'
          '*/*':
            schema:
              $ref: '#/components/schemas/Notification'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Notification'
          description: ''
  /api/notification/v1/orgs/{org}/users/{user_id}/notifications-count/:
    get:
      operationId: notification_v1_orgs_users_notifications_count_retrieve
      description: Get notifications count for a user
      parameters:
        - in: query
          name: channel
          schema:
            type: string
            minLength: 1
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: status
          schema:
            type: string
            minLength: 1
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - notifications
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationCount'
          description: ''
  /api/notification/v1/orgs/{org}/users/{user_id}/notifications/{notification_id}/:
    delete:
      operationId: notification_v1_orgs_users_notifications_destroy
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: notification_id
          schema:
            type: string
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - notifications
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/notification/v1/orgs/{org}/users/{user_id}/notifications/bulk-update/:
    patch:
      operationId: notification_v1_orgs_users_notifications_bulk_update_partial_update
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedNotification'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedNotification'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedNotification'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedNotification'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedNotification'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Notification'
          description: ''
  /api/notification/v1/orgs/{org}/users/{user_id}/register-fcm-token/:
    post:
      operationId: notification_v1_orgs_users_register_fcm_token_create
      description: Save a user's device token
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GCMDevice'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/GCMDevice'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/GCMDevice'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/GCMDevice'
          '*/*':
            schema:
              $ref: '#/components/schemas/GCMDevice'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GCMDevice'
          description: ''
    delete:
      operationId: notification_v1_orgs_users_register_fcm_token_destroy
      description: Save a user's device token
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - notifications
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/notification/v1/orgs/{org}/users/{user_id}/send-notification/:
    post:
      operationId: notification_v1_orgs_users_send_notification_create
      description: Save a user's device token
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendNotificationRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SendNotificationRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SendNotificationRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SendNotificationRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/SendNotificationRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendNotificationRequest'
          description: ''
  /api/notification/v1/orgs/{platform_key}/campaigns/enable/:
    post:
      operationId: notification_v1_orgs_campaigns_enable_create
      description: Re-enable campaigns for a user
      parameters:
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignEnablement'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CampaignEnablement'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CampaignEnablement'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CampaignEnablement'
          '*/*':
            schema:
              $ref: '#/components/schemas/CampaignEnablement'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
          description: ''
  /api/notification/v1/orgs/{platform_key}/campaigns/exclude/:
    post:
      operationId: notification_v1_orgs_campaigns_exclude_create
      description: Exclude a user from specified campaigns
      parameters:
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignExclusion'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CampaignExclusion'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CampaignExclusion'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CampaignExclusion'
          '*/*':
            schema:
              $ref: '#/components/schemas/CampaignExclusion'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
          description: ''
  /api/notification/v1/orgs/{platform_key}/mark-all-as-read:
    post:
      operationId: notification_v1_orgs_mark_all_as_read_create
      description: >-
        Mark all notifications as read for a user. Optionally provide specific
        notification IDs.
      parameters:
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MarkAllReadRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MarkAllReadRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MarkAllReadRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MarkAllReadRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/MarkAllReadRequest'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarkAllReadResponse'
          description: ''
  /api/notification/v1/orgs/{platform_key}/notification-builder/{id}/recipients/:
    get:
      operationId: notification_v1_orgs_notification_builder_recipients_list
      description: Get paginated list of recipients for a notification build
      summary: Get build recipients
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page number
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of items per page
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
        - in: query
          name: search
          schema:
            type: string
          description: Search recipients by username or email
      tags:
        - notifications
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Recipient'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
  /api/notification/v1/orgs/{platform_key}/notification-builder/context/:
    get:
      operationId: notification_v1_orgs_notification_builder_context_retrieve
      description: >-
        Get all context data needed for notification building including
        templates, channels, and platforms
      summary: Get notification context data
      parameters:
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - notifications
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContextResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
  /api/notification/v1/orgs/{platform_key}/notification-builder/preview/:
    post:
      operationId: notification_v1_orgs_notification_builder_preview_create
      description: Preview notification recipients and get build ID for sending
      summary: Preview notification
      parameters:
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationPreview'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/NotificationPreview'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/NotificationPreview'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreviewResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
  /api/notification/v1/orgs/{platform_key}/notification-builder/send/:
    post:
      operationId: notification_v1_orgs_notification_builder_send_create
      description: Send notifications to all recipients in a build
      summary: Send notification
      parameters:
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendNotification'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SendNotification'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SendNotification'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
  /api/notification/v1/orgs/{platform_key}/notification-builder/validate_source/:
    post:
      operationId: notification_v1_orgs_notification_builder_validate_source_create
      description: Validate a single notification source (email, username, platform, csv)
      summary: Validate notification source
      parameters:
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationSource'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/NotificationSource'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/NotificationSource'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateSourceResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: ''
  /api/notification/v1/platforms/{platform_key}/config/test-smtp/:
    post:
      operationId: notification_v1_platforms_config_test_smtp_create
      description: Test SMTP credentials by sending a test email to the specified address
      summary: Test SMTP credentials for a platform
      parameters:
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestSMTPCredentials'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TestSMTPCredentials'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TestSMTPCredentials'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TestSMTPCredentials'
          '*/*':
            schema:
              $ref: '#/components/schemas/TestSMTPCredentials'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestSMTPResponse'
          description: ''
  /api/notification/v1/platforms/{platform_key}/templates/:
    get:
      operationId: notification_v1_platforms_templates_list
      description: >-
        Get all notification templates for the platform. Includes both
        platform-specific and inherited templates from main.
      summary: List notification templates
      parameters:
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - notifications
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/NotificationTemplateList'
          description: ''
  /api/notification/v1/platforms/{platform_key}/templates/{notification_type}/:
    get:
      operationId: notification_v1_platforms_templates_retrieve
      description: >-
        Get detailed view of a notification template by type. Returns
        platform-specific template if exists, otherwise main template.
      summary: Get notification template details
      parameters:
        - in: path
          name: notification_type
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - notifications
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationTemplateDetail'
          description: ''
    patch:
      operationId: notification_v1_platforms_templates_partial_update
      description: >-
        Update notification template. Creates platform-specific copy on first
        edit.
      summary: Update notification template
      parameters:
        - in: path
          name: notification_type
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedNotificationTemplateDetail'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedNotificationTemplateDetail'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedNotificationTemplateDetail'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedNotificationTemplateDetail'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedNotificationTemplateDetail'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationTemplateDetail'
          description: ''
  /api/notification/v1/platforms/{platform_key}/templates/{notification_type}/reset/:
    post:
      operationId: notification_v1_platforms_templates_reset_create
      description: >-
        Delete platform-specific template override and revert to main template.
        Notification preference (on/off) is preserved.
      summary: Reset template to default
      parameters:
        - in: path
          name: notification_type
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - notifications
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  deleted:
                    type: boolean
          description: ''
  /api/notification/v1/platforms/{platform_key}/templates/{notification_type}/test/:
    post:
      operationId: notification_v1_platforms_templates_test_create
      description: >-
        Send a test notification to verify template rendering and delivery.
        Sends to the requesting admin's email or a specified test email.
      summary: Send test notification
      parameters:
        - in: path
          name: notification_type
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationTemplateTest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/NotificationTemplateTest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/NotificationTemplateTest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/NotificationTemplateTest'
          '*/*':
            schema:
              $ref: '#/components/schemas/NotificationTemplateTest'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationTemplateTestResponse'
          description: ''
  /api/notification/v1/platforms/{platform_key}/templates/{notification_type}/toggle/:
    patch:
      operationId: notification_v1_platforms_templates_toggle_partial_update
      description: >-
        Enable or disable a notification type for the platform. This sets the
        NotificationPreference, not the template.
      summary: Toggle notification preference
      parameters:
        - in: path
          name: notification_type
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedNotificationToggle'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedNotificationToggle'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedNotificationToggle'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedNotificationToggle'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedNotificationToggle'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationToggle'
          description: ''
  /api/orgs/{platform_key}/scim/v2/Groups:
    get:
      operationId: list_groups
      description: >-
        List all existing RBAC groups for the specified platform. Only returns
        groups that have been pre-created in the RBAC system.
      summary: List existing RBAC groups
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SCIMGroupListResponse'
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SCIMGroupListResponse'
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden
            application/json:
              schema:
                description: Forbidden
          description: ''
    post:
      operationId: manage_group
      description: >-
        Add/remove users from an existing RBAC group for the specified platform.
        Does not create new groups.
      summary: Manage existing user group
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      requestBody:
        content:
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SCIMGroup'
          application/json:
            schema:
              $ref: '#/components/schemas/SCIMGroup'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
            application/json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
          description: ''
        '400':
          content:
            application/scim+json:
              schema:
                description: Invalid request
            application/json:
              schema:
                description: Invalid request
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden
            application/json:
              schema:
                description: Forbidden
          description: ''
        '404':
          content:
            application/scim+json:
              schema:
                description: RBAC group does not exist
            application/json:
              schema:
                description: RBAC group does not exist
          description: ''
  /api/orgs/{platform_key}/scim/v2/Groups/{id}:
    get:
      operationId: retrieve_group
      description: >-
        Get details of a specific existing RBAC group by unique ID for the
        specified platform
      summary: Get details of a specific RBAC group
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
            application/json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden
            application/json:
              schema:
                description: Forbidden
          description: ''
        '404':
          content:
            application/scim+json:
              schema:
                description: RBAC group not found
            application/json:
              schema:
                description: RBAC group not found
          description: ''
    put:
      operationId: update_group
      description: >-
        Update an existing RBAC group's name, description, and members for the
        specified platform
      summary: Update an existing RBAC group
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      requestBody:
        content:
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SCIMGroup'
          application/json:
            schema:
              $ref: '#/components/schemas/SCIMGroup'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
            application/json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
          description: ''
        '400':
          content:
            application/scim+json:
              schema:
                description: Invalid request
            application/json:
              schema:
                description: Invalid request
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden
            application/json:
              schema:
                description: Forbidden
          description: ''
        '404':
          content:
            application/scim+json:
              schema:
                description: RBAC group not found
            application/json:
              schema:
                description: RBAC group not found
          description: ''
    patch:
      operationId: partial_update_group
      description: >-
        Partially update an existing RBAC group's name, description, and members
        for the specified platform using PATCH method
      summary: Partially update an existing RBAC group
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      requestBody:
        content:
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedSCIMGroup'
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedSCIMGroup'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
            application/json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
          description: ''
        '400':
          content:
            application/scim+json:
              schema:
                description: Invalid request
            application/json:
              schema:
                description: Invalid request
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden
            application/json:
              schema:
                description: Forbidden
          description: ''
        '404':
          content:
            application/scim+json:
              schema:
                description: RBAC group not found
            application/json:
              schema:
                description: RBAC group not found
          description: ''
    delete:
      operationId: delete_group
      description: Delete an existing RBAC group from the system
      summary: Delete an existing RBAC group
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          content:
            application/scim+json:
              schema:
                description: RBAC group deleted successfully
            application/json:
              schema:
                description: RBAC group deleted successfully
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden
            application/json:
              schema:
                description: Forbidden
          description: ''
        '404':
          content:
            application/scim+json:
              schema:
                description: RBAC group not found
            application/json:
              schema:
                description: RBAC group not found
          description: ''
  /api/orgs/{platform_key}/scim/v2/Groups/{id}/:
    get:
      operationId: retrieve_group_2
      description: >-
        Get details of a specific existing RBAC group by unique ID for the
        specified platform
      summary: Get details of a specific RBAC group
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
            application/json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden
            application/json:
              schema:
                description: Forbidden
          description: ''
        '404':
          content:
            application/scim+json:
              schema:
                description: RBAC group not found
            application/json:
              schema:
                description: RBAC group not found
          description: ''
    put:
      operationId: update_group_2
      description: >-
        Update an existing RBAC group's name, description, and members for the
        specified platform
      summary: Update an existing RBAC group
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      requestBody:
        content:
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SCIMGroup'
          application/json:
            schema:
              $ref: '#/components/schemas/SCIMGroup'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
            application/json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
          description: ''
        '400':
          content:
            application/scim+json:
              schema:
                description: Invalid request
            application/json:
              schema:
                description: Invalid request
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden
            application/json:
              schema:
                description: Forbidden
          description: ''
        '404':
          content:
            application/scim+json:
              schema:
                description: RBAC group not found
            application/json:
              schema:
                description: RBAC group not found
          description: ''
    patch:
      operationId: partial_update_group_2
      description: >-
        Partially update an existing RBAC group's name, description, and members
        for the specified platform using PATCH method
      summary: Partially update an existing RBAC group
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      requestBody:
        content:
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedSCIMGroup'
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedSCIMGroup'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
            application/json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
          description: ''
        '400':
          content:
            application/scim+json:
              schema:
                description: Invalid request
            application/json:
              schema:
                description: Invalid request
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden
            application/json:
              schema:
                description: Forbidden
          description: ''
        '404':
          content:
            application/scim+json:
              schema:
                description: RBAC group not found
            application/json:
              schema:
                description: RBAC group not found
          description: ''
    delete:
      operationId: delete_group_2
      description: Delete an existing RBAC group from the system
      summary: Delete an existing RBAC group
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          content:
            application/scim+json:
              schema:
                description: RBAC group deleted successfully
            application/json:
              schema:
                description: RBAC group deleted successfully
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden
            application/json:
              schema:
                description: Forbidden
          description: ''
        '404':
          content:
            application/scim+json:
              schema:
                description: RBAC group not found
            application/json:
              schema:
                description: RBAC group not found
          description: ''
  /api/orgs/{platform_key}/scim/v2/Groups/{id}/add_members:
    post:
      operationId: add_group_members
      description: Add members to an existing RBAC group using SCIM patch operations
      summary: Add members to an existing RBAC group
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
            application/json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
          description: ''
        '400':
          content:
            application/scim+json:
              schema:
                description: Invalid request
            application/json:
              schema:
                description: Invalid request
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden
            application/json:
              schema:
                description: Forbidden
          description: ''
        '404':
          content:
            application/scim+json:
              schema:
                description: RBAC group not found
            application/json:
              schema:
                description: RBAC group not found
          description: ''
  /api/orgs/{platform_key}/scim/v2/Groups/{id}/remove_members:
    post:
      operationId: remove_group_members
      description: Remove members from an existing RBAC group using SCIM patch operations
      summary: Remove members from an existing RBAC group
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
            application/json:
              schema:
                $ref: '#/components/schemas/SCIMGroup'
          description: ''
        '400':
          content:
            application/scim+json:
              schema:
                description: Invalid request
            application/json:
              schema:
                description: Invalid request
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden
            application/json:
              schema:
                description: Forbidden
          description: ''
        '404':
          content:
            application/scim+json:
              schema:
                description: RBAC group not found
            application/json:
              schema:
                description: RBAC group not found
          description: ''
  /api/orgs/{platform_key}/scim/v2/Users:
    get:
      operationId: list_users
      description: List users in the system for the specified platform
      summary: List users in the system
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SCIMUserListResponse'
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SCIMUserListResponse'
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized - authentication required
            application/json:
              schema:
                description: Unauthorized - authentication required
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden - insufficient permissions
            application/json:
              schema:
                description: Forbidden - insufficient permissions
          description: ''
        '500':
          content:
            application/scim+json:
              schema:
                description: Internal server error
            application/json:
              schema:
                description: Internal server error
          description: ''
    post:
      operationId: create_user
      description: Create a new user in the system for the specified platform
      summary: Create a new user in the system
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      requestBody:
        content:
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SCIMUserCreateRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/SCIMUserCreateRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMUserResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/SCIMUserResponse'
          description: ''
        '400':
          content:
            application/scim+json:
              schema:
                description: Invalid request - missing required fields or invalid data
            application/json:
              schema:
                description: Invalid request - missing required fields or invalid data
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized - authentication required
            application/json:
              schema:
                description: Unauthorized - authentication required
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden - insufficient permissions
            application/json:
              schema:
                description: Forbidden - insufficient permissions
          description: ''
        '409':
          content:
            application/scim+json:
              schema:
                description: User already exists
            application/json:
              schema:
                description: User already exists
          description: ''
        '500':
          content:
            application/scim+json:
              schema:
                description: Internal server error
            application/json:
              schema:
                description: Internal server error
          description: ''
  /api/orgs/{platform_key}/scim/v2/Users/{id}:
    get:
      operationId: retrieve_user
      description: Get details of a specific user by ID for the specified platform
      summary: Get details of a specific user
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMUserResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/SCIMUserResponse'
          description: ''
        '400':
          content:
            application/scim+json:
              schema:
                description: Invalid request - missing required fields or invalid data
            application/json:
              schema:
                description: Invalid request - missing required fields or invalid data
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized - authentication required
            application/json:
              schema:
                description: Unauthorized - authentication required
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden - insufficient permissions
            application/json:
              schema:
                description: Forbidden - insufficient permissions
          description: ''
        '404':
          content:
            application/scim+json:
              schema:
                description: User not found
            application/json:
              schema:
                description: User not found
          description: ''
        '500':
          content:
            application/scim+json:
              schema:
                description: Internal server error
            application/json:
              schema:
                description: Internal server error
          description: ''
    put:
      operationId: update_user
      description: Update a user for the specified platform
      summary: Update a user
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      requestBody:
        content:
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SCIMUserCreateRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/SCIMUserCreateRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMUserResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/SCIMUserResponse'
          description: ''
        '400':
          content:
            application/scim+json:
              schema:
                description: Invalid request
            application/json:
              schema:
                description: Invalid request
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden
            application/json:
              schema:
                description: Forbidden
          description: ''
        '404':
          content:
            application/scim+json:
              schema:
                description: User not found
            application/json:
              schema:
                description: User not found
          description: ''
    patch:
      operationId: partial_update_user
      description: Partially update an existing user's information using PATCH method
      summary: Partially update an existing user
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      requestBody:
        content:
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedSCIMUserResponse'
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedSCIMUserResponse'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMUserResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/SCIMUserResponse'
          description: ''
        '400':
          content:
            application/scim+json:
              schema:
                description: Invalid request
            application/json:
              schema:
                description: Invalid request
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden
            application/json:
              schema:
                description: Forbidden
          description: ''
        '404':
          content:
            application/scim+json:
              schema:
                description: User not found
            application/json:
              schema:
                description: User not found
          description: ''
    delete:
      operationId: delete_user
      description: Delete a user for the specified platform (not supported)
      summary: Delete a user (not supported)
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '405':
          content:
            application/scim+json:
              schema:
                description: Method not allowed - User deletion is not supported via SCIM
            application/json:
              schema:
                description: Method not allowed - User deletion is not supported via SCIM
          description: ''
  /api/orgs/{platform_key}/scim/v2/Users/{id}/:
    get:
      operationId: retrieve_user_2
      description: Get details of a specific user by ID for the specified platform
      summary: Get details of a specific user
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMUserResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/SCIMUserResponse'
          description: ''
        '400':
          content:
            application/scim+json:
              schema:
                description: Invalid request - missing required fields or invalid data
            application/json:
              schema:
                description: Invalid request - missing required fields or invalid data
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized - authentication required
            application/json:
              schema:
                description: Unauthorized - authentication required
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden - insufficient permissions
            application/json:
              schema:
                description: Forbidden - insufficient permissions
          description: ''
        '404':
          content:
            application/scim+json:
              schema:
                description: User not found
            application/json:
              schema:
                description: User not found
          description: ''
        '500':
          content:
            application/scim+json:
              schema:
                description: Internal server error
            application/json:
              schema:
                description: Internal server error
          description: ''
    put:
      operationId: update_user_2
      description: Update a user for the specified platform
      summary: Update a user
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      requestBody:
        content:
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SCIMUserCreateRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/SCIMUserCreateRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMUserResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/SCIMUserResponse'
          description: ''
        '400':
          content:
            application/scim+json:
              schema:
                description: Invalid request
            application/json:
              schema:
                description: Invalid request
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden
            application/json:
              schema:
                description: Forbidden
          description: ''
        '404':
          content:
            application/scim+json:
              schema:
                description: User not found
            application/json:
              schema:
                description: User not found
          description: ''
    patch:
      operationId: partial_update_user_2
      description: Partially update an existing user's information using PATCH method
      summary: Partially update an existing user
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      requestBody:
        content:
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedSCIMUserResponse'
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedSCIMUserResponse'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/scim+json:
              schema:
                $ref: '#/components/schemas/SCIMUserResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/SCIMUserResponse'
          description: ''
        '400':
          content:
            application/scim+json:
              schema:
                description: Invalid request
            application/json:
              schema:
                description: Invalid request
          description: ''
        '401':
          content:
            application/scim+json:
              schema:
                description: Unauthorized
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '403':
          content:
            application/scim+json:
              schema:
                description: Forbidden
            application/json:
              schema:
                description: Forbidden
          description: ''
        '404':
          content:
            application/scim+json:
              schema:
                description: User not found
            application/json:
              schema:
                description: User not found
          description: ''
    delete:
      operationId: delete_user_2
      description: Delete a user for the specified platform (not supported)
      summary: Delete a user (not supported)
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - scim+json
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - scim
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '405':
          content:
            application/scim+json:
              schema:
                description: Method not allowed - User deletion is not supported via SCIM
            application/json:
              schema:
                description: Method not allowed - User deletion is not supported via SCIM
          description: ''
  /api/overview/orgs/{org}/active-users:
    get:
      operationId: overview_orgs_active_users_retrieve
      description: >-
        Get active user counts over time.


        This endpoint provides daily counts of active users (users with known
        activity)

        over a specified time period.


        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)

        Returns:
            Daily active user counts over the specified time period, with change metrics
            compared to previous periods.

        Default time range is the last 7 days if no dates are specified.


        An active user is defined as a user with any activity within the past 30
        days.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/overview/orgs/{org}/average-grade:
    get:
      operationId: overview_orgs_average_grade_retrieve
      description: >-
        Get average grade value for platform, course, or user.


        This endpoint returns the average grade at different levels:

        - Platform level: Average grade across all courses

        - Course level: Average grade for a specific course

        - Learner level: Average grade for a specific learner

        - Course-learner level: Grade for a specific learner in a specific
        course


        Query Parameters:
            course_id (str, optional): Filter by course ID
            learner_id (str, optional): Filter by username or email

        Returns:
            The average grade value based on the specified filters.

        Access Control:
            - Platform admins can access any grade data
            - Learners can access their own grade data
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Average'
          description: ''
  /api/overview/orgs/{org}/courses/completions:
    get:
      operationId: overview_orgs_courses_completions_retrieve
      description: >-
        Get course completion summary metrics over time.


        This endpoint provides completion statistics across the platform over a

        specified time period, including daily completion counts and overall
        metrics.


        Query Parameters:
            start_date (str): Start date for the time range (ISO format)
            end_date (str): End date for the time range (ISO format)

        Returns:
            Completion data including:
            - Daily completion counts over time
            - Total unique user count
            - Total completion count
            - Completion percentage
            - Change metrics compared to previous periods

        Default time range is the last 7 days if no dates are specified.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseCompletionSummaryOvertime'
          description: ''
  /api/overview/orgs/{org}/learners:
    get:
      operationId: overview_orgs_learners_retrieve
      description: >-
        List all learners on the platform with aggregated metrics.


        This endpoint returns a paginated list of all learners with key metrics
        including:

        - Enrollment counts

        - Completion counts

        - Time spent on platform


        Query Parameters:
            page (int): Page number for pagination
            length (int): Number of items per page
            search (str): Filter learners by username, email, or name

        Returns:
            A paginated list of learners with their associated metrics.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: search
          schema:
            type: string
            minLength: 1
          description: Search string for learner
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerlearnerUserList'
          description: ''
  /api/overview/orgs/{org}/most-active-courses:
    get:
      operationId: overview_orgs_most_active_courses_retrieve
      description: |-
        Get time spent statistics on a per-course basis.

        This endpoint provides a paginated list of courses with the total time
        spent by users in each course.

        Query Parameters:
            start_date (str, optional): Start date for filtering (ISO format)
            end_date (str, optional): End date for filtering (ISO format)
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page

        Returns:
            A paginated list of courses with:
            - Course identification (ID and name)
            - Total time spent (in seconds)
            - Formatted time spent (human-readable)
            - Percentage of total platform time
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimeSpentPerCourse'
          description: ''
  /api/overview/orgs/{org}/registered-users:
    get:
      operationId: overview_orgs_registered_users_retrieve
      description: |-
        Get registered user counts over time.

        This endpoint provides daily counts of new user registrations over a
        specified time period.

        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)

        Returns:
            Daily registration counts over the specified time period, with change metrics
            compared to previous periods.

        Default time range is the last 7 days if no dates are specified.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/performance/orgs/{org}/courses/{course_id}/grading/average:
    get:
      operationId: performance_orgs_courses_grading_average_retrieve
      description: >-
        Get average grade value for platform, course, or user.


        This endpoint returns the average grade at different levels:

        - Platform level: Average grade across all courses

        - Course level: Average grade for a specific course

        - Learner level: Average grade for a specific learner

        - Course-learner level: Grade for a specific learner in a specific
        course


        Query Parameters:
            course_id (str, optional): Filter by course ID
            learner_id (str, optional): Filter by username or email

        Returns:
            The average grade value based on the specified filters.

        Access Control:
            - Platform admins can access any grade data
            - Learners can access their own grade data
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Average'
          description: ''
  /api/performance/orgs/{org}/courses/{course_id}/grading/average-with-cutoff:
    get:
      operationId: performance_orgs_courses_grading_average_with_cutoff_retrieve
      description: |-
        Returns average course grade and grade cuttoff

        e.g
        ```
        {
            "data": {
                "grade_cutoffs": {
                    "A": 90,
                    "B": 80,
                    "C": 70,
                },
                "average_grade": 50.0,
            }
        }
        ```

        Kwargs
        course_id
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AvgCourseGradeWithCutoff'
          description: ''
  /api/performance/orgs/{org}/courses/{course_id}/grading/detail:
    get:
      operationId: performance_orgs_courses_grading_detail_retrieve
      description: |-
        Grading summary for the entire course overview in a tree-like format

        Kwargs
        course_id <required>
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseGradingDetail'
          description: ''
  /api/performance/orgs/{org}/courses/{course_id}/grading/per-learner:
    get:
      operationId: performance_orgs_courses_grading_per_learner_retrieve
      description: |-
        Grading information per enrolled user in a course

        Kwargs
        course_id <required>
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GradingPerUser'
          description: ''
  /api/performance/orgs/{org}/courses/{course_id}/grading/summary:
    get:
      operationId: performance_orgs_courses_grading_summary_retrieve
      description: |-
        Returns average grades across various assignment types in a course

        Query Params
        course_id

        Returns:
            dict
            {
                "data": [
                    {
                        "assignment_type': <str>,
                        "weight": <float>,
                        "average_weighted_grade": <float>,
                        "average_section_grade": <float>
                    }, ...
                ]
            }
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseGradeSummary'
          description: ''
  /api/performance/orgs/{org}/grading/average:
    get:
      operationId: performance_orgs_grading_average_retrieve
      description: >-
        Get average grade value for platform, course, or user.


        This endpoint returns the average grade at different levels:

        - Platform level: Average grade across all courses

        - Course level: Average grade for a specific course

        - Learner level: Average grade for a specific learner

        - Course-learner level: Grade for a specific learner in a specific
        course


        Query Parameters:
            course_id (str, optional): Filter by course ID
            learner_id (str, optional): Filter by username or email

        Returns:
            The average grade value based on the specified filters.

        Access Control:
            - Platform admins can access any grade data
            - Learners can access their own grade data
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Average'
          description: ''
  /api/performance/orgs/{org}/grading/per-course:
    get:
      operationId: performance_orgs_grading_per_course_retrieve
      description: |-
        List grade-related performance data for all courses.

        This endpoint provides a comprehensive view of grade performance across
        courses, including enrollment counts, pass rates, and average grades.

        Returns:
            A paginated list of courses with:
            - Course identification (ID and name)
            - Enrollment count
            - Number of students who passed
            - Average grade
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerformanceGradesPerCourse'
          description: ''
  /api/perlearner/orgs/{org}/learners:
    get:
      operationId: perlearner_orgs_learners_retrieve
      description: >-
        Enhanced API endpoint for listing learners with comprehensive filtering.


        This endpoint provides a paginated list of learners with detailed
        metrics

        and supports advanced filtering options. It uses DM token authentication

        and respects department-based access controls.


        Query Parameters:
            page (int): Page number for pagination
            length (int): Number of items per page
            search (str): Filter by username, email, or full name
            program (str): Filter by program
            location (str): Filter by location
            is_enrolled (bool): Filter for users with enrollments
            platform (str): Filter by platform
            start_date (date): Filter by join date (start range)
            end_date (date): Filter by join date (end range)

        Returns:
            A paginated list of learners with comprehensive metrics including:
            - Course enrollments and completions
            - Time spent on platform
            - Pathway progress
            - Certificate and skill information
            - Location data

        Access Control:
            - Platform admins can see all learners
            - Department admins can only see learners in their departments
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            format: date
          description: Learner date_joined end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: is_enrolled
          schema:
            type: boolean
            nullable: true
          description: Filter for users who have at least an enrollment
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: query
          name: location
          schema:
            type: string
            minLength: 1
          description: Location search string
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: platform
          schema:
            type: string
            minLength: 1
          description: Platform search string
        - in: query
          name: program
          schema:
            type: string
            minLength: 1
          description: Program search string
        - in: query
          name: search
          schema:
            type: string
            minLength: 1
          description: Search string for learner. email, username or full name
        - in: query
          name: start_date
          schema:
            type: string
            format: date
          description: Learner date_joined start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewPerLearnerList'
          description: ''
  /api/perlearner/orgs/{org}/users:
    get:
      operationId: perlearner_orgs_users_retrieve
      description: >-
        List all learners on the platform with aggregated metrics.


        This endpoint returns a paginated list of all learners with key metrics
        including:

        - Enrollment counts

        - Completion counts

        - Time spent on platform


        Query Parameters:
            page (int): Page number for pagination
            length (int): Number of items per page
            search (str): Filter learners by username, email, or name

        Returns:
            A paginated list of learners with their associated metrics.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: search
          schema:
            type: string
            minLength: 1
          description: Search string for learner
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerlearnerUserList'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/activity/:
    get:
      operationId: perlearner_orgs_users_activity_retrieve
      description: |-
        Provides information on user enrollments

        Params
        user_id e.g developer@ibleducation.com| developer
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivityAPI'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/grading/cutoffs:
    get:
      operationId: perlearner_orgs_users_courses_grading_cutoffs_retrieve
      description: |-
        Provides about a learner current grade in a course with the course cut
        Kwargs
        1. course_id e.g course-v1:Org+Course4+Run
        2. user_id e.g developer@ibleducation.com or dev123 (username|email)
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerlearnerGradeWithCutOff'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/grading/detail:
    get:
      operationId: perlearner_orgs_users_courses_grading_detail_retrieve
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DetailedGradeView'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/grading/summary:
    get:
      operationId: perlearner_orgs_users_courses_grading_summary_retrieve
      description: |-
        Query Params
        1. course_id e.g course-v1:Org+Course4+Run
        2. user_id e.g developer@ibleducation.com or dev123 (username|email)
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerlearnerGradeSummary'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/overview/engagement-index:
    get:
      operationId: perlearner_orgs_users_courses_overview_engagement_index_retrieve
      description: >-
        Average of days with atleast an activity within ENGAGEMENT_INDEX_PERIOD
        consecutive days for a learner in a course
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Value'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/overview/grade:
    get:
      operationId: perlearner_orgs_users_courses_overview_grade_retrieve
      description: |-
        Provides about a learner current grade in a course with the course cut
        Kwargs
        1. course_id e.g course-v1:Org+Course4+Run
        2. user_id e.g developer@ibleducation.com or dev123 (username|email)
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerlearnerGradeWithCutOff'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/overview/performance-index:
    get:
      operationId: perlearner_orgs_users_courses_overview_performance_index_retrieve
      description: >-
        Evaluates performance index for platform, per course, per user and per
        user-per course


        Query Params

        course_id <optional>

        learner_id <optional>
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Value'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/overview/time/over-time:
    get:
      operationId: perlearner_orgs_users_courses_overview_time_over_time_retrieve
      description: >-
        Time spent within a course in secs on a per-day basis


        Kwargs

        1. course_id  e.g course-v1:Org+Course4+Run

        2. user_id e.g developer@ibleducation.com or dev123 (username|email)

        Query Params

        3. start_date e.g 2020-10-01

        4. end_date e.g 2020-10-10


        Default result when no query param is added is last_7_days (today
        inclusive)
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/videos:
    get:
      operationId: perlearner_orgs_users_courses_videos_retrieve
      description: |-
        List of videos within a course a learner has watched

        Kwargs
        1. course_id e.g course-v1:Org+Course4+Run
        2. user_id e.g developer@ibleducation.com or dev123 (username|email)

        Default result when no query param is added is [], 0
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerLearnerCourseVideosWatched'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/videos/over-time:
    get:
      operationId: perlearner_orgs_users_courses_videos_over_time_retrieve
      description: >-
        Get video watch counts over time.


        This endpoint provides daily counts of videos watched over a specified
        time period,

        with options to filter by course or user.


        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)
            course_id (str, optional): Filter by course ID
            user_id (str, optional): Filter by username or email

        Returns:
            Daily video watch counts over the specified time period.

        Default time range is the last 7 days if no dates are specified.


        Access Control:
            - Platform admins can access any video watch data
            - Learners can access their own video watch data
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/grades/per-course:
    get:
      operationId: perlearner_orgs_users_grades_per_course_retrieve
      description: |-
        Summary Grading Information for a learner on a per-enrollment basis

        Query Params
        1. user_id e.g developer@ibleducation.com or dev123 (username|email)
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerlearnerGradingPerCourseAPI'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/info:
    get:
      operationId: perlearner_orgs_users_info_retrieve
      description: |-
        Retrieve detailed information about a specific learner.

        This endpoint returns personal and activity information about a learner,
        including profile data, activity metrics, and location information.

        Path Parameters:
            user_id (str): The username or email of the learner

        Query Parameters:
            meta (bool): Include additional analytics information when true

        Returns:
            Detailed learner information including:
            - Profile data (username, name, email)
            - Registration and activity dates
            - Activity metrics (assessments, time spent, videos watched)
            - Location and browser information (when available)

        Access Control:
            - Platform admins can access any learner
            - Learners can access their own information
            - Department admins can access learners in their departments
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: meta
          schema:
            enum:
              - 'y'
              - 'yes'
              - 'true'
              - 'True'
              - 'n'
              - 'no'
              - 'false'
              - 'False'
            type: string
            default: 'n'
            minLength: 1
          description: |-
            Include extra analytics information?

            * `y` - y
            * `yes` - yes
            * `true` - true
            * `True` - True
            * `n` - n
            * `no` - no
            * `false` - false
            * `False` - False
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: search
          schema:
            type: string
            minLength: 1
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LearnerInformationAPI'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/last-access:
    get:
      operationId: perlearner_orgs_users_last_access_retrieve
      description: >-
        Last course accessed by a learner, includes upto unit information as
        well
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerLearnerLastAccess'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/overview/engagement-index:
    get:
      operationId: perlearner_orgs_users_overview_engagement_index_retrieve
      description: >-
        Average of days with atleast an activity within ENGAGEMENT_INDEX_PERIOD
        consecutive days
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Value'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/overview/grades/average:
    get:
      operationId: perlearner_orgs_users_overview_grades_average_retrieve
      description: >-
        Get average grade value for platform, course, or user.


        This endpoint returns the average grade at different levels:

        - Platform level: Average grade across all courses

        - Course level: Average grade for a specific course

        - Learner level: Average grade for a specific learner

        - Course-learner level: Grade for a specific learner in a specific
        course


        Query Parameters:
            course_id (str, optional): Filter by course ID
            learner_id (str, optional): Filter by username or email

        Returns:
            The average grade value based on the specified filters.

        Access Control:
            - Platform admins can access any grade data
            - Learners can access their own grade data
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Average'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/overview/performance-index:
    get:
      operationId: perlearner_orgs_users_overview_performance_index_retrieve
      description: >-
        Evaluates performance index for platform, per course, per user and per
        user-per course


        Query Params

        course_id <optional>

        learner_id <optional>
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Value'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/overview/time/over-time:
    get:
      operationId: perlearner_orgs_users_overview_time_over_time_retrieve
      description: >-
        Time spent in secs on a per-day basis


        Query Params

        1. course_id <optional> e.g course-v1:Org+Course4+Run

        2. user_id <optional> e.g developer@ibleducation.com or dev123
        (username|email)

        3. start_date e.g 2020-10-01

        4. end_date e.g 2020-10-10


        Default result when no query param is added is last_7_days (today
        inclusive)
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/videos/over-time:
    get:
      operationId: perlearner_orgs_users_videos_over_time_retrieve
      description: >-
        Get video watch counts over time.


        This endpoint provides daily counts of videos watched over a specified
        time period,

        with options to filter by course or user.


        Query Parameters:
            start_date (str, optional): Start date for the time range (ISO format)
            end_date (str, optional): End date for the time range (ISO format)
            course_id (str, optional): Filter by course ID
            user_id (str, optional): Filter by username or email

        Returns:
            Daily video watch counts over the specified time period.

        Default time range is the last 7 days if no dates are specified.


        Access Control:
            - Platform admins can access any video watch data
            - Learners can access their own video watch data
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/perlearner/orgs/{org}/users/{user_id}/videos/per-course:
    get:
      operationId: perlearner_orgs_users_videos_per_course_retrieve
      description: |-
        Summary Videos watched data for a learner per enrollment

        Query Params
        1. user_id e.g developer@ibleducation.com or dev123 (username|email)
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PerlearnerEngagementVideosWatchedPerCourse
          description: ''
  /api/platform/orgs/{org}/:
    get:
      operationId: platform_orgs_retrieve
      description: |-
        Get a list of registered users on the platform.

        This endpoint provides a list of all registered users with basic profile
        information including username, name, email, and registration date.

        Returns:
            A list of registered users with their profile information.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/platform/orgs/{org}/courses/{course_id}/progress/:
    get:
      operationId: platform_orgs_courses_progress_retrieve
      description: |-
        Completion information per enrolled user

        Gives Percentage of units completed in course

        Query Params
        course_id <required>
        user_id <optional>
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/platform/orgs/{org}/courses/{course_id}/progress/average-days-to-complete:
    get:
      operationId: platform_orgs_courses_progress_average_days_to_complete_retrieve
      description: |-
        Average days used to complete a course

        Query Params
            1. course_id <optional> e.g course-v1:Org+Course4+Run
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/platform/orgs/{org}/courses/{course_id}/progress/average-time-to-complete:
    get:
      operationId: platform_orgs_courses_progress_average_time_to_complete_retrieve
      description: |-
        Average time used to complete a course in secs

        Query Params
            1. course_id <optional> e.g course-v1:Org+Course4+Run
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/platform/orgs/{org}/courses/{course_id}/progress/completed:
    get:
      operationId: platform_orgs_courses_progress_completed_retrieve
      description: |-
        Get completion count statistics.

        This endpoint returns completion counts at different levels:
        - Platform level: Total users who have completed at least one course
        - Course level: Total completions for a specific course
        - Learner level: Total courses completed by a specific learner

        Query Parameters:
            course_id (str, optional): Filter by course ID
            user_id (str, optional): Filter by username or email

        Returns:
            A count of completions based on the specified filters.
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/platform/orgs/{org}/courses/{course_id}/progress/completion-rate:
    get:
      operationId: platform_orgs_courses_progress_completion_rate_retrieve
      description: Average of total completed units
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/platform/orgs/{org}/courses/{course_id}/progress/in-progress:
    get:
      operationId: platform_orgs_courses_progress_in_progress_retrieve
      description: >-
        In Progress means any unit completion in the past 30 days


        For platform :  Total users who have atleast a course in_progress on the
        platform

        For course : Total users

        For learner : Total courses in progress


        Query Params
            1. course_id <optional> e.g course-v1:Org+Course4+Run
            2. user_id <optional> e.g developer@ibleducation.com or dev123 (username|email)
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/platform/orgs/{org}/courses/{course_id}/progress/started:
    get:
      operationId: platform_orgs_courses_progress_started_retrieve
      description: |-
        Started means an enrollment

        For platform :  Total users who have atleast an enrollment
        For course : Total users enrolled
        For learner : Total courses in progress

        Query Params
            1. course_id <optional> e.g course-v1:Org+Course4+Run
            2. user_id <optional> e.g developer@ibleducation.com or dev123 (username|email)
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/platform/orgs/{org}/courses/{course_id}/users/{user_id}/grades/passed:
    get:
      operationId: platform_orgs_courses_users_grades_passed_retrieve
      description: |-
        Base class for API views that return a single count value.

        This class formats the response as {"data": {value_key: count}} where
        value_key is configurable (defaults to "count").

        Attributes:
            value_key: The key used in the response for the count value
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/platform/orgs/{org}/courses/{course_id}/users/{user_id}/progress:
    get:
      operationId: platform_orgs_courses_users_progress_retrieve
      description: Gives Percentage of units completed in course for a specific learner
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerlearnerCourseProgress'
          description: ''
  /api/platform/orgs/{org}/courses/{course_id}/users/{user_id}/progress/days-to-complete:
    get:
      operationId: platform_orgs_courses_users_progress_days_to_complete_retrieve
      description: |-
        Average days used to complete a course

        Query Params
            1. course_id <optional> e.g course-v1:Org+Course4+Run
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/platform/orgs/{org}/courses/{course_id}/users/{user_id}/time/count:
    get:
      operationId: platform_orgs_courses_users_time_count_retrieve
      description: Time spent count in seconds within a course by a learner
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Count'
          description: ''
  /api/platform/orgs/{org}/courses/{course_id}/users/{user_id}/videos/count:
    get:
      operationId: platform_orgs_courses_users_videos_count_retrieve
      description: >-
        (Total videos watched / Total Course Videos) or Total Videos watched in
        a course by a learner
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideosCount'
          description: ''
  /api/platform/orgs/{org}/courses/{course_id}/videos/:
    get:
      operationId: platform_orgs_courses_videos_retrieve_2
      description: |-
        Count of total videos in a course

        Query Params
        course_id  e.g course-v1:Org+Course4+Run
      parameters:
        - in: path
          name: course_id
          schema:
            type: string
            pattern: ^((\w*)-(\w*):[^+]+(|\+)[^+]+(|\+)\+\w+)$
          required: true
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/platform/orgs/{org}/courses/count:
    get:
      operationId: platform_orgs_courses_count_retrieve
      description: >-
        Get total count of courses on the platform.


        This endpoint returns the total number of courses available on the
        platform.


        Returns:
            The total count of courses on the platform.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Count'
          description: ''
  /api/platform/orgs/{org}/courses/grades:
    get:
      operationId: platform_orgs_courses_grades_retrieve
      description: |-
        List grading information on a per-course basis.

        This endpoint provides grading statistics for all courses, including
        average grades and completion rates.

        Returns:
            A list of courses with their associated grading metrics.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/platform/orgs/{org}/courses/videos:
    get:
      operationId: platform_orgs_courses_videos_retrieve
      description: >-
        Get video watch statistics on a per-course basis.


        This endpoint provides a list of courses with aggregated video watch
        metrics,

        including total views and completion percentages.


        Returns:
            A list of courses with:
            - Course identification (ID and name)
            - Video watch count
            - Percentage of total videos watched
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatchedVideosPerCourse'
          description: ''
  /api/platform/orgs/{org}/progress/completed:
    get:
      operationId: platform_orgs_progress_completed_retrieve
      description: |-
        Get completion count statistics.

        This endpoint returns completion counts at different levels:
        - Platform level: Total users who have completed at least one course
        - Course level: Total completions for a specific course
        - Learner level: Total courses completed by a specific learner

        Query Parameters:
            course_id (str, optional): Filter by course ID
            user_id (str, optional): Filter by username or email

        Returns:
            A count of completions based on the specified filters.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/platform/orgs/{org}/progress/completion-rate:
    get:
      operationId: platform_orgs_progress_completion_rate_retrieve
      description: Average of total completed units
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/platform/orgs/{org}/progress/in-progress:
    get:
      operationId: platform_orgs_progress_in_progress_retrieve
      description: >-
        In Progress means any unit completion in the past 30 days


        For platform :  Total users who have atleast a course in_progress on the
        platform

        For course : Total users

        For learner : Total courses in progress


        Query Params
            1. course_id <optional> e.g course-v1:Org+Course4+Run
            2. user_id <optional> e.g developer@ibleducation.com or dev123 (username|email)
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/platform/orgs/{org}/progress/started:
    get:
      operationId: platform_orgs_progress_started_retrieve
      description: |-
        Started means an enrollment

        For platform :  Total users who have atleast an enrollment
        For course : Total users enrolled
        For learner : Total courses in progress

        Query Params
            1. course_id <optional> e.g course-v1:Org+Course4+Run
            2. user_id <optional> e.g developer@ibleducation.com or dev123 (username|email)
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/platform/orgs/{org}/time/count:
    get:
      operationId: platform_orgs_time_count_retrieve
      description: >-
        Total time spent count on the platform within specified range or all
        time


        Query Params

        1. start_date e.g 2020-10-01

        2. end_date e.g 2020-10-10


        Default result is all time
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/platform/orgs/{org}/users/active/count:
    get:
      operationId: platform_orgs_users_active_count_retrieve
      description: >-
        Get count of active users on the platform.


        This endpoint returns the number of users who have had activity on the
        platform,

        either for all time or within a specified date range.


        Query Parameters:
            start_date (str, optional): Start date for filtering (ISO format)
            end_date (str, optional): End date for filtering (ISO format)

        Returns:
            The count of active users and change metrics compared to previous periods.

        Default behavior returns the count for all time if no date range is
        specified.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/platform/orgs/{org}/users/count:
    get:
      operationId: platform_orgs_users_count_retrieve
      description: >-
        Get count of registered users on the platform.


        This endpoint returns the number of users registered on the platform,

        either for all time or within a specified date range.


        Query Parameters:
            start_date (str, optional): Start date for filtering (ISO format)
            end_date (str, optional): End date for filtering (ISO format)

        Returns:
            The count of registered users and change metrics compared to previous periods.

        Default behavior returns the count for all time if no date range is
        specified.
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/platform/orgs/{org}/users/courses-completed/count:
    get:
      operationId: platform_orgs_users_courses_completed_count_retrieve
      description: >-
        Count of users who have completed a course on the platform within
        specified range or all time


        Query Params

        1. start_date e.g 2020-10-01

        2. end_date e.g 2020-10-10


        Default is all time
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            minLength: 1
          description: end date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            minLength: 1
          description: start date. ISO 8601
      tags:
        - ai-analytics
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTimeWithTotal'
          description: ''
  /api/provider-association/stripe/callback/{launch_id}/:
    get:
      operationId: provider_association_stripe_callback_retrieve
      description: |-
        Handle callbacks from Stripe after successful checkout.

        Updates:
        - Platform launch state
        - Association configuration status
      parameters:
        - in: path
          name: launch_id
          schema:
            type: string
          required: true
      tags:
        - commerce
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
          description: ''
  /api/providers/apple/associate-account/:
    post:
      operationId: providers_apple_associate_account_create
      description: Associate an Apple account with a user known user
      tags:
        - commerce
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssociateAppleAccount'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/AssociateAppleAccount'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AssociateAppleAccount'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AssociateAppleAccount'
          '*/*':
            schema:
              $ref: '#/components/schemas/AssociateAppleAccount'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssociateAccountResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponse'
          description: ''
  /api/providers/apple/hook/:
    post:
      operationId: providers_apple_hook_create
      description: View to handle apple webhooks
      tags:
        - commerce
      responses:
        '200':
          description: No response body
  /api/providers/apple/subscription-status/:
    post:
      operationId: providers_apple_subscription_status_create
      description: Returns information about a user subscription status
      tags:
        - commerce
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppleSubscriptionStatusRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/AppleSubscriptionStatusRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AppleSubscriptionStatusRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AppleSubscriptionStatusRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/AppleSubscriptionStatusRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppleSubscriptionStatusView'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponse'
          description: ''
  /api/providers/apple/validate-transaction-id/:
    post:
      operationId: providers_apple_validate_transaction_id_create
      description: Checks if a provided transaction_id is valid
      tags:
        - commerce
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppleVerifyTransactionId'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/AppleVerifyTransactionId'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AppleVerifyTransactionId'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AppleVerifyTransactionId'
          '*/*':
            schema:
              $ref: '#/components/schemas/AppleVerifyTransactionId'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponse'
          description: ''
  /api/providers/aws/create-organization/:
    post:
      operationId: providers_aws_create_organization_create
      description: >-
        Serves a view that redirects to the AWS marketplace create organization
        page


        Set CREATE_ORGANIZATION_URL in GlobalConfigurationFetcher to the

        URL of the AWS marketplace create organization page
      tags:
        - commerce
      responses:
        '200':
          description: No response body
  /api/providers/aws/domain-status/:
    get:
      operationId: providers_aws_domain_status_retrieve
      description: API endpoint to get domain setup status
      tags:
        - commerce
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/providers/aws/launch-tenant/:
    post:
      operationId: providers_aws_launch_tenant_create
      description: >-
        Proxy to the Platform launch API


        We cannot expose launching a tenant to an authorized user hence the need
        for the API


        The API validates the x_amzn_marketplace_token and then proxies the
        request to the Platform Launch API
      tags:
        - commerce
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AWSTenantLaunchRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/AWSTenantLaunchRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AWSTenantLaunchRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AWSTenantLaunchRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/AWSTenantLaunchRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantLaunchResponse'
          description: ''
        '417':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantLaunchFailed'
          description: ''
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantLaunchError'
          description: ''
  /api/providers/aws/sync-domain-records/:
    get:
      operationId: providers_aws_sync_domain_records_retrieve
      description: API endpoint to get/update CNAME records for domain setup
      tags:
        - commerce
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    post:
      operationId: providers_aws_sync_domain_records_create
      description: API endpoint to get/update CNAME records for domain setup
      tags:
        - commerce
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/providers/gcp/create-organization/:
    post:
      operationId: providers_gcp_create_organization_create
      description: >-
        Serves a view that redirects to the GCP marketplace create organization
        page


        Set CREATE_ORGANIZATION_URL in GlobalConfigurationFetcher to the URL of
        the GCP marketplace create organization

        page
      tags:
        - commerce
      responses:
        '200':
          description: No response body
  /api/providers/gcp/create-organization/{product_id}/:
    post:
      operationId: providers_gcp_create_organization_create_2
      description: >-
        Serves a view that redirects to the GCP marketplace create organization
        page


        Set CREATE_ORGANIZATION_URL in GlobalConfigurationFetcher to the URL of
        the GCP marketplace create organization

        page
      parameters:
        - in: path
          name: product_id
          schema:
            type: string
          required: true
      tags:
        - commerce
      responses:
        '200':
          description: No response body
  /api/providers/gcp/hook/:
    post:
      operationId: providers_gcp_hook_create
      tags:
        - commerce
      responses:
        '200':
          description: No response body
  /api/providers/gcp/launch-tenant/:
    post:
      operationId: providers_gcp_launch_tenant_create
      description: >-
        Proxy to the Platform launch API


        We cannot expose launching a tenant to an authorized user hence the need
        for the API


        The API validates the x_gcp_marketplace_token and then proxies the
        request to the Platform Launc API
      tags:
        - commerce
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GCPTenantLaunchRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/GCPTenantLaunchRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/GCPTenantLaunchRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/GCPTenantLaunchRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/GCPTenantLaunchRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantLaunchResponse'
          description: ''
        '417':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantLaunchFailed'
          description: ''
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantLaunchError'
          description: ''
  /api/providers/gcp/validate-signup-token/:
    post:
      operationId: providers_gcp_validate_signup_token_create
      tags:
        - commerce
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifyGCPMarketPlaceRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/VerifyGCPMarketPlaceRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/VerifyGCPMarketPlaceRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/VerifyGCPMarketPlaceRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/VerifyGCPMarketPlaceRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerifyGCPMarketPlaceResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerifyGCPMarketPlaceFailedResponse'
          description: ''
  /api/providers/google-pay/get-account/{bundle_id}:
    get:
      operationId: providers_google_pay_get_account_retrieve
      description: >-
        Google Allows us to pass an obfuscated account id to be sent to during a
        subscription purchase
      parameters:
        - in: path
          name: bundle_id
          schema:
            type: string
          required: true
      tags:
        - commerce
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GooglePayAccountResponse'
          description: ''
  /api/providers/google-pay/hook/:
    post:
      operationId: providers_google_pay_hook_create
      description: View to handle Google Pay webhooks
      tags:
        - commerce
      responses:
        '200':
          description: No response body
  /api/providers/google-pay/validate-transaction-id/:
    post:
      operationId: providers_google_pay_validate_transaction_id_create
      description: Associate a Google Pay account with a known user
      tags:
        - commerce
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GooglePayVerifyToken'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/GooglePayVerifyToken'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/GooglePayVerifyToken'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/GooglePayVerifyToken'
          '*/*':
            schema:
              $ref: '#/components/schemas/GooglePayVerifyToken'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponse'
          description: ''
  /api/providers/stripe/create-organization/:
    post:
      operationId: providers_stripe_create_organization_create
      description: >-
        Proxy to the Platform launch API


        We cannot expose launching a tenant to an unauthorized user hence the
        need for the API


        The API validates the stripe_checkout_id and then proxies the request to
        the Platform Launch API
      tags:
        - commerce
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripeNewUserTenantLaunchRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/StripeNewUserTenantLaunchRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StripeNewUserTenantLaunchRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StripeNewUserTenantLaunchRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/StripeNewUserTenantLaunchRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantLaunchResponse'
          description: ''
        '417':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantLaunchFailed'
          description: ''
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantLaunchError'
          description: ''
  /api/recommendations/orgs/{org}/users/{user_id}/:
    get:
      operationId: recommendations_orgs_users_retrieve
      description: >-
        API endpoint that returns a search api url prepopulated with context
        data

        See http://localhost:8000/api/schema/swagger-ui/#/recommendations
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - recommendations
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecommendationSearchAPI'
          description: ''
  /api/reports/orgs/{org}/:
    get:
      operationId: reports_orgs_retrieve
      description: >-
        Lists all available reports in the system.


        This endpoint returns a list of all reports available to the user,
        including:

        - Report metadata (name, description, icon)

        - Available query parameters for each report

        - Result columns that will be returned

        - Current status of any previously requested reports


        If a report has been previously requested by the user, its status will
        be included

        in the response. Expired reports are automatically cleaned up.


        Returns:
            A list of report objects with their metadata and status information.
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - reports
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportList'
          description: ''
  /api/reports/orgs/{org}/{report_name}:
    get:
      operationId: reports_orgs_retrieve_2
      description: >-
        Retrieves detailed information about a specific report type.


        This endpoint provides:

        - Metadata about the report (name, description, icon)

        - Available query parameters for the report

        - Result columns that will be returned

        - Current status of the most recent report of this type requested by the
        user


        Path Parameters:
            report_name (str): The identifier of the report to retrieve details for

        Returns:
            Detailed information about the report type and its current status if previously requested.

        Error Responses:
            404 Not Found: If the specified report type doesn't exist
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: report_name
          schema:
            type: string
          required: true
      tags:
        - reports
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportDetail'
          description: ''
  /api/reports/orgs/{org}/new:
    post:
      operationId: reports_orgs_new_create
      description: >-
        Creates and manages report generation requests.


        This endpoint allows users to:

        1. Request a new report generation

        2. Check the status of a previously requested report

        3. Force regeneration of an existing report


        Reports expire after a configured time period (default is typically
        24-48 hours).


        Request Parameters:
            report_name (str): The identifier of the report to generate
            owner (str): The username of the report owner (usually the current user)
            learner_id (str, optional): Filter by specific learner
            course_id (str, optional): Filter by specific course
            start_date (str, optional): Start date for report data (ISO format)
            end_date (str, optional): End date for report data (ISO format)
            filters (dict, optional): Additional filters specific to the report type
            force (bool, optional): Force regeneration even if a valid report exists

        Returns:
            For new reports:
                - report_id: The unique identifier for the report task
                - state: The current state of the report (PENDING, RUNNING, etc.)

            For completed reports:
                - report_id: The unique identifier for the report task
                - report_name: The name of the report
                - url: Download URL for the report
                - state: COMPLETED
                - expires: Expiration timestamp for the report

            For in-progress reports:
                - report_id: The unique identifier for the report task
                - state: Current state (PENDING, RUNNING)
                - started_on: When the report generation started
                - owner: Username of the report owner

        Error Responses:
            400 Bad Request: Invalid parameters or report configuration
            404 Not Found: Report type not found
            403 Forbidden: User doesn't have permission for the requested report
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - reports
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ReportRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ReportRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ReportRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/ReportRequest'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportCreate'
          description: ''
  /api/reports/platforms/{key}/:
    get:
      operationId: reports_platforms_retrieve
      description: >-
        Returns a list of reports available in the system.


        For each report, it includes:

        - display_name: Human-readable name of the report

        - description: Description of what the report contains

        - icon: URL to an icon representing the report

        - report_name: Unique identifier for the report

        - extra_query_params: Additional parameters that can be passed when
        creating the report

        - result_columns: Columns that will be included in the report results

        - status: Current status of the report if it has been previously
        requested


        The status will include details like the report ID, state, and download
        URL if completed.
      parameters:
        - in: path
          name: key
          schema:
            type: string
          required: true
      tags:
        - reports
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportList'
          description: ''
  /api/reports/platforms/{key}/{report_name}:
    get:
      operationId: reports_platforms_retrieve_2
      description: >-
        Returns details of a specific report type including its status if
        previously requested.
      parameters:
        - in: path
          name: key
          schema:
            type: string
          required: true
        - in: path
          name: report_name
          schema:
            type: string
          required: true
      tags:
        - reports
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportDetail'
          description: ''
  /api/reports/platforms/{key}/new:
    post:
      operationId: reports_platforms_new_create
      description: >-
        Triggers a new report generation.


        If the report has been previously requested, it returns the status of
        the report.

        Reports expire after a configured duration.


        The request body should include:

        - report_name: Name of the report to generate

        - learner_id: (optional) ID of the learner to filter by

        - course_id: (optional) ID of the course to filter by

        - force: (optional) Force generation of a new report even if one exists

        - filters: (optional) Additional filters for the report

        - departments: (optional) Department IDs to filter by
      parameters:
        - in: path
          name: key
          schema:
            type: string
          required: true
      tags:
        - reports
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ReportRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ReportRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ReportRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/ReportRequest'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportCreate'
          description: ''
  /api/roles/platform/orgs/{org}/roles/users/{username}/desired-roles/:
    get:
      operationId: roles_platform_orgs_roles_users_desired_roles_retrieve
      description: |-
        Retrieve a user's desired role information.

        This endpoint returns the role and skills that a user has indicated
        they want to develop or acquire. This represents the user's career
        goals and learning objectives.

        Path Parameters:
            org (str): The platform/organization identifier
            username (str): The username of the user to retrieve role information for

        Returns:
            The user's desired role information including:
            - Target role title
            - Skills needed for the role
            - Current progress toward skill acquisition

        Error Responses:
            400 Bad Request: If the user doesn't exist in the platform or has no desired role
            404 Not Found: If the specified platform doesn't exist
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DesiredRole'
          description: ''
  /api/roles/platform/orgs/{org}/roles/users/{username}/reported-roles/:
    get:
      operationId: roles_platform_orgs_roles_users_reported_roles_retrieve
      description: |-
        Retrieve a user's reported role information.

        This endpoint returns the role and skills that a user has reported
        having in their profile. This represents the user's current skills
        and professional role.

        Path Parameters:
            org (str): The platform/organization identifier
            username (str): The username of the user to retrieve role information for

        Returns:
            The user's reported role information including:
            - Role title
            - Skills associated with the role
            - Experience level

        Error Responses:
            400 Bad Request: If the user doesn't exist in the platform or has no reported role
            404 Not Found: If the specified platform doesn't exist
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportedRole'
          description: ''
  /api/search/ai-search/:
    get:
      operationId: search_ai_search_retrieve
      description: Legacy endpoint for backward compatible mentor search
      parameters:
        - in: query
          name: audience
          schema:
            type: array
            items:
              type: string
          description: Filter by target audience
        - in: query
          name: category
          schema:
            type: array
            items:
              type: string
          description: Filter by mentor category
        - in: query
          name: created_by
          schema:
            type: string
            minLength: 1
          description: Filter mentors created by specific user
        - in: query
          name: filter_facet
          schema:
            type: boolean
            default: false
          description: If present, return only facets without results
        - in: query
          name: id
          schema:
            type: integer
          description: Retrieve a specific mentor by ID
        - in: query
          name: limit
          schema:
            type: integer
            default: 12
          description: Number of results per page
        - in: query
          name: llm
          schema:
            type: array
            items:
              type: string
          description: Filter by language model type
        - in: query
          name: offset
          schema:
            type: integer
            default: 0
          description: Starting position for pagination
        - in: query
          name: order_by
          schema:
            type: string
            minLength: 1
          description: Field to sort results by ('created_at', 'recently_accessed_at')
        - in: query
          name: order_direction
          schema:
            type: string
            default: desc
            minLength: 1
          description: Sort direction ('asc' or 'desc')
        - in: query
          name: page
          schema:
            type: integer
          description: Page number (1-based, used with page_size)
        - in: query
          name: page_size
          schema:
            type: integer
          description: Number of results per page
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter mentors by name or description
        - in: query
          name: tags
          schema:
            type: array
            items:
              type: string
          description: Filter by tags
        - in: query
          name: tenant
          schema:
            type: string
            minLength: 1
          description: Filter by tenant/organization
        - in: query
          name: unique_id
          schema:
            type: string
            format: uuid
          description: Retrieve a specific mentor by UUID
      tags:
        - search
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSearchResponse'
          description: ''
        '400':
          description: Bad request
        '500':
          description: Server error
  /api/search/catalog/:
    get:
      operationId: search_catalog_retrieve
      description: >-
        Search and filter content across the learning catalog.


        This endpoint provides a powerful search interface for discovering
        content across

        multiple content types (courses, programs, pathways, skills, roles,
        resources).

        It supports full-text search, faceted filtering, and pagination.


        Query Parameters:
            query (str, optional): Search term to filter content by name or description
            content (list, optional): Content types to include in results
                                     (courses, programs, pathways, skills, roles, resources)
                                     Default: ["programs", "courses", "pathways", "skills"]

            # Filtering parameters
            course_id (str, optional): Filter by specific course ID
            program_id (str, optional): Filter by specific program ID
            pathway_id (str, optional): Filter by specific pathway ID
            skill_id (str, optional): Filter by specific skill ID
            subject (list, optional): Filter by subject areas
            tenant (list, optional): Filter by tenant/organization
            topics (list, optional): Filter by topic areas
            tags (list, optional): Filter by tags
            level (list, optional): Filter by difficulty level
            self_paced (list, optional): Filter by course format (self-paced, instructor-led)
            promotion (list, optional): Filter by promotion status
            language (list, optional): Filter by content language
            certificate (list, optional): Filter by certificate type
            program_type (list, optional): Filter by program type
            duration (list, optional): Filter by course duration range
            price (str, optional): Filter by price/audit status
            resource_type (list, optional): Filter by resource type
            skills (list, optional): Filter by skills

            # Sorting and pagination
            order_by (str, optional): Field to sort results by
            order_ascending (bool, optional): Sort direction (default: false)
            alphabetical (bool, optional): Sort alphabetically by name (default: false)
            limit (int, optional): Number of results per page (default: 12, max: 100)
            offset (int, optional): Starting position for pagination

            # Response options
            return_facet (bool, optional): Include facet data in response (default: true)
            return_items (bool, optional): Include items in programs/pathways (default: false)
            allow_skill_search (bool, optional): Enable skill-based search (default: false)
            update_facet (str, optional): Force facet update

        Returns:
            A JSON response containing:
            - results: List of content items with metadata
            - count: Total number of matching items
            - next: URL for the next page of results (if available)
            - previous: URL for the previous page of results (if available)
            - current_page: Current page number
            - total_pages: Total number of pages
            - facets: Aggregated counts for each filter category (if requested)

        Each content item contains type-specific fields:
            - Courses:
                {
                    "id": 123,
                    "type": "course",
                    "course_id": "CS101",
                    "name": "Introduction to Computer Science",
                    "description": "Learn the fundamentals of computer science",
                    "short_description": "CS fundamentals",
                    "image_url": "https://example.com/images/cs101.jpg",
                    "level": "Beginner",
                    "subject": "Computer Science",
                    "topics": ["Programming", "Algorithms"],
                    "tags": ["python", "coding"],
                    "language": "English",
                    "tenant": "example-university",
                    "self_paced": true,
                    "duration": "6 weeks",
                    "certificate": "Professional Certificate",
                    "price": "Free",
                    "skills": [
                        {"id": 1, "name": "Python Programming"},
                        {"id": 2, "name": "Algorithms"}
                    ],
                    "url": "https://example.com/courses/cs101"
                }

            - Programs:
                {
                    "id": 456,
                    "type": "program",
                    "program_id": "PROG123",
                    "name": "Data Science Program",
                    "description": "Comprehensive data science curriculum",
                    "short_description": "Learn data science",
                    "image_url": "https://example.com/images/datascience.jpg",
                    "level": "Intermediate",
                    "subject": "Data Science",
                    "topics": ["Machine Learning", "Statistics"],
                    "program_type": "Professional Certificate",
                    "courses": [
                        {"id": 123, "name": "Introduction to Python"},
                        {"id": 124, "name": "Statistics for Data Science"}
                    ],
                    "url": "https://example.com/programs/prog123"
                }

            - Pathways:
                {
                    "id": 789,
                    "type": "pathway",
                    "pathway_id": "PATH456",
                    "name": "Software Engineering Career Path",
                    "description": "Complete pathway to become a software engineer",
                    "image_url": "https://example.com/images/swe-path.jpg",
                    "programs": [
                        {"id": 456, "name": "Programming Fundamentals"},
                        {"id": 457, "name": "Web Development"}
                    ],
                    "url": "https://example.com/pathways/path456"
                }

            - Skills:
                {
                    "id": 321,
                    "type": "skill",
                    "name": "Machine Learning",
                    "description": "Building systems that learn from data",
                    "courses": [
                        {"id": 125, "name": "Machine Learning Fundamentals"}
                    ],
                    "related_skills": [
                        {"id": 322, "name": "Deep Learning"}
                    ]
                }

            - Roles:
                {
                    "id": 654,
                    "type": "role",
                    "name": "Data Scientist",
                    "description": "Professional who analyzes and interprets complex data",
                    "skills": [
                        {"id": 321, "name": "Machine Learning"},
                        {"id": 323, "name": "Data Analysis"}
                    ],
                    "recommended_courses": [
                        {"id": 125, "name": "Machine Learning Fundamentals"}
                    ]
                }

            - Resources:
                {
                    "id": 987,
                    "type": "resource",
                    "name": "Python Cheat Sheet",
                    "description": "Quick reference guide for Python",
                    "resource_type": "PDF",
                    "url": "https://example.com/resources/python-cheatsheet.pdf",
                    "topics": ["Programming", "Python"]
                }

        Error Responses:
            500 Internal Server Error: If an unexpected error occurs during processing

        Notes:
            - Results are cached for performance
            - The 'resources' content type is only included by default if IBL_ENABLE_RESOURCES_IN_FACET is true
            - For debugging, add ?debug=true to see detailed information about skill matching
      parameters:
        - in: query
          name: allow_skill_search
          schema:
            type: boolean
            default: false
          description: Enable skill-based search
        - in: query
          name: alphabetical
          schema:
            type: boolean
            default: false
          description: Sort alphabetically by name
        - in: query
          name: certificate
          schema:
            type: array
            items:
              type: string
          description: Filter by certificate type
        - in: query
          name: content
          schema:
            type: array
            items:
              type: string
          description: Content types to include in results
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: Filter by specific course ID
        - in: query
          name: duration
          schema:
            type: array
            items:
              type: string
          description: Filter by course duration range
        - in: query
          name: language
          schema:
            type: array
            items:
              type: string
          description: Filter by content language
        - in: query
          name: level
          schema:
            type: array
            items:
              type: string
          description: Filter by difficulty level
        - in: query
          name: limit
          schema:
            type: integer
            default: 12
          description: Number of results per page
        - in: query
          name: offset
          schema:
            type: integer
            default: 0
          description: Starting position for pagination
        - in: query
          name: order_ascending
          schema:
            type: boolean
            default: false
          description: Sort direction
        - in: query
          name: order_by
          schema:
            type: string
            minLength: 1
          description: Field to sort results by
        - in: query
          name: pathway_id
          schema:
            type: string
            minLength: 1
          description: Filter by specific pathway ID
        - in: query
          name: price
          schema:
            type: string
            minLength: 1
          description: Filter by price/audit status
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: Filter by specific program ID
        - in: query
          name: program_type
          schema:
            type: array
            items:
              type: string
          description: Filter by program type
        - in: query
          name: promotion
          schema:
            type: array
            items:
              type: string
          description: Filter by promotion status
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter content by name or description
        - in: query
          name: resource_type
          schema:
            type: array
            items:
              type: string
          description: Filter by resource type
        - in: query
          name: return_facet
          schema:
            type: boolean
            default: true
          description: Include facet data in response
        - in: query
          name: return_items
          schema:
            type: boolean
            default: false
          description: Include items in programs/pathways
        - in: query
          name: self_paced
          schema:
            type: array
            items:
              type: string
          description: Filter by course format
        - in: query
          name: skill_id
          schema:
            type: string
            minLength: 1
          description: Filter by specific skill ID
        - in: query
          name: skills
          schema:
            type: array
            items:
              type: string
          description: Filter by skills
        - in: query
          name: subject
          schema:
            type: array
            items:
              type: string
          description: Filter by subject areas
        - in: query
          name: tags
          schema:
            type: array
            items:
              type: string
          description: Filter by tags
        - in: query
          name: tenant
          schema:
            type: string
            minLength: 1
          description: Filter by tenant/organization
        - in: query
          name: topics
          schema:
            type: array
            items:
              type: string
          description: Filter by topic areas
        - in: query
          name: update_facet
          schema:
            type: string
            minLength: 1
          description: Force facet update
      tags:
        - search
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GlobalCatalogSearchResponse'
          description: ''
        '400':
          description: Bad request
        '500':
          description: Server error
  /api/search/mentors/:
    get:
      operationId: search_mentors_retrieve
      description: >-
        Search and filter AI mentors across the platform.


        This endpoint provides a powerful search interface for discovering AI
        mentors

        with support for filtering, pagination, and detailed mentor information.


        Query Parameters:
            # Identification parameters (for detail view)
            id (int, optional): Retrieve a specific mentor by ID
            unique_id (uuid, optional): Retrieve a specific mentor by UUID

            # Search and filtering parameters
            query (str, optional): Search term to filter mentors by name or description
            tenant (str, optional): Filter by tenant/organization
            llm (list, optional): Filter by language model type
            audience (list, optional): Filter by target audience
            category (list, optional): Filter by mentor category
            tags (list, optional): Filter by tags
            created_by (str, optional): Filter mentors created by specific user

            # Sorting and pagination
            order_by (str, optional): Field to sort results by ('created_at', 'recently_accessed_at')
            order_direction (str, optional): Sort direction ('asc' or 'desc', default: 'desc')
            limit (int, optional): Number of results per page (default: 12, max: 100)
            offset (int, optional): Starting position for pagination

        Returns:
            For detail view (when id or unique_id is provided):
                A JSON response containing a single mentor's details:
                {
                    "id": 123,
                    "unique_id": "550e8400-e29b-41d4-a716-446655440000",
                    "name": "Professor Smith",
                    "description": "AI mentor specializing in computer science",
                    "image_url": "https://example.com/images/prof-smith.jpg",
                    "llm": {
                        "id": 1,
                        "name": "GPT-4",
                        "description": "Advanced language model"
                    },
                    "audience": {
                        "id": 2,
                        "name": "College Students",
                        "description": "For university-level learners"
                    },
                    "category": "Computer Science",
                    "tags": ["programming", "algorithms", "data structures"],
                    "created_at": "2023-01-15T12:00:00Z",
                    "recently_accessed_at": "2023-06-20T15:30:00Z",
                    "platform": {
                        "id": 1,
                        "name": "Example University",
                        "key": "example-university"
                    },
                    "visibility": "public",
                    "settings": {
                        "temperature": 0.7,
                        "max_tokens": 1024,
                        "system_prompt": "You are Professor Smith, an expert in computer science..."
                    }
                }

            For list view:
                A JSON response containing:
                {
                    "results": [
                        {
                            "id": 123,
                            "unique_id": "550e8400-e29b-41d4-a716-446655440000",
                            "name": "Professor Smith",
                            "description": "AI mentor specializing in computer science",
                            "image_url": "https://example.com/images/prof-smith.jpg",
                            "llm": {"id": 1, "name": "GPT-4"},
                            "audience": {"id": 2, "name": "College Students"},
                            "category": "Computer Science",
                            "tags": ["programming", "algorithms"],
                            "created_at": "2023-01-15T12:00:00Z",
                            "recently_accessed_at": "2023-06-20T15:30:00Z"
                        },
                        // Additional mentor objects...
                    ],
                    "count": 50,
                    "next": "https://api.example.com/api/search/mentors/?limit=12&offset=12",
                    "previous": null,
                    "current_page": 1,
                    "num_pages": 5,
                    "facets": {
                        "llm": [
                            {"key": "GPT-4", "doc_count": 30},
                            {"key": "Claude", "doc_count": 20}
                        ],
                        "audience": [
                            {"key": "College Students", "doc_count": 35},
                            {"key": "Professionals", "doc_count": 15}
                        ],
                        "category": [
                            {"key": "Computer Science", "doc_count": 25},
                            {"key": "Mathematics", "doc_count": 15},
                            {"key": "Business", "doc_count": 10}
                        ]
                    }
                }

        Error Responses:
            400 Bad Request: If the request parameters are invalid
            404 Not Found: If the requested mentor doesn't exist
            500 Internal Server Error: If an unexpected error occurs

        Notes:
            - Results are cached for performance
            - Public mentors are visible to all users
            - Private mentors are only visible to authorized users
      parameters:
        - in: query
          name: audience
          schema:
            type: array
            items:
              type: string
          description: Filter by target audience
        - in: query
          name: category
          schema:
            type: array
            items:
              type: string
          description: Filter by mentor category
        - in: query
          name: created_by
          schema:
            type: string
            minLength: 1
          description: Filter mentors created by specific user
        - in: query
          name: featured
          schema:
            type: boolean
          description: Filter by featured status
        - in: query
          name: id
          schema:
            type: integer
          description: Retrieve a specific mentor by ID
        - in: query
          name: include_main_public_mentors
          schema:
            type: boolean
            default: false
          description: Include public mentors from main tenant
        - in: query
          name: limit
          schema:
            type: integer
            default: 12
          description: Number of results per page
        - in: query
          name: llm
          schema:
            type: array
            items:
              type: string
          description: Filter by language model type
        - in: query
          name: offset
          schema:
            type: integer
            default: 0
          description: Starting position for pagination
        - in: query
          name: order_by
          schema:
            type: string
            minLength: 1
          description: Field to sort results by ('created_at', 'recently_accessed_at')
        - in: query
          name: order_direction
          schema:
            type: string
            default: desc
            minLength: 1
          description: Sort direction ('asc' or 'desc')
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter mentors by name or description
        - in: query
          name: tags
          schema:
            type: array
            items:
              type: string
          description: Filter by tags
        - in: query
          name: tenant
          schema:
            type: string
            minLength: 1
          description: Filter by tenant/organization
        - in: query
          name: unique_id
          schema:
            type: string
            format: uuid
          description: Retrieve a specific mentor by UUID
      tags:
        - search
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSearchResponse'
          description: ''
        '400':
          description: Bad request
        '500':
          description: Server error
  /api/search/mentors/{mentor_unique_id}/documents/:
    get:
      operationId: search_mentors_documents_retrieve
      description: Search and filter documents associated with a specific mentor
      parameters:
        - in: query
          name: access
          schema:
            type: string
            minLength: 1
          description: Filter by access level (e.g., 'public', 'private')
        - in: query
          name: document_type
          schema:
            type: string
            minLength: 1
          description: Filter by document type (e.g., 'pdf', 'text')
        - in: query
          name: limit
          schema:
            type: integer
            default: 12
          description: Number of results per page
        - in: path
          name: mentor_unique_id
          schema:
            type: string
            format: uuid
          required: true
        - in: query
          name: offset
          schema:
            type: integer
            default: 0
          description: Starting position for pagination
        - in: query
          name: order_by
          schema:
            type: string
            minLength: 1
          description: >-
            Field to sort results by ('date_created', 'last_modified',
            'document_name')
        - in: query
          name: order_direction
          schema:
            type: string
            default: desc
            minLength: 1
          description: Sort direction ('asc' or 'desc')
        - in: query
          name: platform_key
          schema:
            type: string
            minLength: 1
          description: Filter by platform key
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter documents by name or content
        - in: query
          name: training_status
          schema:
            type: string
            minLength: 1
          description: Filter by training status (e.g., 'trained', 'pending')
      tags:
        - search
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentSearchResponse'
          description: ''
        '400':
          description: Bad request
        '404':
          description: Mentor not found
        '500':
          description: Server error
  /api/search/orgs/{org}/users/{username}/mentors/:
    get:
      operationId: search_orgs_users_mentors_retrieve
      description: |-
        Handle GET requests for tenant-specific mentor search.

        Args:
            request: HTTP request object
            org: Tenant/organization key
            username: Username of the user making the request

        Returns:
            Response: DRF Response object with search results
      parameters:
        - in: query
          name: audience
          schema:
            type: array
            items:
              type: string
          description: Filter by target audience
        - in: query
          name: category
          schema:
            type: array
            items:
              type: string
          description: Filter by mentor category
        - in: query
          name: created_by
          schema:
            type: string
            minLength: 1
          description: Filter mentors created by specific user
        - in: query
          name: featured
          schema:
            type: boolean
          description: Filter by featured status
        - in: query
          name: id
          schema:
            type: integer
          description: Retrieve a specific mentor by ID
        - in: query
          name: include_main_public_mentors
          schema:
            type: boolean
            default: false
          description: Include public mentors from main tenant
        - in: query
          name: limit
          schema:
            type: integer
            default: 12
          description: Number of results per page
        - in: query
          name: llm
          schema:
            type: array
            items:
              type: string
          description: Filter by language model type
        - in: query
          name: offset
          schema:
            type: integer
            default: 0
          description: Starting position for pagination
        - in: query
          name: order_by
          schema:
            type: string
            minLength: 1
          description: Field to sort results by ('created_at', 'recently_accessed_at')
        - in: query
          name: order_direction
          schema:
            type: string
            default: desc
            minLength: 1
          description: Sort direction ('asc' or 'desc')
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter mentors by name or description
        - in: query
          name: tags
          schema:
            type: array
            items:
              type: string
          description: Filter by tags
        - in: query
          name: tenant
          schema:
            type: string
            minLength: 1
          description: Filter by tenant/organization
        - in: query
          name: unique_id
          schema:
            type: string
            format: uuid
          description: Retrieve a specific mentor by UUID
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - search
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSearchResponse'
          description: ''
        '400':
          description: Bad request
        '403':
          description: Forbidden - user does not have access
        '500':
          description: Server error
  /api/search/orgs/{org}/users/{username}/prompts/:
    get:
      operationId: search_orgs_users_prompts_retrieve
      description: >-
        Search and filter AI prompts for a specific user within a tenant.


        This endpoint extends the base prompt search functionality but filters
        results

        to only show prompts that are available to a specific user within a
        specific

        organization/tenant.


        Path Parameters:
            org (str): The organization/tenant identifier
            username (str): The username to filter prompts for

        Query Parameters:
            Same as PromptSearchView, plus:

            # Identification parameters (for detail view)
            id (int, optional): Retrieve a specific prompt by ID

        Returns:
            Same format as PromptSearchView, but filtered to only include prompts
            that the specified user has access to within the specified organization.

        Error Responses:
            400 Bad Request: If the request parameters are invalid
            403 Forbidden: If the requested prompt exists but the user doesn't have access
            404 Not Found: If the requested prompt doesn't exist
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - Results are filtered based on user's permissions within the organization
            - Private prompts are only visible to authorized users
      parameters:
        - in: query
          name: alphabetical
          schema:
            type: boolean
            default: false
          description: Sort alphabetically
        - in: query
          name: category
          schema:
            type: string
            minLength: 1
          description: Filter by prompt category
        - in: query
          name: created_by
          schema:
            type: string
            minLength: 1
          description: Filter prompts created by specific user
        - in: query
          name: filter_facet
          schema:
            type: boolean
          description: If true, return only facets without results
        - in: query
          name: language
          schema:
            type: string
            minLength: 1
          description: Filter by prompt language
        - in: query
          name: limit
          schema:
            type: integer
            default: 10
          description: Number of results per page
        - in: query
          name: mentor
          schema:
            type: string
            minLength: 1
          description: Filter by mentor UUID
        - in: query
          name: offset
          schema:
            type: integer
            default: 0
          description: Starting position for pagination
        - in: query
          name: order_direction
          schema:
            type: string
            default: desc
            minLength: 1
          description: Sort direction ('asc' or 'desc')
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter prompts by name or content
        - in: query
          name: sort_by
          schema:
            type: string
            minLength: 1
          description: Field to sort results by
        - in: query
          name: style
          schema:
            type: string
            minLength: 1
          description: Filter by prompt style
        - in: query
          name: tenant
          schema:
            type: string
            minLength: 1
          description: Filter by tenant/organization
        - in: query
          name: tone
          schema:
            type: string
            minLength: 1
          description: Filter by prompt tone
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - search
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptSearchResponse'
          description: ''
        '400':
          description: Bad request
        '403':
          description: Forbidden
        '404':
          description: Not found
        '500':
          description: Server error
  /api/search/orgs/{org}/users/{username}/recommended/:
    get:
      operationId: search_orgs_users_recommended_retrieve
      description: Determine whether to serve a detail view or a list view.
      parameters:
        - in: query
          name: certificate
          schema:
            type: array
            items:
              type: string
          description: Filter by certificate type
        - in: query
          name: content
          schema:
            type: array
            items:
              type: string
            default:
              - courses
          description: >-
            Content types to include in recommendations (courses, programs,
            pathways, skills, roles, resources)
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: Retrieve a specific course by ID
        - in: query
          name: duration
          schema:
            type: array
            items:
              type: string
          description: Filter by course duration range
        - in: query
          name: language
          schema:
            type: array
            items:
              type: string
          description: Filter by content language
        - in: query
          name: level
          schema:
            type: array
            items:
              type: string
          description: Filter by difficulty level
        - in: query
          name: limit
          schema:
            type: integer
            default: 12
          description: Number of results per page
        - in: query
          name: offset
          schema:
            type: integer
            default: 0
          description: Starting position for pagination
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: pathway_id
          schema:
            type: string
            minLength: 1
          description: Retrieve a specific pathway by ID
        - in: query
          name: price
          schema:
            type: string
            minLength: 1
          description: Filter by price/audit status
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: Retrieve a specific program by ID
        - in: query
          name: program_type
          schema:
            type: array
            items:
              type: string
          description: Filter by program type
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter content by name or description
        - in: query
          name: resource_id
          schema:
            type: string
            minLength: 1
          description: Retrieve a specific resource by ID
        - in: query
          name: resource_type
          schema:
            type: array
            items:
              type: string
          description: Filter by resource type
        - in: query
          name: role_id
          schema:
            type: string
            minLength: 1
          description: Retrieve a specific role by ID
        - in: query
          name: self_paced
          schema:
            type: array
            items:
              type: string
          description: Filter by course format (self-paced, instructor-led)
        - in: query
          name: skill_id
          schema:
            type: string
            minLength: 1
          description: Retrieve a specific skill by ID
        - in: query
          name: skills
          schema:
            type: array
            items:
              type: string
          description: Filter by skills
        - in: query
          name: subject
          schema:
            type: array
            items:
              type: string
          description: Filter by subject areas
        - in: query
          name: tags
          schema:
            type: array
            items:
              type: string
          description: Filter by tags
        - in: query
          name: tenant
          schema:
            type: string
            minLength: 1
          description: Filter by tenant/organization
        - in: query
          name: topics
          schema:
            type: array
            items:
              type: string
          description: Filter by topic areas
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - search
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecommendedCoursesResponse'
          description: ''
        '400':
          description: Bad request
        '404':
          description: User not found
        '500':
          description: Server error
  /api/search/personalized-catalog/{username}/:
    get:
      operationId: search_personalized_catalog_retrieve
      description: >-
        Determine whether to serve a detail view or a list view.

        If any detail-identifying parameters are present (course_id, program_id,
        etc.)

        the detail view is returned; otherwise the aggregated list view is
        returned.
      parameters:
        - in: query
          name: allow_skill_search
          schema:
            type: boolean
            default: false
          description: Enable skill-based search
        - in: query
          name: alphabetical
          schema:
            type: boolean
            default: false
          description: Sort alphabetically by name
        - in: query
          name: certificate
          schema:
            type: array
            items:
              type: string
          description: Filter by certificate type
        - in: query
          name: content
          schema:
            type: array
            items:
              type: string
          description: Content types to include in results
        - in: query
          name: course_id
          schema:
            type: string
            minLength: 1
          description: Retrieve a specific course by ID
        - in: query
          name: duration
          schema:
            type: array
            items:
              type: string
          description: Filter by course duration range
        - in: query
          name: language
          schema:
            type: array
            items:
              type: string
          description: Filter by content language
        - in: query
          name: level
          schema:
            type: array
            items:
              type: string
          description: Filter by difficulty level
        - in: query
          name: limit
          schema:
            type: integer
            default: 12
          description: Number of results per page
        - in: query
          name: offset
          schema:
            type: integer
            default: 0
          description: Starting position for pagination
        - in: query
          name: order_ascending
          schema:
            type: boolean
            default: false
          description: Sort direction
        - in: query
          name: order_by
          schema:
            type: string
            minLength: 1
          description: Field to sort results by
        - in: query
          name: pathway_id
          schema:
            type: string
            minLength: 1
          description: Retrieve a specific pathway by ID
        - in: query
          name: price
          schema:
            type: string
            minLength: 1
          description: Filter by price/audit status
        - in: query
          name: program_id
          schema:
            type: string
            minLength: 1
          description: Retrieve a specific program by ID
        - in: query
          name: program_type
          schema:
            type: array
            items:
              type: string
          description: Filter by program type
        - in: query
          name: promotion
          schema:
            type: array
            items:
              type: string
          description: Filter by promotion status
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter content by name or description
        - in: query
          name: recommended
          schema:
            type: boolean
            default: false
          description: Show only recommended content
        - in: query
          name: resource_id
          schema:
            type: string
            minLength: 1
          description: Retrieve a specific resource by ID
        - in: query
          name: resource_type
          schema:
            type: array
            items:
              type: string
          description: Filter by resource type
        - in: query
          name: return_facet
          schema:
            type: boolean
            default: true
          description: Include facet data in response
        - in: query
          name: return_items
          schema:
            type: boolean
            default: false
          description: Include items in programs/pathways
        - in: query
          name: role_id
          schema:
            type: string
            minLength: 1
          description: Retrieve a specific role by ID
        - in: query
          name: self_paced
          schema:
            type: array
            items:
              type: string
          description: Filter by course format
        - in: query
          name: skill_id
          schema:
            type: string
            minLength: 1
          description: Retrieve a specific skill by ID
        - in: query
          name: skills
          schema:
            type: array
            items:
              type: string
          description: Filter by skills
        - in: query
          name: subject
          schema:
            type: array
            items:
              type: string
          description: Filter by subject areas
        - in: query
          name: tags
          schema:
            type: array
            items:
              type: string
          description: Filter by tags
        - in: query
          name: tenant
          schema:
            type: string
            minLength: 1
          description: Filter by tenant/organization
        - in: query
          name: topics
          schema:
            type: array
            items:
              type: string
          description: Filter by topic areas
        - in: query
          name: update_facet
          schema:
            type: string
            minLength: 1
          description: Force facet update
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - search
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
  /api/search/prompts/:
    get:
      operationId: search_prompts_retrieve
      description: |-
        Search and filter AI prompts across the platform.

        This endpoint provides a search interface for discovering AI prompts
        with support for filtering, pagination, and detailed prompt information.

        Query Parameters:
            # Identification parameters (for detail view)
            id (int, optional): Retrieve a specific prompt by ID

            # Search and filtering parameters
            query (str, optional): Search term to filter prompts by name or content
            category (str, optional): Filter by prompt category
            language (str, optional): Filter by prompt language
            style (str, optional): Filter by writing style
            tone (str, optional): Filter by tone
            tenant (str, optional): Filter by tenant/organization
            mentor (str, optional): Filter by associated mentor (UUID)

            # Sorting and pagination
            sort_by (str, optional): Field to sort results by
            order_direction (str, optional): Sort direction ('asc' or 'desc', default: 'desc')
            alphabetical (bool, optional): Sort alphabetically by name (default: false)
            limit (int, optional): Number of results per page (default: 10)
            offset (int, optional): Starting position for pagination

            # Special parameters
            filter_facet (any, optional): If present, return only facets without results

        Returns:
            For detail view (when id is provided):
                A JSON response containing a single prompt's details:
                {
                    "id": 456,
                    "name": "Essay Writing Guide",
                    "content": "Write a well-structured essay on the following topic: {{topic}}...",
                    "category": "Academic Writing",
                    "language": "English",
                    "style": "Formal",
                    "tone": "Professional",
                    "mentor": {
                        "id": 123,
                        "unique_id": "550e8400-e29b-41d4-a716-446655440000",
                        "name": "Professor Smith"
                    },
                    "platform": {
                        "id": 1,
                        "name": "Example University",
                        "key": "example-university"
                    },
                    "created_at": "2023-02-10T09:15:00Z",
                    "updated_at": "2023-05-05T14:20:00Z",
                    "visibility": "public",
                    "variables": ["topic", "length", "style"]
                }

            For list view:
                A JSON response containing:
                {
                    "results": [
                        {
                            "id": 456,
                            "name": "Essay Writing Guide",
                            "content": "Write a well-structured essay on the following topic: {{topic}}...",
                            "category": "Academic Writing",
                            "language": "English",
                            "style": "Formal",
                            "tone": "Professional",
                            "mentor": {"id": 123, "name": "Professor Smith"},
                            "created_at": "2023-02-10T09:15:00Z",
                            "updated_at": "2023-05-05T14:20:00Z"
                        },
                        // Additional prompt objects...
                    ],
                    "count": 30,
                    "next": "?limit=10&offset=10",
                    "previous": null,
                    "current_page": 1,
                    "num_pages": 3,
                    "facets": {
                        "category": [
                            {"key": "Academic Writing", "doc_count": 15},
                            {"key": "Creative Writing", "doc_count": 10},
                            {"key": "Technical Documentation", "doc_count": 5}
                        ],
                        "language": [
                            {"key": "English", "doc_count": 25},
                            {"key": "Spanish", "doc_count": 5}
                        ],
                        "style": [
                            {"key": "Formal", "doc_count": 20},
                            {"key": "Casual", "doc_count": 10}
                        ],
                        "tone": [
                            {"key": "Professional", "doc_count": 15},
                            {"key": "Friendly", "doc_count": 10},
                            {"key": "Technical", "doc_count": 5}
                        ]
                    }
                }

        Error Responses:
            400 Bad Request: If the request parameters are invalid
            403 Forbidden: If the requested prompt exists but is not publicly available
            404 Not Found: If the requested prompt doesn't exist
            500 Internal Server Error: If an unexpected error occurs

        Notes:
            - Only publicly available prompts are returned by default
            - When filtering by mentor, the mentor ID must be a valid UUID
      parameters:
        - in: query
          name: alphabetical
          schema:
            type: boolean
            default: false
          description: Sort alphabetically
        - in: query
          name: category
          schema:
            type: string
            minLength: 1
          description: Filter by prompt category
        - in: query
          name: created_by
          schema:
            type: string
            minLength: 1
          description: Filter prompts created by specific user
        - in: query
          name: filter_facet
          schema:
            type: boolean
          description: If true, return only facets without results
        - in: query
          name: language
          schema:
            type: string
            minLength: 1
          description: Filter by prompt language
        - in: query
          name: limit
          schema:
            type: integer
            default: 10
          description: Number of results per page
        - in: query
          name: mentor
          schema:
            type: string
            minLength: 1
          description: Filter by mentor UUID
        - in: query
          name: offset
          schema:
            type: integer
            default: 0
          description: Starting position for pagination
        - in: query
          name: order_direction
          schema:
            type: string
            default: desc
            minLength: 1
          description: Sort direction ('asc' or 'desc')
        - in: query
          name: query
          schema:
            type: string
            minLength: 1
          description: Search term to filter prompts by name or content
        - in: query
          name: sort_by
          schema:
            type: string
            minLength: 1
          description: Field to sort results by
        - in: query
          name: style
          schema:
            type: string
            minLength: 1
          description: Filter by prompt style
        - in: query
          name: tenant
          schema:
            type: string
            minLength: 1
          description: Filter by tenant/organization
        - in: query
          name: tone
          schema:
            type: string
            minLength: 1
          description: Filter by prompt tone
      tags:
        - search
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptSearchResponse'
          description: ''
        '400':
          description: Bad request
        '500':
          description: Server error
  /api/search/users/orgs/{org}/users/{username}/:
    get:
      operationId: search_users_orgs_users_retrieve
      description: >-
        Search and filter users within a specific organization/tenant.


        This endpoint provides a search interface for discovering users within
        an organization,

        with support for filtering by departments, pagination, and faceted
        filtering.


        Path Parameters:
            org (str): The organization/tenant identifier
            username (str): The username of the user making the request

        Query Parameters:
            # Search parameters
            query (str, optional): Search term to filter users by name, username, or email

            # Department filtering
            department_mode (bool, optional): Enable department-based filtering (default: false)
            user_department (bool, optional): Legacy parameter for department_mode (default: false)
            department (list, optional): Filter by specific departments

            # Additional filters
            role (list, optional): Filter by user role
            status (list, optional): Filter by user status (active, inactive)
            joined_date (list, optional): Filter by join date range
            last_login (list, optional): Filter by last login date range

            # Pagination
            limit (int, optional): Number of results per page (default: 10)
            offset (int, optional): Starting position for pagination

        Returns:
            A JSON response containing:
            ```
            {
                "results": [
                    {
                        "id": 123,
                        "username": "john.doe",
                        "email": "john.doe@example.com",
                        "first_name": "John",
                        "last_name": "Doe",
                        "full_name": "John Doe",
                        "profile_image": "https://example.com/profiles/john-doe.jpg",
                        "role": "Student",
                        "departments": ["Computer Science", "Data Science"],
                        "status": "active",
                        "joined_date": "2023-01-15T12:00:00Z",
                        "last_login": "2023-06-20T15:30:00Z",
                        "metadata": {
                            "location": "New York",
                            "title": "Software Engineer",
                            "bio": "Experienced software engineer with a passion for education"
                        }
                    },
                    // Additional user objects...
                ],
                "count": 50,
                "next": "https://api.example.com/api/search/users/example-org/admin/?limit=10&offset=10",
                "previous": null,
                "current_page": 1,
                "total_pages": 5,
                "facets": {
                    "role": [
                        {"key": "Student", "doc_count": 30},
                        {"key": "Instructor", "doc_count": 15},
                        {"key": "Admin", "doc_count": 5}
                    ],
                    "department": [
                        {"key": "Computer Science", "doc_count": 20},
                        {"key": "Data Science", "doc_count": 15},
                        {"key": "Business", "doc_count": 10},
                        {"key": "Engineering", "doc_count": 5}
                    ],
                    "status": [
                        {"key": "active", "doc_count": 45},
                        {"key": "inactive", "doc_count": 5}
                    ]
                }
            }
            ```
        Error Responses:
            400 Bad Request: If the request parameters are invalid
            403 Forbidden: If the user doesn't have department admin privileges (when using department_mode)
            404 Not Found: If the user or organization doesn't exist
            500 Internal Server Error: If an unexpected error occurs

        Access Control:
            - The requesting user must have an active account in the specified organization
            - When department_mode is enabled, the user must be an admin of at least one department
            - Department filtering restricts results to users in departments where the requesting user is an admin
      parameters:
        - in: query
          name: department
          schema:
            type: array
            items:
              type: string
          description: Filter by department names
        - in: query
          name: education__degree
          schema:
            type: string
            minLength: 1
          description: Filter by degree
        - in: query
          name: education__field_of_study
          schema:
            type: string
            minLength: 1
          description: Filter by field of study
        - in: query
          name: education__institution
          schema:
            type: string
            minLength: 1
          description: Filter by institution
        - in: query
          name: include_membership_data
          schema:
            type: boolean
            default: false
          description: Include user group membership data in results
        - in: query
          name: limit
          schema:
            type: integer
            default: 10
          description: Number of results per page
        - in: query
          name: offset
          schema:
            type: integer
            default: 0
          description: Starting position for pagination
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: query
          name: q
          schema:
            type: string
            minLength: 1
          description: Search term to filter users by name, email, or other attributes
        - in: query
          name: user_resume__company
          schema:
            type: string
            minLength: 1
          description: Filter by company
        - in: query
          name: user_resume__industry
          schema:
            type: string
            minLength: 1
          description: Filter by industry
        - in: query
          name: user_resume__job_title
          schema:
            type: string
            minLength: 1
          description: Filter by job title
        - in: query
          name: user_resume__location
          schema:
            type: string
            minLength: 1
          description: Filter by location
        - in: query
          name: user_resume__skills
          schema:
            type: string
            minLength: 1
          description: Filter by skills
        - in: path
          name: username
          schema:
            type: string
          required: true
      tags:
        - search
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserSearchResponse'
          description: ''
        '400':
          description: Bad request
        '403':
          description: Forbidden
        '404':
          description: Not found
        '500':
          description: Server error
  /api/service/launch/tenant/:
    post:
      operationId: service_launch_tenant_create
      description: >-
        User/tenant creation API


        To create using any payment provider, ensure you use the StudentToken
        Authentication Mechanism
         and also include the correct `provider_key` in the request body:

        ```
            apple_transaction_id: str
            stripe_checkout_id: str
            x_gcp_marketplace_token: str
            aws_transaction_id: str
            google_pay_transaction_id: str
        ```


        To create a tenant without a payment provider, call the API without ny
        of the above provider keys in the request body
      tags:
        - commerce
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TenantLaunchRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TenantLaunchRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TenantLaunchRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TenantLaunchRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/TenantLaunchRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantLaunchResponse'
          description: ''
        '417':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantLaunchFailed'
          description: ''
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantLaunchError'
          description: ''
  /api/service/manage/user/:
    post:
      operationId: service_manage_user_create
      description: User creation flow
      tags:
        - commerce
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/service/manage/user/role/:
    post:
      operationId: service_manage_user_role_create
      description: Make user tenant admin
      tags:
        - commerce
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/service/orgs/{org}/users/{user_id}/stripe/checkout-session/:
    post:
      operationId: service_orgs_users_stripe_checkout_session_create
      description: |-
        Stripe checkout session API View for user upgrade

        Request the following fields:

        - tenant
        - sku
        - mode
        - success_url
        - cancel_url

        Response:
        {
            "redirect_to": "https://checkout.stripe.com/xxx/xxxx/xxxx",
        }
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - commerce
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripeCheckoutSessionResponse'
          description: ''
  /api/service/orgs/{org}/users/{user_id}/stripe/customer-portal/:
    post:
      operationId: service_orgs_users_stripe_customer_portal_create
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - commerce
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripeCustomerPortalRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/StripeCustomerPortalRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StripeCustomerPortalRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StripeCustomerPortalRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/StripeCustomerPortalRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripeCustomerPortalResponse'
          description: ''
  /api/service/orgs/{org}/users/{user_id}/stripe/products/:
    get:
      operationId: service_orgs_users_stripe_products_retrieve
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - commerce
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripeLocalProduct'
          description: ''
  /api/service/orgs/{org}/users/{user_id}/stripe/products/manage/:
    post:
      operationId: service_orgs_users_stripe_products_manage_create
      description: Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - commerce
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/service/orgs/{org}/users/{user_id}/stripe/subscription-renewal/:
    post:
      operationId: service_orgs_users_stripe_subscription_renewal_create
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - commerce
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripeSubscriptionRenewalRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/StripeSubscriptionRenewalRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StripeSubscriptionRenewalRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StripeSubscriptionRenewalRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/StripeSubscriptionRenewalRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripeSubscriptionRenewalResponse'
          description: ''
  /api/service/orgs/{org}/users/{user_id}/stripe/subscriptions/:
    get:
      operationId: service_orgs_users_stripe_subscriptions_retrieve
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - commerce
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/service/orgs/{platform_key}/stripe/course-payment-callback/:
    get:
      operationId: service_orgs_stripe_course_payment_callback_retrieve
      description: |-
        Handle course payment callback after successful Stripe checkout.
        Enrolls the user in the purchased course.

        URL Parameters:
            - stripe_checkout_id: The local Checkout Session UUID

        Response:
            - Redirect: Successfully processed course enrollment
            - 404: Checkout session not found
            - 400: Invalid checkout session or product
            - 500: Server error during processing
      parameters:
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - commerce
      responses:
        '200':
          description: No response body
  /api/service/platforms/{platform_key}/stripe/context/:
    get:
      operationId: service_platforms_stripe_context_retrieve
      description: Create a uuid to help us track internally user initiated checkout
      parameters:
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - commerce
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripeContext'
          description: ''
  /api/service/platforms/{platform_key}/stripe/credit-topup-callback/{checkout_session_id}/:
    get:
      operationId: service_platforms_stripe_credit_topup_callback_retrieve
      description: >-
        Handle  callback after successful Stripe checkout for credit top up.

        Redirects user to another page, ensures user credit is updated
        accordingly.


        URL Parameters:
            - stripe_checkout_id: The Checkout Session UUID

        Response:
            - Redirect: Successfully validated and sending to next page
            - 404: Checkout session not found
            - 400: Invalid checkout session or product
            - 500: Server error during processing
      parameters:
        - in: path
          name: checkout_session_id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - commerce
      responses:
        '200':
          description: No response body
  /api/service/platforms/{platform_key}/stripe/pricing-page-callback/:
    get:
      operationId: service_platforms_stripe_pricing_page_callback_retrieve
      description: >-
        Handle  callback after successful Stripe checkout.

        Redirects user to another page, ensures user subscription is updated
        accordingly.


        URL Parameters:
            - stripe_checkout_id: The local Checkout Session UUID

        Response:
            - Redirect: Successfully validated and sending to next page
            - 404: Checkout session not found
            - 400: Invalid checkout session or product
            - 500: Server error during processing
      parameters:
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - commerce
      responses:
        '200':
          description: No response body
  /api/service/platforms/{platform_key}/stripe/pricing-page-callback/{checkout_session_id}/:
    get:
      operationId: service_platforms_stripe_pricing_page_callback_retrieve_2
      description: >-
        Handle  callback after successful Stripe checkout.

        Redirects user to another page, ensures user subscription is updated
        accordingly.


        URL Parameters:
            - stripe_checkout_id: The local Checkout Session UUID

        Response:
            - Redirect: Successfully validated and sending to next page
            - 404: Checkout session not found
            - 400: Invalid checkout session or product
            - 500: Server error during processing
      parameters:
        - in: path
          name: checkout_session_id
          schema:
            type: string
          required: true
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - commerce
      responses:
        '200':
          description: No response body
  /api/service/platforms/{platform_key}/stripe/pricing-page-session/:
    get:
      operationId: service_platforms_stripe_pricing_page_session_retrieve
      description: Create a uuid to help us track internally user initiated checkout
      parameters:
        - in: path
          name: platform_key
          schema:
            type: string
          required: true
      tags:
        - commerce
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripeBillingPageIdentifierResponse'
          description: ''
  /api/service/stripe/checkout/{checkout_uuid}/:
    get:
      operationId: service_stripe_checkout_retrieve
      parameters:
        - in: path
          name: checkout_uuid
          schema:
            type: string
          required: true
      tags:
        - commerce
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/service/stripe/checkout/free-trial/:
    post:
      operationId: service_stripe_checkout_free_trial_create
      description: |-
        Stripe free trial checkout session. No user auth

        Request the following fields:

        - success_url
        - cancel_url
        - product

        Response:
        {
            "redirect_to": "https://checkout.stripe.com/xxx/xxxx/xxxx",
        }
      tags:
        - commerce
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionResponse'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionResponse'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionResponse'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionResponse'
          '*/*':
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionResponse'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripeCheckoutSessionResponse'
          description: ''
  /api/service/stripe/new-user-checkout/:
    post:
      operationId: service_stripe_new_user_checkout_create
      description: >-
        Stripe checkout session API View for new users (first-time subscription)


        Request the following fields:


        - user_id, username, or email (user identifier)

        - tenant (tenant type to create after successful checkout)

        - sku

        - mode (choices: "subscription", "payment", "setup")

        - success_url

        - cancel_url

        - period (optional): Billing period - "weekly", "monthly", or "yearly"
        (defaults to "monthly")

        - skip_card (optional): Skip card collection for free plans

        - is_free_trial (optional): Enable free trial mode


        Response:

        {
            "redirect_to": "https://checkout.stripe.com/xxx/xxxx/xxxx",
        }
      tags:
        - commerce
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionRequest'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripeCheckoutSessionResponse'
          description: ''
  /api/service/tenant/validation/:
    post:
      operationId: service_tenant_validation_create
      description: Check if tenant exists or not
      tags:
        - commerce
      responses:
        '200':
          description: No response body
  /api/service/token/:
    get:
      operationId: service_token_retrieve
      description: |-
        GET
        Gets site hash_key from
        or
        Gets site_id form hash_key
      tags:
        - commerce
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/service/user/validation/:
    post:
      operationId: service_user_validation_create
      description: Check if tenant exists or not
      tags:
        - commerce
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/skills/orgs/{org}/skills:
    get:
      operationId: skills_orgs_skills_list
      description: |-
        List all available skills on the platform.

        This endpoint returns information about all skills that can be
        acquired on the platform.

        Path Parameters:
            org (str): The platform/organization identifier

        Returns:
            A list of all skills with basic information about each skill.

        Access Control:
            - Platform admins can access this information
            - All authenticated users can access this information
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - skills
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SkillInfo'
          description: ''
  /api/skills/orgs/{org}/skills/{skill_id}/percentile/:
    get:
      operationId: skills_orgs_skills_percentile_retrieve
      description: |-
        Retrieve percentile distribution for a specific skill.

        This endpoint returns the percentile distribution of points earned
        by users for a specific skill.

        Path Parameters:
            skill_id (int): The ID of the skill to retrieve percentile information for
            org (str, optional): The platform/organization identifier to filter results

        Returns:
            A list of percentile breakpoints for the specified skill.

        Error Responses:
            404 Not Found: If the specified skill doesn't exist

        Access Control:
            - Platform admins can access this information
            - All authenticated users can access this information
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: skill_id
          schema:
            type: integer
          required: true
      tags:
        - skills
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PointsPercentile'
          description: ''
  /api/skills/orgs/{org}/skills/{skill_name}/:
    get:
      operationId: skills_orgs_skills_retrieve
      description: |-
        Retrieve detailed information about a specific skill.

        This endpoint returns comprehensive information about a specific skill,
        including its description, categories, and related courses.

        Path Parameters:
            org (str): The platform/organization identifier
            skill_name (str): The name of the skill to retrieve details for

        Returns:
            Detailed information about the specified skill.

        Error Responses:
            404 Not Found: If the specified skill doesn't exist

        Access Control:
            - Platform admins can access this information
            - All authenticated users can access this information
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: skill_name
          schema:
            type: string
          required: true
      tags:
        - skills
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkillDetail'
          description: ''
  /api/skills/orgs/{org}/skills/percentile/:
    get:
      operationId: skills_orgs_skills_percentile_list
      description: >-
        Mixin that includes the StudentTokenAuthentication and
        IsAdminUserOrStudent
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - skills
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PointsPercentile'
          description: ''
  /api/skills/orgs/{org}/skills/thresholds/:
    get:
      operationId: skills_orgs_skills_thresholds_retrieve
      description: >-
        Manage skill thresholds for a platform.


        This endpoint allows platform administrators to view, create, update,
        and delete

        skill thresholds. Skill thresholds define the minimum points required to
        consider

        a skill as acquired or mastered.


        Path Parameters:
            org (str): The platform/organization identifier

        Methods:
            GET: Retrieve all skill thresholds for the platform
            POST: Create a new skill threshold
            PATCH: Update an existing skill threshold
            DELETE: Delete all skill thresholds for the platform

        Request Body (POST):
            name (str, required): The name of the threshold level (e.g., "Beginner", "Intermediate")
            threshold (int, required): The minimum points required to reach this threshold

        Request Body (PATCH):
            name (str, required): The name of the existing threshold to update
            threshold (int, required): The new minimum points value for this threshold

        Returns:
            GET: A list of all skill thresholds for the platform
            POST/PATCH: The created or updated skill threshold with format:
                {
                    "name": "threshold_name",
                    "threshold": threshold_value
                }
            DELETE: No content (204)

        Error Responses:
            400 Bad Request: If the request data is invalid or missing required fields
            404 Not Found: If the specified platform doesn't exist or the threshold
                          to update cannot be found

        Access Control:
            - Only platform administrators can access this endpoint
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - skills
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkillThreshold'
          description: ''
    post:
      operationId: skills_orgs_skills_thresholds_create
      description: >-
        Manage skill thresholds for a platform.


        This endpoint allows platform administrators to view, create, update,
        and delete

        skill thresholds. Skill thresholds define the minimum points required to
        consider

        a skill as acquired or mastered.


        Path Parameters:
            org (str): The platform/organization identifier

        Methods:
            GET: Retrieve all skill thresholds for the platform
            POST: Create a new skill threshold
            PATCH: Update an existing skill threshold
            DELETE: Delete all skill thresholds for the platform

        Request Body (POST):
            name (str, required): The name of the threshold level (e.g., "Beginner", "Intermediate")
            threshold (int, required): The minimum points required to reach this threshold

        Request Body (PATCH):
            name (str, required): The name of the existing threshold to update
            threshold (int, required): The new minimum points value for this threshold

        Returns:
            GET: A list of all skill thresholds for the platform
            POST/PATCH: The created or updated skill threshold with format:
                {
                    "name": "threshold_name",
                    "threshold": threshold_value
                }
            DELETE: No content (204)

        Error Responses:
            400 Bad Request: If the request data is invalid or missing required fields
            404 Not Found: If the specified platform doesn't exist or the threshold
                          to update cannot be found

        Access Control:
            - Only platform administrators can access this endpoint
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - skills
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SkillThreshold'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SkillThreshold'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SkillThreshold'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SkillThreshold'
          '*/*':
            schema:
              $ref: '#/components/schemas/SkillThreshold'
        required: true
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkillThreshold'
          description: ''
    patch:
      operationId: skills_orgs_skills_thresholds_partial_update
      description: >-
        Manage skill thresholds for a platform.


        This endpoint allows platform administrators to view, create, update,
        and delete

        skill thresholds. Skill thresholds define the minimum points required to
        consider

        a skill as acquired or mastered.


        Path Parameters:
            org (str): The platform/organization identifier

        Methods:
            GET: Retrieve all skill thresholds for the platform
            POST: Create a new skill threshold
            PATCH: Update an existing skill threshold
            DELETE: Delete all skill thresholds for the platform

        Request Body (POST):
            name (str, required): The name of the threshold level (e.g., "Beginner", "Intermediate")
            threshold (int, required): The minimum points required to reach this threshold

        Request Body (PATCH):
            name (str, required): The name of the existing threshold to update
            threshold (int, required): The new minimum points value for this threshold

        Returns:
            GET: A list of all skill thresholds for the platform
            POST/PATCH: The created or updated skill threshold with format:
                {
                    "name": "threshold_name",
                    "threshold": threshold_value
                }
            DELETE: No content (204)

        Error Responses:
            400 Bad Request: If the request data is invalid or missing required fields
            404 Not Found: If the specified platform doesn't exist or the threshold
                          to update cannot be found

        Access Control:
            - Only platform administrators can access this endpoint
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - skills
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedSkillThreshold'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedSkillThreshold'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedSkillThreshold'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedSkillThreshold'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedSkillThreshold'
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkillThreshold'
          description: ''
    delete:
      operationId: skills_orgs_skills_thresholds_destroy
      description: >-
        Manage skill thresholds for a platform.


        This endpoint allows platform administrators to view, create, update,
        and delete

        skill thresholds. Skill thresholds define the minimum points required to
        consider

        a skill as acquired or mastered.


        Path Parameters:
            org (str): The platform/organization identifier

        Methods:
            GET: Retrieve all skill thresholds for the platform
            POST: Create a new skill threshold
            PATCH: Update an existing skill threshold
            DELETE: Delete all skill thresholds for the platform

        Request Body (POST):
            name (str, required): The name of the threshold level (e.g., "Beginner", "Intermediate")
            threshold (int, required): The minimum points required to reach this threshold

        Request Body (PATCH):
            name (str, required): The name of the existing threshold to update
            threshold (int, required): The new minimum points value for this threshold

        Returns:
            GET: A list of all skill thresholds for the platform
            POST/PATCH: The created or updated skill threshold with format:
                {
                    "name": "threshold_name",
                    "threshold": threshold_value
                }
            DELETE: No content (204)

        Error Responses:
            400 Bad Request: If the request data is invalid or missing required fields
            404 Not Found: If the specified platform doesn't exist or the threshold
                          to update cannot be found

        Access Control:
            - Only platform administrators can access this endpoint
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
      tags:
        - skills
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/skills/orgs/{org}/skills/users/{user_id}/:
    get:
      operationId: skills_orgs_skills_users_retrieve
      description: >-
        Retrieve a user's skill information.


        This endpoint returns information about skills that a user has acquired

        through the platform. It can return all skills or filter by a specific
        skill.


        Path Parameters:
            org (str): The platform/organization identifier
            user_id (str): The username of the user to retrieve skill information for

        Query Parameters:
            skill_name (str, optional): Filter results to a specific skill

        Returns:
            When skill_name is provided:
                Details about the specific skill including points earned and percentile ranking

            When skill_name is not provided:
                A list of all skills the user has acquired with their points

        Access Control:
            - Platform admins can access any user's skill information
            - Users can access their own skill information
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - skills
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserSkill'
          description: ''
  /api/skills/orgs/{org}/skills/users/{user_id}/desired-skills/:
    get:
      operationId: skills_orgs_skills_users_desired_skills_retrieve
      description: |-
        Retrieve a user's desired skills.

        This endpoint returns the skills that a user has indicated they want
        to develop or acquire through the platform.

        Path Parameters:
            org (str): The platform/organization identifier
            user_id (str): The username of the user to retrieve skill information for

        Returns:
            The user's desired skills information.

        Error Responses:
            400 Bad Request: If the user doesn't exist in the platform or has no desired skills
            404 Not Found: If the specified platform doesn't exist

        Access Control:
            - Platform admins can access any user's information
            - Users can access their own information
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - skills
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DesiredSkill'
          description: ''
  /api/skills/orgs/{org}/skills/users/{user_id}/point-percentile/:
    get:
      operationId: skills_orgs_skills_users_point_percentile_retrieve
      description: >-
        Retrieve a user's total skill points and percentile ranking.


        This endpoint returns the total skill points a user has earned across

        all skills and their percentile ranking compared to other users on the
        platform.


        Path Parameters:
            org (str): The platform/organization identifier
            user_id (str): The username of the user to retrieve information for

        Returns:
            The user's total skill points and percentile ranking information:
            - Username
            - Total points earned across all skills
            - Percentile ranking compared to other users

        Access Control:
            - Platform admins can access any user's information
            - Users can access their own information
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - skills
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserSkillPointsPercentile'
          description: ''
  /api/skills/orgs/{org}/skills/users/{user_id}/reported-skills/:
    get:
      operationId: skills_orgs_skills_users_reported_skills_retrieve
      description: |-
        Retrieve a user's self-reported skills.

        This endpoint returns the skills that a user has reported having
        prior to or outside of the platform learning experience.

        Path Parameters:
            org (str): The platform/organization identifier
            user_id (str): The username of the user to retrieve skill information for

        Returns:
            The user's self-reported skills information.

        Error Responses:
            400 Bad Request: If the user doesn't exist in the platform or has no reported skills
            404 Not Found: If the specified platform doesn't exist

        Access Control:
            - Platform admins can access any user's information
            - Users can access their own information
      parameters:
        - in: path
          name: org
          schema:
            type: string
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - skills
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportedSkill'
          description: ''
  /api/user-groups/orgs/{key}/:
    get:
      operationId: user_groups_orgs_retrieve
      description: >-
        Get a list of user groups with metrics and filtering options.


        This endpoint provides a paginated list of user groups with aggregated
        metrics

        about learner performance, course completions, and skill acquisition.


        This endpoint uses DM token authentication and respects department-based

        access controls.


        Query Parameters:
            page (int, optional): Page number for pagination
            length (int, optional): Number of items per page
            program (str, optional): Filter by program
            pathway (str, optional): Filter by pathway
            groups (list, optional): Filter by group names
            location (str, optional): Filter by location
            is_enrolled (bool, optional): Filter for groups with enrolled users
            start_date (date, optional): Filter by learner join date (start range)
            end_date (date, optional): Filter by learner join date (end range)

        Returns:
            A paginated list of user groups with comprehensive metrics.

        Access Control:
            - Platform admins can see all groups
            - Department admins can only see groups in their departments
      parameters:
        - in: query
          name: department_id
          schema:
            type: integer
          description: >-
            When `department_mode=1` is passed, it allows to filter data for
            only user content groups for the specified department 
        - in: query
          name: end_date
          schema:
            type: string
            format: date
          description: Filter by learners date_joined. Start date. ISO 8601
        - in: query
          name: format
          schema:
            enum:
              - json
            type: string
            default: json
            minLength: 1
          description: |-
            Format

            * `json` - json
        - in: query
          name: groups
          schema:
            type: array
            items:
              type: string
          description: >-
            Groups search string. Single string or list of strings. e.g
            'sample_group' or `['group', 'another group']` 
        - in: query
          name: include_main_platform
          schema:
            type: boolean
            default: true
          description: Include main platform data
        - in: query
          name: is_enrolled
          schema:
            type: boolean
            nullable: true
          description: Filter for users who have at least an enrollment
        - in: path
          name: key
          schema:
            type: string
          required: true
        - in: query
          name: length
          schema:
            type: integer
          description: Size of data to return
        - in: query
          name: location
          schema:
            type: string
            minLength: 1
          description: Location search string
        - in: query
          name: page
          schema:
            type: integer
          description: Page offset
        - in: query
          name: pathway
          schema:
            type: string
            minLength: 1
          description: Pathway string
        - in: query
          name: program
          schema:
            type: string
            minLength: 1
          description: Program search string
        - in: query
          name: start_date
          schema:
            type: string
            format: date
          description: Filter by learners date_joined. Start date. ISO 8601
      tags:
        - core
      security:
        - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupList'
          description: ''
components:
  schemas:
    AIGeneratedImage:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        user:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          nullable: true
        image:
          type: string
          format: uri
        platform:
          type: integer
          nullable: true
        prompt:
          type: string
        model:
          type: string
          maxLength: 255
        provider:
          type: string
          maxLength: 255
        date_created:
          type: string
          format: date-time
          readOnly: true
      required:
        - date_created
        - id
        - image
    AIUserProfileMemoryRelation:
      type: object
      properties:
        tag:
          type: string
          readOnly: true
        detail:
          type: string
          nullable: true
      required:
        - tag
    AIUserProfileRequest:
      type: object
      properties:
        tag:
          type: string
        detail:
          type: string
      required:
        - detail
        - tag
    AWSTenantLaunchRequest:
      type: object
      properties:
        username:
          type: string
        email:
          type: string
          format: email
        firstname:
          type: string
          default: ''
        lastname:
          type: string
          default: ''
        password:
          type: string
        name:
          type: string
          description: Organization name
        key:
          type: string
          description: Unique key for the organization
        ignore_user_exists:
          type: boolean
          default: false
        is_advertising:
          type: boolean
          default: false
          description: >-
            Advertising mode allows a platform to set custom usd balance to
            allocate for its members
        aws_transaction_id:
          type: string
          description: AWS Marketplace Customer Id and Product Code Identifier
      required:
        - aws_transaction_id
        - email
        - key
        - name
        - username
    AcceptanceEnum:
      enum:
        - Unaccepted
        - Accepted
        - Rejected
      type: string
      description: |-
        * `Unaccepted` - Unaccepted
        * `Accepted` - Accepted
        * `Rejected` - Rejected
    AccessEnum:
      enum:
        - public
        - private
      type: string
      description: |-
        * `public` - Public
        * `private` - Private
    AccessTimesHeatmap:
      type: object
      properties:
        day_of_week:
          type: integer
        hour:
          type: integer
        value:
          type: integer
      required:
        - day_of_week
        - hour
        - value
    AccessibleMentorsByEmailRequest:
      type: object
      description: Request serializer for accessible mentors by email endpoint.
      properties:
        email:
          type: string
          format: email
          description: The user email to check mentor access for
        all_mentors:
          type: boolean
          default: false
          description: >-
            If true, return all mentors in the platform. If false (default),
            return only mentors owned by the user's email.
      required:
        - email
    AccessibleMentorsByEmailResponse:
      type: object
      description: Response serializer for accessible mentors by email.
      properties:
        mentors:
          type: array
          items:
            type: string
            format: uuid
          readOnly: true
          description: List of mentor unique IDs
        user_id:
          type: integer
          readOnly: true
          description: The user ID that mentors belong to
      required:
        - mentors
        - user_id
    ActionBreakdown:
      type: object
      description: Action/trace name cost breakdown.
      properties:
        action:
          type: string
        cost:
          type: string
          format: decimal
          pattern: ^-?\d{0,9}(?:\.\d{0,3})?$
        sessions:
          type: integer
        trace_count:
          type: integer
        unique_users:
          type: integer
      required:
        - action
        - cost
        - sessions
        - trace_count
    ActivateUserFreeTrial:
      type: object
      properties:
        free_trial_started:
          type: boolean
          default: true
        app:
          type: string
          description: The app url or name or id
        platform:
          type: string
          description: The platform key
      required:
        - app
        - platform
    ActiveUsersData:
      type: object
      properties:
        username:
          type: string
          description: learner username
        name:
          type: string
          description: learner name
        engagement_index:
          type: number
          format: double
          description: Engagement index
        performance_index:
          type: number
          format: double
          description: Performance index
      required:
        - engagement_index
        - name
        - performance_index
        - username
    ActiveUsersList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ActiveUsersData'
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - pagination
    ActiveUsersPerCourse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ActiveUsersPerCourseData'
        total:
          type: integer
          description: Total unique active users in this period
        meta:
          $ref: '#/components/schemas/OvertimeMeta'
      required:
        - data
        - meta
        - total
    ActiveUsersPerCourseData:
      type: object
      properties:
        course_id:
          type: string
          description: Edx Course ID
        name:
          type: string
          description: Course Name
        user_count:
          type: integer
          description: Active users for the period
      required:
        - course_id
        - name
        - user_count
    ActivityAPI:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ActivityData'
        total:
          type: integer
          description: Total rows
      required:
        - total
    ActivityData:
      type: object
      properties:
        course_id:
          type: string
          description: edx Course Id
        name:
          type: string
          description: Course name
        course_start:
          type: string
          description: Course start date
        course_end:
          type: string
          description: Course end date
        average_time_invested:
          type: number
          format: double
          description: Overall course average time invested (other students inclusive)
        time_invested:
          type: integer
          description: Total time spent
        days_away:
          type: string
          description: Days from today the course has been accessed
        last_access_date:
          type: string
          description: When course was last accessed
        days_accessed:
          type: integer
          description: Unique days course was accessed
      required:
        - average_time_invested
        - course_end
        - course_id
        - course_start
        - days_accessed
        - days_away
        - last_access_date
        - name
        - time_invested
    ActivityInfo:
      type: object
      description: Serializer for activity information.
      properties:
        first_activity:
          type: string
          format: date-time
          nullable: true
        last_activity:
          type: string
          format: date-time
          nullable: true
      required:
        - first_activity
        - last_activity
    AddMentorToDisclaimer:
      type: object
      description: >-
        Serializer for adding a mentor to a disclaimer.


        This serializer validates the mentor_id input and provides proper schema
        documentation

        for the add_mentor action.
      properties:
        mentor_id:
          type: string
          description: The unique_id of the mentor to add to the disclaimer.
          maxLength: 255
      required:
        - mentor_id
    AlignMentorBubbleEnum:
      enum:
        - left
        - right
      type: string
      description: |-
        * `left` - Left
        * `right` - Right
    AnalyticsOverview:
      type: object
      properties:
        conversation_volume:
          $ref: '#/components/schemas/MetricChange'
        users:
          $ref: '#/components/schemas/MetricChange'
        topics:
          $ref: '#/components/schemas/MetricChange'
        user_rating:
          $ref: '#/components/schemas/MetricChange'
      required:
        - conversation_volume
        - topics
        - user_rating
        - users
    Answer:
      type: object
      description: |-
        Serializer for an individual answer choice for a question.

        Attributes:
            text (str): The text of the answer.
            is_correct (Optional[bool]): Boolean indicating if this answer is correct.
      properties:
        text:
          type: string
          maxLength: 500
        is_correct:
          type: boolean
          default: false
      required:
        - text
    App:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        url:
          type: string
          maxLength: 255
        type:
          type: string
          maxLength: 50
        metadata: {}
        onboarding_required:
          type: boolean
          description: >-
            If true, users will be required to complete onboarding before using
            this app
      required:
        - name
        - type
        - url
    AppleSubscriptionStatusRequest:
      type: object
      properties:
        bundle_id:
          type: string
          default: com.ibleducation.community
    AppleSubscriptionStatusView:
      type: object
      properties:
        data: {}
      required:
        - data
    AppleVerifyTransactionId:
      type: object
      properties:
        apple_transaction_id:
          type: string
      required:
        - apple_transaction_id
    Artifact:
      type: object
      description: >-
        Serializer for Artifact model.


        Artifacts are structured content like essays, documents, code files,
        etc.

        that are generated by AI agents during a chat session and are best

        displayed separately from the normal chat flow.


        Fields:
            - id: Unique identifier for the artifact
            - title: Title or identifier for the artifact
            - content: The markdown-styled content of the artifact
            - file_extension: The extension of the file (e.g., 'py', 'md', 'html', 'json', 'csv')
            - chat_message: Reference to the chat message that contains this artifact
            - llm_name: Name of the LLM that generated the artifact
            - llm_provider: Provider of the LLM (e.g., 'openai', 'google', 'anthropic')
            - date_created: Timestamp when the artifact was created
            - date_updated: Timestamp when the artifact was last updated
            - metadata: Additional metadata for the artifact
            - username: Username of the student who owns the artifact (read-only)
            - session_id: UUID of the session that generated the artifact (read-only)

        Read-only fields:
            - id, date_created, date_updated, username, session_id
      properties:
        id:
          type: integer
          readOnly: true
        title:
          type: string
          description: Title or identifier for the artifact
          maxLength: 255
        content:
          type: string
          description: The markdown-styled content of the artifact
        file_extension:
          type: string
          readOnly: true
          description: >-
            The extension of the file for the artifact. eg. `py`, `md`, `html`,
            `json`, `csv`, etc
        chat_message:
          type: integer
          readOnly: true
        llm_name:
          type: string
          readOnly: true
        llm_provider:
          type: string
          readOnly: true
        date_created:
          type: string
          format: date-time
          readOnly: true
        date_updated:
          type: string
          format: date-time
          readOnly: true
        metadata:
          description: Additional metadata for the artifact
        username:
          type: string
          description: Username of the student who owns this artifact
          readOnly: true
        session_id:
          type: string
          format: uuid
          description: UUID of the session that generated this artifact
          readOnly: true
      required:
        - chat_message
        - content
        - date_created
        - date_updated
        - file_extension
        - id
        - llm_name
        - llm_provider
        - session_id
        - title
        - username
    ArtifactList:
      type: object
      description: |-
        Lightweight serializer for listing artifacts.

        This serializer is optimized for list views, excluding the potentially
        large content field and including useful computed fields.

        Fields:
            - id: Unique identifier for the artifact
            - title: Title or identifier for the artifact
            - file_extension: The extension of the file
            - llm_name: Name of the LLM that generated the artifact
            - llm_provider: Provider of the LLM
            - date_created: Timestamp when the artifact was created
            - date_updated: Timestamp when the artifact was last updated
            - username: Username of the student who owns the artifact
            - session_id: UUID of the session that generated the artifact
            - content_length: Length of the content in characters
      properties:
        id:
          type: integer
          readOnly: true
        title:
          type: string
          readOnly: true
          description: Title or identifier for the artifact
        file_extension:
          type: string
          readOnly: true
          description: >-
            The extension of the file for the artifact. eg. `py`, `md`, `html`,
            `json`, `csv`, etc
        llm_name:
          type: string
          readOnly: true
        llm_provider:
          type: string
          readOnly: true
        date_created:
          type: string
          format: date-time
          readOnly: true
        date_updated:
          type: string
          format: date-time
          readOnly: true
        username:
          type: string
          description: Username of the student who owns this artifact
          readOnly: true
        session_id:
          type: string
          format: uuid
          description: UUID of the session that generated this artifact
          readOnly: true
        content_length:
          type: integer
          description: Length of the artifact content in characters
          readOnly: true
      required:
        - content_length
        - date_created
        - date_updated
        - file_extension
        - id
        - llm_name
        - llm_provider
        - session_id
        - title
        - username
    Assertion:
      type: object
      properties:
        entityId:
          type: string
        issuedOn:
          type: string
        credentialDetails:
          type: object
          additionalProperties:
            type: string
          readOnly: true
        recipient:
          type: object
          additionalProperties:
            type: string
          readOnly: true
        metadata:
          nullable: true
        course:
          type: object
          additionalProperties:
            type: string
          readOnly: true
        program:
          type: object
          additionalProperties:
            type: string
          readOnly: true
        narrative:
          type: string
          nullable: true
        revoked:
          type: boolean
        revocationReason:
          type: string
        acceptance:
          $ref: '#/components/schemas/AcceptanceEnum'
        expires:
          type: string
      required:
        - course
        - credentialDetails
        - entityId
        - expires
        - issuedOn
        - program
        - recipient
        - revocationReason
    AssociateAccountResponse:
      type: object
      properties:
        success:
          type: boolean
          default: true
        message: {}
        data: {}
      required:
        - data
        - message
    AssociateAppleAccount:
      type: object
      properties:
        app_receipt:
          type: string
      required:
        - app_receipt
    AssumedKnowledge:
      type: object
      properties:
        levels:
          type: array
          items:
            $ref: '#/components/schemas/AssumedKnowledgeLevel'
      required:
        - levels
    AssumedKnowledgeLevel:
      type: object
      properties:
        category:
          type: string
        level:
          type: string
      required:
        - category
        - level
    AudioToTextRequest:
      type: object
      properties:
        file:
          type: string
          format: uri
      required:
        - file
    AudioToTextResponse:
      type: object
      properties:
        text:
          type: string
      required:
        - text
    AuthToken:
      type: object
      properties:
        token:
          type: string
          description: Token
        expires:
          type: string
          format: date-time
          description: Token Expiration Date
      required:
        - expires
        - token
    AutoMemoryPrompt:
      type: object
      properties:
        auto_memory_prompt:
          type: string
        reset:
          type: boolean
    Average:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/AverageData'
      required:
        - data
    AverageData:
      type: object
      properties:
        average:
          type: number
          format: double
          description: Average
      required:
        - average
    AverageOvertime:
      type: object
      description: |-
        Returns
            {
                "data": {
                    "2022-04-26": 0,
                    "2022-04-27": 0,
                    ...
                    "2023-01-01": 0
                },
                "average": 0
            }
      properties:
        data:
          type: object
          additionalProperties: {}
          description: >-
            Dates are keys and values are the value for the date in the key. e,g
            `{"2020-01-01": 30. ...}`
        average:
          type: number
          format: double
          description: average
    AvgCourseGradeWithCutoff:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/AvgCourseGradeWithCutoffData'
    AvgCourseGradeWithCutoffData:
      type: object
      properties:
        grade_cutoffs:
          type: object
          additionalProperties: {}
          description: Dictionary showing grade cutoffs
        average_grade:
          type: number
          format: double
          description: Course Average grade
      required:
        - average_grade
        - grade_cutoffs
    BaseErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          default: false
        message: {}
        data: {}
      required:
        - message
    BaseFinanceResponse:
      type: object
      description: Base response for all finance metrics.
      properties:
        metric:
          type: string
          description: The metric type that was requested
        filters:
          allOf:
            - $ref: '#/components/schemas/FinanceFilters'
          description: Applied filters for this query
        value:
          type: string
          format: decimal
          pattern: ^-?\d{0,15}(?:\.\d{0,5})?$
          description: Primary metric value (cost in USD)
        percentage_change:
          type: number
          format: double
          nullable: true
          description: Percentage change vs comparison period (null if no comparison)
        overtime:
          type: array
          items:
            $ref: '#/components/schemas/OvertimeData'
          description: Time series data for overtime visualization
        period_info:
          allOf:
            - $ref: '#/components/schemas/PeriodInfo'
          description: Information about the analysis period
        comparison_info:
          allOf:
            - $ref: '#/components/schemas/ComparisonInfo'
          description: Information about comparison period (empty if no comparison)
      required:
        - comparison_info
        - filters
        - metric
        - overtime
        - percentage_change
        - period_info
        - value
    BaseResponse:
      type: object
      properties:
        success:
          type: boolean
          default: true
        message: {}
        data: {}
      required:
        - message
    BillingPeriod:
      type: object
      description: Billing period information.
      properties:
        start_date:
          type: string
          format: date
        end_date:
          type: string
          format: date
        days:
          type: integer
      required:
        - days
        - end_date
        - start_date
    BlankCourseInvitationCreate:
      type: object
      description: Request serializer for BlankCourseInvitationView POST endpoint
      properties:
        course_id:
          type: string
          description: The course to create invitations for
        source:
          type: string
          description: The source identifier for the invitations
        count:
          type: integer
          description: The number of blank invitations to create
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the invitations
      required:
        - count
        - course_id
        - source
    BlankEnum:
      enum:
        - ''
    BlankPlatformInvitationCreate:
      type: object
      description: Request serializer for BlankPlatformInvitationView POST endpoint
      properties:
        platform_key:
          type: string
          description: The platform to create invitations for
        source:
          type: string
          description: The source identifier for the invitations
        count:
          type: integer
          description: The number of blank invitations to create
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the invitations
      required:
        - count
        - platform_key
        - source
    BlankProgramInvitationCreate:
      type: object
      description: Request serializer for BlankProgramInvitationView POST endpoint
      properties:
        program_key:
          type: string
          description: The program to create invitations for
        source:
          type: string
          description: The source identifier for the invitations
        count:
          type: integer
          description: The number of blank invitations to create
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the invitations
      required:
        - count
        - program_key
        - source
    BlockSkillPointInfoRequest:
      type: object
      description: |-
        Request serializer for BlockSkillPointInfoView POST endpoint.
        Validates request body for updating block skill point information.
      properties:
        block_id:
          type: string
          description: ID of the block to update skill point information for
        point_data:
          type: object
          additionalProperties:
            type: integer
            minimum: 0
          description: >-
            Dictionary mapping skill names to point values. Example:
            {'skill_name': 5}
        overwrite:
          type: boolean
          default: true
          description: >-
            If True, removes all skills not in point_data. If False, only
            updates specified skills.
      required:
        - block_id
        - point_data
    Bot:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        platform:
          type: integer
          readOnly: true
        tenant:
          type: string
          readOnly: true
        name:
          type: string
          maxLength: 255
        provider:
          $ref: '#/components/schemas/Provider05cEnum'
        is_configured:
          type: boolean
          readOnly: true
        slack_config:
          type: integer
        discord_config:
          type: integer
          readOnly: true
        webex_config:
          type: integer
          readOnly: true
        whatsapp_config:
          type: integer
          readOnly: true
        teams_config:
          type: integer
          readOnly: true
        webhook_url:
          type: string
          readOnly: true
      required:
        - discord_config
        - id
        - is_configured
        - name
        - platform
        - provider
        - slack_config
        - teams_config
        - tenant
        - webex_config
        - webhook_url
        - whatsapp_config
    BotCommand:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        command:
          type: string
          maxLength: 100
        mentor:
          type: integer
        bot:
          type: integer
      required:
        - bot
        - command
        - id
        - mentor
    BotCreate:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        provider:
          $ref: '#/components/schemas/Provider05cEnum'
        is_configured:
          type: boolean
          readOnly: true
        webhook_url:
          type: string
          readOnly: true
        discord_config:
          type: integer
          readOnly: true
        webex_config:
          type: integer
          readOnly: true
        whatsapp_config:
          type: integer
          readOnly: true
        teams_config:
          type: integer
          readOnly: true
      required:
        - discord_config
        - id
        - is_configured
        - name
        - provider
        - teams_config
        - webex_config
        - webhook_url
        - whatsapp_config
    Breakdown:
      type: object
      description: Detailed breakdown of costs.
      properties:
        by_provider:
          type: array
          items:
            $ref: '#/components/schemas/ProviderBreakdown'
        by_mentor:
          type: array
          items:
            $ref: '#/components/schemas/MentorBreakdown'
        by_action:
          type: array
          items:
            $ref: '#/components/schemas/ActionBreakdown'
    BulkCourseInvitationCreate:
      type: object
      description: Request serializer for BulkCourseInvitationView POST endpoint
      properties:
        invitation_data:
          type: array
          items:
            $ref: '#/components/schemas/CourseInvitationCreate'
          description: List of invitation data objects
        platform_key:
          type: string
          description: The platform key for permission validation
      required:
        - invitation_data
    BulkCourseInvitationResponse:
      type: object
      description: Response serializer for bulk invitation creation
      properties:
        successes:
          type: integer
          description: Number of successfully created invitations
        error_codes:
          type: array
          items:
            type: string
          description: List of error codes for failed invitations
      required:
        - error_codes
        - successes
    BulkCreateAssertion:
      type: object
      properties:
        skipped:
          type: array
          items: {}
        issued:
          type: array
          items: {}
      required:
        - issued
        - skipped
    BulkPlatformInvitationCreate:
      type: object
      description: Request serializer for BulkPlatformInvitationView POST endpoint
      properties:
        invitation_data:
          type: array
          items:
            $ref: '#/components/schemas/PlatformInvitationCreate'
          description: List of invitation data objects
        platform_key:
          type: string
          description: The platform key for permission validation
      required:
        - invitation_data
    BulkPlatformInvitationResponse:
      type: object
      description: Response serializer for bulk invitation creation
      properties:
        successes:
          type: integer
          description: Number of successfully created invitations
        error_codes:
          type: array
          items:
            type: string
          description: List of error codes for failed invitations
      required:
        - error_codes
        - successes
    BulkProgramInvitationCreate:
      type: object
      description: Request serializer for BulkProgramInvitationView POST endpoint
      properties:
        invitation_data:
          type: array
          items:
            $ref: '#/components/schemas/ProgramInvitationCreate'
          description: List of invitation data objects
        platform_key:
          type: string
          description: The platform key for permission validation
      required:
        - invitation_data
    BulkProgramInvitationResponse:
      type: object
      description: Response serializer for bulk invitation creation
      properties:
        successes:
          type: integer
          description: Number of successfully created invitations
        error_codes:
          type: array
          items:
            type: string
          description: List of error codes for failed invitations
      required:
        - error_codes
        - successes
    BulkSuggestionResponse:
      type: object
      description: Response serializer for bulk suggestion operation results
      properties:
        successes:
          type: integer
          description: Number of successfully created suggestions
        error_codes:
          type: array
          items:
            type: string
          description: List of error codes for failed suggestions
      required:
        - error_codes
        - successes
    CallAuthenticationRequest:
      type: object
      description: Serializer for IBL Call Pro authentication request.
      properties:
        session_id:
          type: string
          description: The ID of the session for the call
        pathway:
          type: string
          description: The pathway identifier for the call context
        enable_video:
          type: boolean
          description: >-
            Whether to enable video during the call. Required for screensharing
            and video calls to work.
      required:
        - pathway
        - session_id
    CallAuthenticationResponse:
      type: object
      description: Serializer for IBL Call Pro authentication parameters.
      properties:
        ws_url:
          type: string
          description: The WebSocket URL for the IBL Call Pro server
        room_name:
          type: string
          description: The name of the IBL Call Pro room
        participant_name:
          type: string
          description: The name of the participant joining the room
        participant_token:
          type: string
          description: The JWT token for authenticating the participant
      required:
        - participant_name
        - participant_token
        - room_name
        - ws_url
    CallConfiguration:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        mentor:
          type: string
          format: uuid
        mode:
          $ref: '#/components/schemas/CallConfigurationModeEnum'
        tts_provider:
          $ref: '#/components/schemas/TtsProviderEnum'
        stt_provider:
          $ref: '#/components/schemas/SttProviderEnum'
        llm_provider:
          $ref: '#/components/schemas/LlmProviderEnum'
        use_function_calling_for_rag:
          type: boolean
          description: >-
            Whether to use function calls in the agent or force RAG calls before
            LLM generation
        google_voice:
          $ref: '#/components/schemas/Voice'
        openai_voice:
          $ref: '#/components/schemas/Voice'
        openai_voice_id:
          type: integer
          nullable: true
        google_voice_id:
          type: integer
          nullable: true
        enable_video:
          type: boolean
          description: >-
            Whether to enable video for the call. (applicable only for realtime
            mode)
        platform_key:
          type: string
          readOnly: true
      required:
        - id
        - mentor
        - platform_key
    CallConfigurationModeEnum:
      enum:
        - realtime
        - inference
      type: string
      description: |-
        * `realtime` - Realtime
        * `inference` - Inference
    CampaignEnablement:
      type: object
      description: Serializer for campaign enablement requests.
      properties:
        campaign_id:
          type: integer
        campaign_title:
          type: string
        email:
          type: string
          format: email
    CampaignExclusion:
      type: object
      description: Serializer for campaign exclusion requests.
      properties:
        campaign_id:
          type: integer
        campaign_title:
          type: string
        email:
          type: string
          format: email
    CatalogAutoIncrementResponse:
      type: object
      description: Response serializer for CatalogAutoIncrementView GET endpoint.
      properties:
        course_number:
          type: integer
          description: Current course auto-increment number
        item_number:
          type: integer
          description: Current item auto-increment number
        program_number:
          type: integer
          description: Current program auto-increment number
        org:
          type: string
          description: Platform organization
        key:
          type: string
          description: Platform key
      required:
        - course_number
        - key
        - org
    CatalogAutoIncrementUpdateRequest:
      type: object
      description: Serializer for auto increment update request parameters.
      properties:
        key:
          type: string
          description: Platform key identifier
        org:
          type: string
          description: Platform organization identifier
        number_type:
          type: string
          description: Type of number requested (e.g., course, program, pathway)
      required:
        - number_type
    CeleryHeartbeat:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/CeleryHeartbeatStatusEnum'
        message:
          type: string
      required:
        - message
        - status
    CeleryHeartbeatFail:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/CeleryHeartbeatFailStatusEnum'
        message:
          type: string
      required:
        - message
        - status
    CeleryHeartbeatFailStatusEnum:
      enum:
        - unhealthy
        - healthy
      type: string
      description: |-
        * `unhealthy` - unhealthy
        * `healthy` - healthy
    CeleryHeartbeatStatusEnum:
      enum:
        - healthy
        - unhealthy
      type: string
      description: |-
        * `healthy` - healthy
        * `unhealthy` - unhealthy
    ChannelEnum:
      enum:
        - email
        - push_notification
        - email & push_notification
      type: string
      description: |-
        * `email` - email
        * `push_notification` - push_notification
        * `email & push_notification` - email & push_notification
    ChatHistory:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        message:
          readOnly: true
        inserted_at:
          type: string
          format: date-time
          readOnly: true
        title:
          type: string
          nullable: true
        feedback:
          readOnly: true
        document_sources:
          nullable: true
        files:
          readOnly: true
      required:
        - feedback
        - files
        - id
        - inserted_at
        - message
    ChatHistoryFilterData:
      type: object
      properties:
        topics:
          type: array
          items:
            $ref: '#/components/schemas/TopicModel'
        date_ranges:
          type: array
          items:
            $ref: '#/components/schemas/DateRange'
        sentiment:
          type: array
          items:
            type: string
        users:
          type: array
          items:
            $ref: '#/components/schemas/ChatHistoryFilterUser'
      required:
        - topics
        - users
    ChatHistoryFilterUser:
      type: object
      properties:
        username:
          type: string
        email:
          type: string
          format: email
        lti_email:
          type: string
          format: email
          readOnly: true
      required:
        - email
        - lti_email
        - username
    ChatHistoryItem:
      type: object
      properties:
        type:
          type: string
        content:
          type: string
        timestamp:
          type: string
          format: date-time
      required:
        - content
        - timestamp
        - type
    ChatHistorySessionId:
      type: object
      properties:
        id:
          type: string
      required:
        - id
    ChatSessionRequest:
      type: object
      properties:
        mentor:
          type: string
          description: Name of mentor
        tools:
          type: array
          items:
            type: string
          description: >-
            List of tools slugs to use. Passing `null` will use all tools
            assigned to the mentor. For no tools, pass an empty list.
        enable_artifacts:
          type: boolean
          default: false
        shareable_link_token:
          type: string
          description: Optional token for a mentor's shareable link
      required:
        - mentor
    ChatSessionResponse:
      type: object
      properties:
        session_id:
          type: string
          format: uuid
        tools:
          type: array
          items:
            $ref: '#/components/schemas/ToolResponse'
        enable_artifacts:
          type: boolean
      required:
        - session_id
        - tools
    CheckDocumentTrainingStatus:
      type: object
      properties:
        status:
          type: string
          description: Status of the training
        message:
          type: string
          description: Message of the training
      required:
        - message
        - status
    CloudMessageTypeEnum:
      enum:
        - FCM
        - GCM
      type: string
      description: |-
        * `FCM` - Firebase Cloud Message
        * `GCM` - Google Cloud Message
    Company:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        user:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          readOnly: true
        user_info:
          allOf:
            - $ref: '#/components/schemas/UserInfo'
          readOnly: true
        name:
          type: string
          maxLength: 100
        industry:
          type: string
          nullable: true
          maxLength: 100
        website:
          type: string
          format: uri
          nullable: true
          maxLength: 255
        logo_url:
          type: string
          format: uri
          nullable: true
          maxLength: 255
        data:
          nullable: true
          description: Metadata
        metadata:
          nullable: true
          description: Metadata
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - id
        - name
        - updated_at
        - user
        - user_info
    ComparisonInfo:
      type: object
      description: Comparison period information.
      properties:
        previous_period_count:
          type: integer
          description: Number of days in comparison period
        previous_period_value:
          type: string
          format: decimal
          pattern: ^-?\d{0,15}(?:\.\d{0,5})?$
          description: Cost value for comparison period
        comparison_start:
          type: string
          description: Start date of comparison period
        comparison_end:
          type: string
          description: End date of comparison period
        comparison_days:
          type: integer
          description: Number of comparison days
        recent_period_value:
          type: string
          format: decimal
          pattern: ^-?\d{0,15}(?:\.\d{0,5})?$
          description: Cost value for current period
    ComponentBlock:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        unit:
          type: integer
        type:
          $ref: '#/components/schemas/ComponentBlockTypeEnum'
        display_name:
          type: string
          maxLength: 255
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - display_name
        - id
        - unit
        - updated_at
    ComponentBlockTypeEnum:
      enum:
        - html
        - multiple_choice
      type: string
      description: |-
        * `html` - Html
        * `multiple_choice` - Multiple Choice
    ConfigurationItem:
      type: object
      description: Serializer for individual configuration items
      properties:
        key:
          type: string
          description: Configuration key
          maxLength: 255
        value:
          description: Configuration value stored as JSON
        description:
          type: string
          default: ''
          description: Optional description for the configuration
        is_public:
          type: boolean
          default: false
          description: If True, this configuration will be visible to platform members
      required:
        - key
        - value
    ConnectedService:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        provider:
          $ref: '#/components/schemas/ConnectedServiceProviderEnum'
        service:
          $ref: '#/components/schemas/ServiceEnum'
        expires_at:
          type: string
          format: date-time
          nullable: true
        scope:
          type: string
        service_info:
          allOf:
            - $ref: '#/components/schemas/ExternalServiceInfo'
          readOnly: true
      required:
        - id
        - provider
        - scope
        - service
        - service_info
    ConnectedServiceProviderEnum:
      enum:
        - google
      type: string
      description: '* `google` - Google'
    ConsumerChannel:
      type: object
      description: Serializer for channel
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          title: Channel name
          maxLength: 255
      required:
        - id
    ContentAnalytics:
      type: object
      description: Serializer for individual content item analytics.
      properties:
        enrollments:
          type: integer
          description: Total enrollments for this item
        active_enrollments:
          type: integer
          description: Active enrollments for this item
        completion_rate:
          type: number
          format: double
          description: Completion rate percentage
        avg_rating:
          type: number
          format: double
          nullable: true
          description: Average rating
        rating_count:
          type: integer
          description: Number of ratings
        associated_courses:
          type: integer
          description: Associated courses (for skills)
        learners_count:
          type: integer
          description: Number of learners (for skills)
        total_time_spent:
          type: integer
          description: Total time spent on this content in seconds (courses only)
        avg_time_per_learner:
          type: number
          format: double
          description: Average time spent per learner in seconds (courses only)
      required:
        - active_enrollments
        - completion_rate
        - enrollments
    ContentAverages:
      type: object
      description: Serializer for content summary averages.
      properties:
        completion_rate:
          type: number
          format: double
          description: Average completion rate percentage
        average_rating:
          type: number
          format: double
          description: Average rating
        enrollments_per_course:
          type: number
          format: double
          description: Average enrollments per course
        enrollments_per_program:
          type: number
          format: double
          description: Average enrollments per program
        enrollments_per_pathway:
          type: number
          format: double
          description: Average enrollments per pathway
        courses_per_skill:
          type: number
          format: double
          description: Average courses per skill
        time_per_learner:
          type: number
          format: double
          description: Average time spent per learner in seconds (courses only)
    ContentDetailsContentInfo:
      type: object
      description: Serializer for the content information block.
      properties:
        id:
          type: string
          description: Identifier for the content item
        name:
          type: string
          nullable: true
        type:
          type: string
          description: Content type (course, program, pathway, skill)
        slug:
          type: string
          nullable: true
        platform:
          type: string
          nullable: true
        external:
          type: boolean
          description: Whether the content is external to the platform
        metadata:
          type: object
          additionalProperties: {}
          description: Metadata associated with the content item
      required:
        - external
        - id
        - type
    ContentDetailsLearner:
      type: object
      description: Serializer for individual learner entries in content details.
      properties:
        user_id:
          type: integer
          description: Learner identifier
        username:
          type: string
          nullable: true
          description: Learner username
        email:
          type: string
          format: email
          nullable: true
          description: Learner email
        name:
          type: string
          nullable: true
          description: Learner display name
        enrollment_date:
          type: string
          format: date-time
          nullable: true
          description: Date the learner enrolled in the content
        completion_status:
          type: string
          description: Completion status for the learner
        completion_percentage:
          type: number
          format: double
          nullable: true
          description: Learner completion percentage
        last_activity:
          type: string
          format: date-time
          nullable: true
          description: Last activity timestamp for the learner
        rating:
          type: number
          format: double
          nullable: true
          description: Learner rating for the content, if available
        review:
          type: string
          nullable: true
          description: Learner review content, if available
        details:
          type: object
          additionalProperties: {}
          description: Additional learner-specific metadata
      required:
        - completion_percentage
        - completion_status
        - email
        - enrollment_date
        - last_activity
        - name
        - rating
        - review
        - user_id
        - username
    ContentDetailsPagination:
      type: object
      description: Serializer for pagination information in content details response.
      properties:
        count:
          type: integer
          description: Total learner records
        next:
          type: string
          nullable: true
          description: Relative URL for the next page
        previous:
          type: string
          nullable: true
          description: Relative URL for the previous page
        current_page:
          type: integer
          description: Current page number
        total_pages:
          type: integer
          description: Total number of pages
      required:
        - count
        - current_page
        - total_pages
    ContentDetailsResponse:
      type: object
      description: Serializer for the content details API response.
      properties:
        content_info:
          $ref: '#/components/schemas/ContentDetailsContentInfo'
        summary:
          $ref: '#/components/schemas/ContentDetailsSummary'
        pagination:
          $ref: '#/components/schemas/ContentDetailsPagination'
        learners:
          type: array
          items:
            $ref: '#/components/schemas/ContentDetailsLearner'
      required:
        - content_info
        - learners
        - pagination
        - summary
    ContentDetailsSummary:
      type: object
      description: Serializer for summary data in the content details endpoint.
      properties:
        totals:
          type: object
          additionalProperties:
            type: number
            format: double
          description: Total counts related to the content item
        averages:
          type: object
          additionalProperties:
            type: number
            format: double
            nullable: true
          description: Average values related to the content item
        time_series:
          allOf:
            - $ref: '#/components/schemas/ContentDetailsTimeSeries'
          description: Optional time series data for the requested metric
      required:
        - averages
        - totals
    ContentDetailsTimeSeries:
      type: object
      description: Serializer describing the time series block.
      properties:
        metric:
          type: string
          description: Metric represented in the time series
        interval:
          type: string
          description: Aggregation interval (e.g., month)
        data:
          type: array
          items:
            $ref: '#/components/schemas/ContentDetailsTimeSeriesPoint'
      required:
        - data
        - interval
        - metric
    ContentDetailsTimeSeriesPoint:
      type: object
      description: >-
        Serializer for individual time series points in content details
        response.
      properties:
        period:
          type: string
          description: ISO8601 timestamp representing the aggregated period
        value:
          type: number
          format: double
          description: Value for the requested metric during the period
        average:
          type: number
          format: double
          nullable: true
          description: Average value for the period (used for ratings)
      required:
        - period
        - value
    ContentItem:
      type: object
      description: Serializer for individual content items.
      properties:
        id:
          type: string
          description: Content identifier
        name:
          type: string
          description: Content name
        slug:
          type: string
          description: Content slug
        platform:
          type: string
          nullable: true
          description: Platform key
        external:
          type: boolean
          description: Whether content is external to the platform
        analytics:
          $ref: '#/components/schemas/ContentAnalytics'
        instructor:
          type: string
          nullable: true
          description: Instructor name
        category:
          type: string
          nullable: true
          description: Content category
        duration:
          type: string
          nullable: true
          description: Content duration
        enabled:
          type: boolean
          description: Whether content is enabled
        created:
          type: string
          nullable: true
          description: Creation date
        updated:
          type: string
          nullable: true
          description: Last update date
        metadata: {}
      required:
        - analytics
        - external
        - id
        - name
        - platform
        - slug
    ContentPagination:
      type: object
      description: Serializer for content pagination metadata.
      properties:
        count:
          type: integer
          description: Total number of items
        next:
          type: string
          nullable: true
          description: URL for next page
        previous:
          type: string
          nullable: true
          description: URL for previous page
        current_page:
          type: integer
          description: Current page number
        total_pages:
          type: integer
          description: Total number of pages
      required:
        - count
        - current_page
        - total_pages
    ContentResponse:
      type: object
      description: Serializer for the complete content API response.
      properties:
        metric:
          type: string
          description: The metric type (course, program, pathway, skill)
        summary:
          allOf:
            - $ref: '#/components/schemas/ContentSummary'
          description: Summary statistics for the metric
        pagination:
          allOf:
            - $ref: '#/components/schemas/ContentPagination'
          description: Pagination metadata
        results:
          type: array
          items:
            $ref: '#/components/schemas/ContentItem'
          description: List of content items
      required:
        - metric
        - pagination
        - results
        - summary
    ContentSummary:
      type: object
      description: Serializer for content summary data.
      properties:
        totals:
          $ref: '#/components/schemas/ContentTotals'
        averages:
          $ref: '#/components/schemas/ContentAverages'
        overtime:
          type: array
          items:
            $ref: '#/components/schemas/OvertimeDataPoint'
          description: Time spent over time data (courses only, when include_overtime=true)
      required:
        - averages
        - totals
    ContentTotals:
      type: object
      description: Serializer for content summary totals.
      properties:
        total_learners:
          type: integer
          description: Total number of learners
        total_enrollments:
          type: integer
          description: Total number of enrollments
        total_time_spent:
          type: integer
          description: Total time spent in seconds (courses only)
        courses:
          type: integer
          description: Total number of courses
        active_courses:
          type: integer
          description: Number of active courses
        platform_courses:
          type: integer
          description: Number of platform-owned courses
        external_courses:
          type: integer
          description: Number of external courses
        programs:
          type: integer
          description: Total number of programs
        active_programs:
          type: integer
          description: Number of active programs
        platform_programs:
          type: integer
          description: Number of platform-owned programs
        external_programs:
          type: integer
          description: Number of external programs
        pathways:
          type: integer
          description: Total number of pathways
        active_pathways:
          type: integer
          description: Number of active pathways
        platform_pathways:
          type: integer
          description: Number of platform-owned pathways
        external_pathways:
          type: integer
          description: Number of external pathways
        skills:
          type: integer
          description: Total number of skills
        active_skills:
          type: integer
          description: Number of active skills
        platform_skills:
          type: integer
          description: Number of platform-owned skills
        external_skills:
          type: integer
          description: Number of external skills
        associated_courses:
          type: integer
          description: Number of courses associated with skills
        learners_with_skills:
          type: integer
          description: Number of learners with skills
      required:
        - total_enrollments
        - total_learners
    ContextResponse:
      type: object
      description: Response serializer for context endpoint
      properties:
        status:
          type: string
        data:
          type: object
          additionalProperties: {}
      required:
        - data
        - status
    ConversationChartPoint:
      type: object
      properties:
        date:
          type: string
          format: date-time
        value:
          type: integer
      required:
        - date
        - value
    ConversationDetailResponse:
      type: object
      properties:
        summary:
          type: object
          additionalProperties: {}
        messages:
          type: array
          items:
            type: object
            additionalProperties: {}
      required:
        - messages
        - summary
    ConversationListItem:
      type: object
      properties:
        platform_name:
          type: string
        platform_key:
          type: string
        mentor:
          type: string
        mentor_unique_id:
          type: string
        model:
          type: string
        cost:
          type: string
          readOnly: true
        username:
          type: string
          nullable: true
          maxLength: 255
        name:
          type: string
          maxLength: 255
        first_user_message:
          type: string
          nullable: true
        topics: {}
        message_count:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
        user_queries:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          nullable: true
        assistant_responses:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          nullable: true
        average_sentiment:
          type: number
          format: double
          nullable: true
        sentiment:
          type: string
          nullable: true
          maxLength: 16
        created_at:
          type: string
          format: date-time
        platform:
          type: integer
        session:
          type: string
          format: uuid
        user:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          nullable: true
      required:
        - cost
        - created_at
        - mentor
        - mentor_unique_id
        - message_count
        - model
        - name
        - platform
        - platform_key
        - platform_name
        - session
        - topics
    ConversationListResponse:
      type: object
      properties:
        summary:
          type: object
          additionalProperties: {}
        results:
          type: array
          items:
            $ref: '#/components/schemas/ConversationListItem'
        pagination:
          type: object
          additionalProperties: {}
      required:
        - pagination
        - results
        - summary
    ConversationMessage:
      type: object
      properties:
        first_message:
          type: string
          readOnly: true
        topics:
          type: array
          items:
            $ref: '#/components/schemas/TopicModel'
        id:
          type: string
          format: uuid
        user_id:
          type: string
        message_count:
          type: integer
          readOnly: true
        model:
          type: string
        inserted_at:
          type: string
          format: date-time
        user_sentiment:
          type: string
          readOnly: true
      required:
        - first_message
        - id
        - inserted_at
        - message_count
        - model
        - topics
        - user_id
        - user_sentiment
    ConversationRating:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        full_conversation_text:
          type: string
        rating_text:
          type: string
          nullable: true
        score:
          type: number
          format: double
          nullable: true
      required:
        - full_conversation_text
        - id
    ConversationSummary:
      type: object
      properties:
        total_conversations:
          type: integer
        total_human_messages:
          type: integer
        total_ai_messages:
          type: integer
      required:
        - total_ai_messages
        - total_conversations
        - total_human_messages
    ConversationVolume:
      type: object
      properties:
        date:
          type: string
          format: date-time
        conversation_count:
          type: integer
      required:
        - conversation_count
        - date
    Conversations:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        messages:
          type: string
          readOnly: true
        topics:
          type: array
          items:
            $ref: '#/components/schemas/TopicModel'
        sentiment:
          type: string
          readOnly: true
        mentor:
          type: string
          format: uuid
        student:
          type: string
          readOnly: true
        email:
          type: string
          readOnly: true
        model:
          type: string
        rating:
          type: integer
          readOnly: true
        platform:
          type: string
        lti_email:
          type: string
          description: Email claim from LTI1.3 JWT if an LTI user and available
          readOnly: true
        lti_username:
          type: string
          description: Username claim from LTI1.3 JWT if an LTI user and available
          readOnly: true
        inserted_at:
          type: string
          format: date-time
          readOnly: true
        has_document:
          type: boolean
        memory_tracked:
          type: boolean
        enable_artifacts:
          type: boolean
        llm_name:
          type: string
          nullable: true
          maxLength: 255
        llm_provider:
          type: string
          nullable: true
          maxLength: 255
        metadata:
          nullable: true
        is_conversation:
          type: boolean
          description: True if the session has both user and AI messages
        tools:
          type: array
          items:
            type: integer
      required:
        - email
        - id
        - inserted_at
        - lti_email
        - lti_username
        - mentor
        - messages
        - model
        - platform
        - rating
        - sentiment
        - student
        - topics
    ConversationsChart:
      type: object
      properties:
        metric:
          type: string
        points:
          type: array
          items:
            $ref: '#/components/schemas/ConversationChartPoint'
      required:
        - metric
        - points
    Cost:
      type: object
      properties:
        total_cost:
          type: number
          format: double
      required:
        - total_cost
    CostPerTenant:
      type: object
      properties:
        platform_key:
          type: string
        total_cost:
          type: number
          format: double
        model_costs:
          type: array
          items:
            $ref: '#/components/schemas/ModelCost'
      required:
        - model_costs
        - platform_key
        - total_cost
    Count:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/CountData'
      required:
        - data
    CountData:
      type: object
      properties:
        count:
          type: integer
          description: Total
      required:
        - count
    Course:
      type: object
      properties:
        course_id:
          type: string
          readOnly: true
          description: The edX course ID string for the course.
        name:
          type: string
          readOnly: true
          description: The display name of the course. (Should match edX)
        slug:
          type: string
          readOnly: true
          nullable: true
          description: An additional unique slug field. (Optional)
          pattern: ^[-a-zA-Z0-9_]+$
        org:
          type: string
      required:
        - course_id
        - name
        - slug
    CourseAccessRequestCreate:
      type: object
      description: Request serializer for CourseLicenseAccessRequestUserView POST endpoint
      properties:
        platform_key:
          type: string
          description: The unique identifier for the platform
        platform_org:
          type: string
          description: The organization identifier for the platform
        course_id:
          type: string
          description: The unique identifier for the course
      required:
        - course_id
    CourseAccessRequestDetail:
      type: object
      description: Response serializer for access request details
      properties:
        id:
          type: integer
          description: The unique identifier for the access request
        user_id:
          type: integer
          description: The ID of the user who made the request
        username:
          type: string
          description: The username of the user who made the request
        name:
          type: string
          description: The full name of the user who made the request
        approved:
          type: boolean
          nullable: true
          description: Whether the request has been approved (null if not reviewed)
        reviewed:
          type: boolean
          description: Whether the request has been reviewed
        created:
          type: string
          format: date-time
          description: When the request was created
        modified:
          type: string
          format: date-time
          description: When the request was last modified
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the request
        platform_key:
          type: string
          description: The platform key associated with the request
        course_id:
          type: string
          description: The course ID associated with the request
      required:
        - approved
        - course_id
        - created
        - id
        - modified
        - name
        - platform_key
        - reviewed
        - user_id
        - username
    CourseAccessRequestStatusResponse:
      type: object
      description: Response serializer for CourseLicenseAccessRequestUserView GET endpoint
      properties:
        active:
          type: boolean
          description: Whether the access request is active
        approved:
          type: boolean
          nullable: true
          description: Whether the access request has been approved (null if not reviewed)
        exists:
          type: boolean
          description: Whether an access request exists for this user and course
      required:
        - active
        - approved
        - exists
    CourseAccessRequestUpdate:
      type: object
      description: >-
        Request serializer for CourseLicenseAccessRequestManagementView POST
        endpoint
      properties:
        request_id:
          type: integer
          description: The ID of the access request to update
        platform_key:
          type: string
          description: The unique identifier for the platform
        platform_org:
          type: string
          description: The organization identifier for the platform
        approved:
          type: boolean
          description: Whether to approve the request
        active:
          type: boolean
          description: Whether the request should remain active
      required:
        - request_id
    CourseCompletion:
      type: object
      properties:
        completed:
          type: boolean
        completion_percentage:
          type: number
          format: double
          nullable: true
        passed:
          type: boolean
          nullable: true
        passed_date:
          type: string
          format: date-time
          nullable: true
      required:
        - completed
    CourseCompletionPerCourse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/CourseCompletionPerCourseData'
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - pagination
    CourseCompletionPerCourseData:
      type: object
      properties:
        course_id:
          type: string
          description: Edx Course ID
        name:
          type: string
          description: Course Name
        enrollments:
          type: integer
          description: Number of enrollments
        completions:
          type: integer
          description: Number of completions
        average:
          type: number
          format: double
          description: Average Completions.
      required:
        - average
        - completions
        - course_id
        - enrollments
        - name
    CourseCompletionSummaryDataOvertime:
      type: object
      properties:
        overtime:
          type: object
          additionalProperties: {}
          description: >-
            Dates are keys and values are the value for the date in the key. e,g
            `{"2020-01-01": 30. ...}`
        total_user_count:
          type: integer
          description: Total unique active users in this period
        completed_count:
          type: integer
          description: Total course completions
        completed_percent:
          type: number
          format: double
          description: Completion percent for the time range
      required:
        - completed_count
        - completed_percent
        - total_user_count
    CourseCompletionSummaryOvertime:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/CourseCompletionSummaryDataOvertime'
        meta:
          $ref: '#/components/schemas/OvertimeMeta'
      required:
        - data
        - meta
    CourseCreateUpdate:
      type: object
      description: Serializer for course creation/update request body.
      properties:
        course_id:
          type: string
          description: The unique identifier for the course
        org:
          type: string
          description: The organization associated with the course
        name:
          type: string
          description: The name of the course
        slug:
          type: string
          description: The slug for the course
        data:
          description: Additional course data
      required:
        - course_id
        - org
    CourseCreationTask:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        user_id:
          type: string
          readOnly: true
        student:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          readOnly: true
        name:
          type: string
          maxLength: 200
        description:
          type: string
          description: Description of the course to create and its requirements
        target_audience:
          type: string
          description: The intended audience for the course. eg. Grade 11 students.
          maxLength: 200
        platform:
          type: integer
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        status:
          allOf:
            - $ref: '#/components/schemas/CourseCreationTaskStatusEnum'
          readOnly: true
        publish_course:
          type: boolean
        course_data:
          readOnly: true
        provider:
          type: string
          maxLength: 20
        model:
          type: string
          maxLength: 150
        desired_number_of_sections:
          type: integer
          maximum: 2147483647
          minimum: 0
        logs:
          type: string
          readOnly: true
        files:
          type: array
          items:
            $ref: '#/components/schemas/CourseCreationTaskFile'
          readOnly: true
        date_created:
          type: string
          format: date-time
          readOnly: true
        last_modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - course_data
        - date_created
        - description
        - files
        - id
        - last_modified
        - logs
        - name
        - platform
        - platform_key
        - status
        - student
        - target_audience
        - user_id
    CourseCreationTaskFile:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        course_creation_task:
          type: integer
        file:
          type: string
          format: uri
        date_created:
          type: string
          format: date-time
          readOnly: true
        last_modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - course_creation_task
        - date_created
        - file
        - id
        - last_modified
    CourseCreationTaskStatusEnum:
      enum:
        - Pending
        - Scheduled
        - Success
        - Failed
        - Cancelled
        - In Progress
      type: string
      description: |-
        * `Pending` - Pending
        * `Scheduled` - Scheduled
        * `Success` - Success
        * `Failed` - Failed
        * `Cancelled` - Cancelled
        * `In Progress` - In Progress
    CourseDeleteResponse:
      type: object
      description: Serializer for course deletion response.
      properties:
        count:
          type: integer
          description: Number of courses deleted
        type:
          type: object
          additionalProperties: {}
          description: Types of objects deleted
      required:
        - count
        - type
    CourseDetail:
      type: object
      properties:
        course_id:
          type: string
        name:
          type: string
          nullable: true
        platform:
          type: string
          nullable: true
        enrollment:
          $ref: '#/components/schemas/EnrollmentInfo'
        completion:
          allOf:
            - $ref: '#/components/schemas/CourseCompletion'
          nullable: true
        time_spent:
          type: string
          description: >-
            Total time spent on this course in human-readable format (e.g., '1h
            30m')
        time_spent_secs:
          type: integer
          description: Total time spent on this course in seconds
      required:
        - course_id
        - enrollment
    CourseEnrollmentSearchResponse:
      type: object
      description: Serializer for course enrollment search results.
      properties:
        user_id:
          type: integer
          description: User ID associated with the enrollment
        username:
          type: string
          description: Username associated with the enrollment
        email:
          type: string
          description: Email of the user
        course_id:
          type: string
          description: Course ID associated with the enrollment
        active:
          type: boolean
          description: Whether the enrollment is active
        created:
          type: string
          format: date-time
          description: Date when enrollment began/activated
        started:
          type: string
          format: date-time
          nullable: true
          description: Date when enrollment started
        ended:
          type: string
          format: date-time
          nullable: true
          description: Date when enrollment ended/deactivated
        expired:
          type: string
          format: date-time
          nullable: true
          description: Date when enrollment expires
        metadata:
          nullable: true
          description: Enrollment specific metadata
        name:
          type: string
          nullable: true
          description: Full name of the user
        course_name:
          type: string
          description: Name of the course
      required:
        - active
        - course_id
        - course_name
        - created
        - email
        - ended
        - expired
        - metadata
        - name
        - started
        - user_id
        - username
    CourseGradeDetailBlock:
      type: object
      properties:
        display_name:
          type: string
          description: Block name
        id:
          type: string
          description: Block Id
        attempts:
          type: string
          description: Total users who have attempted it
        average:
          type: string
          description: Average block value
      required:
        - average
        - display_name
        - id
    CourseGradeDetailSubSection:
      type: object
      properties:
        display_name:
          type: string
          description: Block name
        id:
          type: string
          description: Block Id
        attempts:
          type: string
          description: Total users who have attempted it
        average:
          type: string
          description: Average block value
        problems:
          type: array
          items:
            $ref: '#/components/schemas/CourseGradeDetailBlock'
          description: Problems in section
      required:
        - average
        - display_name
        - id
    CourseGradeSummary:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/CourseGradeSummaryData'
    CourseGradeSummaryData:
      type: object
      properties:
        assignment_type:
          type: string
          description: Assignment Type name
        weight:
          type: number
          format: double
          description: Assignment weight
        average_weighted_grade:
          type: number
          format: double
          description: Assignment weighted grade average in course
        average_section_grade:
          type: number
          format: double
          description: Assignment section grade average in course
      required:
        - assignment_type
        - average_section_grade
        - average_weighted_grade
        - weight
    CourseGradingDetail:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/CourseGradingDetailData'
    CourseGradingDetailData:
      type: object
      properties:
        display_name:
          type: string
          description: Chapter name
        id:
          type: string
          description: Chapter Id
        subsections:
          type: array
          items:
            $ref: '#/components/schemas/CourseGradeDetailSubSection'
      required:
        - display_name
        - id
    CourseGroupSuggestionCreate:
      type: object
      description: Request serializer for CourseGroupSuggestionManagementView POST endpoint
      properties:
        platform_key:
          type: string
          description: The platform for the group suggestion
        course_id:
          type: string
          description: The course ID to suggest
        group_id:
          type: integer
          description: The group to suggest the course to
        accepted:
          type: boolean
          default: false
          description: Whether the suggestion is accepted
        visible:
          type: boolean
          default: true
          description: Whether the suggestion is visible
        metadata:
          type: object
          additionalProperties: {}
          description: Additional suggestion metadata
        suggested_by:
          type: string
          description: The user who suggested the group
        direct:
          type: boolean
          default: true
          description: Whether the suggestion is direct
        department_mode:
          type: boolean
          default: false
          description: Flag to ensure department admins can call the API
      required:
        - course_id
        - group_id
        - platform_key
    CourseGroupSuggestionDetail:
      type: object
      description: Response serializer for course group suggestion details
      properties:
        id:
          type: integer
          description: The unique identifier for the group suggestion
        group_id:
          type: integer
          description: The ID of the group receiving the suggestion
        group_name:
          type: string
          description: The name of the group receiving the suggestion
        platform_key:
          type: string
          description: The platform key associated with the suggestion
        accepted:
          type: boolean
          description: Whether the suggestion has been accepted
        visible:
          type: boolean
          description: Whether the suggestion is visible
        created:
          type: string
          format: date-time
          description: When the suggestion was created
        modified:
          type: string
          format: date-time
          description: When the suggestion was last modified
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the suggestion
        course_id:
          type: string
          description: The course ID being suggested
        course_name:
          type: string
          description: The name of the course being suggested
        user_count:
          type: integer
          description: Number of users in the group
      required:
        - course_id
        - course_name
        - created
        - group_id
        - group_name
        - id
        - metadata
        - modified
        - platform_key
        - visible
    CourseInvitationCreate:
      type: object
      description: Request serializer for CourseInvitationView POST endpoint
      properties:
        course_id:
          type: string
          description: The course to create an invitation for
        email:
          type: string
          format: email
          description: The email address to invite
        username:
          type: string
          description: The username to invite
        active:
          type: boolean
          default: true
          description: Whether the invitation is active
        source:
          type: string
          description: The source of the invitation
        redirect_to:
          type: string
          format: uri
          description: URL to redirect to after accepting the invitation
        created:
          type: string
          format: date-time
          description: When the invitation was created
        expired:
          type: string
          format: date-time
          description: When the invitation expires
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the invitation
      required:
        - course_id
    CourseInvitationDetail:
      type: object
      description: Response serializer for course invitation details
      properties:
        id:
          type: integer
          description: The unique identifier for the invitation
        user_id:
          type: integer
          nullable: true
          description: The ID of the user associated with the invitation
        username:
          type: string
          nullable: true
          description: The username of the user associated with the invitation
        email:
          type: string
          format: email
          nullable: true
          description: The email address associated with the invitation
        created:
          type: string
          format: date-time
          description: When the invitation was created
        started:
          type: string
          format: date-time
          nullable: true
          description: When the invitation was started
        expired:
          type: string
          format: date-time
          nullable: true
          description: When the invitation expires
        source:
          type: string
          nullable: true
          description: The source of the invitation
        redirect_to:
          type: string
          format: uri
          nullable: true
          description: URL to redirect to after accepting the invitation
        active:
          type: boolean
          description: Whether the invitation is active
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the invitation
        course_id:
          type: string
          description: The course ID associated with the invitation
      required:
        - active
        - course_id
        - email
        - expired
        - id
        - metadata
        - redirect_to
        - source
        - started
        - username
    CourseInvitationRedemption:
      type: object
      description: Request serializer for CourseInvitationRedemptionView POST endpoint
      properties:
        course_id:
          type: string
          description: The course ID for the invitation
        source:
          type: string
          description: The source identifier for the invitation
        email:
          type: string
          format: email
          description: The email to associate with the invitation
        username:
          type: string
          description: The username to associate with the invitation
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the invitation
      required:
        - course_id
        - source
    CourseLicenseAssignmentCreate:
      type: object
      description: Request serializer for CourseLicenseAssignmentView POST endpoint
      properties:
        license_id:
          type: integer
          description: The ID of the course license
        user_id:
          type: integer
          description: The user ID to assign the license to
        email:
          type: string
          format: email
          description: The email to assign the license to
        platform_key:
          type: string
          description: The unique identifier for the platform
        platform_org:
          type: string
          description: The organization identifier for the platform
        active:
          type: boolean
          default: true
          description: Whether the assignment is active
        fulfilled:
          type: boolean
          default: false
          description: Whether the assignment has been fulfilled
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the assignment
      required:
        - license_id
    CourseLicenseAssignmentDetail:
      type: object
      description: Response serializer for course license assignment details
      properties:
        id:
          type: integer
          description: The unique identifier for the assignment
        user_id:
          type: integer
          description: The ID of the user assigned the license
        username:
          type: string
          description: The username of the user assigned the license
        email:
          type: string
          format: email
          nullable: true
          description: The email address of the user assigned the license
        active:
          type: boolean
          description: Whether the assignment is active
        fulfilled:
          type: boolean
          description: Whether the assignment has been fulfilled
        redirect_to:
          type: string
          format: uri
          nullable: true
          description: URL to redirect to after fulfillment
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the assignment
        license_id:
          type: integer
          description: The ID of the course license
        license_name:
          type: string
          description: The name of the course license
        course_id:
          type: string
          description: The course ID associated with the license
      required:
        - active
        - course_id
        - email
        - id
        - license_id
        - license_name
        - metadata
        - user_id
        - username
    CourseLicenseCreate:
      type: object
      description: Request serializer for CourseLicenseCreateView POST endpoint
      properties:
        platform_key:
          type: string
          description: The platform to create a license for
        platform_org:
          type: string
          description: The organization identifier for the platform
        course_id:
          type: string
          description: The course ID to create a license for
        name:
          type: string
          description: Display name for the license
        count:
          type: integer
          default: 0
          description: Number of seats purchased
        started:
          type: string
          format: date-time
          description: Date when license should begin
        expired:
          type: string
          format: date-time
          nullable: true
          description: Date when license should expire
        active:
          type: boolean
          default: true
          description: Whether the license is active
        metadata:
          type: object
          additionalProperties: {}
          description: Additional license metadata
        enrollment_config:
          type: object
          additionalProperties: {}
          description: Additional enrollment configuration
        source:
          type: string
          description: Source identifier
        external_id:
          type: string
          nullable: true
          description: External identifier (must be unique)
        transaction_id:
          type: string
          description: Transaction identifier for tracking
        change_type:
          type: string
          default: create
          description: Type of change being made
      required:
        - course_id
        - platform_key
    CourseLicenseDetail:
      type: object
      description: Response serializer for course license details
      properties:
        id:
          type: integer
          description: The unique identifier for the license
        created:
          type: string
          format: date-time
          description: When the license was created
        started:
          type: string
          format: date-time
          description: When the license becomes active
        expired:
          type: string
          format: date-time
          nullable: true
          description: When the license expires
        name:
          type: string
          description: The display name of the license
        count:
          type: integer
          description: The number of seats purchased
        active:
          type: boolean
          description: Whether the license is active
        metadata:
          type: object
          additionalProperties: {}
          description: Additional license metadata
        source:
          type: string
          description: The source identifier for the license
        external_id:
          type: string
          nullable: true
          description: External identifier for the license
        platform_key:
          type: string
          description: The platform key associated with the license
        course_id:
          type: string
          description: The course ID associated with the license
        usage_count:
          type: integer
          default: 0
          description: The number of seats purchased
      required:
        - active
        - count
        - course_id
        - created
        - expired
        - external_id
        - id
        - metadata
        - name
        - platform_key
        - source
        - started
    CourseLicenseGroupAssignmentCreate:
      type: object
      description: Request serializer for CourseLicenseGroupAssignmentView POST endpoint
      properties:
        license_id:
          type: integer
          description: The ID of the course license
        group_id:
          type: integer
          description: The group ID to assign the license to
        platform_key:
          type: string
          description: The unique identifier for the platform
        platform_org:
          type: string
          description: The organization identifier for the platform
        active:
          type: boolean
          default: true
          description: Whether the assignment is active
        fulfilled:
          type: boolean
          default: false
          description: Whether the assignment has been fulfilled
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the assignment
      required:
        - group_id
        - license_id
    CourseLicenseGroupAssignmentDetail:
      type: object
      description: Response serializer for course license group assignment details
      properties:
        id:
          type: integer
          description: The unique identifier for the assignment
        group_id:
          type: integer
          description: The ID of the group assigned the license
        group_name:
          type: string
          description: The name of the group assigned the license
        active:
          type: boolean
          description: Whether the assignment is active
        fulfilled:
          type: boolean
          description: Whether the assignment has been fulfilled
        redirect_to:
          type: string
          format: uri
          nullable: true
          description: URL to redirect to after fulfillment
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the assignment
        license_id:
          type: integer
          description: The ID of the course license
        license_name:
          type: string
          description: The name of the course license
        course_id:
          type: string
          description: The course ID associated with the license
      required:
        - active
        - course_id
        - group_id
        - group_name
        - id
        - license_id
        - license_name
        - metadata
    CourseLicenseUpdate:
      type: object
      description: Request serializer for CourseLicenseUpdateView POST endpoint
      properties:
        license_id:
          type: integer
          description: >-
            The ID of the license to update (required if external_id not
            provided)
        external_id:
          type: string
          description: >-
            External identifier of the license to update (required if license_id
            not provided)
        platform_key:
          type: string
          description: The platform key (not updatable)
        platform_org:
          type: string
          description: The platform organization (not updatable)
        course_id:
          type: string
          description: The course ID (not updatable)
        name:
          type: string
          description: Updated display name for the license
        count:
          type: integer
          description: Updated number of seats purchased
        started:
          type: string
          format: date-time
          description: Updated date when license should begin
        expired:
          type: string
          format: date-time
          nullable: true
          description: Updated date when license should expire
        active:
          type: boolean
          description: Updated active status
        metadata:
          type: object
          additionalProperties: {}
          description: Updated additional license metadata
        source:
          type: string
          description: Updated source identifier
        transaction_id:
          type: string
          description: Transaction identifier for tracking
        change_type:
          type: string
          default: update
          description: Type of change being made
    CourseMetadataSearchRequest:
      type: object
      description: Serializer for course metadata search request body.
      properties:
        data__contains:
          description: Filter by metadata fields (JSON object)
        slug:
          type: string
          description: Filter by course slug
        course_id:
          type: string
          description: Filter by course ID
    CourseMetadataUpdateRequest:
      type: object
      description: Serializer for course metadata update request body.
      properties:
        course_id:
          type: string
          description: The course ID to update metadata for
        metadata:
          description: The metadata to update
        update:
          type: boolean
          default: true
          description: Whether to update (True) or overwrite (False) existing metadata
      required:
        - course_id
        - metadata
    CoursePoint:
      type: object
      properties:
        course_id:
          type: string
          description: The edX course ID string for the course.
          maxLength: 255
        points:
          type: integer
      required:
        - course_id
        - points
    CourseRecommendation:
      type: object
      description: Individual course recommendation with reasoning.
      properties:
        course_id:
          type: string
          description: The ID of the recommended course
        course_title:
          type: string
          description: The title of the recommended course
        reason:
          type: string
          description: AI-generated explanation for why this course is recommended
        domain:
          type: string
          nullable: true
          description: Course domain/subject area
        difficulty_level:
          type: string
          nullable: true
          description: Course difficulty level
        estimated_hours:
          type: number
          format: double
          nullable: true
          description: Estimated hours to complete
        confidence_score:
          type: number
          format: double
          nullable: true
          description: AI confidence in this recommendation (0-1)
        platform_key:
          type: string
          nullable: true
          description: >-
            Platform/tenant key this course belongs to (extracted from course_id
            or metadata)
        description:
          type: string
          nullable: true
          description: >-
            Course description (priority: description > short_description >
            overview with HTML stripped)
        short_description:
          type: string
          nullable: true
          description: Course short description from edx_data
      required:
        - course_id
        - course_title
        - reason
    CourseReviewInfoResponse:
      type: object
      description: Serializer for course review info response.
      properties:
        course_id:
          type: string
          description: The course ID associated with the reviews
        avg_rating:
          type: number
          format: double
          nullable: true
          description: Average rating of the course
        count:
          type: integer
          description: Total number of reviews for the course
      required:
        - avg_rating
        - count
        - course_id
    CourseReviewPaginatedResponse:
      type: object
      description: Paginated response serializer for CourseReviewQueryView GET endpoint.
      properties:
        count:
          type: integer
          description: Total number of reviews
        next_page:
          type: integer
          nullable: true
          description: Next page number
        previous_page:
          type: integer
          nullable: true
          description: Previous page number
        results:
          type: array
          items:
            type: object
            additionalProperties: {}
      required:
        - count
        - next_page
        - previous_page
        - results
    CourseReviewRequest:
      type: object
      description: Request serializer for CourseReviewUpdateView POST endpoint.
      properties:
        course_id:
          type: string
          description: The course ID to review
        username:
          type: string
          description: The username of the reviewer
        user_id:
          type: integer
          description: The user ID of the reviewer (alternative to username)
        rating:
          type: number
          format: double
          nullable: true
          description: The rating value (typically 1-5)
        title:
          type: string
          description: The review title
        content:
          type: string
          description: The review content/text
        visible:
          type: boolean
          default: true
          description: Whether the review is visible
        metadata:
          description: Additional review metadata
      required:
        - course_id
        - username
    CourseReviewResponse:
      type: object
      description: |-
        Response serializer for CourseReviewQueryView GET endpoint.
        Matches the actual structure returned by review.to_json()
      properties:
        user_id:
          type: integer
          description: User ID of the reviewer
        course_id:
          type: string
        username:
          type: string
          description: Username of the reviewer
        content:
          type: string
          description: Review content
        rating:
          type: number
          format: double
          nullable: true
          description: Review rating
        title:
          type: string
          description: Review title
        visible:
          type: boolean
          description: Whether review is visible
        created:
          type: string
          format: date-time
          description: Review creation date
        modified:
          type: string
          format: date-time
          description: Review modification date
        metadata: {}
      required:
        - content
        - created
        - metadata
        - modified
        - rating
        - title
        - user_id
        - username
        - visible
    CourseSkill:
      type: object
      properties:
        course_id:
          type: string
          description: The edX course ID string for the course.
          maxLength: 255
        skills:
          type: array
          items:
            $ref: '#/components/schemas/Skill'
      required:
        - course_id
        - skills
    CourseSkillPointInfoRequest:
      type: object
      description: |-
        Request serializer for CourseSkillPointInfoView POST endpoint.
        Validates request body for updating course skill point information.
      properties:
        course_id:
          type: string
          description: ID of the course to update skill point information for
        point_data:
          type: object
          additionalProperties:
            type: integer
            minimum: 0
          description: >-
            Dictionary mapping skill names to point values. Example:
            {'skill_name': 5}
        overwrite:
          type: boolean
          default: true
          description: >-
            If True, removes all skills not in point_data. If False, only
            updates specified skills.
      required:
        - course_id
        - point_data
    CourseSuggestionBulkCreate:
      type: object
      description: Request serializer for CourseSuggestionBulkManagementView POST endpoint
      properties:
        platform_key:
          type: string
          description: The platform for the suggestions
        suggestion_data:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: >-
            List of suggestion data objects, each containing course_id, user_id,
            etc.
        department_mode:
          type: boolean
          default: false
          description: Flag to ensure department admins can call the API
      required:
        - platform_key
        - suggestion_data
    CourseSuggestionCreate:
      type: object
      description: Request serializer for CourseSuggestionManagementView POST endpoint
      properties:
        platform_key:
          type: string
          description: The platform for the suggestion
        course_id:
          type: string
          description: The course ID to suggest
        user_id:
          type: string
          description: The user to suggest the course to
        username:
          type: string
          description: The username of the user to suggest the course to
        email:
          type: string
          format: email
          description: The email of the user to suggest the course to
        accepted:
          type: boolean
          default: false
          description: Whether the suggestion is accepted
        visible:
          type: boolean
          default: true
          description: Whether the suggestion is visible
        metadata:
          type: object
          additionalProperties: {}
          description: Additional suggestion metadata
        suggested_by:
          type: string
          description: The user who suggested the course
        direct:
          type: boolean
          default: true
          description: Whether the suggestion is direct
        department_mode:
          type: boolean
          default: false
          description: Flag to ensure department admins can call the API
      required:
        - course_id
        - platform_key
        - user_id
    CourseSuggestionDetail:
      type: object
      description: Response serializer for course suggestion details
      properties:
        id:
          type: integer
          description: The unique identifier for the suggestion
        user_id:
          type: integer
          description: The ID of the user receiving the suggestion
        username:
          type: string
          description: The username of the user receiving the suggestion
        name:
          type: string
          description: The full name of the user receiving the suggestion
        platform_key:
          type: string
          description: The platform key associated with the suggestion
        accepted:
          type: boolean
          description: Whether the suggestion has been accepted by the user
        visible:
          type: boolean
          description: Whether the suggestion is visible to the user
        created:
          type: string
          format: date-time
          description: When the suggestion was created
        modified:
          type: string
          format: date-time
          description: When the suggestion was last modified
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the suggestion
        course_id:
          type: string
          description: The course ID being suggested
        course_name:
          type: string
          description: The name of the course being suggested
      required:
        - accepted
        - course_id
        - course_name
        - created
        - id
        - metadata
        - modified
        - name
        - platform_key
        - user_id
        - username
        - visible
    CrawlerPatternTypeEnum:
      enum:
        - glob
        - regex
      type: string
      description: |-
        * `glob` - Glob
        * `regex` - Regex
    Credential:
      type: object
      properties:
        credential_id:
          type: string
        credential_url:
          type: string
        name:
          type: string
        credential_type:
          type: string
          nullable: true
        issuer:
          type: string
          nullable: true
        issued_on:
          type: string
          format: date-time
          nullable: true
        expires_at:
          type: string
          format: date-time
          nullable: true
        revoked:
          type: boolean
      required:
        - credential_id
        - credential_url
        - name
        - revoked
    CredentialRequest:
      type: object
      properties:
        name:
          type: string
          description: Name of the credential provider (e.g., 'openai', 'google-drive')
        value:
          description: >-
            Credential data for the provider (API keys, service account details,
            etc.)
        platform:
          type: string
          description: Organization key identifier for the tenant
      required:
        - name
        - platform
        - value
    CrontabSchedule:
      type: object
      properties:
        minute:
          type: string
          title: Minute(s)
          description: 'Cron Minutes to Run. Use "*" for "all". (Example: "0,30")'
          maxLength: 240
        hour:
          type: string
          title: Hour(s)
          description: 'Cron Hours to Run. Use "*" for "all". (Example: "8,20")'
          maxLength: 96
        day_of_week:
          type: string
          title: Day(s) Of The Week
          description: >-
            Cron Days Of The Week to Run. Use "*" for "all", Sunday is 0 or 7,
            Monday is 1. (Example: "0,5")
          maxLength: 64
        day_of_month:
          type: string
          title: Day(s) Of The Month
          description: 'Cron Days Of The Month to Run. Use "*" for "all". (Example: "1,15")'
          maxLength: 124
        month_of_year:
          type: string
          title: Month(s) Of The Year
          description: >-
            Cron Months (1-12) Of The Year to Run. Use "*" for "all". (Example:
            "1,12")
          maxLength: 64
    CurrentUsersResponse:
      type: object
      description: Users currently active.
      properties:
        metric:
          type: string
          default: currently_active
        count:
          type: integer
        change:
          type: integer
      required:
        - change
        - count
    CustomInstructionResponse:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        about_user:
          type: string
          nullable: true
        mentor_tone:
          type: string
          nullable: true
        profession:
          type: string
          description: 'Position or work. eg: Engineer, student etc.'
          maxLength: 100
        desired_mentor_traits:
          type: string
          description: Comma separated list of expected traits for mentor.
      required:
        - id
    DataSet:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        platform:
          type: object
          additionalProperties:
            oneOf:
              - type: string
              - type: integer
          nullable: true
          readOnly: true
        name:
          type: string
          maxLength: 255
        prompt:
          type: string
          description: >-
            (if any) Special instructions for generating the dataset. This could
            be requirements on tone, language, style, etc.
          maxLength: 1000
        source_url:
          type: string
          format: uri
          maxLength: 400
        source_file:
          type: string
          format: uri
        status:
          $ref: '#/components/schemas/DataSetStatusEnum'
        num_data_points:
          type: integer
          maximum: 2147483647
          minimum: 0
        train_split:
          type: number
          format: double
          maximum: 1
          minimum: 0
        train_file:
          type: string
          format: uri
        test_file:
          type: string
          format: uri
        retry_attempts:
          type: integer
          maximum: 2147483647
          minimum: 0
        error_log:
          type: string
        date_created:
          type: string
          format: date-time
          readOnly: true
        last_modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - date_created
        - id
        - last_modified
        - name
        - platform
    DataSetCreate:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 255
        source_url:
          type: string
          format: uri
          maxLength: 400
        source_file:
          type: string
          format: uri
        num_data_points:
          type: integer
          maximum: 2147483647
          minimum: 0
        train_split:
          type: number
          format: double
          maximum: 1
          minimum: 0
        prompt:
          type: string
          description: >-
            (if any) Special instructions for generating the dataset. This could
            be requirements on tone, language, style, etc.
          maxLength: 1000
      required:
        - id
        - name
    DataSetStatusEnum:
      enum:
        - pending
        - processing
        - completed
        - failed
      type: string
      description: |-
        * `pending` - Pending
        * `processing` - Processing
        * `completed` - Completed
        * `failed` - Failed
    DateRange:
      type: object
      properties:
        start_date:
          type: string
          format: date
        end_date:
          type: string
          format: date
      required:
        - end_date
        - start_date
    DesiredRole:
      type: object
      properties:
        user_id:
          type: integer
        username:
          type: string
        roles:
          type: array
          items:
            $ref: '#/components/schemas/Role'
        data:
          readOnly: true
          nullable: true
      required:
        - data
        - roles
    DesiredRoleCreateUpdateRequest:
      type: object
      description: Serializer for desired role creation/update request parameters.
      properties:
        user_id:
          type: integer
          description: User ID
        username:
          type: string
          description: Username
        roles:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: >-
            List of roles (can be role IDs or objects with name, platform_key,
            etc.)
        data:
          description: Additional data
      required:
        - roles
    DesiredSkill:
      type: object
      properties:
        user_id:
          type: integer
        username:
          type: string
        skills:
          type: array
          items:
            $ref: '#/components/schemas/Skill'
        data:
          readOnly: true
          nullable: true
      required:
        - data
        - skills
    DesiredSkillCreateUpdateRequest:
      type: object
      description: Serializer for desired skill creation/update request parameters.
      properties:
        user_id:
          type: integer
          description: User ID
        username:
          type: string
          description: Username
        skills:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: >-
            List of skills (can be skill IDs or objects with name, platform_key,
            etc.)
        data:
          description: Additional data
      required:
        - skills
    DetailedGradeSubsection:
      type: object
      properties:
        display_name:
          type: string
          description: Subsection name
        id:
          type: string
          description: Subsection Id
        graded_earned:
          type: string
          description: Subsection earned mark
        graded_possible:
          type: string
          description: Subsection Possible Mark
        graded_percent:
          type: string
          description: Subsection Grade
      required:
        - display_name
        - graded_earned
        - graded_percent
        - graded_possible
        - id
    DetailedGradeView:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DetailedGradeViewData'
    DetailedGradeViewData:
      type: object
      properties:
        display_name:
          type: string
          description: Chapter name
        id:
          type: string
          description: Chapter Id
        children:
          type: array
          items:
            $ref: '#/components/schemas/DetailedGradeSubsection'
      required:
        - display_name
        - id
    Disclaimer:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        scope:
          $ref: '#/components/schemas/ScopeEnum'
        platform:
          type: integer
          readOnly: true
          description: 'Platform to which the disclaimer applies. '
        content:
          type: string
        title:
          type: string
          maxLength: 120
        active:
          type: boolean
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        has_agreed:
          type: boolean
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        mentors:
          type: array
          items:
            type: string
            format: uuid
      required:
        - content
        - created_at
        - has_agreed
        - id
        - platform
        - platform_key
        - updated_at
    DisclaimerAgreement:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        user:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          readOnly: true
        disclaimer:
          type: integer
        agreed_at:
          type: string
          format: date-time
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        user_id:
          type: string
          readOnly: true
      required:
        - agreed_at
        - disclaimer
        - id
        - platform_key
        - user
        - user_id
    DiscordConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        bot:
          type: integer
          readOnly: true
        client_id:
          type: string
          maxLength: 255
        token:
          type: string
          maxLength: 500
        client_secret:
          type: string
          maxLength: 500
      required:
        - bot
        - client_id
        - client_secret
        - id
        - token
    DiscordUserConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        user:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          readOnly: true
        discord_user_id:
          type: string
          maxLength: 200
        date_created:
          type: string
          format: date-time
          readOnly: true
        last_modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - date_created
        - discord_user_id
        - id
        - last_modified
        - user
    DiscordWebhook:
      type: object
      properties:
        application_id:
          type: string
        type:
          type: string
        token:
          type: string
        id:
          type: string
      required:
        - application_id
        - id
        - token
        - type
    Document:
      type: object
      description: Serializer for document objects
      properties:
        id:
          type: integer
          description: Document ID
        document_name:
          type: string
          description: Name of the document
        document_type:
          type: string
          description: Type of document (e.g., 'pdf', 'text')
        access:
          type: string
          description: Access level of the document
        training_status:
          type: string
          description: Training status of the document
        date_created:
          type: string
          format: date-time
          description: Date when the document was created
        last_modified:
          type: string
          format: date-time
          description: Date when the document was last modified
        url:
          type: string
          format: uri
          description: URL to access the document
        metadata:
          description: Additional metadata for the document
      required:
        - access
        - date_created
        - document_name
        - document_type
        - id
        - last_modified
        - metadata
        - training_status
        - url
    DocumentFacet:
      type: object
      description: Serializer for document facets
      properties:
        total:
          type: integer
          description: Total number of documents in this facet
        terms:
          type: object
          additionalProperties: {}
          description: Terms and their counts in this facet
        other:
          type: integer
          description: Count of documents not in any term
      required:
        - other
        - terms
        - total
    DocumentFromPoolRequest:
      type: object
      properties:
        to_pathway:
          type: string
          description: Pathway for document to be trained in.
        document_id:
          type: integer
          description: The document id from pool.
      required:
        - document_id
        - to_pathway
    DocumentSearchResponse:
      type: object
      description: Response serializer for DocumentSearchView
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/Document'
          description: List of documents matching the search criteria
        count:
          type: integer
          description: Total number of documents matching the search criteria
        next:
          type: string
          format: uri
          nullable: true
          description: URL for the next page of results
        previous:
          type: string
          format: uri
          nullable: true
          description: URL for the previous page of results
        current_page:
          type: integer
          description: Current page number
        total_pages:
          type: integer
          description: Total number of pages
        facets:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DocumentFacet'
          description: Facet information for filtering
      required:
        - count
        - current_page
        - facets
        - next
        - previous
        - results
        - total_pages
    DocumentSettingsResponse:
      type: object
      properties:
        retrain_interval_days:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          nullable: true
    Education:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        user:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          readOnly: true
        user_info:
          allOf:
            - $ref: '#/components/schemas/UserInfo'
          readOnly: true
        institution:
          allOf:
            - $ref: '#/components/schemas/Institution'
          readOnly: true
        institution_id:
          type: integer
          writeOnly: true
        degree:
          type: string
          nullable: true
          maxLength: 100
        field_of_study:
          type: string
          nullable: true
          maxLength: 100
        start_date:
          type: string
          format: date
        end_date:
          type: string
          format: date
          nullable: true
        grade:
          type: string
          format: decimal
          pattern: ^-?\d{0,1}(?:\.\d{0,2})?$
          nullable: true
        activities:
          type: string
          nullable: true
          maxLength: 255
        description:
          type: string
          nullable: true
        data:
          nullable: true
          description: Metadata
        metadata:
          nullable: true
          description: Metadata
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
          readOnly: true
        is_current:
          type: boolean
          nullable: true
      required:
        - id
        - institution
        - institution_id
        - start_date
        - updated_at
        - user
        - user_info
    EdxCourse:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        run:
          type: string
          maxLength: 50
        number:
          type: string
          maxLength: 50
        description:
          type: string
        xblock_id:
          type: string
          maxLength: 200
        task:
          type: integer
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - id
        - name
        - number
        - run
        - updated_at
        - xblock_id
    EdxSignalReceiverRequest:
      type: object
      properties:
        type:
          type: string
        data: {}
      required:
        - data
        - type
    ElevenlabsCustomVoice:
      type: object
      properties:
        name:
          type: string
        files:
          type: array
          items:
            type: string
            format: uri
      required:
        - files
        - name
    ElevenlabsCustomVoiceResponse:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        owner_student:
          type: string
          nullable: true
          readOnly: true
        language:
          type: string
          maxLength: 255
        is_premade:
          type: boolean
        description:
          type: string
        sample_audio_url:
          type: string
          nullable: true
          readOnly: true
      required:
        - name
        - owner_student
        - sample_audio_url
    EmailPromptDetail:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        inserted_at:
          type: string
          readOnly: true
        sender_email:
          type: string
          format: email
          maxLength: 254
        sender_name:
          type: string
          nullable: true
        subject:
          type: string
          nullable: true
        content:
          type: string
        mentor_name:
          type: string
          nullable: true
        mentor_email:
          type: string
          format: email
          maxLength: 254
        is_processed:
          type: boolean
        mentor_response:
          type: string
          nullable: true
        send_status:
          type: string
          nullable: true
      required:
        - content
        - id
        - inserted_at
        - mentor_email
        - sender_email
    EmailPromptList:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        sender_email:
          type: string
          format: email
          maxLength: 254
        sender_name:
          type: string
          nullable: true
        subject:
          type: string
          nullable: true
        content_summary:
          type: string
          nullable: true
          readOnly: true
        mentor_name:
          type: string
          nullable: true
        mentor_email:
          type: string
          format: email
          maxLength: 254
        is_processed:
          type: boolean
        inserted_at:
          type: string
          readOnly: true
      required:
        - content_summary
        - id
        - inserted_at
        - mentor_email
        - sender_email
    EmailPromptSummary:
      type: object
      properties:
        total_emails:
          type: integer
          readOnly: true
        replied_emails:
          type: integer
          readOnly: true
        pending_emails:
          type: integer
          readOnly: true
      required:
        - pending_emails
        - replied_emails
        - total_emails
    EngagementPerCourse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/EngagementPerCourseData'
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - pagination
    EngagementPerCourseData:
      type: object
      properties:
        course_id:
          type: string
          description: edx Course Id
        course_start:
          type: string
          description: Course start date
        course_end:
          type: string
          description: Course end date
        average_days:
          type: integer
          description: Average days spent by each learners on the course
        average_time_spent:
          type: number
          format: double
          description: Average days spent by learner on the course
        name:
          type: string
          description: Course name
      required:
        - average_days
        - average_time_spent
        - course_end
        - course_id
        - course_start
        - name
    EnrollmentInfo:
      type: object
      properties:
        created:
          type: string
          format: date-time
          nullable: true
        started:
          type: string
          format: date-time
          nullable: true
        ended:
          type: string
          format: date-time
          nullable: true
        active:
          type: boolean
      required:
        - active
    Enrollments:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/EnrollmentsData'
        pagination:
          $ref: '#/components/schemas/Pagination'
        meta:
          $ref: '#/components/schemas/OvertimeMeta'
      required:
        - pagination
    EnrollmentsData:
      type: object
      properties:
        course_id:
          type: string
          description: Edx Course ID
        name:
          type: string
          description: Course Name
        users:
          type: integer
          description: Number of users
        percentage:
          type: number
          format: double
          description: Percentage ...
      required:
        - course_id
        - name
        - percentage
        - users
    EnrollmentsPerUser:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/EnrollmentsPerUserData'
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - pagination
    EnrollmentsPerUserData:
      type: object
      properties:
        username:
          type: string
          description: learner username
        full_name:
          type: string
          description: learner Name
        email:
          type: string
          description: Email
        timestamp:
          type: string
          description: Course start date
      required:
        - email
        - full_name
        - timestamp
        - username
    Entity:
      type: object
      description: Entity information for the invoice.
      properties:
        type:
          $ref: '#/components/schemas/EntityTypeEnum'
        username:
          type: string
        platform_key:
          type: string
        platform_name:
          type: string
        display_name:
          type: string
      required:
        - display_name
    EntityTypeEnum:
      enum:
        - user
        - platform
        - global
      type: string
      description: |-
        * `user` - user
        * `platform` - platform
        * `global` - global
    ErrorResponse:
      type: object
      description: Generic error response serializer
      properties:
        status:
          type: string
        message:
          type: string
        details: {}
      required:
        - message
        - status
    Experience:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        user:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          readOnly: true
        user_info:
          allOf:
            - $ref: '#/components/schemas/UserInfo'
          readOnly: true
        company:
          allOf:
            - $ref: '#/components/schemas/Company'
          readOnly: true
        company_id:
          type: integer
          writeOnly: true
        title:
          type: string
          maxLength: 100
        employment_type:
          type: string
          nullable: true
          maxLength: 50
        location:
          type: string
          nullable: true
          maxLength: 100
        start_date:
          type: string
          format: date
        end_date:
          type: string
          format: date
          nullable: true
        is_current:
          type: boolean
        description:
          type: string
          nullable: true
        data:
          nullable: true
          description: Metadata
        metadata:
          nullable: true
          description: Metadata
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - company
        - company_id
        - id
        - start_date
        - title
        - updated_at
        - user
        - user_info
    ExternalServiceInfo:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        display_name:
          type: string
          maxLength: 255
        logo:
          type: string
          format: uri
          nullable: true
      required:
        - display_name
        - id
        - name
    FinanceDetailsResponse:
      type: object
      description: Serializer for /financial/details responses.
      properties:
        page:
          type: integer
        limit:
          type: integer
        total_pages:
          type: integer
        total_records:
          type: integer
        rows: {}
        total_cost:
          type: string
          format: decimal
          pattern: ^-?\d{0,15}(?:\.\d{0,5})?$
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/MetricInfo'
      required:
        - limit
        - page
        - total_pages
        - total_records
    FinanceFilters:
      type: object
      description: Applied filters for the response.
      properties:
        start_date:
          type: string
        end_date:
          type: string
        granularity:
          type: string
        comparison_days:
          type: integer
        platform_key:
          type: string
        mentor_unique_id:
          type: string
        username:
          type: string
        provider:
          type: string
        llm_model:
          type: string
        all_time:
          type: boolean
      required:
        - granularity
    FreeUsageCount:
      type: object
      properties:
        count:
          type: integer
      required:
        - count
    FullCourse:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        run:
          type: string
          maxLength: 50
        number:
          type: string
          maxLength: 50
        description:
          type: string
        xblock_id:
          type: string
          maxLength: 200
        task:
          type: integer
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        sections:
          type: array
          items:
            $ref: '#/components/schemas/SectionWithChildren'
      required:
        - created_at
        - id
        - name
        - number
        - run
        - sections
        - updated_at
        - xblock_id
    GCMDevice:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
          nullable: true
          maxLength: 255
        registration_id:
          type: string
        device_id:
          type: integer
          nullable: true
          description: 'ANDROID_ID / TelephonyManager.getDeviceId() (e.g: 0x01)'
        active:
          type: boolean
          title: Is active
          description: Inactive devices will not be sent notifications
        date_created:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          title: Creation date
        cloud_message_type:
          allOf:
            - $ref: '#/components/schemas/CloudMessageTypeEnum'
          description: |-
            You should choose FCM, GCM is deprecated

            * `FCM` - Firebase Cloud Message
            * `GCM` - Google Cloud Message
        application_id:
          type: string
          nullable: true
          description: >-
            Opaque application identity, should be filled in for multiple
            key/certificate access
          maxLength: 64
      required:
        - date_created
        - registration_id
    GCPTenantLaunchRequest:
      type: object
      properties:
        username:
          type: string
        email:
          type: string
          format: email
        firstname:
          type: string
          default: ''
        lastname:
          type: string
          default: ''
        password:
          type: string
        name:
          type: string
          description: Organization name
        key:
          type: string
          description: Unique key for the organization
        ignore_user_exists:
          type: boolean
          default: false
        is_advertising:
          type: boolean
          default: false
          description: >-
            Advertising mode allows a platform to set custom usd balance to
            allocate for its members
        x_gcp_marketplace_token:
          type: string
          description: GCP Marketplace token
        product_id:
          type: string
          default: ''
          description: GCP product to subscribe to
      required:
        - email
        - key
        - name
        - username
        - x_gcp_marketplace_token
    GlobalCatalogSearchResponse:
      type: object
      description: Response serializer for GlobalCatalogSearchView
      properties:
        results:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: List of content items matching the search criteria
        count:
          type: integer
          description: Total number of items matching the search criteria
        next:
          type: string
          format: uri
          nullable: true
          description: URL for the next page of results
        previous:
          type: string
          format: uri
          nullable: true
          description: URL for the previous page of results
        current_page:
          type: integer
          description: Current page number
        total_pages:
          type: integer
          description: Total number of pages
        facets:
          type: object
          additionalProperties: {}
          description: Facet information for filtering
      required:
        - count
        - current_page
        - next
        - previous
        - results
        - total_pages
    GooglePayAccountResponse:
      type: object
      properties:
        account_id:
          type: string
          maxLength: 255
        bundle_id:
          type: string
          default: ''
          description: The bundle id of the app
          maxLength: 255
        status:
          $ref: '#/components/schemas/GooglePayAccountResponseStatusEnum'
        created_on:
          type: string
          format: date-time
          readOnly: true
        last_updated:
          type: string
          format: date-time
          readOnly: true
        user:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          nullable: true
      required:
        - account_id
        - created_on
        - last_updated
    GooglePayAccountResponseStatusEnum:
      enum:
        - ACCOUNT_ACTIVE
        - ACCOUNT_PENDING
      type: string
      description: |-
        * `ACCOUNT_ACTIVE` - Account Active
        * `ACCOUNT_PENDING` - Account Pending
    GooglePayVerifyToken:
      type: object
      properties:
        google_pay_receipt:
          type: string
        bundle_id:
          type: string
          default: ai.ibl.mentorai
        key:
          type: string
        name:
          type: string
      required:
        - google_pay_receipt
    GradingPerUser:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/GradingPerUserData'
        total:
          type: integer
          description: Total rows
    GradingPerUserData:
      type: object
      properties:
        username:
          type: string
          description: learner username
        full_name:
          type: string
          description: learner Name
        start_date:
          type: string
          description: Course enrollment date
        submissions:
          type: integer
          description: Total assessment submissions
        last_active:
          type: string
          description: Last active time
        percent:
          type: number
          format: double
          description: TStudent course grade
      required:
        - full_name
        - last_active
        - percent
        - start_date
        - submissions
        - username
    GreetingMethodEnum:
      enum:
        - proactive_prompt
        - proactive_response
      type: string
      description: |-
        * `proactive_prompt` - Proactive Prompt
        * `proactive_response` - Proactive Response
    GroupList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/GroupListData'
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - pagination
    GroupListData:
      type: object
      description: Serializer for department list endpoint
      properties:
        id:
          type: integer
        name:
          type: string
        platform:
          type: string
        courses_enrolled:
          type: integer
        courses_completed:
          type: integer
        completion_rate:
          type: number
          format: double
        pathways_completed:
          type: integer
        certificates_earned:
          type: integer
        skills_points:
          type: integer
        skills_earned:
          type: integer
        time_spent:
          type: string
      required:
        - certificates_earned
        - completion_rate
        - courses_completed
        - courses_enrolled
        - id
        - name
        - pathways_completed
        - platform
        - skills_earned
        - skills_points
        - time_spent
    GuidedPrompt:
      type: object
      properties:
        prompt:
          type: string
        icon:
          type: string
      required:
        - icon
        - prompt
    GuidedPromptsResponse:
      type: object
      properties:
        ai_prompts:
          type: array
          items:
            type: string
            description: AI suggested prompts
        results:
          type: array
          items:
            $ref: '#/components/schemas/GuidedPrompt'
      required:
        - ai_prompts
        - results
    HeygenMarketingVideoDetail:
      type: object
      properties:
        name:
          type: string
          maxLength: 1024
        data:
          nullable: true
        script:
          type: string
          nullable: true
        pk:
          type: integer
          readOnly: true
          title: ID
        video_file:
          type: string
          nullable: true
          readOnly: true
        generation_status:
          type: string
          readOnly: true
      required:
        - generation_status
        - pk
        - video_file
    HeygenMarketingVideoList:
      type: object
      properties:
        name:
          type: string
          maxLength: 1024
        data:
          nullable: true
        pk:
          type: integer
          readOnly: true
          title: ID
        generation_status:
          type: string
          readOnly: true
      required:
        - generation_status
        - pk
    HeygenTemplateRequest:
      type: object
      properties:
        template_id:
          type: string
        preview_image_url:
          type: string
          nullable: true
        name:
          type: string
      required:
        - name
        - template_id
    HeygenTemplateResponseSingle:
      type: object
      properties:
        template_id:
          type: string
          nullable: true
          readOnly: true
        preview_image_url:
          type: string
          nullable: true
          readOnly: true
        name:
          type: string
        provider:
          type: string
      required:
        - name
        - preview_image_url
        - provider
        - template_id
    HeygenVideoDetail:
      type: object
      properties:
        name:
          type: string
          maxLength: 1024
        data:
          nullable: true
        script:
          type: string
          nullable: true
        id:
          type: integer
          readOnly: true
        video_file:
          type: string
          nullable: true
          readOnly: true
        generation_status:
          type: string
          readOnly: true
      required:
        - generation_status
        - id
        - video_file
    HeygenVideoRequest:
      type: object
      properties:
        script:
          type: string
        name:
          type: string
        template_id:
          type: string
          nullable: true
      required:
        - name
        - script
    HumanSupportTicket:
      type: object
      description: >-
        serializer interface intended for students/ non-admin users.

        This limits students to only update the subject and description of a
        ticket.
      properties:
        id:
          type: integer
          readOnly: true
        username:
          type: string
          readOnly: true
        email:
          type: string
          readOnly: true
        full_name:
          type: string
          readOnly: true
        user:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          readOnly: true
        session:
          type: string
          format: uuid
          readOnly: true
        subject:
          type: string
          maxLength: 255
        description:
          type: string
        status:
          $ref: '#/components/schemas/HumanSupportTicketStatusEnum'
        mentor_id:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        resolved_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
      required:
        - created_at
        - description
        - email
        - full_name
        - id
        - mentor_id
        - resolved_at
        - session
        - subject
        - updated_at
        - user
        - username
    HumanSupportTicketStatusEnum:
      enum:
        - open
        - in_progress
        - closed
      type: string
      description: |-
        * `open` - Open
        * `in_progress` - In Progress
        * `closed` - Closed
    ImageUpload:
      type: object
      properties:
        file:
          type: string
          format: uri
      required:
        - file
    InputQuestion:
      type: object
      properties:
        text:
          type: string
          maxLength: 1024
        difficulty_level:
          type: integer
          maximum: 5
          minimum: 1
        possible_answers:
          type: array
          items:
            $ref: '#/components/schemas/IntialQuestionAnswer'
      required:
        - possible_answers
        - text
    Institution:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 100
        institution_type:
          $ref: '#/components/schemas/InstitutionTypeEnum'
        location:
          type: string
          nullable: true
          maxLength: 100
        website:
          type: string
          format: uri
          nullable: true
          maxLength: 255
        accreditation:
          type: string
          nullable: true
          maxLength: 100
        established_year:
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        data:
          nullable: true
          description: Metadata
        metadata:
          nullable: true
          description: Metadata
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - id
        - name
        - updated_at
    InstitutionTypeEnum:
      enum:
        - university
        - college
        - institute
        - academy
        - other
      type: string
      description: |-
        * `university` - University
        * `college` - College
        * `institute` - Institute
        * `academy` - Academy
        * `other` - Other
    IntegrationCredential:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        value: {}
        platform:
          type: string
          description: The platform key
        service_info:
          allOf:
            - $ref: '#/components/schemas/ExternalServiceInfo'
          readOnly: true
      required:
        - name
        - platform
        - service_info
    IntegrationCredentialSchema:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        schema: {}
        service_info:
          allOf:
            - $ref: '#/components/schemas/ExternalServiceInfo'
          readOnly: true
      required:
        - name
        - service_info
    IntialQuestionAnswer:
      type: object
      properties:
        text:
          type: string
          maxLength: 500
      required:
        - text
    InvoiceReportResponse:
      type: object
      description: Complete invoice report response.
      properties:
        entity:
          $ref: '#/components/schemas/Entity'
        billing_period:
          $ref: '#/components/schemas/BillingPeriod'
        summary:
          $ref: '#/components/schemas/Summary'
        breakdown:
          $ref: '#/components/schemas/Breakdown'
      required:
        - billing_period
        - entity
        - summary
    Issuer:
      type: object
      properties:
        name:
          type: string
          readOnly: true
        org:
          type: string
          readOnly: true
        entityId:
          type: string
        signatories:
          type: object
          additionalProperties:
            type: string
          readOnly: true
        url:
          type: string
          readOnly: true
        iconImage:
          type: string
        allowed_template_tags:
          nullable: true
      required:
        - entityId
        - iconImage
        - name
        - org
        - signatories
        - url
    IssuerAuthority:
      type: object
      properties:
        name:
          type: string
          maxLength: 254
        title:
          type: string
          maxLength: 254
        signature:
          type: string
          format: uri
          maxLength: 200
      required:
        - name
        - signature
        - title
    ItemTypeEnum:
      enum:
        - course
        - unit
        - resource
        - course_unit
        - course_resource
        - unit_resource
        - all
      type: string
      description: |-
        * `course` - Course
        * `unit` - Unit
        * `resource` - Resource
        * `course_unit` - Course and Unit
        * `course_resource` - Course and Resource
        * `unit_resource` - Unit and Resource
        * `all` - Course, Unit, and Resource
    JobRun:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        title:
          type: string
          maxLength: 400
        description:
          type: string
        session:
          type: string
          format: uuid
        active:
          type: boolean
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        steps:
          type: array
          items:
            $ref: '#/components/schemas/Step'
      required:
        - created_at
        - id
        - session
        - steps
        - title
        - updated_at
    KindEnum:
      enum:
        - KnowledgeGap
        - LessonsLearned
        - HelpRequest
      type: string
      description: |-
        * `KnowledgeGap` - KnowledgeGap
        * `LessonsLearned` - LessonsLearned
        * `HelpRequest` - HelpRequest
    LLMCredentialRequest:
      type: object
      properties:
        name:
          type: string
          description: Name of the credential provider
        value:
          description: Value of the credential provider
        platform:
          type: string
          description: Key of the tenant
      required:
        - name
        - platform
        - value
    LLMCredentialResponse:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        value: {}
        platform:
          type: string
          description: The platform key
        service_info:
          allOf:
            - $ref: '#/components/schemas/ExternalServiceInfo'
          readOnly: true
      required:
        - name
        - platform
        - service_info
    LLMCredentialSchema:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        schema: {}
        service_info:
          allOf:
            - $ref: '#/components/schemas/ExternalServiceInfo'
          readOnly: true
      required:
        - name
        - service_info
    LLMModelForTenant:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        llm_provider:
          type: string
          maxLength: 255
        llm_name:
          type: string
          maxLength: 255
        tenant:
          type: integer
          nullable: true
      required:
        - id
        - llm_name
        - llm_provider
    LLMQuestion:
      type: object
      description: |-
        Serializer for individual question data, including possible answers.

        Attributes:
            question_id (str): Unique identifier for the question.
            text (str): The text of the question.
            difficulty_level (Optional[int]): An optional difficulty level for the question.
            options (list[AnswerSerializer]): List of possible answers for the question.
      properties:
        text:
          type: string
          maxLength: 500
        difficulty_level:
          type: integer
          maximum: 5
          minimum: 1
        options:
          type: array
          items:
            $ref: '#/components/schemas/Answer'
      required:
        - options
        - text
    LLMResponse:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
          nullable: true
        metadata:
          nullable: true
        resource_ids:
          nullable: true
        tags:
          nullable: true
        overview:
          type: string
          nullable: true
        use_cases:
          type: string
          nullable: true
        documentation:
          type: string
          nullable: true
        sdk_samples:
          type: string
          nullable: true
        chat_models:
          nullable: true
        disabled_models:
          description: List of disabled models. If empty, all models are enabled.
        logo:
          type: string
          format: uri
          nullable: true
      required:
        - id
        - name
    LLMTracesListResponse:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        date:
          type: string
          format: date-time
      required:
        - date
        - id
        - name
    LanguagesView:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        code:
          type: string
          nullable: true
          maxLength: 255
      required:
        - id
        - name
    LauncherViewPostRequest:
      type: object
      properties:
        user_id:
          type: integer
        key:
          type: string
        name:
          type: string
        org:
          type: string
        lms_url:
          type: string
        cms_url:
          type: string
        portal_url:
          type: string
        use_default_hosts:
          type: boolean
      required:
        - key
        - user_id
    LearnerAnalyticsResponse:
      type: object
      description: Unified response serializer for learner analytics endpoint.
      properties:
        user:
          $ref: '#/components/schemas/UserInfo'
        summary:
          $ref: '#/components/schemas/LearnerSummary'
        results:
          type: array
          items:
            $ref: '#/components/schemas/LearnerAnalyticsResult'
        pagination:
          $ref: '#/components/schemas/Pagination'
        overtime:
          type: array
          items:
            $ref: '#/components/schemas/OvertimeDataPoint'
          description: Time spent over time data (when overtime=true)
        generated_at:
          type: string
          format: date-time
      required:
        - generated_at
        - pagination
        - results
        - summary
        - user
    LearnerAnalyticsResult:
      type: object
      description: >-
        Unified serializer for learner analytics results - handles both
        cross-platform and platform-specific data.
      properties:
        platform_id:
          type: integer
        platform_name:
          type: string
        platform_key:
          type: string
          nullable: true
        summary:
          $ref: '#/components/schemas/PlatformSummary'
        metrics:
          $ref: '#/components/schemas/PlatformMetrics'
        activity:
          $ref: '#/components/schemas/ActivityInfo'
        last_updated:
          type: string
          format: date-time
        user_id:
          type: integer
      required:
        - platform_id
        - platform_key
        - platform_name
    LearnerData:
      type: object
      properties:
        courses:
          type: array
          items:
            $ref: '#/components/schemas/CourseDetail'
        programs:
          type: array
          items:
            $ref: '#/components/schemas/ProgramDetail'
        pathways:
          type: array
          items:
            $ref: '#/components/schemas/PathwayDetail'
        mentors:
          type: array
          items:
            $ref: '#/components/schemas/MentorDetail'
        skills:
          $ref: '#/components/schemas/SkillsDetail'
        credentials:
          type: array
          items:
            $ref: '#/components/schemas/Credential'
        time_spent:
          $ref: '#/components/schemas/TimeSpentDetail'
    LearnerDetailsResponse:
      type: object
      properties:
        user:
          $ref: '#/components/schemas/UserInfo'
        data:
          $ref: '#/components/schemas/LearnerData'
      required:
        - data
        - user
    LearnerInformationAPI:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/LearnerInformationAPIData'
      required:
        - data
    LearnerInformationAPIData:
      type: object
      properties:
        username:
          type: string
          description: learner username
        name:
          type: string
          description: learner Name
        email:
          type: string
          description: learner email
        date_joined:
          type: string
          description: Registration Timestamp e.g 2022-05-05T00:00:00+00:00
        last_activity:
          type: string
          description: Last Activity Timestamp e.g 2022-05-05T00:00:00+00:00
        total_assessments:
          type: integer
          description: Total assessments attempted
        total_time_spent:
          type: integer
          description: Total time spent in seconds
        total_videos:
          type: integer
          description: Total videos watched
        course_completions:
          type: integer
          description: Total courses completed
        time_spent_overtime:
          type: object
          additionalProperties: {}
        continent:
          type: string
          description: last location - continent
        continent_code:
          type: string
          description: last location - continent code
        country:
          type: string
          description: last location - country
        country_code:
          type: string
          description: last location - country code
        region:
          type: string
          description: last location - region
        region_code:
          type: string
          description: last location - region code
        location:
          type: string
          description: last location
        city:
          type: string
          description: last location - city
        browser:
          type: string
          description: last known browser
        operating_system:
          type: string
          description: last known operating system
        resolution:
          type: string
          description: last known browser resolution
      required:
        - date_joined
        - email
        - last_activity
        - name
        - username
    LearnerListItem:
      type: object
      description: Serializer for individual learner in the list.
      properties:
        user_id:
          type: integer
          description: User ID
        username:
          type: string
          nullable: true
          description: Username
        email:
          type: string
          format: email
          nullable: true
          description: Email address
        name:
          type: string
          nullable: true
          description: Display name
        is_active:
          type: boolean
          description: Whether user is active
        platform_id:
          type: integer
          description: Platform ID
        platform_name:
          type: string
          nullable: true
          description: Platform name
        platform_key:
          type: string
          nullable: true
          description: Platform key
        metrics:
          allOf:
            - $ref: '#/components/schemas/LearnerMetrics'
          description: Learner metrics
        first_activity:
          type: string
          format: date-time
          nullable: true
          description: First activity date
        last_activity:
          type: string
          format: date-time
          nullable: true
          description: Last activity date
      required:
        - email
        - first_activity
        - is_active
        - last_activity
        - metrics
        - name
        - platform_id
        - platform_key
        - platform_name
        - user_id
        - username
    LearnerListPagination:
      type: object
      description: Serializer for learner list pagination.
      properties:
        page:
          type: integer
          description: Current page number
        limit:
          type: integer
          description: Records per page
        total_pages:
          type: integer
          description: Total number of pages
        total_records:
          type: integer
          description: Total number of records
        has_next:
          type: boolean
          description: Whether there is a next page
        has_previous:
          type: boolean
          description: Whether there is a previous page
        next_page:
          type: integer
          nullable: true
          description: Next page number
        previous_page:
          type: integer
          nullable: true
          description: Previous page number
      required:
        - has_next
        - has_previous
        - limit
        - next_page
        - page
        - previous_page
        - total_pages
        - total_records
    LearnerListResponse:
      type: object
      description: Serializer for learner list API response.
      properties:
        platform:
          allOf:
            - $ref: '#/components/schemas/PlatformInfo'
          description: Platform information
        learners:
          type: array
          items:
            $ref: '#/components/schemas/LearnerListItem'
          description: List of learners
        pagination:
          allOf:
            - $ref: '#/components/schemas/LearnerListPagination'
          description: Pagination metadata
        generated_at:
          type: string
          format: date-time
          description: Response generation timestamp
      required:
        - generated_at
        - learners
        - pagination
        - platform
    LearnerMetrics:
      type: object
      description: Serializer for learner metrics from UserPlatformSummary.
      properties:
        enrollments:
          type: integer
          description: Total enrollments
        programs:
          type: integer
          description: Total programs
        pathways:
          type: integer
          description: Total pathways
        resources:
          type: integer
          description: Total resources
        reported_skills:
          type: integer
          description: Reported skills count
        desired_skills:
          type: integer
          description: Desired skills count
        assigned_skills:
          type: integer
          description: Assigned skills count
        total_skills:
          type: integer
          description: Total skills count
        credentials:
          type: integer
          description: Credentials earned
        points:
          type: number
          format: double
          description: Total points
        total_time_spent_seconds:
          type: integer
          description: Total time spent in seconds
        top_content:
          allOf:
            - $ref: '#/components/schemas/TopContent'
          description: Course with most time spent
      required:
        - assigned_skills
        - credentials
        - desired_skills
        - enrollments
        - pathways
        - points
        - programs
        - reported_skills
        - resources
        - top_content
        - total_skills
        - total_time_spent_seconds
    LearnerSummary:
      type: object
      description: Serializer for learner summary data across all platforms.
      properties:
        total_time_spent_seconds:
          type: integer
          description: Total time spent across all platforms
      required:
        - total_time_spent_seconds
    LinkCourseRequest:
      type: object
      properties:
        course_id:
          type: string
      required:
        - course_id
    LinkCourseResponse:
      type: object
      properties:
        mentor_unique_id:
          type: string
        course_id:
          type: string
          nullable: true
        is_linked:
          type: boolean
      required:
        - is_linked
        - mentor_unique_id
    LlmProviderEnum:
      enum:
        - openai
        - google
      type: string
      description: |-
        * `openai` - Openai
        * `google` - Google
    LtiKey:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: Name of the RSA Key
        public_key:
          type: string
          readOnly: true
          description: Public Key in PEM format
        public_jwk:
          readOnly: true
          description: Public key in JWK format
        platform_key:
          type: string
          writeOnly: true
          description: Platform Key
      required:
        - id
        - name
        - platform_key
        - public_jwk
        - public_key
    LtiLaunchGate:
      type: object
      properties:
        allowed_keys:
          type: array
          items:
            type: string
        allowed_courses:
          type: array
          items:
            type: string
        allow_all_within_org:
          type: boolean
          default: false
          description: >-
            If True, a target_link_uri will work with any content within this
            org
    LtiMentor:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: The name of the mentor
        org:
          type: string
          readOnly: true
          description: The org of the mentor
        course_key:
          type: string
          readOnly: true
          description: The course key
        mentor_config:
          $ref: '#/components/schemas/LtiMentorCourseXBlock'
        platform_key:
          type: string
          writeOnly: true
          description: Platform key the requesting user belongs to
      required:
        - course_key
        - id
        - mentor_config
        - name
        - org
        - platform_key
    LtiMentorCourseXBlock:
      type: object
      properties:
        mentor:
          type: string
          description: The unique_id of the mentor
        location:
          type: string
          readOnly: true
          description: The xblock location of the mentor
      required:
        - location
        - mentor
    LtiTool:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        title:
          type: string
          description: The title of the tool
        issuer:
          type: string
          format: uri
          description: >-
            This value will look someting like https://example.com. Value
            provided by Lti 1.3 Platform.
        client_id:
          type: string
          description: The client id provided by Lti 1.3 Platform
        auth_login_url:
          type: string
          format: uri
          description: >-
            The Platforms OIDC Login endpoint. Value provided by LTI 1.3
            Platform.
        auth_token_url:
          type: string
          format: uri
          description: >-
            The Platforms OIDC Token endpoint. Value provided by LTI 1.3
            Platform.
        auth_audience:
          type: string
          nullable: true
          description: The platforms Oauth2 Audience (aud). Usually can be skipped.
        key_set_url:
          type: string
          format: uri
          nullable: true
          description: The platforms JWKS endpoint. Value provided by LTI 1.3 Platform.
        key_set:
          nullable: true
          default: ''
          description: >-
            In case Platform's JWKS endpoint is not available, you can provide
            the JWKS here. Value provided by LTI 1.3 Platform.
        tool_key:
          type: integer
          description: Reference to Lti Tool
        deployment_ids:
          type: array
          items:
            type: string
          description: >-
            List of deployment ids. Example: ["1", "deployment-2"]. Value(s)
            provided by LTI 1.3 Platform.
        platform_key:
          type: string
          writeOnly: true
        launch_gate:
          $ref: '#/components/schemas/LtiLaunchGate'
      required:
        - auth_login_url
        - auth_token_url
        - client_id
        - deployment_ids
        - id
        - issuer
        - launch_gate
        - platform_key
        - title
        - tool_key
    MCPServer:
      type: object
      description: Serializer for the MCPServer model.
      properties:
        id:
          type: integer
          readOnly: true
        platform:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        url:
          type: string
          format: uri
          description: The url of the MCP server.
          maxLength: 200
        image:
          type: string
          format: uri
          nullable: true
        transport:
          $ref: '#/components/schemas/TransportEnum'
        extra_headers:
          description: Headers to send to the MCP server. Useful for authentication,
        platform_key:
          type: string
          readOnly: true
        is_featured:
          type: boolean
          description: Featured mcp servers will be accessible to all other tenants.
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - id
        - name
        - platform
        - platform_key
        - updated_at
        - url
    ManagerAuthToken:
      type: object
      description: Manager auth token serializer
      properties:
        token:
          type: string
          readOnly: true
          description: Token key
        expires:
          type: string
          format: date-time
          description: Token expiration
      required:
        - expires
        - token
    MarkAllReadRequest:
      type: object
      description: Serializer for the request to mark notifications as read.
      properties:
        notification_ids:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Optional list of notification IDs to mark as read. If not provided,
            all unread notifications will be marked as read.
    MarkAllReadResponse:
      type: object
      description: Serializer for the response when marking all notifications as read.
      properties:
        message:
          type: string
        count:
          type: integer
      required:
        - count
        - message
    MaskedIntegrationCredential:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        value: {}
        platform:
          type: string
          description: The platform key
        service_info:
          allOf:
            - $ref: '#/components/schemas/ExternalServiceInfo'
          readOnly: true
      required:
        - name
        - platform
        - service_info
    MaskedLLMCredential:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        value: {}
        platform:
          type: string
          description: The platform key
        service_info:
          allOf:
            - $ref: '#/components/schemas/ExternalServiceInfo'
          readOnly: true
      required:
        - name
        - platform
        - service_info
    MediaResource:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        title:
          type: string
          description: Title of the media resource
          maxLength: 255
        description:
          type: string
          nullable: true
          description: Description of the media resource
        media_type:
          allOf:
            - $ref: '#/components/schemas/MediaTypeEnum'
          description: |-
            Type of media

            * `video` - Video
            * `image` - Image
            * `document` - Document
            * `audio` - Audio
            * `other` - Other
        item_type:
          allOf:
            - $ref: '#/components/schemas/ItemTypeEnum'
          readOnly: true
          description: |-
            Type of item this media is associated with

            * `course` - Course
            * `unit` - Unit
            * `resource` - Resource
            * `course_unit` - Course and Unit
            * `course_resource` - Course and Resource
            * `unit_resource` - Unit and Resource
            * `all` - Course, Unit, and Resource
        course_id:
          type: string
          nullable: true
          description: ID of the associated course
          maxLength: 255
        unit_id:
          type: string
          nullable: true
          description: ID of the associated unit
          maxLength: 255
        item_id:
          type: string
          nullable: true
          description: ID of the associated item (resource)
          maxLength: 255
        platform:
          type: integer
          readOnly: true
          description: The platform this media resource belongs to
        file_url:
          type: string
          format: uri
          nullable: true
          description: External URL for the media resource
          maxLength: 1000
        file:
          type: string
          format: uri
          nullable: true
          description: Uploaded media file
        created_by:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: User who created this media resource
          readOnly: true
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: When this record was created
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: When this record was last updated
      required:
        - created_at
        - created_by
        - id
        - item_type
        - media_type
        - platform
        - title
        - updated_at
    MediaTypeEnum:
      enum:
        - video
        - image
        - document
        - audio
        - other
      type: string
      description: |-
        * `video` - Video
        * `image` - Image
        * `document` - Document
        * `audio` - Audio
        * `other` - Other
    MemoryComponentData:
      type: object
      properties:
        kind:
          $ref: '#/components/schemas/KindEnum'
        content:
          type: string
      required:
        - content
    MemoryComponentMemory:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/MemoryComponentData'
          readOnly: true
      required:
        - data
    MemoryComponentMemoryDetail:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/MemoryComponentData'
        catalog_item:
          type: string
          readOnly: true
        mentor_unique_id:
          type: string
          readOnly: true
        student:
          type: string
          readOnly: true
        inserted_at:
          type: string
          readOnly: true
      required:
        - catalog_item
        - data
        - inserted_at
        - mentor_unique_id
        - student
    MemoryComponentResponse:
      type: object
      properties:
        knowledge_gaps:
          type: array
          items:
            type: string
          readOnly: true
        lessons_learned:
          type: array
          items:
            type: string
          readOnly: true
        help_requests:
          type: array
          items:
            type: string
          readOnly: true
      required:
        - help_requests
        - knowledge_gaps
        - lessons_learned
    MemoryProgress:
      type: object
      properties:
        memory_type:
          type: string
          readOnly: true
        all_units:
          type: integer
          nullable: true
          readOnly: true
        all_unit_names:
          type: array
          items:
            type: string
          nullable: true
          readOnly: true
        current_unit:
          type: integer
          nullable: true
          readOnly: true
        current_unit_name:
          type: string
          nullable: true
          readOnly: true
        item_name:
          type: string
          nullable: true
          readOnly: true
      required:
        - all_unit_names
        - all_units
        - current_unit
        - current_unit_name
        - item_name
        - memory_type
    MemoryStatusRequestView:
      type: object
      properties:
        enabled:
          type: boolean
          description: Enable or disable memory use
      required:
        - enabled
    MemoryStatusView:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        username:
          type: string
          maxLength: 500
        platform_key:
          type: string
          maxLength: 500
        enabled:
          type: boolean
      required:
        - id
        - platform_key
        - username
    Mentor:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        unique_id:
          type: string
          format: uuid
        flow:
          nullable: true
          description: The langflow json for the mentor
        slug:
          type: string
          maxLength: 255
          pattern: ^[-a-zA-Z0-9_]+$
        platform:
          type: string
          maxLength: 255
        allow_anonymous:
          type: boolean
        metadata:
          nullable: true
        enable_moderation:
          type: boolean
        enable_multi_query_rag:
          type: boolean
        enable_post_processing_system:
          type: boolean
        enable_openai_assistant:
          type: boolean
          description: (Deprecated) Set template mentor to openai-agent instead.
        enable_total_grounding:
          type: boolean
          description: >-
            Whether to force mentor to only use information within the provided
            documents.
        enable_suggested_prompts:
          type: boolean
          description: >-
            Whether to show suggested prompts for the mentor or not. Note:
            Suggested prompts are created by tenant admins.
        enable_guided_prompts:
          type: boolean
          description: >-
            Whether to show suggested prompts for the mentor or not. Note:
            Guided prompts are created with an llm based on chat history.
        guided_prompt_instructions:
          type: string
          description: Instructions to determine how prompt suggestions are generated.
        google_voice:
          type: integer
          nullable: true
        openai_voice:
          type: integer
          nullable: true
        categories:
          type: array
          items:
            $ref: '#/components/schemas/MentorCategory'
        types:
          type: array
          items:
            $ref: '#/components/schemas/MentorType'
        subjects:
          type: array
          items:
            $ref: '#/components/schemas/Subject'
        proactive_prompt:
          type: string
          description: >-
            Prompt template used to start a conversation with the user when
            greeting_type is proactive_prompt. This will be sent to the LLM so
            it can respond naturally
        disclaimer:
          type: string
          description: Disclaimer to be shown to the user when the mentor is used.
        enable_disclaimer:
          type: boolean
        embed_is_context_aware:
          type: boolean
          description: Allow embedded mentor to read content on the embedded web page.
        embed_open_by_default:
          type: boolean
          description: Open mentor embed iframe by default.
        embed_show_attachment:
          type: boolean
          description: Show attachments on embedded mentor.
        embed_show_voice_call:
          type: boolean
          description: Show voice call button on embedded mentor.
        embed_show_voice_record:
          type: boolean
          description: Show voice recording button on embedded mentor.
        placeholder_prompt:
          type: string
          description: >-
            Placeholder to be shown in the input text area when the mentor is
            used.
        moderation_system_prompt:
          type: string
          description: >-
            The prompt for the moderation system. This prompt must clearly
            distinguish between 'Approapriate' and 'Not Appropriate' queries.
        post_processing_prompt:
          type: string
          description: >-
            Prompt to be used to alter or modify final llm response into any
            desired form.
        moderation_response:
          type: string
          description: >-
            Desired feedback to return to the user when their prompt is deemed
            inappropriate.
        safety_system_prompt:
          type: string
          description: Prompt to check whether the models response is appropriate or not.
        safety_response:
          type: string
          description: >-
            Feedback given to the user when a model generates an inappropriate
            response
        enable_safety_system:
          type: boolean
        proactive_response:
          type: string
          description: Response to start a conversation with a user.
        greeting_method:
          allOf:
            - $ref: '#/components/schemas/GreetingMethodEnum'
          description: >-
            How the mentor should greet the user. proactive_prompt: Allow the
            LLM to respond to proactive_prompt msg. proactive_response: use
            proactive_response template without performing an LLM call.


            * `proactive_prompt` - Proactive Prompt

            * `proactive_response` - Proactive Response
        call_configuration:
          $ref: '#/components/schemas/CallConfiguration'
        mcp_servers:
          type: array
          items:
            $ref: '#/components/schemas/MCPServer'
        last_accessed_by:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          nullable: true
        recently_accessed_at:
          type: string
          format: date-time
          nullable: true
        created_by:
          type: string
          nullable: true
          maxLength: 255
        created_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
      required:
        - categories
        - created_at
        - id
        - mcp_servers
        - name
        - subjects
        - types
        - updated_at
    MentorAudience:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
          nullable: true
          maxLength: 255
      required:
        - id
        - name
    MentorBreakdown:
      type: object
      description: Mentor cost breakdown.
      properties:
        mentor:
          type: string
        cost:
          type: string
          format: decimal
          pattern: ^-?\d{0,9}(?:\.\d{0,3})?$
        sessions:
          type: integer
        mentor_name:
          type: string
      required:
        - cost
        - mentor
        - sessions
    MentorCategory:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
          nullable: true
          maxLength: 255
        category_group:
          type: integer
          nullable: true
        audience:
          $ref: '#/components/schemas/MentorAudience'
        audiences:
          type: array
          items:
            $ref: '#/components/schemas/MentorAudience'
      required:
        - audience
        - audiences
        - id
        - name
    MentorCategoryCreate:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        category_group:
          type: integer
          nullable: true
        description:
          type: string
          nullable: true
          maxLength: 255
        audience:
          type: integer
          nullable: true
          description: >-
            Deprecated: This is only left for backward compatibility. Please use
            the audiences field instead.
        audiences:
          type: array
          items:
            type: integer
      required:
        - id
        - name
    MentorCategoryGroup:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
        audience:
          $ref: '#/components/schemas/MentorAudience'
        date_created:
          type: string
          format: date-time
          readOnly: true
        categories:
          type: array
          items:
            $ref: '#/components/schemas/MentorCategory'
        audiences:
          type: array
          items:
            $ref: '#/components/schemas/MentorAudience'
      required:
        - audience
        - audiences
        - categories
        - date_created
        - description
        - id
        - name
    MentorCategoryGroupCreate:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
        audience:
          type: integer
          nullable: true
          description: >-
            Deprecated: This is only left for backward compatibility. Please use
            the audiences field instead.
        audiences:
          type: array
          items:
            type: integer
        date_created:
          type: string
          format: date-time
          readOnly: true
      required:
        - date_created
        - description
        - id
        - name
    MentorCreate:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        unique_id:
          type: string
          format: uuid
        flow:
          nullable: true
          description: The langflow json for the mentor
        slug:
          type: string
          maxLength: 255
          pattern: ^[-a-zA-Z0-9_]+$
        platform:
          type: string
          maxLength: 255
        allow_anonymous:
          type: boolean
        metadata:
          nullable: true
        enable_moderation:
          type: boolean
        enable_multi_query_rag:
          type: boolean
        enable_post_processing_system:
          type: boolean
        enable_openai_assistant:
          type: boolean
          description: (Deprecated) Set template mentor to openai-agent instead.
        enable_total_grounding:
          type: boolean
          description: >-
            Whether to force mentor to only use information within the provided
            documents.
        enable_suggested_prompts:
          type: boolean
          description: >-
            Whether to show suggested prompts for the mentor or not. Note:
            Suggested prompts are created by tenant admins.
        enable_guided_prompts:
          type: boolean
          description: >-
            Whether to show suggested prompts for the mentor or not. Note:
            Guided prompts are created with an llm based on chat history.
        google_voice:
          type: integer
          nullable: true
        openai_voice:
          type: integer
          nullable: true
        guided_prompt_instructions:
          type: string
          description: Instructions to determine how prompt suggestions are generated.
        categories:
          type: array
          items:
            type: integer
        types:
          type: array
          items:
            type: integer
        subjects:
          type: array
          items:
            type: integer
        proactive_prompt:
          type: string
          description: >-
            Prompt template used to start a conversation with the user when
            greeting_type is proactive_prompt. This will be sent to the LLM so
            it can respond naturally
        disclaimer:
          type: string
          description: Disclaimer to be shown to the user when the mentor is used.
        enable_disclaimer:
          type: boolean
        embed_is_context_aware:
          type: boolean
          description: Allow embedded mentor to read content on the embedded web page.
        embed_open_by_default:
          type: boolean
          description: Open mentor embed iframe by default.
        embed_show_attachment:
          type: boolean
          description: Show attachments on embedded mentor.
        embed_show_voice_call:
          type: boolean
          description: Show voice call button on embedded mentor.
        embed_show_voice_record:
          type: boolean
          description: Show voice recording button on embedded mentor.
        placeholder_prompt:
          type: string
          description: >-
            Placeholder to be shown in the input text area when the mentor is
            used.
        moderation_system_prompt:
          type: string
          description: >-
            The prompt for the moderation system. This prompt must clearly
            distinguish between 'Approapriate' and 'Not Appropriate' queries.
        post_processing_prompt:
          type: string
          description: >-
            Prompt to be used to alter or modify final llm response into any
            desired form.
        moderation_response:
          type: string
          description: >-
            Desired feedback to return to the user when their prompt is deemed
            inappropriate.
        safety_system_prompt:
          type: string
          description: Prompt to check whether the models response is appropriate or not.
        safety_response:
          type: string
          description: >-
            Feedback given to the user when a model generates an inappropriate
            response
        disable_chathistory:
          type: boolean
        enable_safety_system:
          type: boolean
        proactive_response:
          type: string
          description: Response to start a conversation with a user.
        mcp_servers:
          type: array
          items:
            type: integer
        greeting_method:
          allOf:
            - $ref: '#/components/schemas/GreetingMethodEnum'
          description: >-
            How the mentor should greet the user. proactive_prompt: Allow the
            LLM to respond to proactive_prompt msg. proactive_response: use
            proactive_response template without performing an LLM call.


            * `proactive_prompt` - Proactive Prompt

            * `proactive_response` - Proactive Response
        last_accessed_by:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          nullable: true
        recently_accessed_at:
          type: string
          format: date-time
          nullable: true
        created_by:
          type: string
          nullable: true
          maxLength: 255
        created_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
      required:
        - created_at
        - name
        - updated_at
    MentorCustomVoice:
      type: object
      properties:
        voice_provider:
          type: string
        voice_name:
          type: string
          nullable: true
      required:
        - voice_provider
    MentorCustomVoiceResponse:
      type: object
      properties:
        voice_provider:
          type: string
          readOnly: true
        voice_name:
          type: string
          readOnly: true
      required:
        - voice_name
        - voice_provider
    MentorData:
      type: object
      properties:
        mentor_unique_id:
          type: string
        mentor_name:
          type: string
        total_cost:
          type: number
          format: double
        mentor_sessions:
          type: array
          items:
            $ref: '#/components/schemas/MentorSession'
      required:
        - mentor_name
        - mentor_sessions
        - mentor_unique_id
        - total_cost
    MentorDetail:
      type: object
      properties:
        mentor_id:
          type: string
        name:
          type: string
        slug:
          type: string
        platform_key:
          type: string
          nullable: true
        categories:
          type: array
          items:
            type: string
        subjects:
          type: array
          items:
            type: string
        interactions:
          $ref: '#/components/schemas/MentorInteractions'
      required:
        - interactions
        - mentor_id
        - name
        - slug
    MentorDetailAnalytics:
      type: object
      properties:
        total_mentors:
          type: integer
        active_mentors:
          type: integer
        total_questions_answered:
          type: integer
        total_ratings:
          type: integer
      required:
        - active_mentors
        - total_mentors
        - total_questions_answered
        - total_ratings
    MentorEval:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        mentor:
          type: string
          readOnly: true
        questions:
          type: array
          items:
            $ref: '#/components/schemas/MentorEvalQuestion'
          readOnly: true
        eval_id:
          type: string
          format: uuid
        name:
          type: string
          nullable: true
        passing_score:
          type: integer
          maximum: 2147483647
          minimum: 0
        evaluation_prompt:
          type: string
        question_set:
          type: integer
          nullable: true
      required:
        - id
        - mentor
        - questions
    MentorEvalQuestion:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        content:
          type: string
        sample_answer:
          type: string
          nullable: true
      required:
        - content
        - id
    MentorEvalQuestionRequest:
      type: object
      properties:
        content:
          type: string
        sample_answer:
          type: string
          nullable: true
      required:
        - content
    MentorEvalReport:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        mentor_eval:
          type: string
          readOnly: true
        mentor:
          type: string
          readOnly: true
        conversation_ratings:
          type: array
          items:
            $ref: '#/components/schemas/ConversationRating'
          readOnly: true
        overall_score:
          type: number
          format: double
          readOnly: true
        is_passed:
          type: boolean
          readOnly: true
        generated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - conversation_ratings
        - generated_at
        - id
        - is_passed
        - mentor
        - mentor_eval
        - overall_score
    MentorEvalRequest:
      type: object
      properties:
        id:
          type: integer
          nullable: true
        name:
          type: string
          nullable: true
        passing_score:
          type: integer
          nullable: true
        questions:
          type: array
          items:
            $ref: '#/components/schemas/MentorEvalQuestionRequest'
          nullable: true
        evaluation_prompt:
          type: string
          nullable: true
    MentorFacet:
      type: object
      description: Serializer for mentor facets
      properties:
        total:
          type: integer
          description: Total number of mentors in this facet
        terms:
          type: object
          additionalProperties: {}
          description: Terms and their counts in this facet
        other:
          type: integer
          description: Count of mentors not in any term
      required:
        - other
        - terms
        - total
    MentorFork:
      type: object
      properties:
        new_mentor_name:
          type: string
        destination_platform_key:
          type: string
        clone_documents:
          type: boolean
          default: false
      required:
        - destination_platform_key
        - new_mentor_name
    MentorFromTemplateWithSettingRequest:
      type: object
      properties:
        template_name:
          type: string
        display_name:
          type: string
        description:
          type: string
        profile_image:
          type: string
          format: uri
        initial_message:
          type: string
        suggested_message:
          type: string
        new_mentor_name:
          type: string
        theme:
          type: string
        user_message_color:
          type: string
        mentor_bubble_color:
          type: string
        align_mentor_bubble:
          type: string
        system_prompt:
          type: string
        llm_provider:
          type: string
        llm_name:
          type: string
        mentor_visibility:
          type: string
        enable_image_generation:
          type: boolean
        enable_web_browsing:
          type: boolean
        enable_code_interpreter:
          type: boolean
        metadata: {}
        custom_css:
          type: string
        uploaded_profile_image:
          type: string
          format: uri
        proactive_response:
          type: string
        greeting_method:
          $ref: '#/components/schemas/GreetingMethodEnum'
        forkable:
          type: boolean
        forkable_with_training_data:
          type: boolean
        categories:
          type: array
          items:
            type: integer
            description: ID of the mentor category
        types:
          type: array
          items:
            type: integer
            description: ID of the mentor type
        subjects:
          type: array
          items:
            type: integer
            description: ID of the subject
        tool_slugs:
          type: array
          items:
            type: string
            description: slug of the tool
        llm_temperature:
          type: number
          format: double
          minimum: 0
          maximum: 1
        seo_tags: {}
        marketing_conversations: {}
        proactive_prompt:
          type: string
        disclaimer:
          type: string
        enable_disclaimer:
          type: boolean
        embed_is_context_aware:
          type: boolean
        embed_open_by_default:
          type: boolean
        embed_show_attachment:
          type: boolean
        embed_show_voice_call:
          type: boolean
        embed_show_voice_record:
          type: boolean
        placeholder_prompt:
          type: string
        moderation_system_prompt:
          type: string
        post_processing_prompt:
          type: string
        moderation_response:
          type: string
        enable_moderation:
          type: boolean
          default: false
        enable_multi_query_rag:
          type: boolean
          default: false
        enable_post_processing_system:
          type: boolean
          default: false
        enable_openai_assistant:
          type: boolean
        enable_total_grounding:
          type: boolean
          default: false
        google_voice:
          type: integer
        openai_voice:
          type: integer
        enable_suggested_prompts:
          type: boolean
          nullable: true
        enable_guided_prompts:
          type: boolean
          nullable: true
        mcp_servers:
          type: array
          items:
            type: integer
          nullable: true
        guided_prompt_instructions:
          type: string
          nullable: true
      required:
        - new_mentor_name
        - template_name
    MentorInteractions:
      type: object
      properties:
        total_messages:
          type: integer
        latest_interaction:
          type: string
          format: date-time
          nullable: true
        rating:
          type: number
          format: double
          nullable: true
      required:
        - total_messages
    MentorMemorySettingsRequest:
      type: object
      properties:
        item_type:
          type: string
          nullable: true
        item_identifier:
          type: string
          nullable: true
        learner_advance_correct_rate:
          type: number
          format: double
          nullable: true
        learner_advance_question_count:
          type: integer
          nullable: true
    MentorMemorySettingsResponse:
      type: object
      properties:
        item_type:
          type: string
          nullable: true
          readOnly: true
        item_identifier:
          type: string
          nullable: true
          readOnly: true
        learner_advance_correct_rate:
          type: number
          format: double
          nullable: true
        learner_advance_question_count:
          type: integer
          nullable: true
      required:
        - item_identifier
        - item_type
    MentorMetadata:
      type: object
      properties:
        metadata: {}
        mentor:
          type: string
        mentor_id:
          type: integer
      required:
        - metadata
    MentorPolicy:
      type: object
      description: >-
        Serializer for mentor-specific RBAC policies using ModelSerializer
        pattern.

        Accepts mentor_id and role, generates resources and role internally.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          readOnly: true
          description: Policy name. If not supplied, defaults to a UUID4
        platform_key:
          type: string
          description: Platform key where the mentor belongs
          writeOnly: true
        mentor_id:
          type: integer
          writeOnly: true
          description: ID of the mentor to manage access for
        role:
          type: string
          description: Role for accessing this mentor (viewer or editor)
        resources:
          readOnly: true
          description: List of resources this policy applies to
        users:
          type: array
          items:
            $ref: '#/components/schemas/RbacUser'
          readOnly: true
        groups:
          type: array
          items:
            $ref: '#/components/schemas/RbacPolicyGroup'
          readOnly: true
        groups_to_add:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of group IDs to grant access to this mentor
        groups_to_remove:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of group IDs to revoke access from this mentor
        users_to_add:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of user IDs to grant access to this mentor
        users_to_remove:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of user IDs to revoke access from this mentor
      required:
        - groups
        - id
        - mentor_id
        - name
        - platform_key
        - resources
        - role
        - users
    MentorScenario:
      type: object
      properties:
        display:
          type: string
          nullable: true
        name:
          type: string
        prompts:
          type: array
          items:
            $ref: '#/components/schemas/MentorScenarioPrompt'
      required:
        - name
        - prompts
    MentorScenarioPrompt:
      type: object
      properties:
        summary:
          type: string
        content:
          type: string
        icon:
          type: string
      required:
        - content
        - summary
    MentorSearchResponse:
      type: object
      description: Response serializer for MentorSearchView
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/Mentor'
          description: List of mentors matching the search criteria
        count:
          type: integer
          description: Total number of mentors matching the search criteria
        next:
          type: string
          format: uri
          nullable: true
          description: URL for the next page of results
        previous:
          type: string
          format: uri
          nullable: true
          description: URL for the previous page of results
        current_page:
          type: integer
          description: Current page number
        total_pages:
          type: integer
          description: Total number of pages
        facets:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/MentorFacet'
          description: Facet information for filtering
      required:
        - count
        - current_page
        - next
        - previous
        - results
        - total_pages
    MentorSession:
      type: object
      properties:
        session_id:
          type: string
        cost:
          type: number
          format: double
      required:
        - cost
        - session_id
    MentorSettings:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        display_name:
          type: string
          nullable: true
          maxLength: 255
        profile_image:
          type: string
          nullable: true
        initial_message:
          type: string
          nullable: true
        suggested_message:
          type: string
          nullable: true
        theme:
          $ref: '#/components/schemas/ThemeEnum'
        user_message_color:
          type: string
          maxLength: 7
        mentor_bubble_color:
          type: string
          maxLength: 7
        align_mentor_bubble:
          $ref: '#/components/schemas/AlignMentorBubbleEnum'
        mentor:
          type: string
          readOnly: true
        mentor_slug:
          type: string
          readOnly: true
        mentor_unique_id:
          type: string
          readOnly: true
        mentor_id:
          type: integer
          readOnly: true
        metadata:
          readOnly: true
        mentor_visibility:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/MentorVisibilityEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        enable_image_generation:
          type: boolean
          nullable: true
        enable_web_browsing:
          type: boolean
          nullable: true
        enable_code_interpreter:
          type: boolean
          nullable: true
        enable_memory_component:
          type: boolean
          readOnly: true
        custom_css:
          type: string
          nullable: true
        allow_anonymous:
          type: boolean
          readOnly: true
        mentor_description:
          type: string
          readOnly: true
        suggested_prompts:
          readOnly: true
        proactive_response:
          type: string
          readOnly: true
        greeting_method:
          type: string
          readOnly: true
        mentor_tools:
          readOnly: true
        can_use_tools:
          type: boolean
          readOnly: true
        llm_name:
          type: string
          readOnly: true
        proactive_prompt:
          type: string
          readOnly: true
        disclaimer:
          type: string
          readOnly: true
        enable_disclaimer:
          type: boolean
          readOnly: true
        embed_is_context_aware:
          type: boolean
          readOnly: true
        embed_open_by_default:
          type: boolean
          readOnly: true
        embed_show_attachment:
          type: boolean
          readOnly: true
        embed_show_voice_call:
          type: boolean
          readOnly: true
        embed_show_voice_record:
          type: boolean
          readOnly: true
        placeholder_prompt:
          type: string
          readOnly: true
        enable_email_chat:
          type: boolean
          readOnly: true
        enable_spaced_repetition:
          type: boolean
          readOnly: true
        enable_instruction_mode:
          type: boolean
          readOnly: true
        enable_socratic_mode:
          type: boolean
          readOnly: true
        is_guided_mentor:
          type: boolean
          readOnly: true
        enable_guided_prompts:
          type: boolean
          readOnly: true
        enable_moderation:
          type: boolean
          readOnly: true
        enable_multi_query_rag:
          type: boolean
          readOnly: true
        enable_post_processing_system:
          type: boolean
          readOnly: true
        enable_safety_system:
          type: boolean
          readOnly: true
        forkable:
          type: boolean
          readOnly: true
        forkable_with_training_data:
          type: boolean
          readOnly: true
        mentor_name:
          type: string
          readOnly: true
        categories:
          type: array
          items:
            $ref: '#/components/schemas/MentorCategory'
          readOnly: true
        types:
          type: array
          items:
            $ref: '#/components/schemas/MentorType'
          readOnly: true
        subjects:
          type: array
          items:
            $ref: '#/components/schemas/Subject'
          readOnly: true
        recently_accessed_at:
          type: string
          format: date-time
          readOnly: true
        created_by:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        llm_config:
          readOnly: true
        system_prompt:
          type: string
          readOnly: true
        llm_provider:
          type: string
          readOnly: true
        llm_temperature:
          type: number
          format: double
          readOnly: true
        safety_system_prompt:
          type: string
          readOnly: true
        safety_response:
          type: string
          readOnly: true
        moderation_system_prompt:
          type: string
          readOnly: true
        post_processing_prompt:
          type: string
          readOnly: true
        moderation_response:
          type: string
          readOnly: true
        mcp_servers:
          type: array
          items:
            $ref: '#/components/schemas/MCPServer'
          readOnly: true
        department:
          type: string
          readOnly: true
        disable_chathistory:
          type: string
          readOnly: true
        call_configuration:
          allOf:
            - $ref: '#/components/schemas/CallConfiguration'
          readOnly: true
        guided_prompt_instructions:
          type: string
          readOnly: true
        seo_tags:
          readOnly: true
        marketing_conversations:
          readOnly: true
        template_mentor:
          readOnly: true
        google_voice:
          type: string
          readOnly: true
        openai_voice:
          type: string
          readOnly: true
        enable_openai_assistant:
          type: boolean
          readOnly: true
        enable_total_grounding:
          type: boolean
          readOnly: true
        enable_suggested_prompts:
          type: boolean
          readOnly: true
        is_deleted:
          type: boolean
          readOnly: true
      required:
        - allow_anonymous
        - call_configuration
        - can_use_tools
        - categories
        - created_at
        - created_by
        - department
        - disable_chathistory
        - disclaimer
        - embed_is_context_aware
        - embed_open_by_default
        - embed_show_attachment
        - embed_show_voice_call
        - embed_show_voice_record
        - enable_disclaimer
        - enable_email_chat
        - enable_guided_prompts
        - enable_instruction_mode
        - enable_memory_component
        - enable_moderation
        - enable_multi_query_rag
        - enable_openai_assistant
        - enable_post_processing_system
        - enable_safety_system
        - enable_socratic_mode
        - enable_spaced_repetition
        - enable_suggested_prompts
        - enable_total_grounding
        - forkable
        - forkable_with_training_data
        - google_voice
        - greeting_method
        - guided_prompt_instructions
        - id
        - is_deleted
        - is_guided_mentor
        - llm_config
        - llm_name
        - llm_provider
        - llm_temperature
        - marketing_conversations
        - mcp_servers
        - mentor
        - mentor_description
        - mentor_id
        - mentor_name
        - mentor_slug
        - mentor_tools
        - mentor_unique_id
        - metadata
        - moderation_response
        - moderation_system_prompt
        - openai_voice
        - placeholder_prompt
        - platform_key
        - post_processing_prompt
        - proactive_prompt
        - proactive_response
        - recently_accessed_at
        - safety_response
        - safety_system_prompt
        - seo_tags
        - subjects
        - suggested_prompts
        - system_prompt
        - template_mentor
        - types
        - updated_at
    MentorSettingsPublic:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        display_name:
          type: string
          nullable: true
          maxLength: 255
        profile_image:
          type: string
          nullable: true
        initial_message:
          type: string
          nullable: true
        suggested_message:
          type: string
          nullable: true
        theme:
          $ref: '#/components/schemas/ThemeEnum'
        user_message_color:
          type: string
          maxLength: 7
        mentor_bubble_color:
          type: string
          maxLength: 7
        align_mentor_bubble:
          $ref: '#/components/schemas/AlignMentorBubbleEnum'
        mentor:
          type: string
          readOnly: true
        mentor_slug:
          type: string
          readOnly: true
        mentor_unique_id:
          type: string
          readOnly: true
        mentor_id:
          type: integer
          readOnly: true
        metadata:
          readOnly: true
        mentor_visibility:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/MentorVisibilityEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        enable_image_generation:
          type: boolean
          nullable: true
        enable_web_browsing:
          type: boolean
          nullable: true
        enable_code_interpreter:
          type: boolean
          nullable: true
        enable_memory_component:
          type: boolean
          readOnly: true
        custom_css:
          type: string
          nullable: true
        allow_anonymous:
          type: boolean
          readOnly: true
        mentor_description:
          type: string
          readOnly: true
        suggested_prompts:
          readOnly: true
        proactive_response:
          type: string
          readOnly: true
        greeting_method:
          type: string
          readOnly: true
        mentor_tools:
          readOnly: true
        can_use_tools:
          type: boolean
          readOnly: true
        llm_name:
          type: string
          readOnly: true
        proactive_prompt:
          type: string
          readOnly: true
        disclaimer:
          type: string
          readOnly: true
        enable_disclaimer:
          type: boolean
          readOnly: true
        embed_is_context_aware:
          type: boolean
          readOnly: true
        embed_open_by_default:
          type: boolean
          readOnly: true
        embed_show_attachment:
          type: boolean
          readOnly: true
        embed_show_voice_call:
          type: boolean
          readOnly: true
        embed_show_voice_record:
          type: boolean
          readOnly: true
        placeholder_prompt:
          type: string
          readOnly: true
        enable_email_chat:
          type: boolean
          readOnly: true
        enable_spaced_repetition:
          type: boolean
          readOnly: true
        enable_instruction_mode:
          type: boolean
          readOnly: true
        enable_socratic_mode:
          type: boolean
          readOnly: true
        is_guided_mentor:
          type: boolean
          readOnly: true
        enable_guided_prompts:
          type: boolean
          readOnly: true
        enable_moderation:
          type: boolean
          readOnly: true
        enable_multi_query_rag:
          type: boolean
          readOnly: true
        enable_post_processing_system:
          type: boolean
          readOnly: true
        enable_safety_system:
          type: boolean
          readOnly: true
        forkable:
          type: boolean
          readOnly: true
        forkable_with_training_data:
          type: boolean
          readOnly: true
        mentor_name:
          type: string
          readOnly: true
        categories:
          type: array
          items:
            $ref: '#/components/schemas/MentorCategory'
          readOnly: true
        types:
          type: array
          items:
            $ref: '#/components/schemas/MentorType'
          readOnly: true
        subjects:
          type: array
          items:
            $ref: '#/components/schemas/Subject'
          readOnly: true
        recently_accessed_at:
          type: string
          format: date-time
          readOnly: true
        created_by:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        llm_config:
          readOnly: true
      required:
        - allow_anonymous
        - can_use_tools
        - categories
        - created_at
        - created_by
        - disclaimer
        - embed_is_context_aware
        - embed_open_by_default
        - embed_show_attachment
        - embed_show_voice_call
        - embed_show_voice_record
        - enable_disclaimer
        - enable_email_chat
        - enable_guided_prompts
        - enable_instruction_mode
        - enable_memory_component
        - enable_moderation
        - enable_multi_query_rag
        - enable_post_processing_system
        - enable_safety_system
        - enable_socratic_mode
        - enable_spaced_repetition
        - forkable
        - forkable_with_training_data
        - greeting_method
        - id
        - is_guided_mentor
        - llm_config
        - llm_name
        - mentor
        - mentor_description
        - mentor_id
        - mentor_name
        - mentor_slug
        - mentor_tools
        - mentor_unique_id
        - metadata
        - placeholder_prompt
        - platform_key
        - proactive_prompt
        - proactive_response
        - recently_accessed_at
        - subjects
        - suggested_prompts
        - types
        - updated_at
    MentorSettingsRequest:
      type: object
      properties:
        mentor_name:
          type: string
        template_name:
          type: string
        display_name:
          type: string
        profile_image:
          type: string
          format: uri
        initial_message:
          type: string
          nullable: true
        suggested_message:
          type: string
          nullable: true
        theme:
          type: string
        user_message_color:
          type: string
        mentor_bubble_color:
          type: string
        align_mentor_bubble:
          type: string
        system_prompt:
          type: string
        llm_provider:
          type: string
        llm_name:
          type: string
        featured:
          type: boolean
        disable_chathistory:
          type: boolean
        metadata:
          nullable: true
        custom_css:
          type: string
          nullable: true
        department_id:
          type: integer
          nullable: true
          description: Department to authorize users by
        mentor_visibility:
          type: string
        enable_image_generation:
          type: boolean
        enable_web_browsing:
          type: boolean
        enable_code_interpreter:
          type: boolean
        allow_anonymous:
          type: boolean
        forkable:
          type: boolean
        forkable_with_training_data:
          type: boolean
        mentor_description:
          type: string
        uploaded_profile_image:
          type: string
          format: uri
        proactive_response:
          type: string
        greeting_method:
          $ref: '#/components/schemas/GreetingMethodEnum'
        can_use_tools:
          type: boolean
        tool_slugs:
          type: array
          items:
            type: string
            description: slug of the tool
        llm_temperature:
          type: number
          format: double
          minimum: 0
          maximum: 1
        proactive_prompt:
          type: string
        disclaimer:
          type: string
        placeholder_prompt:
          type: string
        moderation_system_prompt:
          type: string
        post_processing_prompt:
          type: string
        moderation_response:
          type: string
        enable_moderation:
          type: boolean
        enable_multi_query_rag:
          type: boolean
        enable_post_processing_system:
          type: boolean
        enable_openai_assistant:
          type: boolean
        enable_total_grounding:
          type: boolean
        enable_suggested_prompts:
          type: boolean
          nullable: true
        enable_guided_prompts:
          type: boolean
          nullable: true
        mcp_servers:
          type: array
          items:
            type: integer
          nullable: true
        embed_is_context_aware:
          type: boolean
        embed_open_by_default:
          type: boolean
        embed_show_attachment:
          type: boolean
        embed_show_voice_call:
          type: boolean
        embed_show_voice_record:
          type: boolean
        google_voice:
          type: integer
        openai_voice:
          type: integer
        guided_prompt_instructions:
          type: string
          nullable: true
        safety_system_prompt:
          type: string
        safety_response:
          type: string
        enable_safety_system:
          type: boolean
        enable_spaced_repetition:
          type: boolean
          default: false
        enable_instruction_mode:
          type: boolean
          default: false
        enable_socratic_mode:
          type: boolean
          default: false
        is_guided_mentor:
          type: boolean
          default: false
        enable_email_chat:
          type: boolean
          default: false
        categories:
          type: array
          items:
            type: integer
            description: ID of the mentor category
        types:
          type: array
          items:
            type: integer
            description: ID of the mentor type
        subjects:
          type: array
          items:
            type: integer
            description: ID of the subject
    MentorSummary:
      type: object
      properties:
        rating:
          type: number
          format: double
          nullable: true
        summary:
          type: string
          nullable: true
        tags:
          type: array
          items:
            type: string
      required:
        - rating
        - summary
        - tags
    MentorType:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
          nullable: true
      required:
        - id
        - name
    MentorUserSetting:
      type: object
      properties:
        reference_saved_memories:
          type: boolean
        as_tenant_admin:
          type: boolean
          default: true
    MentorVisibilityEnum:
      enum:
        - viewable_by_tenant_admins
        - viewable_by_tenant_students
        - viewable_by_anyone
      type: string
      description: |-
        * `viewable_by_tenant_admins` - Viewable By Tenant Admins
        * `viewable_by_tenant_students` - Viewable By Tenant Students
        * `viewable_by_anyone` - Viewable By Anyone
    MentorWizard:
      type: object
      properties:
        name:
          type: string
          maxLength: 100
        description:
          type: string
          maxLength: 1000
          minLength: 20
      required:
        - description
        - name
    MessageStatistics:
      type: object
      properties:
        time:
          type: string
          format: date-time
        avg_messages:
          type: integer
        total_sessions:
          type: integer
      required:
        - avg_messages
        - time
        - total_sessions
    MessageView:
      type: object
      properties:
        count:
          type: integer
        title:
          type: string
        proactive_prompt:
          type: string
        mentor_unique_id:
          type: string
        platform_key:
          type: string
        previous:
          type: string
        next:
          type: string
        results:
          type: array
          items: {}
      required:
        - count
        - mentor_unique_id
        - next
        - platform_key
        - previous
        - proactive_prompt
        - results
        - title
    MessageViewRequest:
      type: object
      properties:
        title:
          type: string
        tools:
          type: array
          items:
            type: string
          nullable: true
          default: []
          description: List of tools slugs to use
        enable_artifacts:
          type: boolean
    MessageViewUpdatResponse:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    Metadata:
      type: object
      properties:
        metadata: {}
        prompt:
          type: string
        prompt_id:
          type: integer
      required:
        - metadata
    MetricChange:
      type: object
      properties:
        total:
          type: integer
        change:
          type: number
          format: double
      required:
        - change
        - total
    MetricDetail:
      type: object
      description: Base serializer for detailed metric data.
      properties:
        total:
          type: integer
        details:
          type: array
          items:
            type: object
            additionalProperties: {}
      required:
        - total
    MetricInfo:
      type: object
      properties:
        name:
          type: string
        unit:
          type: string
        description:
          type: string
      required:
        - description
        - name
        - unit
    ModelCost:
      type: object
      properties:
        model:
          type: string
        total_cost:
          type: number
          format: double
      required:
        - model
        - total_cost
    ModerationLog:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        username:
          type: string
          maxLength: 200
        platform_key:
          type: string
          maxLength: 200
        mentor:
          type: integer
        prompt:
          type: string
        reason:
          type: string
        target_system:
          $ref: '#/components/schemas/TargetSystemEnum'
        date_created:
          type: string
          format: date-time
          readOnly: true
      required:
        - date_created
        - id
        - mentor
        - platform_key
        - prompt
        - reason
    NewPerLearnerList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/NewPerLearnerListData'
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - pagination
    NewPerLearnerListData:
      type: object
      properties:
        username:
          type: string
        user_id:
          type: integer
        name:
          type: string
        email:
          type: string
          format: email
        courses_enrolled:
          type: integer
        courses_completed:
          type: integer
        time_spent:
          type: string
        pathways_assigned:
          type: integer
        pathways_completed:
          type: integer
        certificates_earned:
          type: integer
        assessments_passed:
          type: integer
        skills_earned:
          type: integer
        skills_points:
          type: integer
        last_login:
          type: string
        location:
          type: string
      required:
        - assessments_passed
        - certificates_earned
        - courses_completed
        - courses_enrolled
        - email
        - last_login
        - location
        - name
        - pathways_assigned
        - pathways_completed
        - skills_earned
        - skills_points
        - time_spent
        - user_id
        - username
    NoChatMessagesFound:
      type: object
      properties:
        error:
          type: string
          default: No chat messages found.
    Notification:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        username:
          type: string
        title:
          type: string
          readOnly: true
        body:
          type: string
          readOnly: true
        status:
          title: Message status
          oneOf:
            - $ref: '#/components/schemas/NotificationStatusEnum'
            - $ref: '#/components/schemas/BlankEnum'
        channel:
          type: string
          nullable: true
          readOnly: true
        context:
          nullable: true
        short_message:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - body
        - channel
        - id
        - short_message
        - title
        - updated_at
        - username
    NotificationCount:
      type: object
      properties:
        status:
          type: string
        channel:
          type: string
    NotificationPreview:
      type: object
      description: Request serializer for notification preview
      properties:
        template_id:
          type: string
          format: uuid
          nullable: true
          description: Use a predefined template in the system
        template_data:
          allOf:
            - $ref: '#/components/schemas/NotificationTemplateData'
          nullable: true
          description: >-
            Specify this to send a new custom message without using a predefined
            template
        channels:
          type: array
          items:
            type: integer
          description: Specify the channel ids to send notifications to.
        sources:
          type: array
          items:
            $ref: '#/components/schemas/NotificationSource'
          description: Specify the sources to send notifications to
        context:
          type: object
          additionalProperties: {}
          description: Specify the context that would be available in the message text
        process_on:
          type: string
          format: date-time
          nullable: true
          description: >-
            (ISO datetime) Specify the date and time of processing this
            notification. Note, notifications are sent hourly and only scheduled
            messages prior to the beginning of the hour would be sent
      required:
        - channels
        - sources
    NotificationSource:
      type: object
      description: Request serializer for source validation
      properties:
        type:
          $ref: '#/components/schemas/NotificationSourceTypeEnum'
        data:
          nullable: true
      required:
        - data
        - type
    NotificationSourceTypeEnum:
      enum:
        - email
        - username
        - platform
        - csv
        - department
        - pathway
        - program
      type: string
      description: |-
        * `email` - email
        * `username` - username
        * `platform` - platform
        * `csv` - csv
        * `department` - department
        * `pathway` - pathway
        * `program` - program
    NotificationStatusEnum:
      enum:
        - READ
        - UNREAD
        - CANCELLED
      type: string
      description: |-
        * `READ` - Read
        * `UNREAD` - Unread
        * `CANCELLED` - Cancelled
    NotificationTemplateData:
      type: object
      properties:
        message_title:
          type: string
          nullable: true
          default: ''
          description: Title of the message
        message_body:
          type: string
          description: |2-

                This would be the body of the message. Some context are available to use in the system.

                e.g

                ```
                This is a sample message to {{username}}.

                Available accessors are 
                - site_name
                - site_url
                - site_logo_url
                - username
                and <anything passed into context dictionary>
                ```

                
      required:
        - message_body
    NotificationTemplateDetail:
      type: object
      description: Serializer for detailed template view and editing
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: Unique identifier for this notification template.
        type:
          readOnly: true
          nullable: true
          description: >-
            Select the type of notification from the available options.


            * `DEFAULT_TEMPLATE` - Default Template

            * `APP_REGISTRATION` - App Registration

            * `USER_NOTIF_USER_REGISTRATION` - User Notif User Registration

            * `USER_NOTIF_COURSE_ENROLLMENT` - User Notif Course Enrollment

            * `ADMIN_NOTIF_COURSE_ENROLLMENT` - Admin Notif Course Enrollment

            * `USER_NOTIF_USER_INACTIVITY` - User Notif User Inactivity

            * `USER_NOTIF_COURSE_COMPLETION` - User Notif Course Completion

            * `USER_NOTIF_CREDENTIALS` - User Notif Credentials

            * `CUSTOM_NOTIFICATION` - Custom Notification

            * `PLATFORM_INVITATION` - Platform Invitation

            * `PROGRAM_INVITATION` - Program Invitation

            * `COURSE_INVITATION` - Course Invitation

            * `USER_NOTIF_LEARNER_PROGRESS` - User Notif Learner Progress

            * `PROACTIVE_LEARNER_NOTIFICATION` - Proactive Learner Notification

            * `ROLE_CHANGE` - Role Change

            * `COURSE_LICENSE_ASSIGNMENT` - Course License Assignment

            * `COURSE_LICENSE_GROUP_ASSIGNMENT` - Course License Group
            Assignment

            * `PROGRAM_LICENSE_ASSIGNMENT` - Program License Assignment

            * `PROGRAM_LICENSE_GROUP_ASSIGNMENT` - Program License Group
            Assignment

            * `USER_LICENSE_ASSIGNMENT` - User License Assignment

            * `USER_LICENSE_GROUP_ASSIGNMENT` - User License Group Assignment
          oneOf:
            - $ref: '#/components/schemas/Type2a5Enum'
            - $ref: '#/components/schemas/NullEnum'
        name:
          type: string
          nullable: true
          description: A friendly name for the notification template.
          maxLength: 255
        description:
          type: string
          description: >-
            Admin-friendly description of what this notification does, when it
            triggers, and what data it needs
        message_title:
          type: string
          nullable: true
          description: The title for the notification message.
          maxLength: 255
        message_body:
          type: string
          description: The full notification message body.
        short_message_body:
          type: string
          description: A short version of the notification message body.
        email_subject:
          type: string
          nullable: true
          description: Email subject line (supports Django template syntax)
          maxLength: 255
        email_from_address:
          type: string
          nullable: true
          description: 'Sender email address (default: IBL <noreply@ibl.ai>)'
          maxLength: 255
        email_html_template:
          type: string
          nullable: true
          description: Full HTML template for email body
        spas_detail:
          type: array
          items:
            $ref: '#/components/schemas/Spa'
          readOnly: true
        allowed_channels_detail:
          type: array
          items:
            $ref: '#/components/schemas/ConsumerChannel'
          readOnly: true
        spa_ids:
          type: array
          items:
            type: integer
            writeOnly: true
          writeOnly: true
        channel_ids:
          type: array
          items:
            type: integer
            writeOnly: true
          writeOnly: true
        is_inherited:
          type: boolean
          readOnly: true
        is_enabled:
          type: boolean
          readOnly: true
        source_platform:
          type: string
          readOnly: true
        metadata: {}
        available_context:
          type: string
          readOnly: true
        proactive_prompt_message:
          type: string
          nullable: true
          description: Default prompt message for AI mentor notifications
        periodic_config:
          type: string
          readOnly: true
        periodic_learner_scope:
          allOf:
            - $ref: '#/components/schemas/PeriodicLearnerScopeEnum'
          writeOnly: true
        periodic_report_period_days:
          type: integer
          maximum: 365
          minimum: 1
          writeOnly: true
        periodic_frequency:
          allOf:
            - $ref: '#/components/schemas/PeriodicFrequencyEnum'
          writeOnly: true
        periodic_custom_interval_days:
          type: integer
          maximum: 365
          minimum: 1
          writeOnly: true
        periodic_execution_time:
          type: string
          writeOnly: true
        periodic_timezone:
          type: string
          writeOnly: true
        periodic_mentors:
          type: array
          items:
            type: object
            additionalProperties: {}
          writeOnly: true
          description: >-
            List of mentor configurations: [{"unique_id": "uuid", "prompt":
            "..."}]
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Timestamp when this template was created
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Timestamp when this template was last updated
      required:
        - allowed_channels_detail
        - available_context
        - created_at
        - id
        - is_enabled
        - is_inherited
        - periodic_config
        - source_platform
        - spas_detail
        - type
        - updated_at
    NotificationTemplateList:
      type: object
      description: Serializer for listing notification templates with inheritance info
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: Unique identifier for this notification template.
        type:
          nullable: true
          description: >-
            Select the type of notification from the available options.


            * `DEFAULT_TEMPLATE` - Default Template

            * `APP_REGISTRATION` - App Registration

            * `USER_NOTIF_USER_REGISTRATION` - User Notif User Registration

            * `USER_NOTIF_COURSE_ENROLLMENT` - User Notif Course Enrollment

            * `ADMIN_NOTIF_COURSE_ENROLLMENT` - Admin Notif Course Enrollment

            * `USER_NOTIF_USER_INACTIVITY` - User Notif User Inactivity

            * `USER_NOTIF_COURSE_COMPLETION` - User Notif Course Completion

            * `USER_NOTIF_CREDENTIALS` - User Notif Credentials

            * `CUSTOM_NOTIFICATION` - Custom Notification

            * `PLATFORM_INVITATION` - Platform Invitation

            * `PROGRAM_INVITATION` - Program Invitation

            * `COURSE_INVITATION` - Course Invitation

            * `USER_NOTIF_LEARNER_PROGRESS` - User Notif Learner Progress

            * `PROACTIVE_LEARNER_NOTIFICATION` - Proactive Learner Notification

            * `ROLE_CHANGE` - Role Change

            * `COURSE_LICENSE_ASSIGNMENT` - Course License Assignment

            * `COURSE_LICENSE_GROUP_ASSIGNMENT` - Course License Group
            Assignment

            * `PROGRAM_LICENSE_ASSIGNMENT` - Program License Assignment

            * `PROGRAM_LICENSE_GROUP_ASSIGNMENT` - Program License Group
            Assignment

            * `USER_LICENSE_ASSIGNMENT` - User License Assignment

            * `USER_LICENSE_GROUP_ASSIGNMENT` - User License Group Assignment
          oneOf:
            - $ref: '#/components/schemas/Type2a5Enum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        name:
          type: string
          nullable: true
          description: A friendly name for the notification template.
          maxLength: 255
        description:
          type: string
          description: >-
            Admin-friendly description of what this notification does, when it
            triggers, and what data it needs
        is_inherited:
          type: boolean
          readOnly: true
        source_platform:
          type: string
          readOnly: true
        is_enabled:
          type: boolean
          readOnly: true
        can_customize:
          type: boolean
          readOnly: true
        is_custom:
          type: boolean
          readOnly: true
          default: false
        message_title:
          type: string
          nullable: true
          description: The title for the notification message.
          maxLength: 255
        email_subject:
          type: string
          nullable: true
          description: Email subject line (supports Django template syntax)
          maxLength: 255
        spas:
          type: string
          readOnly: true
        allowed_channels:
          type: string
          readOnly: true
        available_context:
          type: string
          readOnly: true
      required:
        - allowed_channels
        - available_context
        - can_customize
        - id
        - is_custom
        - is_enabled
        - is_inherited
        - source_platform
        - spas
    NotificationTemplateTest:
      type: object
      description: Serializer for testing notification template
      properties:
        test_email:
          type: string
          format: email
          description: >-
            Email address to send test notification to. Defaults to requesting
            user's email.
        context:
          description: >-
            Optional context variables for template rendering (e.g.,
            {'course_name': 'Test Course'})
    NotificationTemplateTestResponse:
      type: object
      description: Serializer for test notification response
      properties:
        success:
          type: boolean
          description: Whether the test email was sent successfully
        message:
          type: string
          description: Description of the result
        recipient:
          type: string
          format: email
          description: Email address the test was sent to
      required:
        - message
        - recipient
        - success
    NotificationToggle:
      type: object
      description: Serializer for toggling notification preference
      properties:
        allow_notification:
          type: boolean
      required:
        - allow_notification
    NullEnum:
      enum:
        - null
    OAuthStartResponse:
      type: object
      properties:
        auth_url:
          type: string
          format: uri
      required:
        - auth_url
    Observation:
      type: object
      properties:
        id:
          type: string
        trace_id:
          type: string
        type:
          type: string
        parent_observation_id:
          type: string
          nullable: true
        start_time:
          type: string
          format: date-time
        end_time:
          type: string
          format: date-time
          nullable: true
        name:
          type: string
        metadata: {}
        level:
          type: string
        status_message:
          type: string
          nullable: true
        version:
          type: string
          nullable: true
        input:
          type: string
          nullable: true
        output:
          type: string
          nullable: true
        provided_model_name:
          type: string
          nullable: true
        internal_model_id:
          type: string
          nullable: true
        model_parameters:
          type: string
          nullable: true
        provided_usage_details:
          type: string
        usage_details:
          type: string
        provided_cost_details:
          type: string
        cost_details:
          type: string
        total_cost:
          type: string
          format: decimal
          pattern: ^-?\d{0,6}(?:\.\d{0,12})?$
          nullable: true
        completion_start_time:
          type: string
          format: date-time
          nullable: true
        prompt_id:
          type: string
          nullable: true
        prompt_name:
          type: string
          nullable: true
        prompt_version:
          type: integer
          maximum: 65535
          minimum: 0
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
        event_ts:
          type: string
          format: date-time
        is_deleted:
          type: integer
          maximum: 255
          minimum: 0
      required:
        - cost_details
        - created_at
        - event_ts
        - id
        - is_deleted
        - level
        - metadata
        - name
        - provided_cost_details
        - provided_usage_details
        - start_time
        - trace_id
        - type
        - usage_details
    OnboardingStatusUpdate:
      type: object
      properties:
        onboarding_completed:
          type: boolean
        app:
          type: string
          description: The app url or name or id
      required:
        - app
        - onboarding_completed
    OverTime:
      type: object
      properties:
        data:
          type: object
          additionalProperties: {}
      required:
        - data
    OverTimeWithTotal:
      type: object
      description: |-
        Returns
            {
                "data": {
                    "2022-04-26": 0,
                    "2022-04-27": 0,
                    ...
                    "2023-01-01": 0
                },
                "total": 0
            }
      properties:
        data:
          type: object
          additionalProperties: {}
          description: >-
            Dates are keys and values are the value for the date in the key. e,g
            `{"2020-01-01": 30. ...}`
        total:
          type: integer
          description: Total
    OvertimeData:
      type: object
      description: Individual overtime data point.
      properties:
        date:
          type: string
          description: Date in YYYY-MM-DD format
        value:
          type: string
          format: decimal
          pattern: ^-?\d{0,15}(?:\.\d{0,5})?$
          description: Cost value for this time period
      required:
        - date
        - value
    OvertimeDataPoint:
      type: object
      description: Serializer for individual overtime data points.
      properties:
        date:
          type: string
          description: Date in YYYY-MM-DD format
        value:
          type: integer
          description: Time spent in seconds for this date
      required:
        - date
        - value
    OvertimeMeta:
      type: object
      properties:
        total:
          type: integer
          description: Total records
        change_range:
          type: integer
          default: 0
          description: Change in range
        change_last_seven_days:
          type: integer
          default: 0
          description: Change in last 7 days
        change_last_thirty_days:
          type: integer
          default: 0
          description: Change in last 30 days
        change_last_seven_days_percent:
          type: number
          format: double
          default: 0
          description: Change in last 7 days in percentage
        change_last_thirty_days_percent:
          type: number
          format: double
          default: 0
          description: Change in last 30 days in percentage
        change_range_percent:
          type: number
          format: double
          description: Change in range in percentage
      required:
        - total
    OvertimeWithChangeInfo:
      type: object
      description: |-
        Returns
            {
                "data": {
                    "2022-04-26": 0,
                    "2022-04-27": 0,
                    ...
                    "2023-01-01": 0
                },
                "total": 0
            }
      properties:
        data:
          type: object
          additionalProperties: {}
          description: >-
            Dates are keys and values are the value for the date in the key. e,g
            `{"2020-01-01": 30. ...}`
        total:
          type: integer
          description: Total
        meta:
          $ref: '#/components/schemas/OvertimeMeta'
      required:
        - meta
    PageContent:
      type: object
      properties:
        page_content:
          type: string
          description: The page content
      required:
        - page_content
    PaginatedAIGeneratedImageList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/AIGeneratedImage'
    PaginatedArtifactListList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/ArtifactList'
    PaginatedAssertionsResponse:
      type: object
      description: |-
        {
                'next': self.get_next_link(),
                'previous': self.get_previous_link(),
                'count': self.page.paginator.count,
                'data': data,
                'num_pages': self.page.paginator.num_pages,
                'page_number': self.page.number,
                'max_page_size': self.max_page_size
            }
      properties:
        next:
          type: string
        previous:
          type: string
        count:
          type: integer
        num_pages:
          type: integer
        page_number:
          type: integer
        max_page_size:
          type: integer
        data:
          type: array
          items:
            $ref: '#/components/schemas/Assertion'
      required:
        - count
        - data
        - max_page_size
        - next
        - num_pages
        - page_number
        - previous
    PaginatedConversationsList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Conversations'
    PaginatedCourseAccessRequest:
      type: object
      description: Response serializer for paginated access request list
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/CourseAccessRequestDetail'
          description: List of access requests
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedCourseCreationTaskFileList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/CourseCreationTaskFile'
    PaginatedCourseCreationTaskList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/CourseCreationTask'
    PaginatedCourseGroupSuggestion:
      type: object
      description: Response serializer for paginated course group suggestion list
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/CourseGroupSuggestionDetail'
          description: List of course group suggestions
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedCourseInvitation:
      type: object
      description: Response serializer for paginated course invitation list
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/CourseInvitationDetail'
          description: List of course invitations
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedCourseLicense:
      type: object
      description: Response serializer for paginated course license list
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/CourseLicenseDetail'
          description: List of course licenses
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedCourseLicenseAssignment:
      type: object
      description: Response serializer for paginated course license assignment list
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/CourseLicenseAssignmentDetail'
          description: List of course license assignments
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedCourseLicenseGroupAssignment:
      type: object
      description: Response serializer for paginated course license group assignment list
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/CourseLicenseGroupAssignmentDetail'
          description: List of course license group assignments
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedCourseSuggestion:
      type: object
      description: Response serializer for paginated course suggestion list
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/CourseSuggestionDetail'
          description: List of course suggestions
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedDataSetList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/DataSet'
    PaginatedDisclaimerAgreementList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/DisclaimerAgreement'
    PaginatedDisclaimerList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Disclaimer'
    PaginatedEdxCourseList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/EdxCourse'
    PaginatedEmailPromptListList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/EmailPromptList'
    PaginatedHeygenMarketingVideoListList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/HeygenMarketingVideoList'
    PaginatedHeygenTemplateResponseSingleList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/HeygenTemplateResponseSingle'
    PaginatedHumanSupportTicketList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/HumanSupportTicket'
    PaginatedJobRunList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/JobRun'
    PaginatedMCPServerList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/MCPServer'
    PaginatedMentorList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Mentor'
    PaginatedModerationLogList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/ModerationLog'
    PaginatedObservationList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?offset=400&limit=100
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?offset=200&limit=100
        results:
          type: array
          items:
            $ref: '#/components/schemas/Observation'
    PaginatedPathwayGroupSuggestion:
      type: object
      description: Response serializer for paginated pathway group suggestion list
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/PathwayGroupSuggestionDetail'
          description: List of pathway group suggestions
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedPathwaySuggestion:
      type: object
      description: Response serializer for paginated pathway suggestion list
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/PathwaySuggestionDetail'
          description: List of pathway suggestions
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedPeriodicAgentList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/PeriodicAgent'
    PaginatedPeriodicAgentLogList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/PeriodicAgentLog'
    PaginatedPlatformInvitation:
      type: object
      description: Response serializer for paginated platform invitation list
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/PlatformInvitationDetail'
          description: List of platform invitations
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedPlatformLicense:
      type: object
      description: Response serializer for paginated platform license list
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/PlatformLicenseDetail'
          description: List of platform licenses
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedPlayWrightScriptList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/PlayWrightScript'
    PaginatedProgramGroupSuggestion:
      type: object
      description: Response serializer for paginated program group suggestion list
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/ProgramGroupSuggestionDetail'
          description: List of program group suggestions
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedProgramInvitation:
      type: object
      description: Response serializer for paginated program invitation list
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/ProgramInvitationDetail'
          description: List of program invitations
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedProgramLicense:
      type: object
      description: |-
        Response serializer for paginated program license list.

        This serializer represents a paginated list of program licenses,
        with navigation links and metadata.

        Fields:
            count: Total number of results matching the query
            next: URL for the next page of results (null if no next page)
            previous: URL for the previous page of results (null if no previous page)
            results: List of program licenses
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/ProgramLicenseDetail'
          description: List of program licenses
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedProgramLicenseAssignment:
      type: object
      description: >-
        Response serializer for paginated program license assignment list.


        This serializer represents a paginated list of program license
        assignments,

        with navigation links and metadata.


        Fields:
            count: Total number of results matching the query
            next: URL for the next page of results (null if no next page)
            previous: URL for the previous page of results (null if no previous page)
            results: List of program license assignments
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/ProgramLicenseAssignmentDetail'
          description: List of program license assignments
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedProgramLicenseGroupAssignment:
      type: object
      description: >-
        Response serializer for paginated program license group assignment list.


        This serializer represents a paginated list of program license group
        assignments,

        with navigation links and metadata.


        Fields:
            count: Total number of results matching the query
            next: URL for the next page of results (null if no next page)
            previous: URL for the previous page of results (null if no previous page)
            results: List of program license group assignments
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/ProgramLicenseGroupAssignmentDetail'
          description: List of program license group assignments
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedProgramSuggestion:
      type: object
      description: Response serializer for paginated program suggestion list
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/ProgramSuggestionDetail'
          description: List of program suggestions
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedProjectList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?offset=400&limit=100
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?offset=200&limit=100
        results:
          type: array
          items:
            $ref: '#/components/schemas/Project'
    PaginatedRbacGroupList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/RbacGroup'
    PaginatedRbacPolicyList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/RbacPolicy'
    PaginatedRbacRoleList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/RbacRole'
    PaginatedRetrieverDocumentEmbeddingList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?offset=400&limit=100
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?offset=200&limit=100
        results:
          type: array
          items:
            $ref: '#/components/schemas/RetrieverDocumentEmbedding'
    PaginatedSectionList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Section'
    PaginatedSkill:
      type: object
      properties:
        next_page:
          type: string
        previous_page:
          type: string
        results:
          type: array
          items:
            $ref: '#/components/schemas/Skill'
          readOnly: true
        count:
          type: integer
          readOnly: true
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedSubSectionList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/SubSection'
    PaginatedTicketMessageList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/TicketMessage'
    PaginatedTopicStatisticsResponse:
      type: object
      properties:
        count:
          type: integer
        next:
          type: string
          format: uri
          nullable: true
        previous:
          type: string
          format: uri
          nullable: true
        results:
          type: array
          items:
            $ref: '#/components/schemas/TopicStatistics'
      required:
        - count
        - next
        - previous
        - results
    PaginatedTraceList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?offset=400&limit=100
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?offset=200&limit=100
        results:
          type: array
          items:
            $ref: '#/components/schemas/Trace'
    PaginatedTrainingList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Training'
    PaginatedUnitList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Unit'
    PaginatedUserAppList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/UserApp'
    PaginatedUserEdxMemoryList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/UserEdxMemory'
    PaginatedUserLicense:
      type: object
      description: Response serializer for paginated user license list
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/UserLicenseDetail'
          description: List of user licenses
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedUserLicenseAssignment:
      type: object
      description: Response serializer for paginated user license assignment list
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/UserLicenseAssignmentDetail'
          description: List of user license assignments
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedUserLicenseGroupAssignment:
      type: object
      description: Response serializer for paginated user license group assignment list
      properties:
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
        results:
          type: array
          items:
            $ref: '#/components/schemas/UserLicenseGroupAssignmentDetail'
          description: List of user license group assignments
      required:
        - count
        - next_page
        - previous_page
        - results
    PaginatedUserMemoryList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/UserMemory'
    PaginatedVeoVideoListList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/VeoVideoList'
    PaginatedVoiceList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Voice'
    Pagination:
      type: object
      properties:
        totalItems:
          type: integer
          description: Total records
        currentPage:
          type: integer
          description: Current Page
        perPage:
          type: integer
          description: Size of data returned per page
        totalPages:
          type: integer
          description: Amount of pages
      required:
        - currentPage
        - perPage
        - totalItems
        - totalPages
    PatchedArtifact:
      type: object
      description: >-
        Serializer for Artifact model.


        Artifacts are structured content like essays, documents, code files,
        etc.

        that are generated by AI agents during a chat session and are best

        displayed separately from the normal chat flow.


        Fields:
            - id: Unique identifier for the artifact
            - title: Title or identifier for the artifact
            - content: The markdown-styled content of the artifact
            - file_extension: The extension of the file (e.g., 'py', 'md', 'html', 'json', 'csv')
            - chat_message: Reference to the chat message that contains this artifact
            - llm_name: Name of the LLM that generated the artifact
            - llm_provider: Provider of the LLM (e.g., 'openai', 'google', 'anthropic')
            - date_created: Timestamp when the artifact was created
            - date_updated: Timestamp when the artifact was last updated
            - metadata: Additional metadata for the artifact
            - username: Username of the student who owns the artifact (read-only)
            - session_id: UUID of the session that generated the artifact (read-only)

        Read-only fields:
            - id, date_created, date_updated, username, session_id
      properties:
        id:
          type: integer
          readOnly: true
        title:
          type: string
          description: Title or identifier for the artifact
          maxLength: 255
        content:
          type: string
          description: The markdown-styled content of the artifact
        file_extension:
          type: string
          readOnly: true
          description: >-
            The extension of the file for the artifact. eg. `py`, `md`, `html`,
            `json`, `csv`, etc
        chat_message:
          type: integer
          readOnly: true
        llm_name:
          type: string
          readOnly: true
        llm_provider:
          type: string
          readOnly: true
        date_created:
          type: string
          format: date-time
          readOnly: true
        date_updated:
          type: string
          format: date-time
          readOnly: true
        metadata:
          description: Additional metadata for the artifact
        username:
          type: string
          description: Username of the student who owns this artifact
          readOnly: true
        session_id:
          type: string
          format: uuid
          description: UUID of the session that generated this artifact
          readOnly: true
    PatchedBotCommand:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        command:
          type: string
          maxLength: 100
        mentor:
          type: integer
        bot:
          type: integer
    PatchedBotCreate:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        provider:
          $ref: '#/components/schemas/Provider05cEnum'
        is_configured:
          type: boolean
          readOnly: true
        webhook_url:
          type: string
          readOnly: true
        discord_config:
          type: integer
          readOnly: true
        webex_config:
          type: integer
          readOnly: true
        whatsapp_config:
          type: integer
          readOnly: true
        teams_config:
          type: integer
          readOnly: true
    PatchedCallConfiguration:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        mentor:
          type: string
          format: uuid
        mode:
          $ref: '#/components/schemas/CallConfigurationModeEnum'
        tts_provider:
          $ref: '#/components/schemas/TtsProviderEnum'
        stt_provider:
          $ref: '#/components/schemas/SttProviderEnum'
        llm_provider:
          $ref: '#/components/schemas/LlmProviderEnum'
        use_function_calling_for_rag:
          type: boolean
          description: >-
            Whether to use function calls in the agent or force RAG calls before
            LLM generation
        google_voice:
          $ref: '#/components/schemas/Voice'
        openai_voice:
          $ref: '#/components/schemas/Voice'
        openai_voice_id:
          type: integer
          nullable: true
        google_voice_id:
          type: integer
          nullable: true
        enable_video:
          type: boolean
          description: >-
            Whether to enable video for the call. (applicable only for realtime
            mode)
        platform_key:
          type: string
          readOnly: true
    PatchedConversations:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        messages:
          type: string
          readOnly: true
        topics:
          type: array
          items:
            $ref: '#/components/schemas/TopicModel'
        sentiment:
          type: string
          readOnly: true
        mentor:
          type: string
          format: uuid
        student:
          type: string
          readOnly: true
        email:
          type: string
          readOnly: true
        model:
          type: string
        rating:
          type: integer
          readOnly: true
        platform:
          type: string
        lti_email:
          type: string
          description: Email claim from LTI1.3 JWT if an LTI user and available
          readOnly: true
        lti_username:
          type: string
          description: Username claim from LTI1.3 JWT if an LTI user and available
          readOnly: true
        inserted_at:
          type: string
          format: date-time
          readOnly: true
        has_document:
          type: boolean
        memory_tracked:
          type: boolean
        enable_artifacts:
          type: boolean
        llm_name:
          type: string
          nullable: true
          maxLength: 255
        llm_provider:
          type: string
          nullable: true
          maxLength: 255
        metadata:
          nullable: true
        is_conversation:
          type: boolean
          description: True if the session has both user and AI messages
        tools:
          type: array
          items:
            type: integer
    PatchedCourseCreationTaskFile:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        course_creation_task:
          type: integer
        file:
          type: string
          format: uri
        date_created:
          type: string
          format: date-time
          readOnly: true
        last_modified:
          type: string
          format: date-time
          readOnly: true
    PatchedCredentialRequest:
      type: object
      properties:
        name:
          type: string
          description: Name of the credential provider (e.g., 'openai', 'google-drive')
        value:
          description: >-
            Credential data for the provider (API keys, service account details,
            etc.)
        platform:
          type: string
          description: Organization key identifier for the tenant
    PatchedDataSet:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        platform:
          type: object
          additionalProperties:
            oneOf:
              - type: string
              - type: integer
          nullable: true
          readOnly: true
        name:
          type: string
          maxLength: 255
        prompt:
          type: string
          description: >-
            (if any) Special instructions for generating the dataset. This could
            be requirements on tone, language, style, etc.
          maxLength: 1000
        source_url:
          type: string
          format: uri
          maxLength: 400
        source_file:
          type: string
          format: uri
        status:
          $ref: '#/components/schemas/DataSetStatusEnum'
        num_data_points:
          type: integer
          maximum: 2147483647
          minimum: 0
        train_split:
          type: number
          format: double
          maximum: 1
          minimum: 0
        train_file:
          type: string
          format: uri
        test_file:
          type: string
          format: uri
        retry_attempts:
          type: integer
          maximum: 2147483647
          minimum: 0
        error_log:
          type: string
        date_created:
          type: string
          format: date-time
          readOnly: true
        last_modified:
          type: string
          format: date-time
          readOnly: true
    PatchedDisclaimer:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        scope:
          $ref: '#/components/schemas/ScopeEnum'
        platform:
          type: integer
          readOnly: true
          description: 'Platform to which the disclaimer applies. '
        content:
          type: string
        title:
          type: string
          maxLength: 120
        active:
          type: boolean
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        has_agreed:
          type: boolean
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        mentors:
          type: array
          items:
            type: string
            format: uuid
    PatchedDiscordConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        bot:
          type: integer
          readOnly: true
        client_id:
          type: string
          maxLength: 255
        token:
          type: string
          maxLength: 500
        client_secret:
          type: string
          maxLength: 500
    PatchedDiscordUserConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        user:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          readOnly: true
        discord_user_id:
          type: string
          maxLength: 200
        date_created:
          type: string
          format: date-time
          readOnly: true
        last_modified:
          type: string
          format: date-time
          readOnly: true
    PatchedHumanSupportTicket:
      type: object
      description: >-
        serializer interface intended for students/ non-admin users.

        This limits students to only update the subject and description of a
        ticket.
      properties:
        id:
          type: integer
          readOnly: true
        username:
          type: string
          readOnly: true
        email:
          type: string
          readOnly: true
        full_name:
          type: string
          readOnly: true
        user:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          readOnly: true
        session:
          type: string
          format: uuid
          readOnly: true
        subject:
          type: string
          maxLength: 255
        description:
          type: string
        status:
          $ref: '#/components/schemas/HumanSupportTicketStatusEnum'
        mentor_id:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        resolved_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
    PatchedLLMCredentialRequest:
      type: object
      properties:
        name:
          type: string
          description: Name of the credential provider
        value:
          description: Value of the credential provider
        platform:
          type: string
          description: Key of the tenant
    PatchedMCPServer:
      type: object
      description: Serializer for the MCPServer model.
      properties:
        id:
          type: integer
          readOnly: true
        platform:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        url:
          type: string
          format: uri
          description: The url of the MCP server.
          maxLength: 200
        image:
          type: string
          format: uri
          nullable: true
        transport:
          $ref: '#/components/schemas/TransportEnum'
        extra_headers:
          description: Headers to send to the MCP server. Useful for authentication,
        platform_key:
          type: string
          readOnly: true
        is_featured:
          type: boolean
          description: Featured mcp servers will be accessible to all other tenants.
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    PatchedMediaResource:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        title:
          type: string
          description: Title of the media resource
          maxLength: 255
        description:
          type: string
          nullable: true
          description: Description of the media resource
        media_type:
          allOf:
            - $ref: '#/components/schemas/MediaTypeEnum'
          description: |-
            Type of media

            * `video` - Video
            * `image` - Image
            * `document` - Document
            * `audio` - Audio
            * `other` - Other
        item_type:
          allOf:
            - $ref: '#/components/schemas/ItemTypeEnum'
          readOnly: true
          description: |-
            Type of item this media is associated with

            * `course` - Course
            * `unit` - Unit
            * `resource` - Resource
            * `course_unit` - Course and Unit
            * `course_resource` - Course and Resource
            * `unit_resource` - Unit and Resource
            * `all` - Course, Unit, and Resource
        course_id:
          type: string
          nullable: true
          description: ID of the associated course
          maxLength: 255
        unit_id:
          type: string
          nullable: true
          description: ID of the associated unit
          maxLength: 255
        item_id:
          type: string
          nullable: true
          description: ID of the associated item (resource)
          maxLength: 255
        platform:
          type: integer
          readOnly: true
          description: The platform this media resource belongs to
        file_url:
          type: string
          format: uri
          nullable: true
          description: External URL for the media resource
          maxLength: 1000
        file:
          type: string
          format: uri
          nullable: true
          description: Uploaded media file
        created_by:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: User who created this media resource
          readOnly: true
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: When this record was created
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: When this record was last updated
    PatchedMentorCategoryGroupCreate:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
        audience:
          type: integer
          nullable: true
          description: >-
            Deprecated: This is only left for backward compatibility. Please use
            the audiences field instead.
        audiences:
          type: array
          items:
            type: integer
        date_created:
          type: string
          format: date-time
          readOnly: true
    PatchedMentorCreate:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        unique_id:
          type: string
          format: uuid
        flow:
          nullable: true
          description: The langflow json for the mentor
        slug:
          type: string
          maxLength: 255
          pattern: ^[-a-zA-Z0-9_]+$
        platform:
          type: string
          maxLength: 255
        allow_anonymous:
          type: boolean
        metadata:
          nullable: true
        enable_moderation:
          type: boolean
        enable_multi_query_rag:
          type: boolean
        enable_post_processing_system:
          type: boolean
        enable_openai_assistant:
          type: boolean
          description: (Deprecated) Set template mentor to openai-agent instead.
        enable_total_grounding:
          type: boolean
          description: >-
            Whether to force mentor to only use information within the provided
            documents.
        enable_suggested_prompts:
          type: boolean
          description: >-
            Whether to show suggested prompts for the mentor or not. Note:
            Suggested prompts are created by tenant admins.
        enable_guided_prompts:
          type: boolean
          description: >-
            Whether to show suggested prompts for the mentor or not. Note:
            Guided prompts are created with an llm based on chat history.
        google_voice:
          type: integer
          nullable: true
        openai_voice:
          type: integer
          nullable: true
        guided_prompt_instructions:
          type: string
          description: Instructions to determine how prompt suggestions are generated.
        categories:
          type: array
          items:
            type: integer
        types:
          type: array
          items:
            type: integer
        subjects:
          type: array
          items:
            type: integer
        proactive_prompt:
          type: string
          description: >-
            Prompt template used to start a conversation with the user when
            greeting_type is proactive_prompt. This will be sent to the LLM so
            it can respond naturally
        disclaimer:
          type: string
          description: Disclaimer to be shown to the user when the mentor is used.
        enable_disclaimer:
          type: boolean
        embed_is_context_aware:
          type: boolean
          description: Allow embedded mentor to read content on the embedded web page.
        embed_open_by_default:
          type: boolean
          description: Open mentor embed iframe by default.
        embed_show_attachment:
          type: boolean
          description: Show attachments on embedded mentor.
        embed_show_voice_call:
          type: boolean
          description: Show voice call button on embedded mentor.
        embed_show_voice_record:
          type: boolean
          description: Show voice recording button on embedded mentor.
        placeholder_prompt:
          type: string
          description: >-
            Placeholder to be shown in the input text area when the mentor is
            used.
        moderation_system_prompt:
          type: string
          description: >-
            The prompt for the moderation system. This prompt must clearly
            distinguish between 'Approapriate' and 'Not Appropriate' queries.
        post_processing_prompt:
          type: string
          description: >-
            Prompt to be used to alter or modify final llm response into any
            desired form.
        moderation_response:
          type: string
          description: >-
            Desired feedback to return to the user when their prompt is deemed
            inappropriate.
        safety_system_prompt:
          type: string
          description: Prompt to check whether the models response is appropriate or not.
        safety_response:
          type: string
          description: >-
            Feedback given to the user when a model generates an inappropriate
            response
        disable_chathistory:
          type: boolean
        enable_safety_system:
          type: boolean
        proactive_response:
          type: string
          description: Response to start a conversation with a user.
        mcp_servers:
          type: array
          items:
            type: integer
        greeting_method:
          allOf:
            - $ref: '#/components/schemas/GreetingMethodEnum'
          description: >-
            How the mentor should greet the user. proactive_prompt: Allow the
            LLM to respond to proactive_prompt msg. proactive_response: use
            proactive_response template without performing an LLM call.


            * `proactive_prompt` - Proactive Prompt

            * `proactive_response` - Proactive Response
        last_accessed_by:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          nullable: true
        recently_accessed_at:
          type: string
          format: date-time
          nullable: true
        created_by:
          type: string
          nullable: true
          maxLength: 255
        created_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
    PatchedNotification:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        username:
          type: string
        title:
          type: string
          readOnly: true
        body:
          type: string
          readOnly: true
        status:
          title: Message status
          oneOf:
            - $ref: '#/components/schemas/NotificationStatusEnum'
            - $ref: '#/components/schemas/BlankEnum'
        channel:
          type: string
          nullable: true
          readOnly: true
        context:
          nullable: true
        short_message:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
          readOnly: true
    PatchedNotificationTemplateDetail:
      type: object
      description: Serializer for detailed template view and editing
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: Unique identifier for this notification template.
        type:
          readOnly: true
          nullable: true
          description: >-
            Select the type of notification from the available options.


            * `DEFAULT_TEMPLATE` - Default Template

            * `APP_REGISTRATION` - App Registration

            * `USER_NOTIF_USER_REGISTRATION` - User Notif User Registration

            * `USER_NOTIF_COURSE_ENROLLMENT` - User Notif Course Enrollment

            * `ADMIN_NOTIF_COURSE_ENROLLMENT` - Admin Notif Course Enrollment

            * `USER_NOTIF_USER_INACTIVITY` - User Notif User Inactivity

            * `USER_NOTIF_COURSE_COMPLETION` - User Notif Course Completion

            * `USER_NOTIF_CREDENTIALS` - User Notif Credentials

            * `CUSTOM_NOTIFICATION` - Custom Notification

            * `PLATFORM_INVITATION` - Platform Invitation

            * `PROGRAM_INVITATION` - Program Invitation

            * `COURSE_INVITATION` - Course Invitation

            * `USER_NOTIF_LEARNER_PROGRESS` - User Notif Learner Progress

            * `PROACTIVE_LEARNER_NOTIFICATION` - Proactive Learner Notification

            * `ROLE_CHANGE` - Role Change

            * `COURSE_LICENSE_ASSIGNMENT` - Course License Assignment

            * `COURSE_LICENSE_GROUP_ASSIGNMENT` - Course License Group
            Assignment

            * `PROGRAM_LICENSE_ASSIGNMENT` - Program License Assignment

            * `PROGRAM_LICENSE_GROUP_ASSIGNMENT` - Program License Group
            Assignment

            * `USER_LICENSE_ASSIGNMENT` - User License Assignment

            * `USER_LICENSE_GROUP_ASSIGNMENT` - User License Group Assignment
          oneOf:
            - $ref: '#/components/schemas/Type2a5Enum'
            - $ref: '#/components/schemas/NullEnum'
        name:
          type: string
          nullable: true
          description: A friendly name for the notification template.
          maxLength: 255
        description:
          type: string
          description: >-
            Admin-friendly description of what this notification does, when it
            triggers, and what data it needs
        message_title:
          type: string
          nullable: true
          description: The title for the notification message.
          maxLength: 255
        message_body:
          type: string
          description: The full notification message body.
        short_message_body:
          type: string
          description: A short version of the notification message body.
        email_subject:
          type: string
          nullable: true
          description: Email subject line (supports Django template syntax)
          maxLength: 255
        email_from_address:
          type: string
          nullable: true
          description: 'Sender email address (default: IBL <noreply@ibl.ai>)'
          maxLength: 255
        email_html_template:
          type: string
          nullable: true
          description: Full HTML template for email body
        spas_detail:
          type: array
          items:
            $ref: '#/components/schemas/Spa'
          readOnly: true
        allowed_channels_detail:
          type: array
          items:
            $ref: '#/components/schemas/ConsumerChannel'
          readOnly: true
        spa_ids:
          type: array
          items:
            type: integer
            writeOnly: true
          writeOnly: true
        channel_ids:
          type: array
          items:
            type: integer
            writeOnly: true
          writeOnly: true
        is_inherited:
          type: boolean
          readOnly: true
        is_enabled:
          type: boolean
          readOnly: true
        source_platform:
          type: string
          readOnly: true
        metadata: {}
        available_context:
          type: string
          readOnly: true
        proactive_prompt_message:
          type: string
          nullable: true
          description: Default prompt message for AI mentor notifications
        periodic_config:
          type: string
          readOnly: true
        periodic_learner_scope:
          allOf:
            - $ref: '#/components/schemas/PeriodicLearnerScopeEnum'
          writeOnly: true
        periodic_report_period_days:
          type: integer
          maximum: 365
          minimum: 1
          writeOnly: true
        periodic_frequency:
          allOf:
            - $ref: '#/components/schemas/PeriodicFrequencyEnum'
          writeOnly: true
        periodic_custom_interval_days:
          type: integer
          maximum: 365
          minimum: 1
          writeOnly: true
        periodic_execution_time:
          type: string
          writeOnly: true
        periodic_timezone:
          type: string
          writeOnly: true
        periodic_mentors:
          type: array
          items:
            type: object
            additionalProperties: {}
          writeOnly: true
          description: >-
            List of mentor configurations: [{"unique_id": "uuid", "prompt":
            "..."}]
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Timestamp when this template was created
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Timestamp when this template was last updated
    PatchedNotificationToggle:
      type: object
      description: Serializer for toggling notification preference
      properties:
        allow_notification:
          type: boolean
    PatchedPeriodicAgentCreate:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        mentor:
          type: string
          format: uuid
        title:
          type: string
          maxLength: 255
        username:
          type: string
          readOnly: true
        description:
          type: string
        prompt:
          type: string
          description: Prompt for the periodic agent if any.
        task:
          $ref: '#/components/schemas/PeriodicTask'
        created_at:
          type: string
          format: date-time
          readOnly: true
        modified_at:
          type: string
          format: date-time
          readOnly: true
        enabled:
          type: boolean
          readOnly: true
        one_off:
          type: boolean
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        pathway:
          type: string
          maxLength: 255
        callback_url:
          type: string
          format: uri
          maxLength: 200
        callback_secret:
          type: string
          maxLength: 255
        parent_session_id:
          type: string
          maxLength: 200
        parent_mentor_id:
          type: integer
          maximum: 9223372036854776000
          minimum: -9223372036854776000
          format: int64
          nullable: true
        previous_agent:
          type: integer
          nullable: true
          description: Agent that needs to run before the current agent runs.
        previous_agent_status:
          allOf:
            - $ref: '#/components/schemas/PreviousAgentStatusEnum'
          description: >-
            The status that the previous agent must be in before this agent gets
            scheduled.


            * `success` - Success

            * `error` - Error

            * `running` - Running

            * `pending` - Pending
        previous_agent_output:
          type: string
          readOnly: true
          description: >-
            This will be fed into the run of this agent as part of its input
            prompt.
    PatchedPlatformPublicImageAsset:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        category:
          type: string
          description: Category of the asset
          maxLength: 200
        image:
          type: string
          format: uri
          writeOnly: true
        url:
          type: string
          readOnly: true
        created_on:
          type: string
          format: date-time
          readOnly: true
        last_updated:
          type: string
          format: date-time
          readOnly: true
    PatchedPlatformPublicMetadata:
      type: object
      properties:
        platform_key:
          type: string
          readOnly: true
        platform_name:
          type: string
          readOnly: true
        metadata:
          description: The public metadata
    PatchedPlayWrightScript:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        platform:
          type: integer
          readOnly: true
          nullable: true
        student:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          readOnly: true
          nullable: true
        title:
          type: string
          maxLength: 400
        description:
          type: string
          maxLength: 400
        script:
          type: string
        is_public:
          type: boolean
          readOnly: true
    PatchedProject:
      type: object
      description: >-
        Unified serializer for Project model.


        Write-only fields:

        - mentors_to_add: List of mentor unique IDs to add to the project

        - mentors_to_remove: List of mentor unique IDs to remove from the
        project


        These fields are mutually exclusive and only used during create/update
        operations.

        For create: only mentors_to_add is used

        For update: either can be used, but not both at once
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: Name of the project
          maxLength: 255
        description:
          type: string
          description: Description of the project
        shared:
          type: boolean
          description: Whether this project is shared with others or personal
        owner:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: User who created this project
          readOnly: true
        owner_username:
          type: string
          readOnly: true
        platform:
          type: integer
          readOnly: true
          nullable: true
          description: Platform this project belongs to
        platform_key:
          type: string
          readOnly: true
        platform_name:
          type: string
          readOnly: true
        mentor_count:
          type: integer
          readOnly: true
        is_personal:
          type: boolean
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        mentors:
          type: array
          items:
            $ref: '#/components/schemas/ProjectMentor'
          readOnly: true
        mentors_to_add:
          type: array
          items:
            type: string
            format: uuid
          writeOnly: true
          description: List of mentor unique IDs to add to the project
        mentors_to_remove:
          type: array
          items:
            type: string
            format: uuid
          writeOnly: true
          description: List of mentor unique IDs to remove from the project
    PatchedPrompt:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        mentor:
          type: string
          format: uuid
        tone:
          type: string
          nullable: true
        style:
          type: string
        language:
          type: string
        tags:
          type: array
          items:
            type: integer
        is_system:
          type: boolean
          default: true
        metadata: {}
        category:
          type: string
        prompt:
          type: string
        title:
          type: string
          nullable: true
          maxLength: 255
        description:
          type: string
          nullable: true
        prompt_visibility:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/PromptVisibilityEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        created_by:
          type: string
          nullable: true
          maxLength: 255
        platform:
          type: integer
    PatchedRbacGroup:
      type: object
      description: Serializer for RBAC groups.
      properties:
        id:
          type: integer
          readOnly: true
        unique_id:
          type: string
          description: The unique identifier for the group
          maxLength: 255
        platform:
          allOf:
            - $ref: '#/components/schemas/RbacPlatform'
          readOnly: true
        platform_key:
          type: string
          description: The platform key
          writeOnly: true
        name:
          type: string
          description: Optional name of the group
          maxLength: 255
        description:
          type: string
          description: Optional group description
        owner:
          allOf:
            - $ref: '#/components/schemas/RbacUser'
          readOnly: true
        users:
          type: array
          items:
            $ref: '#/components/schemas/RbacUser'
          readOnly: true
        users_to_add:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of user IDs to add to this group
        users_to_remove:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of user IDs to remove from this group
        is_internal:
          type: boolean
          readOnly: true
          description: >-
            When True, this group is internal to the system and cannot be viewed
            or modified by tenants via API endpoints.
    PatchedRbacPolicy:
      type: object
      description: Serializer for policies.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: Policy name. If not supplied, defaults to a UUID4
          maxLength: 255
        role:
          allOf:
            - $ref: '#/components/schemas/RbacBaseRole'
          readOnly: true
          description: Role information (read-only)
        platform:
          allOf:
            - $ref: '#/components/schemas/RbacPlatform'
          readOnly: true
          description: Platform information (read-only)
        resources:
          type: array
          items:
            type: string
          description: >-
            List of resource paths this policy grants access to (e.g.,
            ['/platforms/1/mentors', '/platforms/1/mentors/settings'])
        users:
          type: array
          items:
            $ref: '#/components/schemas/RbacUser'
          readOnly: true
        groups:
          type: array
          items:
            $ref: '#/components/schemas/RbacPolicyGroup'
          readOnly: true
        role_id:
          type: integer
          writeOnly: true
          description: ID of the role this policy applies to
        platform_key:
          type: string
          description: Platform key where this policy applies
          writeOnly: true
        users_to_add:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of user IDs to add to this Policy
        users_to_remove:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of user IDs to remove from this Policy
        groups_to_add:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of group IDs to add to this Policy
        groups_to_remove:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of group IDs to remove from this Policy
        is_internal:
          type: boolean
          readOnly: true
          description: >-
            When True, this policy is internal to the system and cannot be
            viewed or modified by tenants via API endpoints.
    PatchedRbacRole:
      type: object
      description: Serializer for roles.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        platform:
          allOf:
            - $ref: '#/components/schemas/RbacPlatform'
          readOnly: true
          description: Platform information (read-only)
        platform_key:
          type: string
          description: Platform key where this role belongs
          writeOnly: true
        actions:
          type: array
          items:
            type: string
          description: >-
            List of actions/permissions this role can perform (e.g.,
            ['Ibl.Mentor/Settings/read', 'Ibl.Mentor/Settings/write'])
        data_actions:
          type: array
          items:
            type: string
          description: >-
            List of data actions/permissions this role can perform for
            field-level access (e.g., ['Ibl.Mentor/Settings/name/read',
            'Ibl.Mentor/Settings/email/write'])
        is_internal:
          type: boolean
          readOnly: true
          description: >-
            When True, this role is internal to the system and cannot be viewed
            or modified by tenants via API endpoints.
    PatchedSCIMGroup:
      type: object
      description: SCIM group serializer for RBAC group management
      properties:
        schemas:
          type: array
          items:
            type: string
          default:
            - urn:ietf:params:scim:schemas:core:2.0:Group
          description: SCIM schema identifiers
        id:
          type: string
          description: RBAC group unique ID (must match existing RBAC group)
        displayName:
          type: string
          description: RBAC group display name
        description:
          type: string
          description: RBAC group description
        members:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: Users to add/remove from the RBAC group
        meta:
          allOf:
            - $ref: '#/components/schemas/SCIMMeta'
          description: Resource metadata
    PatchedSCIMUserResponse:
      type: object
      description: SCIM user response serializer
      properties:
        schemas:
          type: array
          items:
            type: string
          description: SCIM schema identifiers
        id:
          type: string
          description: User ID
        userName:
          type: string
          description: Username
        name:
          allOf:
            - $ref: '#/components/schemas/SCIMName'
          description: User's name information
        emails:
          type: array
          items:
            $ref: '#/components/schemas/SCIMEmail'
          description: User's email addresses
        active:
          type: boolean
          description: Whether the user is active
        urn_ietf_params_scim_schemas_extension_enterprise_2_0_User:
          allOf:
            - $ref: '#/components/schemas/SCIMEnterpriseUser'
          description: Enterprise user extension data
        meta:
          allOf:
            - $ref: '#/components/schemas/SCIMMeta'
          description: Resource metadata
    PatchedSection:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        course:
          type: integer
        display_name:
          type: string
          maxLength: 255
        status:
          allOf:
            - $ref: '#/components/schemas/Status6eeEnum'
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    PatchedSkillThreshold:
      type: object
      properties:
        name:
          type: string
          description: The name of the threshold e.g Beginner.
          maxLength: 255
        threshold:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          description: The threshold for the skill.
        platform:
          type: string
          description: The platform key
    PatchedSlackConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        bot:
          type: integer
        client_id:
          type: string
          maxLength: 255
        client_secret:
          type: string
          maxLength: 500
        app_token:
          type: string
          maxLength: 500
        verification_token:
          type: string
          maxLength: 500
    PatchedSlackUserConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        user:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          readOnly: true
        slack_team_domain:
          type: string
          description: >-
            Team Domain in the stated slack workspace. This is also the
            workspace name.
          maxLength: 200
        slack_username:
          type: string
          description: Username in the stated slack workspace
          maxLength: 200
        date_created:
          type: string
          format: date-time
          readOnly: true
        last_modified:
          type: string
          format: date-time
          readOnly: true
    PatchedSubSection:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        section:
          type: integer
        display_name:
          type: string
          maxLength: 255
        status:
          allOf:
            - $ref: '#/components/schemas/Status6eeEnum'
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    PatchedTeamsConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        bot:
          type: integer
          readOnly: true
        client_id:
          type: string
          maxLength: 500
        client_secret:
          type: string
          maxLength: 500
        verification_token:
          type: string
          maxLength: 500
    PatchedTicketMessage:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        ticket:
          type: integer
        sender:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          nullable: true
        message:
          type: string
        timestamp:
          type: string
          format: date-time
          readOnly: true
    PatchedTrainingCreate:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        project_name:
          type: string
          maxLength: 255
        dataset:
          type: string
          format: uuid
        base_model_name:
          type: string
          maxLength: 400
        provider:
          $ref: '#/components/schemas/Provider63aEnum'
        text_column:
          type: string
          maxLength: 50
        learning_rate:
          type: number
          format: double
        batch_size:
          type: integer
          maximum: 2147483647
          minimum: 0
        num_epochs:
          type: integer
          maximum: 2147483647
          minimum: 0
        block_size:
          type: integer
          maximum: 2147483647
          minimum: 0
        warmup_ratio:
          type: number
          format: double
        lora_r:
          type: integer
          maximum: 2147483647
          minimum: 0
        lora_alpha:
          type: integer
          maximum: 2147483647
          minimum: 0
        lora_dropout:
          type: number
          format: double
        weight_decay:
          type: number
          format: double
        gradient_accumulation:
          type: integer
          maximum: 2147483647
          minimum: 0
        use_peft:
          type: boolean
        use_fp16:
          type: boolean
        use_int4:
          type: boolean
        push_to_hub:
          type: boolean
        repo_id:
          type: string
          maxLength: 400
        preprocess_dataset:
          type: boolean
        prompt_column:
          type: string
          maxLength: 50
        prompt_prefix:
          type: string
          maxLength: 50
        prompt_suffix:
          type: string
          maxLength: 50
        response_prefix:
          type: string
          maxLength: 50
        date_created:
          type: string
          format: date-time
          readOnly: true
        last_modified:
          type: string
          format: date-time
          readOnly: true
    PatchedUnit:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        subsection:
          type: integer
        display_name:
          type: string
          maxLength: 255
        status:
          allOf:
            - $ref: '#/components/schemas/Status6eeEnum'
          readOnly: true
        type:
          $ref: '#/components/schemas/TypeC42Enum'
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    PatchedWebexConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        bot:
          type: integer
          readOnly: true
        webex_bot_id:
          type: string
          description: Bot id from webex
          maxLength: 255
        bot_access_token:
          type: string
          maxLength: 500
        bot_username:
          type: string
          maxLength: 500
    PatchedWhatsappConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        bot:
          type: integer
          readOnly: true
        phone_number_id:
          type: string
          maxLength: 255
        application_secret:
          type: string
          maxLength: 500
        webhook_verification_token:
          type: string
          maxLength: 500
        access_token:
          type: string
          description: Access token to the bot. This can also be a temporary access token.
          maxLength: 500
    PatchedWhatsappUserConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        user:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          readOnly: true
        phone_number:
          type: string
          maxLength: 128
        date_created:
          type: string
          format: date-time
          readOnly: true
        last_modified:
          type: string
          format: date-time
          readOnly: true
    Pathway:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        pathway_id:
          type: string
          description: A unique pathway ID.
          maxLength: 255
        pathway_uuid:
          type: string
          format: uuid
        path:
          type: string
          readOnly: true
        name:
          type: string
          description: The verbose name of the pathway.
          maxLength: 255
        visible:
          type: boolean
          description: Pathway visibility
        slug:
          type: string
          nullable: true
          description: An additional unique slug field. (Optional)
          maxLength: 255
          pattern: ^[-a-zA-Z0-9_]+$
        user_id:
          type: integer
        username:
          type: string
        platform_key:
          type: string
        data:
          nullable: true
          description: Metadata
      required:
        - id
        - path
        - pathway_id
    PathwayCompletion:
      type: object
      properties:
        completed:
          type: boolean
        completion_percentage:
          type: number
          format: double
          nullable: true
      required:
        - completed
    PathwayCompletionResponse:
      type: object
      description: Response serializer for PathwayCompletionQueryView GET endpoint.
      properties:
        count:
          type: integer
          description: Total number of items in the pathway
        completion_percentage:
          type: number
          format: double
          description: Overall completion percentage for the pathway (0.0 to 1.0)
      required:
        - completion_percentage
        - count
    PathwayCreateUpdateRequest:
      type: object
      description: Serializer for pathway creation/update request body.
      properties:
        pathway_id:
          type: string
          description: Pathway ID
        pathway_uuid:
          type: string
          description: Pathway UUID
        user_id:
          type: integer
          description: User ID of the pathway owner
        username:
          type: string
          description: Username of the pathway owner
        name:
          type: string
          description: Pathway name
        slug:
          type: string
          description: Pathway slug
        visible:
          type: boolean
          default: true
          description: Whether the pathway is visible
        platform_key:
          type: string
          description: Platform key
        path:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: List of items in the pathway with item_id and optional position
        data:
          description: Additional pathway data
      required:
        - name
        - path
        - user_id
    PathwayDeleteResponse:
      type: object
      description: Serializer for pathway deletion response.
      properties:
        count:
          type: integer
          description: Number of pathways deleted
        type:
          type: object
          additionalProperties: {}
          description: Types of objects deleted
      required:
        - count
        - type
    PathwayDetail:
      type: object
      properties:
        pathway_id:
          type: string
        name:
          type: string
          nullable: true
        platform:
          type: string
          nullable: true
        enrollment:
          $ref: '#/components/schemas/PathwayEnrollment'
        completion:
          allOf:
            - $ref: '#/components/schemas/PathwayCompletion'
          nullable: true
      required:
        - enrollment
        - pathway_id
    PathwayEnrollment:
      type: object
      properties:
        created:
          type: string
          format: date-time
          nullable: true
        ended:
          type: string
          format: date-time
          nullable: true
        active:
          type: boolean
      required:
        - active
    PathwayEnrollmentPlus:
      type: object
      description: Includes metadata+
      properties:
        user_id:
          type: integer
        username:
          type: string
        pathway_id:
          type: string
        pathway_uuid:
          type: string
        platform_key:
          type: string
        org:
          type: string
        name:
          type: string
        slug:
          type: string
        created:
          type: string
          format: date-time
          nullable: true
          description: Date when enrollment began/activated
        ended:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: Date when enrollment ended/deactivated
        active:
          type: boolean
          description: Whether the enrollment is active
        metadata:
          nullable: true
      required:
        - ended
    PathwayEnrollmentRequest:
      type: object
      description: Serializer for pathway enrollment request parameters.
      properties:
        user_id:
          type: string
          description: User ID for enrollment
        username:
          type: string
          description: Username for enrollment
        pathway_id:
          type: string
          description: Pathway ID for enrollment
        pathway_uuid:
          type: string
          description: Pathway UUID for enrollment
        pathway_key:
          type: string
          description: Pathway key for enrollment
        slug:
          type: string
          description: Pathway slug for enrollment
        org:
          type: string
          description: Organization for the pathway
        platform_key:
          type: string
          description: Platform key for the pathway
        include_default_platform:
          type: boolean
          description: Include enrollments from default platform
        include_metadata:
          type: boolean
          default: true
          description: Include metadata in the response
        active:
          type: boolean
          default: true
          description: Whether the enrollment should be active
    PathwayGroupSuggestionCreate:
      type: object
      description: >-
        Request serializer for PathwayGroupSuggestionManagementView POST
        endpoint
      properties:
        platform_key:
          type: string
          description: The platform for the group suggestion
        platform_org:
          type: string
          description: The organization identifier for the platform
        pathway_uuid:
          type: string
          description: The pathway UUID to suggest
        group_id:
          type: integer
          description: The group to suggest the pathway to
        accepted:
          type: boolean
          default: false
          description: Whether the suggestion is accepted
        visible:
          type: boolean
          default: true
          description: Whether the suggestion is visible
        metadata:
          type: object
          additionalProperties: {}
          description: Additional suggestion metadata
        suggested_by:
          type: string
          description: The user who suggested the group
        department_mode:
          type: boolean
          default: false
          description: Flag to ensure department admins can call the API
      required:
        - group_id
        - pathway_uuid
        - platform_key
    PathwayGroupSuggestionDetail:
      type: object
      description: Response serializer for pathway group suggestion details
      properties:
        id:
          type: integer
          description: The unique identifier for the group suggestion
        group_id:
          type: integer
          description: The ID of the group receiving the suggestion
        group_name:
          type: string
          description: The name of the group receiving the suggestion
        platform_key:
          type: string
          description: The platform key associated with the suggestion
        accepted:
          type: boolean
          description: Whether the suggestion has been accepted
        visible:
          type: boolean
          description: Whether the suggestion is visible
        created:
          type: string
          format: date-time
          description: When the suggestion was created
        modified:
          type: string
          format: date-time
          description: When the suggestion was last modified
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the suggestion
        pathway_id:
          type: string
          description: The pathway ID being suggested
        pathway_uuid:
          type: string
          description: The UUID of the pathway being suggested
        pathway_name:
          type: string
          description: The name of the pathway being suggested
        pathway_platform_key:
          type: string
          description: The platform key associated with the pathway
        user_count:
          type: integer
          description: Number of users in the group
      required:
        - created
        - group_id
        - group_name
        - id
        - metadata
        - modified
        - pathway_id
        - pathway_name
        - pathway_platform_key
        - pathway_uuid
        - platform_key
        - visible
    PathwaySelfEnrollmentRequest:
      type: object
      description: Serializer for pathway self-enrollment request parameters.
      properties:
        user_id:
          type: string
          description: User ID for self-enrollment
        username:
          type: string
          description: Username for self-enrollment
        pathway_id:
          type: string
          description: Pathway ID for self-enrollment
        pathway_key:
          type: string
          description: Pathway key for self-enrollment
        slug:
          type: string
          description: Pathway slug for self-enrollment
        org:
          type: string
          description: Organization for the pathway
        platform_key:
          type: string
          description: Platform key for the pathway
        active:
          type: boolean
          default: true
          description: Whether the enrollment should be active
    PathwaySuggestionBulkCreate:
      type: object
      description: Request serializer for PathwaySuggestionBulkManagementView POST endpoint
      properties:
        platform_key:
          type: string
          description: The platform for the suggestions
        platform_org:
          type: string
          description: The organization identifier for the platform
        suggestion_data:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: >-
            List of suggestion data objects, each containing pathway_id,
            user_id, etc.
        department_mode:
          type: boolean
          default: false
          description: Flag to ensure department admins can call the API
      required:
        - platform_key
        - suggestion_data
    PathwaySuggestionCreate:
      type: object
      description: Request serializer for PathwaySuggestionManagementView POST endpoint
      properties:
        platform_key:
          type: string
          description: The platform for the suggestion
        pathway_id:
          type: string
          description: The pathway ID to suggest
        pathway_uuid:
          type: string
          description: The pathway UUID to suggest
        user_id:
          type: string
          description: The user to suggest the pathway to
        username:
          type: string
          description: The username of the user to suggest the pathway to
        email:
          type: string
          format: email
          description: The email of the user to suggest the pathway to
        accepted:
          type: boolean
          default: false
          description: Whether the suggestion is accepted
        visible:
          type: boolean
          default: true
          description: Whether the suggestion is visible
        metadata:
          type: object
          additionalProperties: {}
          description: Additional suggestion metadata
        suggested_by:
          type: string
          description: The user who suggested the pathway
        direct:
          type: boolean
          default: true
          description: Whether the suggestion is direct
        department_mode:
          type: boolean
          default: false
          description: Flag to ensure department admins can call the API
      required:
        - pathway_id
        - pathway_uuid
        - platform_key
        - user_id
    PathwaySuggestionDetail:
      type: object
      description: Response serializer for pathway suggestion details
      properties:
        id:
          type: integer
          description: The unique identifier for the suggestion
        user_id:
          type: integer
          description: The ID of the user receiving the suggestion
        username:
          type: string
          description: The username of the user receiving the suggestion
        name:
          type: string
          description: The full name of the user receiving the suggestion
        platform_key:
          type: string
          description: The platform key associated with the suggestion
        accepted:
          type: boolean
          description: Whether the suggestion has been accepted by the user
        visible:
          type: boolean
          description: Whether the suggestion is visible to the user
        created:
          type: string
          format: date-time
          description: When the suggestion was created
        modified:
          type: string
          format: date-time
          description: When the suggestion was last modified
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the suggestion
        pathway_id:
          type: string
          description: The pathway ID being suggested
        pathway_uuid:
          type: string
          description: The UUID of the pathway being suggested
        pathway_name:
          type: string
          description: The name of the pathway being suggested
        pathway_platform_key:
          type: string
          description: The platform key associated with the pathway
      required:
        - accepted
        - created
        - id
        - metadata
        - modified
        - name
        - pathway_id
        - pathway_name
        - pathway_platform_key
        - pathway_uuid
        - platform_key
        - user_id
        - username
        - visible
    PerLearnerCourseLastAccessData:
      type: object
      properties:
        course_id:
          type: string
          description: Edx Course ID
        course_name:
          type: string
          description: Course Name
        block_id:
          type: string
          description: Last Block Accessed
        block_display_name:
          type: string
          description: Last Block Display Name
        course_grade:
          type: number
          format: double
          description: Course grade
        course_progress:
          type: number
          format: double
          description: Course progress
        last_accessed:
          type: string
          description: Last accessed time
    PerLearnerCourseVideosWatched:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PerLearnerCourseVideosWatchedData'
        total:
          type: integer
          description: videos watched
      required:
        - data
        - total
    PerLearnerCourseVideosWatchedData:
      type: object
      properties:
        id:
          type: string
          description: Video Id
        name:
          type: string
          description: Video Name
        watched:
          type: boolean
          description: Watch status
      required:
        - id
        - name
        - watched
    PerLearnerLastAccess:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/PerLearnerLastAccessData'
    PerLearnerLastAccessData:
      type: object
      properties:
        course_last_accessed:
          allOf:
            - $ref: '#/components/schemas/PerLearnerCourseLastAccessData'
          description: Course last accessed metadata
        last_accessed:
          type: string
          description: Last accessed time
    PerLearnerTimeSpentInCourseTree:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/TimeChildData'
        total:
          type: integer
          description: Total time spent
    PerformanceGradesPerCourse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PerformanceGradesPerCourseData'
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - pagination
    PerformanceGradesPerCourseData:
      type: object
      properties:
        name:
          type: string
          description: Course name
        course_id:
          type: string
          description: Course id
        num_enrollments:
          type: integer
          description: Course enrollments
        num_passed:
          type: integer
          description: Total users who have passed the course
        avg_grade:
          type: number
          format: double
          description: Course Average grade
      required:
        - avg_grade
        - course_id
        - name
        - num_enrollments
        - num_passed
    PeriodEnum:
      enum:
        - weekly
        - monthly
        - yearly
      type: string
      description: |-
        * `weekly` - weekly
        * `monthly` - monthly
        * `yearly` - yearly
    PeriodInfo:
      type: object
      description: Information about the analysis period.
      properties:
        start_date:
          type: string
          description: Start date of analysis period
        end_date:
          type: string
          description: End date of analysis period
        period_days:
          type: integer
          description: Number of days in period
        range_type:
          type: string
          description: Type of date range (custom, default, all_time, etc.)
    PeriodicAgent:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        mentor:
          $ref: '#/components/schemas/Mentor'
        title:
          type: string
          maxLength: 255
        username:
          type: string
          readOnly: true
        description:
          type: string
        prompt:
          type: string
          description: Prompt for the periodic agent if any.
        task:
          $ref: '#/components/schemas/PeriodicTask'
        created_at:
          type: string
          format: date-time
          readOnly: true
        modified_at:
          type: string
          format: date-time
          readOnly: true
        enabled:
          type: boolean
          readOnly: true
        one_off:
          type: boolean
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        pathway:
          type: string
          maxLength: 255
        callback_url:
          type: string
          format: uri
          maxLength: 200
        callback_secret:
          type: string
          maxLength: 255
        parent_session_id:
          type: string
          maxLength: 200
        parent_mentor_id:
          type: integer
          maximum: 9223372036854776000
          minimum: -9223372036854776000
          format: int64
          nullable: true
        previous_agent:
          type: integer
          nullable: true
          description: Agent that needs to run before the current agent runs.
        previous_agent_status:
          allOf:
            - $ref: '#/components/schemas/PreviousAgentStatusEnum'
          description: >-
            The status that the previous agent must be in before this agent gets
            scheduled.


            * `success` - Success

            * `error` - Error

            * `running` - Running

            * `pending` - Pending
        previous_agent_output:
          type: string
          readOnly: true
          description: >-
            This will be fed into the run of this agent as part of its input
            prompt.
      required:
        - created_at
        - enabled
        - id
        - mentor
        - modified_at
        - one_off
        - platform_key
        - previous_agent_output
        - task
        - title
        - username
    PeriodicAgentCreate:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        mentor:
          type: string
          format: uuid
        title:
          type: string
          maxLength: 255
        username:
          type: string
          readOnly: true
        description:
          type: string
        prompt:
          type: string
          description: Prompt for the periodic agent if any.
        task:
          $ref: '#/components/schemas/PeriodicTask'
        created_at:
          type: string
          format: date-time
          readOnly: true
        modified_at:
          type: string
          format: date-time
          readOnly: true
        enabled:
          type: boolean
          readOnly: true
        one_off:
          type: boolean
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        pathway:
          type: string
          maxLength: 255
        callback_url:
          type: string
          format: uri
          maxLength: 200
        callback_secret:
          type: string
          maxLength: 255
        parent_session_id:
          type: string
          maxLength: 200
        parent_mentor_id:
          type: integer
          maximum: 9223372036854776000
          minimum: -9223372036854776000
          format: int64
          nullable: true
        previous_agent:
          type: integer
          nullable: true
          description: Agent that needs to run before the current agent runs.
        previous_agent_status:
          allOf:
            - $ref: '#/components/schemas/PreviousAgentStatusEnum'
          description: >-
            The status that the previous agent must be in before this agent gets
            scheduled.


            * `success` - Success

            * `error` - Error

            * `running` - Running

            * `pending` - Pending
        previous_agent_output:
          type: string
          readOnly: true
          description: >-
            This will be fed into the run of this agent as part of its input
            prompt.
      required:
        - created_at
        - enabled
        - id
        - mentor
        - modified_at
        - one_off
        - platform_key
        - previous_agent_output
        - task
        - title
        - username
    PeriodicAgentLog:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        content:
          type: string
        status:
          $ref: '#/components/schemas/PeriodicAgentLogStatusEnum'
        start_time:
          type: string
          format: date-time
        end_time:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        modified_at:
          type: string
          format: date-time
          readOnly: true
        periodic_agent:
          type: integer
      required:
        - created_at
        - id
        - modified_at
        - periodic_agent
    PeriodicAgentLogStatusEnum:
      enum:
        - success
        - error
        - running
      type: string
      description: |-
        * `success` - Success
        * `error` - Error
        * `running` - Running
    PeriodicAgentStatistics:
      type: object
      properties:
        total_tasks:
          type: integer
        succeeded_tasks:
          type: integer
        failed_tasks:
          type: integer
        running_tasks:
          type: integer
        pending_tasks:
          type: integer
      required:
        - failed_tasks
        - pending_tasks
        - running_tasks
        - succeeded_tasks
        - total_tasks
    PeriodicFrequencyEnum:
      enum:
        - DAILY
        - WEEKLY
        - MONTHLY
        - CUSTOM
      type: string
      description: |-
        * `DAILY` - DAILY
        * `WEEKLY` - WEEKLY
        * `MONTHLY` - MONTHLY
        * `CUSTOM` - CUSTOM
    PeriodicLearnerScopeEnum:
      enum:
        - ACTIVE_LEARNERS
        - ALL_LEARNERS
      type: string
      description: |-
        * `ACTIVE_LEARNERS` - ACTIVE_LEARNERS
        * `ALL_LEARNERS` - ALL_LEARNERS
    PeriodicTask:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          readOnly: true
          description: Short Description For This Task
        crontab:
          $ref: '#/components/schemas/CrontabSchedule'
        one_off:
          type: boolean
          title: One-off Task
          description: If True, the schedule will only run the task a single time
        start_time:
          type: string
          format: date-time
          nullable: true
          title: Start Datetime
          description: Datetime when the schedule should begin triggering the task to run
        enabled:
          type: boolean
          description: Set to False to disable the schedule
      required:
        - crontab
        - id
        - name
    PerlearnerCourseProgress:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/PerlearnerCourseProgressData'
      required:
        - data
    PerlearnerCourseProgressData:
      type: object
      properties:
        progress:
          type: number
          format: double
          description: Perlearner Course progress
      required:
        - progress
    PerlearnerEngagementVideosData:
      type: object
      properties:
        course_id:
          type: string
          description: Edx Course ID
        name:
          type: string
          description: Course Name
        total_videos:
          type: integer
          description: Total course videos
        watched:
          type: integer
          description: Total videos watched by student
        total_time_watch:
          type: integer
          description: Total time user watched video
        average_class_watch:
          type: number
          format: double
          description: Average videos watched by students in course
        class_time_average:
          type: number
          format: double
          description: Average time spent by students on this course
      required:
        - average_class_watch
        - class_time_average
        - course_id
        - name
        - total_time_watch
        - total_videos
        - watched
    PerlearnerEngagementVideosWatchedPerCourse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PerlearnerEngagementVideosData'
      required:
        - data
    PerlearnerGradeSummary:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PerlearnerGradeSummaryData'
    PerlearnerGradeSummaryData:
      type: object
      properties:
        assignment_type:
          type: string
          description: Assignment Type name
        weight:
          type: number
          format: double
          description: Assignment weight
        weighted_grade:
          type: number
          format: double
          description: Assignment grade
        average_section_grade:
          type: number
          format: double
          description: Assignment section grade average in course
      required:
        - assignment_type
        - average_section_grade
        - weight
        - weighted_grade
    PerlearnerGradeWithCutOff:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/PerlearnerGradeWithCutOffData'
    PerlearnerGradeWithCutOffData:
      type: object
      properties:
        grade_cutoffs:
          type: object
          additionalProperties: {}
          description: Dictionary showing grade cutoffs
        grade:
          type: number
          format: double
          description: Grade
      required:
        - grade
        - grade_cutoffs
    PerlearnerGradingPerCourseAPI:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PerlearnerGradingPerCourseAPIData'
      required:
        - data
    PerlearnerGradingPerCourseAPIData:
      type: object
      properties:
        course_id:
          type: string
          description: Edx Course ID
        name:
          type: string
          description: Course Name
        graded_activities:
          type: string
          description: Total problems in course
        submissions:
          type: integer
          description: Cumulative problem submissions
        problems_attempted:
          type: integer
          description: Number of problems from total problems attempted
        assignments_correct:
          type: integer
          description: Number of problems answered correctly
        class_average:
          type: number
          format: double
          description: Average grade obtained by all learner in the course
        grade:
          type: number
          format: double
          description: Learner course grade
      required:
        - assignments_correct
        - class_average
        - course_id
        - grade
        - graded_activities
        - name
        - problems_attempted
        - submissions
    PerlearnerUserList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PerlearnerUserListData'
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - pagination
    PerlearnerUserListData:
      type: object
      properties:
        username:
          type: string
          description: learner username
        full_name:
          type: string
          description: learner Name
        enrollments:
          type: integer
          description: Total enrollments
        completions:
          type: integer
          description: Total completions
        last_active:
          type: string
          description: Last active time
        time_spent:
          type: string
          description: Time spent formatted in seconds
        engagement_index:
          type: number
          format: double
          description: Engagement index
        performance_index:
          type: number
          format: double
          description: Performance index
      required:
        - completions
        - engagement_index
        - enrollments
        - full_name
        - last_active
        - performance_index
        - time_spent
        - username
    PermissionCheckRequest:
      type: object
      description: Serializer for permission check requests
      properties:
        platform_key:
          type: string
          description: Platform key to check permissions for
        resources:
          type: array
          items:
            type: string
          description: >-
            List of resource paths to check permissions for. Must start and end
            with '/' (e.g., ['/mentors/', '/mentors/123/', '/students/'])
      required:
        - platform_key
        - resources
    PieChartData:
      type: object
      properties:
        new_users:
          $ref: '#/components/schemas/PieChartSegment'
        returning_users:
          $ref: '#/components/schemas/PieChartSegment'
      required:
        - new_users
        - returning_users
    PieChartSegment:
      type: object
      properties:
        count:
          type: integer
        percentage:
          type: number
          format: double
      required:
        - count
        - percentage
    PinnedMessageCreate:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        platform:
          type: string
          description: The platform key
        username:
          type: string
          maxLength: 255
        session_id:
          type: string
          format: uuid
          nullable: true
      required:
        - id
        - platform
        - session_id
        - username
    PinnedMessageGet:
      type: object
      properties:
        session_id:
          type: string
        mentor:
          $ref: '#/components/schemas/Mentor'
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ChatHistory'
      required:
        - mentor
        - messages
        - session_id
    PinnedMessageRequest:
      type: object
      properties:
        session_id:
          type: string
          description: Session id of the message to pin
      required:
        - session_id
    Platform:
      type: object
      description: 'Note: Create and update operations deprecated.'
      properties:
        key:
          type: string
          description: The platform key
          maxLength: 200
        name:
          type: string
          nullable: true
          description: The name of the platform
          maxLength: 200
        org:
          type: string
          nullable: true
          description: The associated edX org code
          maxLength: 200
        lms_url:
          type: string
          format: uri
          nullable: true
          description: The LMS URL for the platform
          maxLength: 300
        cms_url:
          type: string
          format: uri
          nullable: true
          description: The CMS URL for the platform
          maxLength: 300
        portal_url:
          type: string
          format: uri
          nullable: true
          description: The portal URL for the platform
          maxLength: 300
        is_advertising:
          type: boolean
          description: >-
            Advertising mode allows a platform to set custom usd balance to
            allocate for its members
      required:
        - key
    PlatformApiKey:
      type: object
      description: Serializer for PlatformApiKey's
      properties:
        username:
          type: string
          readOnly: true
          description: Username that created token
        name:
          type: string
          description: Name of the token. Used by the user to identify the token.
          maxLength: 255
          pattern: ^[-a-zA-Z0-9_]+$
        key:
          type: string
          readOnly: true
        platform_key:
          type: string
          description: The platform key
          writeOnly: true
        expires:
          type: string
          format: date-time
          readOnly: true
          description: When token expires
        expires_in:
          type: string
          writeOnly: true
          nullable: true
          description: >-
            Optional duration until key expires. Format: [DD]
            [HH:[MM:]]ss[.uuuuuu]
        created:
          type: string
          format: date-time
          readOnly: true
          description: When token was created
      required:
        - created
        - expires
        - key
        - name
        - platform_key
        - username
    PlatformConfigurationList:
      type: object
      description: Serializer for listing platform configurations
      properties:
        platform_key:
          type: string
          readOnly: true
        configurations:
          type: object
          additionalProperties: {}
          readOnly: true
          description: Dictionary of configuration key-value pairs with proper type casting
        count:
          type: integer
          readOnly: true
          description: Number of configurations returned
      required:
        - configurations
        - count
        - platform_key
    PlatformConfigurationSet:
      type: object
      description: Serializer for setting platform configurations
      properties:
        platform_key:
          type: string
          writeOnly: true
          description: Platform key to set configurations for
        configurations:
          type: array
          items:
            $ref: '#/components/schemas/ConfigurationItem'
          description: List of configurations to set
      required:
        - configurations
        - platform_key
    PlatformConfigurationSetResponse:
      type: object
      description: Response serializer for setting platform configurations
      properties:
        platform_key:
          type: string
          readOnly: true
        results:
          type: array
          items:
            type: object
            additionalProperties: {}
          readOnly: true
          description: Results for each configuration item
        total_set:
          type: integer
          readOnly: true
          description: Total number of configurations set
      required:
        - platform_key
        - results
        - total_set
    PlatformInfo:
      type: object
      description: Serializer for platform information.
      properties:
        platform_id:
          type: integer
          description: Platform ID
        platform_name:
          type: string
          description: Platform name
        platform_key:
          type: string
          description: Platform key
      required:
        - platform_id
        - platform_key
        - platform_name
    PlatformInvitationCreate:
      type: object
      description: Request serializer for PlatformInvitationView POST endpoint
      properties:
        platform_key:
          type: string
          description: The platform to create an invitation for
        email:
          type: string
          format: email
          description: The email address to invite
        username:
          type: string
          description: The username to invite
        active:
          type: boolean
          default: true
          description: Whether the invitation is active
        source:
          type: string
          description: The source of the invitation
        redirect_to:
          type: string
          format: uri
          description: URL to redirect to after accepting the invitation
        created:
          type: string
          format: date-time
          description: When the invitation was created
        expired:
          type: string
          format: date-time
          description: When the invitation expires
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the invitation
      required:
        - platform_key
    PlatformInvitationDetail:
      type: object
      description: Response serializer for platform invitation details
      properties:
        id:
          type: integer
          description: The unique identifier for the invitation
        user_id:
          type: integer
          nullable: true
          description: The ID of the user associated with the invitation
        username:
          type: string
          nullable: true
          description: The username of the user associated with the invitation
        email:
          type: string
          format: email
          nullable: true
          description: The email address associated with the invitation
        created:
          type: string
          format: date-time
          description: When the invitation was created
        started:
          type: string
          format: date-time
          nullable: true
          description: When the invitation was started
        expired:
          type: string
          format: date-time
          nullable: true
          description: When the invitation expires
        source:
          type: string
          nullable: true
          description: The source of the invitation
        redirect_to:
          type: string
          format: uri
          nullable: true
          description: URL to redirect to after accepting the invitation
        active:
          type: boolean
          description: Whether the invitation is active
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the invitation
        platform_key:
          type: string
          description: The platform key associated with the invitation
      required:
        - active
        - email
        - expired
        - id
        - metadata
        - platform_key
        - redirect_to
        - source
        - started
        - username
    PlatformInvitationRedemption:
      type: object
      description: Request serializer for PlatformInvitationRedemptionView POST endpoint
      properties:
        platform_key:
          type: string
          description: The platform key for the invitation
        source:
          type: string
          description: The source identifier for the invitation
        email:
          type: string
          format: email
          description: The email to associate with the invitation
        username:
          type: string
          description: The username to associate with the invitation
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the invitation
      required:
        - platform_key
        - source
    PlatformLicenseCreate:
      type: object
      description: Request serializer for PlatformLicenseCreateView POST endpoint
      properties:
        platform_key:
          type: string
          description: The platform to create a license for
        platform_org:
          type: string
          description: The organization identifier for the platform
        name:
          type: string
          description: Display name for the license
        count:
          type: integer
          default: 0
          description: Number of seats purchased
        started:
          type: string
          format: date-time
          description: Date when license should begin
        expired:
          type: string
          format: date-time
          nullable: true
          description: Date when license should expire
        active:
          type: boolean
          default: true
          description: Whether the license is active
        metadata:
          type: object
          additionalProperties: {}
          description: Additional license metadata
        source:
          type: string
          description: Source identifier
        external_id:
          type: string
          nullable: true
          description: External identifier (must be unique)
        transaction_id:
          type: string
          description: Transaction identifier for tracking
        change_type:
          type: string
          default: create
          description: Type of change being made
      required:
        - platform_key
    PlatformLicenseDetail:
      type: object
      description: Response serializer for platform license details
      properties:
        id:
          type: integer
          description: The unique identifier for the license
        created:
          type: string
          format: date-time
          description: When the license was created
        started:
          type: string
          format: date-time
          description: When the license becomes active
        expired:
          type: string
          format: date-time
          nullable: true
          description: When the license expires
        name:
          type: string
          description: The display name of the license
        count:
          type: integer
          description: The number of seats purchased
        active:
          type: boolean
          description: Whether the license is active
        metadata:
          type: object
          additionalProperties: {}
          description: Additional license metadata
        source:
          type: string
          description: The source identifier for the license
        external_id:
          type: string
          nullable: true
          description: External identifier for the license
        platform_key:
          type: string
          description: The platform key associated with the license
      required:
        - active
        - count
        - created
        - expired
        - external_id
        - id
        - metadata
        - name
        - platform_key
        - source
        - started
    PlatformLicenseUpdate:
      type: object
      description: Request serializer for PlatformLicenseUpdateView POST endpoint
      properties:
        license_id:
          type: integer
          description: >-
            The ID of the license to update (required if external_id not
            provided)
        external_id:
          type: string
          description: >-
            External identifier of the license to update (required if license_id
            not provided)
        platform_key:
          type: string
          description: The platform key (not updatable)
        platform_org:
          type: string
          description: The platform organization (not updatable)
        name:
          type: string
          description: Updated display name for the license
        count:
          type: integer
          description: Updated number of seats purchased
        started:
          type: string
          format: date-time
          description: Updated date when license should begin
        expired:
          type: string
          format: date-time
          nullable: true
          description: Updated date when license should expire
        active:
          type: boolean
          description: Updated active status
        metadata:
          type: object
          additionalProperties: {}
          description: Updated additional license metadata
        source:
          type: string
          description: Updated source identifier
        transaction_id:
          type: string
          description: Transaction identifier for tracking
        change_type:
          type: string
          default: update
          description: Type of change being made
    PlatformList:
      type: object
      properties:
        key:
          type: string
          description: The platform key
          maxLength: 200
        name:
          type: string
          nullable: true
          description: The name of the platform
          maxLength: 200
        org:
          type: string
          nullable: true
          description: The associated edX org code
          maxLength: 200
        lms_url:
          type: string
          format: uri
          nullable: true
          description: The LMS URL for the platform
          maxLength: 300
        cms_url:
          type: string
          format: uri
          nullable: true
          description: The CMS URL for the platform
          maxLength: 300
        portal_url:
          type: string
          format: uri
          nullable: true
          description: The portal URL for the platform
          maxLength: 300
        status:
          allOf:
            - $ref: '#/components/schemas/PlatformListStatusEnum'
          minimum: -2147483648
          maximum: 2147483647
        active:
          type: boolean
      required:
        - key
    PlatformListStatusEnum:
      enum:
        - -2
        - -1
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
      type: integer
      description: |-
        * `-2` - FAILED
        * `-1` - TERMINATED
        * `0` - PENDING
        * `1` - BUILDING
        * `2` - RUNNING
        * `3` - PAUSED
        * `4` - STOPPING
        * `5` - STOPPED
        * `6` - REPAIR
    PlatformMembershipConfig:
      type: object
      properties:
        platform_key:
          type: string
          readOnly: true
        platform_name:
          type: string
          readOnly: true
        allow_self_linking:
          type: boolean
          description: Whether users can self-link to this platform
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - created
        - modified
        - platform_key
        - platform_name
    PlatformMembershipConfigPostRequest:
      type: object
      properties:
        platform_key:
          type: string
        allow_self_linking:
          type: boolean
      required:
        - allow_self_linking
        - platform_key
    PlatformMetrics:
      type: object
      description: Serializer for detailed platform metrics (platform-specific view).
      properties:
        enrollments:
          $ref: '#/components/schemas/MetricDetail'
        programs:
          $ref: '#/components/schemas/MetricDetail'
        pathways:
          $ref: '#/components/schemas/MetricDetail'
        resources:
          $ref: '#/components/schemas/MetricDetail'
        skills:
          $ref: '#/components/schemas/SkillsMetric'
        credentials:
          $ref: '#/components/schemas/MetricDetail'
        points:
          $ref: '#/components/schemas/PointsMetric'
      required:
        - credentials
        - enrollments
        - pathways
        - points
        - programs
        - resources
        - skills
    PlatformPrompt:
      type: object
      description: >-
        Serializer for platform recommendation prompt management.


        Used by instructors/admins to configure tenant-specific prompts for
        different SPAs.

        A platform can have multiple prompts (one per SPA/frontend).


        Note: spa_url will be automatically normalized (protocol stripped,
        lowercase) during validation.
      properties:
        platform_key:
          type: string
          description: Platform key this prompt belongs to
        prompt_text:
          type: string
          description: The custom recommendation strategy prompt
        recommendation_type:
          allOf:
            - $ref: '#/components/schemas/RecommendationTypeEnum'
          default: catalog
          description: >-
            Prompt category. Use 'catalog' for
            courses/programs/resources/pathways; use 'mentors' for mentor
            prompts.


            * `mentors` - Mentor Recommendations

            * `catalog` - Catalog Recommendations
        spa_url:
          type: string
          nullable: true
          description: >-
            Frontend/SPA identifier (e.g., 'catalog.example.com',
            'mentor-ai.ibl.com', 'https://mentor-ai.ibl.com'). Protocol and case
            will be normalized automatically. Leave blank for platform-wide
            prompts.
        active:
          type: boolean
          default: true
          description: Whether this prompt is currently active
    PlatformPromptResponse:
      type: object
      description: Response serializer for platform prompt retrieval.
      properties:
        platform_key:
          type: string
        prompt_text:
          type: string
        recommendation_type:
          type: string
        spa_url:
          type: string
          nullable: true
        active:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        created_by:
          type: string
          nullable: true
          description: Username of who created this prompt
      required:
        - active
        - created_at
        - platform_key
        - prompt_text
        - recommendation_type
        - updated_at
    PlatformPublicImageAsset:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        category:
          type: string
          description: Category of the asset
          maxLength: 200
        image:
          type: string
          format: uri
          writeOnly: true
        url:
          type: string
          readOnly: true
        created_on:
          type: string
          format: date-time
          readOnly: true
        last_updated:
          type: string
          format: date-time
          readOnly: true
      required:
        - category
        - created_on
        - id
        - image
        - last_updated
        - url
    PlatformPublicMetadata:
      type: object
      properties:
        platform_key:
          type: string
          readOnly: true
        platform_name:
          type: string
          readOnly: true
        metadata:
          description: The public metadata
      required:
        - platform_key
        - platform_name
    PlatformSkillPointBulkRequest:
      type: object
      description: >-
        Request serializer for PlatformSkillPointBulkManagementView POST
        endpoint.
      properties:
        platform_key:
          type: string
          description: Platform key identifier (required for platform admin access)
        skill_point_data:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: List of skill point data objects to create/update
      required:
        - skill_point_data
    PlatformSkillPointBulkResponse:
      type: object
      description: >-
        Response serializer for PlatformSkillPointBulkManagementView POST
        endpoint.
      properties:
        successes:
          type: integer
          description: Number of successful updates
        total:
          type: integer
          description: Total number of updates attempted
      required:
        - successes
        - total
    PlatformSkillPointGroupRequest:
      type: object
      description: >-
        Request serializer for PlatformSkillPointGroupManagementView POST
        endpoint.
      properties:
        platform_key:
          type: string
          description: Platform key identifier
        group_id:
          type: integer
          description: ID of the user group to update
        point_data:
          type: object
          additionalProperties:
            type: integer
            minimum: 0
          description: Dictionary mapping skill names to point values to apply to group
        overwrite:
          type: boolean
          default: true
          description: >-
            If True, removes all skills not in point_data. If False, only
            updates specified skills.
      required:
        - group_id
        - platform_key
        - point_data
    PlatformSkillPointRequest:
      type: object
      description: Request serializer for PlatformSkillPointManagementView POST endpoint.
      properties:
        username:
          type: string
          description: Username to update skill points for
        platform_key:
          type: string
          description: Platform key identifier
        point_data:
          type: object
          additionalProperties:
            type: integer
            minimum: 0
          description: >-
            Dictionary mapping skill names to point values. Example:
            {'skill_name': 5}
        overwrite:
          type: boolean
          default: true
          description: >-
            If True, removes all skills not in point_data. If False, only
            updates specified skills.
      required:
        - platform_key
        - point_data
        - username
    PlatformSkillPointResponse:
      type: object
      description: Response serializer for PlatformSkillPointManagementView GET endpoint.
      properties:
        results:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: List of platform skill point entries
        count:
          type: integer
          description: Total number of results
        next_page:
          type: string
          format: uri
          nullable: true
          description: URL for next page of results
        previous_page:
          type: string
          format: uri
          nullable: true
          description: URL for previous page of results
      required:
        - count
        - next_page
        - previous_page
        - results
    PlatformSummary:
      type: object
      description: Serializer for platform summary data (cross-platform view).
      properties:
        enrollments:
          type: integer
        programs:
          type: integer
        pathways:
          type: integer
        resources:
          type: integer
        reported_skills:
          type: integer
        desired_skills:
          type: integer
        assigned_skills:
          type: integer
        total_skills:
          type: integer
        credentials:
          type: integer
        points:
          type: number
          format: double
        first_activity:
          type: string
          format: date-time
          nullable: true
        last_activity:
          type: string
          format: date-time
          nullable: true
        total_time_spent_seconds:
          type: integer
          description: Total time spent
        top_content:
          allOf:
            - $ref: '#/components/schemas/TopContent'
          description: Course with most time spent
      required:
        - assigned_skills
        - credentials
        - desired_skills
        - enrollments
        - first_activity
        - last_activity
        - pathways
        - points
        - programs
        - reported_skills
        - resources
        - top_content
        - total_skills
        - total_time_spent_seconds
    PlatformUpdatePostRequest:
      type: object
      properties:
        user_id:
          type: integer
        key:
          type: string
        new_key:
          type: string
        name:
          type: string
        lms_url:
          type: string
        cms_url:
          type: string
        portal_url:
          type: string
      required:
        - key
        - user_id
    PlayWrightScript:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        platform:
          type: integer
          readOnly: true
          nullable: true
        student:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          readOnly: true
          nullable: true
        title:
          type: string
          maxLength: 400
        description:
          type: string
          maxLength: 400
        script:
          type: string
        is_public:
          type: boolean
          readOnly: true
      required:
        - id
        - is_public
        - platform
        - script
        - student
        - title
    PointsMetric:
      type: object
      description: Serializer for points metrics.
      properties:
        total:
          type: number
          format: double
        details:
          type: array
          items:
            type: object
            additionalProperties: {}
      required:
        - total
    PointsPercentile:
      type: object
      properties:
        username:
          type: string
        points:
          type: number
          format: double
        percentile:
          type: number
          format: double
          description: >-
            Percentile of points for user. If an `org` was provided, this is the
            percentile of the user relative to users within the org.
      required:
        - percentile
        - points
        - username
    PredictiveAnalyticsRequest:
      type: object
      properties:
        prompt:
          $ref: '#/components/schemas/ReuestDataVariableList'
      required:
        - prompt
    PredictiveAnalyticsResponse:
      type: object
      properties:
        predictions:
          type: array
          items:
            $ref: '#/components/schemas/ResponseDataVariable'
      required:
        - predictions
    PreviewResponse:
      type: object
      description: Response serializer for notification preview
      properties:
        status:
          type: string
        build_id:
          type: string
          format: uuid
        count:
          type: integer
        warning:
          type: string
          nullable: true
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/Recipient'
      required:
        - build_id
        - count
        - recipients
        - status
        - warning
    PreviousAgentStatusEnum:
      enum:
        - success
        - error
        - running
        - pending
      type: string
      description: |-
        * `success` - Success
        * `error` - Error
        * `running` - Running
        * `pending` - Pending
    Program:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        institution:
          allOf:
            - $ref: '#/components/schemas/Institution'
          readOnly: true
        institution_id:
          type: integer
          writeOnly: true
        name:
          type: string
          maxLength: 100
        program_type:
          $ref: '#/components/schemas/ProgramTypeEnum'
        duration:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: Duration in months
        description:
          type: string
          nullable: true
        data:
          nullable: true
          description: Metadata
        metadata:
          nullable: true
          description: Metadata
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - duration
        - id
        - institution
        - institution_id
        - name
        - program_type
        - updated_at
    ProgramCompletion:
      type: object
      properties:
        completed:
          type: boolean
        completion_percentage:
          type: number
          format: double
          nullable: true
        passed:
          type: boolean
          nullable: true
        passed_date:
          type: string
          format: date-time
          nullable: true
      required:
        - completed
    ProgramCompletionResponse:
      type: object
      description: Response serializer for ProgramCompletionQueryView GET endpoint.
      properties:
        count:
          type: integer
          description: Total number of courses in the program
        completion_percentage:
          type: number
          format: double
          description: Overall completion percentage for the program (0.0 to 1.0)
      required:
        - completion_percentage
        - count
    ProgramCoursePosition:
      type: object
      properties:
        course_id:
          type: string
        name:
          type: string
        slug:
          type: string
        position:
          type: integer
          readOnly: true
      required:
        - position
    ProgramCreateUpdateRequest:
      type: object
      description: Serializer for program creation/update request body.
      properties:
        program_id:
          type: string
          description: Program ID
        program_key:
          type: string
          description: Program key
        name:
          type: string
          description: Program name
        slug:
          type: string
          description: Program slug
        org:
          type: string
          description: Organization
        platform_key:
          type: string
          description: Platform key
        enabled:
          type: boolean
          default: true
          description: Whether the program is enabled
        course_list:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: List of courses in the program with course_id and optional position
        program_type:
          type: string
          description: Program type
        data:
          description: Additional program data
      required:
        - course_list
        - name
        - program_id
    ProgramDeleteResponse:
      type: object
      description: Serializer for program deletion response.
      properties:
        count:
          type: integer
          description: Number of programs deleted
        type:
          type: object
          additionalProperties: {}
          description: Types of objects deleted
      required:
        - count
        - type
    ProgramDetail:
      type: object
      properties:
        program_id:
          type: string
        name:
          type: string
          nullable: true
        platform:
          type: string
          nullable: true
        enrollment:
          $ref: '#/components/schemas/EnrollmentInfo'
        completion:
          allOf:
            - $ref: '#/components/schemas/ProgramCompletion'
          nullable: true
      required:
        - enrollment
        - program_id
    ProgramEnrollment:
      type: object
      properties:
        user_id:
          type: integer
        username:
          type: string
        program_id:
          type: string
        program_key:
          type: string
        platform_key:
          type: string
        org:
          type: string
        name:
          type: string
        slug:
          type: string
        created:
          type: string
          format: date-time
          nullable: true
          description: Date when enrollment began/activated
        started:
          type: string
          format: date-time
          nullable: true
          description: Date when enrollment started
        ended:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: Date when enrollment ended/deactivated
        expired:
          type: string
          format: date-time
          nullable: true
          description: Date when enrollment expires (null, if not expiring)
        active:
          type: boolean
          description: Whether the enrollment is active
      required:
        - ended
    ProgramEnrollmentPlus:
      type: object
      description: Includes metadata+
      properties:
        user_id:
          type: integer
        username:
          type: string
        program_id:
          type: string
        program_key:
          type: string
        platform_key:
          type: string
        org:
          type: string
        name:
          type: string
        slug:
          type: string
        created:
          type: string
          format: date-time
          nullable: true
          description: Date when enrollment began/activated
        started:
          type: string
          format: date-time
          nullable: true
          description: Date when enrollment started
        ended:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: Date when enrollment ended/deactivated
        expired:
          type: string
          format: date-time
          nullable: true
          description: Date when enrollment expires (null, if not expiring)
        active:
          type: boolean
          description: Whether the enrollment is active
        metadata:
          nullable: true
      required:
        - ended
    ProgramEnrollmentSearchResponse:
      type: object
      description: Response serializer for ProgramEnrollmentSearchView GET endpoint.
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/ProgramEnrollmentPlus'
          description: List of program enrollments
        count:
          type: integer
          description: Total number of reviews
        next_page:
          type: integer
          nullable: true
          description: Next page number
        previous_page:
          type: integer
          nullable: true
          description: Previous page number
      required:
        - count
        - next_page
        - previous_page
        - results
    ProgramGroupSuggestionCreate:
      type: object
      description: >-
        Request serializer for ProgramGroupSuggestionManagementView POST
        endpoint
      properties:
        platform_key:
          type: string
          description: The platform for the group suggestion
        platform_org:
          type: string
          description: The organization identifier for the platform
        program_key:
          type: string
          description: The program key to suggest
        group_id:
          type: integer
          description: The group to suggest the program to
        accepted:
          type: boolean
          default: false
          description: Whether the suggestion is accepted
        visible:
          type: boolean
          default: true
          description: Whether the suggestion is visible
        metadata:
          type: object
          additionalProperties: {}
          description: Additional suggestion metadata
        department_mode:
          type: boolean
          default: false
          description: Flag to ensure department admins can call the API
      required:
        - group_id
        - platform_key
        - program_key
    ProgramGroupSuggestionDetail:
      type: object
      description: Response serializer for program group suggestion details
      properties:
        id:
          type: integer
          description: The unique identifier for the group suggestion
        group_id:
          type: integer
          description: The ID of the group receiving the suggestion
        group_name:
          type: string
          description: The name of the group receiving the suggestion
        platform_key:
          type: string
          description: The platform key associated with the suggestion
        accepted:
          type: boolean
          description: Whether the suggestion has been accepted
        visible:
          type: boolean
          description: Whether the suggestion is visible
        created:
          type: string
          format: date-time
          description: When the suggestion was created
        modified:
          type: string
          format: date-time
          description: When the suggestion was last modified
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the suggestion
        program_key:
          type: string
          description: The program key being suggested
        program_name:
          type: string
          description: The name of the program being suggested
        user_count:
          type: integer
          description: Number of users in the group
      required:
        - accepted
        - created
        - group_id
        - group_name
        - id
        - metadata
        - modified
        - platform_key
        - program_key
        - program_name
        - user_count
        - visible
    ProgramInvitationCreate:
      type: object
      description: Request serializer for ProgramInvitationView POST endpoint
      properties:
        program_key:
          type: string
          description: The program to create an invitation for
        email:
          type: string
          format: email
          description: The email address to invite
        username:
          type: string
          description: The username to invite
        active:
          type: boolean
          default: true
          description: Whether the invitation is active
        source:
          type: string
          description: The source of the invitation
        redirect_to:
          type: string
          format: uri
          description: URL to redirect to after accepting the invitation
        created:
          type: string
          format: date-time
          description: When the invitation was created
        expired:
          type: string
          format: date-time
          description: When the invitation expires
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the invitation
        enrollment_config:
          type: object
          additionalProperties: {}
          description: Enrollment configuration (dates, etc.)
      required:
        - program_key
    ProgramInvitationDetail:
      type: object
      description: Response serializer for program invitation details
      properties:
        id:
          type: integer
          description: The unique identifier for the invitation
        user_id:
          type: integer
          nullable: true
          description: The ID of the user associated with the invitation
        username:
          type: string
          nullable: true
          description: The username of the user associated with the invitation
        email:
          type: string
          format: email
          nullable: true
          description: The email address associated with the invitation
        created:
          type: string
          format: date-time
          description: When the invitation was created
        started:
          type: string
          format: date-time
          nullable: true
          description: When the invitation was started
        expired:
          type: string
          format: date-time
          nullable: true
          description: When the invitation expires
        source:
          type: string
          nullable: true
          description: The source of the invitation
        redirect_to:
          type: string
          format: uri
          nullable: true
          description: URL to redirect to after accepting the invitation
        active:
          type: boolean
          description: Whether the invitation is active
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the invitation
        program_key:
          type: string
          description: The program key associated with the invitation
      required:
        - active
        - created
        - email
        - expired
        - id
        - metadata
        - program_key
        - redirect_to
        - source
        - started
        - user_id
        - username
    ProgramInvitationRedemption:
      type: object
      description: Request serializer for ProgramInvitationRedemptionView POST endpoint
      properties:
        program_key:
          type: string
          description: The program key for the invitation
        source:
          type: string
          description: The source identifier for the invitation
        email:
          type: string
          format: email
          description: The email to associate with the invitation
        username:
          type: string
          description: The username to associate with the invitation
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the invitation
      required:
        - program_key
        - source
    ProgramLicenseAssignmentCreate:
      type: object
      description: >-
        Request serializer for ProgramLicenseAssignmentView POST endpoint.


        This serializer validates the request data for creating or updating a
        program license assignment.

        Either user_id or email must be provided to identify the user to assign
        the license to.


        Fields:
            license_id: The ID of the program license to assign
            user_id: The user ID to assign the license to (required if email not provided)
            username: The username to assign the license to (alternative to user_id)
            email: The email to assign the license to (required if user_id not provided)
            platform_key: The unique identifier for the platform (for permission validation)
            platform_org: The organization identifier for the platform (for permission validation)
            active: Whether the assignment should be active
            fulfilled: Whether the assignment should be marked as fulfilled
            direct: Whether the assignment is being directly assigned to the user
            redirect_to: URL to redirect to after fulfillment
            metadata: Additional metadata for the assignment

        Notes:
            - If both user_id and email are provided, user_id takes precedence
            - If the user doesn't exist but email is provided, an email-only assignment will be created
            - The license must have available seats for the assignment to succeed
      properties:
        license_id:
          type: integer
          description: The ID of the program license to assign
        user_id:
          type: integer
          description: >-
            The user ID to assign the license to (required if email not
            provided)
        username:
          type: string
          description: The username to assign the license to (alternative to user_id)
        email:
          type: string
          format: email
          description: >-
            The email to assign the license to (required if user_id not
            provided)
        platform_key:
          type: string
          description: The unique identifier for the platform (for permission validation)
        platform_org:
          type: string
          description: >-
            The organization identifier for the platform (for permission
            validation)
        active:
          type: boolean
          default: true
          description: Whether the assignment should be active
        fulfilled:
          type: boolean
          default: false
          description: Whether the assignment should be marked as fulfilled
        direct:
          type: boolean
          default: true
          description: Whether the assignment is being directly assigned to the user
        redirect_to:
          type: string
          nullable: true
          description: URL to redirect to after fulfillment
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the assignment
      required:
        - license_id
    ProgramLicenseAssignmentDetail:
      type: object
      description: >-
        Response serializer for program license assignment details.


        This serializer represents a program license assignment with all its
        attributes,

        including user information, license details, and assignment status.


        Fields:
            id: The unique identifier for the assignment
            user_id: The ID of the user assigned the license (may be null for email-only assignments)
            username: The username of the user assigned the license (may be null for email-only assignments)
            name: The full name of the user assigned the license (may be null for email-only assignments)
            email: The email address of the user assigned the license (may be null for user-only assignments)
            active: Whether the assignment is active and valid
            fulfilled: Whether the assignment has been processed/fulfilled
            direct: Whether the assignment was directly assigned to the user (vs. via a group)
            redirect_to: URL to redirect to after fulfillment
            metadata: Additional metadata for the assignment
            created: When the assignment was created
            modified: When the assignment was last modified
            license_id: The ID of the program license
            license_name: The name of the program license
            program_key: The program key associated with the license
      properties:
        id:
          type: integer
          description: The unique identifier for the assignment
        user_id:
          type: integer
          nullable: true
          description: The ID of the user assigned the license
        username:
          type: string
          nullable: true
          description: The username of the user assigned the license
        name:
          type: string
          nullable: true
          description: The full name of the user assigned the license
        email:
          type: string
          format: email
          nullable: true
          description: The email address of the user assigned the license
        active:
          type: boolean
          description: Whether the assignment is active and valid
        fulfilled:
          type: boolean
          description: Whether the assignment has been processed/fulfilled
        direct:
          type: boolean
          description: >-
            Whether the assignment was directly assigned to the user (vs. via a
            group)
        redirect_to:
          type: string
          format: uri
          description: URL to redirect to after fulfillment
        metadata:
          type: object
          additionalProperties: {}
          nullable: true
          description: Additional metadata for the assignment
        created:
          type: string
          format: date-time
          description: When the assignment was created
        modified:
          type: string
          format: date-time
          description: When the assignment was last modified
        license_id:
          type: integer
          description: The ID of the program license
        license_name:
          type: string
          description: The name of the program license
        program_key:
          type: string
          description: The program key associated with the license
      required:
        - active
        - email
        - fulfilled
        - id
        - license_id
        - license_name
        - metadata
        - name
        - program_key
        - user_id
        - username
    ProgramLicenseCreateDetail:
      type: object
      description: Request serializer for ProgramLicenseCreateView POST endpoint
      properties:
        platform_key:
          type: string
          description: >-
            The unique identifier for the platform (required if platform_id not
            provided)
        platform_org:
          type: string
          description: >-
            The organization identifier for the platform (required if
            platform_id not provided)
        platform_id:
          type: integer
          description: The ID of the platform (required if platform_key/org not provided)
        program_key:
          type: string
          description: The unique identifier for the program to license
        name:
          type: string
          description: Display name for the license
        count:
          type: integer
          description: Number of seats purchased
        started:
          type: string
          format: date-time
          description: Date when license should begin
        expired:
          type: string
          format: date-time
          nullable: true
          description: Date when license should expire
        external_id:
          type: string
          nullable: true
          description: External identifier for the license
        active:
          type: boolean
          default: true
          description: Whether the license should be active
        metadata:
          type: object
          additionalProperties: {}
          description: Additional license metadata
        enrollment_config:
          type: object
          additionalProperties: {}
          description: Enrollment configuration
        source:
          type: string
          default: api
          description: Source identifier
        transaction_id:
          type: string
          description: Transaction identifier for tracking
      required:
        - count
        - name
        - program_key
        - started
    ProgramLicenseDetail:
      type: object
      description: >-
        Response serializer for program license details.


        This serializer represents a program license with all its attributes,

        including basic license information, program details, and usage
        statistics.


        Fields:
            id: The unique identifier for the license
            created: When the license was created
            started: When the license becomes active
            expired: When the license expires (null if no expiration)
            name: The display name of the license
            count: The number of seats purchased
            active: Whether the license is active
            metadata: Additional license metadata
            source: The source identifier for the license
            external_id: External identifier for the license (null if none)
            platform_key: The platform key associated with the license
            program_id: The program ID associated with the license
            program_name: The name of the program associated with the license
            usage_count: Number of assignments using this license
            assignments: Assignment counts (if verbose mode is enabled)

        Notes:
            - The assignments field is only included when verbose=true in the request
            - The expired field may be null if the license doesn't expire
            - The external_id field may be null if not provided
      properties:
        id:
          type: integer
          description: The unique identifier for the license
        created:
          type: string
          format: date-time
          description: When the license was created
        started:
          type: string
          format: date-time
          description: When the license becomes active
        expired:
          type: string
          format: date-time
          nullable: true
          description: When the license expires (null if no expiration)
        name:
          type: string
          description: The display name of the license
        count:
          type: integer
          description: The number of seats purchased
        active:
          type: boolean
          description: Whether the license is active
        metadata:
          type: object
          additionalProperties: {}
          description: Additional license metadata
        source:
          type: string
          description: The source identifier for the license
        external_id:
          type: string
          nullable: true
          description: External identifier for the license (null if none)
        platform_key:
          type: string
          description: The platform key associated with the license
        program_id:
          type: string
          description: The program ID associated with the license
        program_key:
          type: string
          description: The program key associated with the license
        program_name:
          type: string
          description: The name of the program associated with the license
        usage_count:
          type: integer
          description: Number of assignments using this license
        assignments:
          type: object
          additionalProperties:
            type: integer
          description: Assignment counts by status (only included in verbose mode)
      required:
        - active
        - count
        - created
        - expired
        - external_id
        - id
        - metadata
        - name
        - platform_key
        - source
        - started
        - usage_count
    ProgramLicenseGroupAssignmentCreate:
      type: object
      description: >-
        Request serializer for ProgramLicenseGroupAssignmentView POST endpoint.


        This serializer validates the request data for creating or updating a
        program license group assignment.

        Group assignments will automatically create individual assignments for
        all users in the group.


        Fields:
            license_id: The ID of the program license to assign
            group_id: The ID of the user group to assign the license to
            platform_key: The unique identifier for the platform (for permission validation)
            platform_org: The organization identifier for the platform (for permission validation)
            active: Whether the group assignment should be active
            fulfilled: Whether the group assignment should be marked as fulfilled
            redirect_to: URL to redirect to after fulfillment
            metadata: Additional metadata for the group assignment

        Notes:
            - All users in the group will receive individual license assignments
            - The license must have enough available seats for all users in the group
            - If the license doesn't have enough seats, the operation will fail
            - Users who already have a direct assignment to this license will not be affected
      properties:
        license_id:
          type: integer
          description: The ID of the program license to assign
        group_id:
          type: integer
          description: The ID of the user group to assign the license to
        platform_key:
          type: string
          description: The unique identifier for the platform (for permission validation)
        platform_org:
          type: string
          description: >-
            The organization identifier for the platform (for permission
            validation)
        active:
          type: boolean
          default: true
          description: Whether the group assignment should be active
        fulfilled:
          type: boolean
          default: false
          description: Whether the group assignment should be marked as fulfilled
        redirect_to:
          type: string
          nullable: true
          description: URL to redirect to after fulfillment
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the group assignment
      required:
        - group_id
        - license_id
    ProgramLicenseGroupAssignmentDetail:
      type: object
      description: >-
        Response serializer for program license group assignment details.


        This serializer represents a program license group assignment with all
        its attributes,

        including group information, license details, and assignment status.


        Fields:
            id: The unique identifier for the group assignment
            group_id: The ID of the group assigned the license
            group_name: The name of the group assigned the license
            active: Whether the group assignment is active and valid
            fulfilled: Whether the group assignment has been processed/fulfilled
            redirect_to: URL to redirect to after fulfillment
            metadata: Additional metadata for the group assignment
            created: When the group assignment was created
            modified: When the group assignment was last modified
            license_id: The ID of the program license
            license_name: The name of the program license
            program_key: The program key associated with the license
            program_name: The name of the program associated with the license
            user_count: Number of users in the group
            assigned_count: Number of users in the group who have been assigned the license
      properties:
        id:
          type: integer
          description: The unique identifier for the assignment
        group_id:
          type: integer
          description: The ID of the group assigned the license
        group_name:
          type: string
          description: The name of the group assigned the license
        active:
          type: boolean
          description: Whether the assignment is active and valid
        fulfilled:
          type: boolean
          description: Whether the assignment has been processed/fulfilled
        redirect_to:
          type: string
          format: uri
          nullable: true
          description: URL to redirect to after fulfillment
        metadata:
          type: object
          additionalProperties: {}
          nullable: true
          description: Additional metadata for the assignment
        created:
          type: string
          format: date-time
          description: When the assignment was created
        modified:
          type: string
          format: date-time
          description: When the assignment was last modified
        license_id:
          type: integer
          description: The ID of the program license
        license_name:
          type: string
          description: The name of the program license
        program_key:
          type: string
          description: The program key associated with the license
        program_name:
          type: string
          description: The name of the program associated with the license
        user_count:
          type: integer
          description: Number of users in the group
        assigned_count:
          type: integer
          description: Number of users in the group who have been assigned the license
      required:
        - active
        - assigned_count
        - created
        - fulfilled
        - group_id
        - group_name
        - id
        - license_id
        - license_name
        - metadata
        - modified
        - program_key
        - program_name
        - redirect_to
        - user_count
    ProgramLicenseUpdateDetail:
      type: object
      description: >-
        Request serializer for ProgramLicenseUpdateView POST endpoint.


        This serializer validates the request data for updating an existing
        program license.

        Either license_id or external_id must be provided to identify the
        license to update.


        Fields:
            license_id: The ID of the license to update (required if external_id not provided)
            external_id: External identifier of the license to update (required if license_id not provided)
            name: Updated display name for the license
            count: Updated number of seats purchased
            started: Updated date when license should begin
            expired: Updated date when license should expire
            active: Updated active status
            metadata: Updated additional license metadata
            enrollment_config: Updated enrollment configuration
            source: Updated source identifier
            transaction_id: Transaction identifier for tracking
            change_type: Type of change being made (default: "update")

        Notes:
            - Cannot update the platform or program associated with a license
            - A license history record is automatically created for each update
            - If count is reduced, it must not be less than the number of active assignments
            - Setting active=false will not deactivate existing assignments
      properties:
        license_id:
          type: integer
          description: >-
            The ID of the license to update (required if external_id not
            provided)
        external_id:
          type: string
          description: >-
            External identifier of the license to update (required if license_id
            not provided)
        name:
          type: string
          description: Updated display name for the license
        count:
          type: integer
          description: Updated number of seats purchased
        started:
          type: string
          format: date-time
          description: Updated date when license should begin
        expired:
          type: string
          format: date-time
          nullable: true
          description: Updated date when license should expire
        active:
          type: boolean
          description: Updated active status
        metadata:
          type: object
          additionalProperties: {}
          description: Updated additional license metadata
        enrollment_config:
          type: object
          additionalProperties: {}
          description: Updated enrollment configuration
        source:
          type: string
          description: Updated source identifier
        transaction_id:
          type: string
          description: Transaction identifier for tracking
        change_type:
          type: string
          default: update
          description: Type of change being made
    ProgramMetadataRequest:
      type: object
      description: Request serializer for ProgramMetadataView POST endpoint.
      properties:
        program_id:
          type: string
          description: The unique identifier for the program
        org:
          type: string
          description: The organization associated with the program
        platform_key:
          type: string
          description: Platform key identifier (alternative to org)
        program_key:
          type: string
          description: Program key (alternative to program_id + org)
        metadata:
          type: object
          additionalProperties: {}
          description: Metadata to update for the program
        update:
          type: boolean
          default: true
          description: Whether to update existing metadata
      required:
        - metadata
        - program_id
    ProgramMetadataResponse:
      type: object
      description: Response serializer for ProgramMetadataView GET endpoint.
      properties:
        name:
          type: string
          nullable: true
          description: Program name
        description:
          type: string
          nullable: true
          description: Program description
        enabled:
          type: boolean
          nullable: true
          description: Whether the program is enabled
        slug:
          type: string
          nullable: true
          description: Program slug
        skills:
          type: array
          items:
            type: string
          description: List of associated skills
        platform_key:
          type: string
          nullable: true
          description: Platform key
    ProgramReview:
      type: object
      description: Serializer for program review data.
      properties:
        user_id:
          type: integer
          description: The user identifier
        username:
          type: string
          description: The username of the reviewer
        content:
          type: string
          description: Review content/text
        rating:
          type: number
          format: double
          nullable: true
          description: Rating value (typically 1-5)
        title:
          type: string
          description: Review title
        visible:
          type: boolean
          description: Whether the review is visible
        created:
          type: string
          nullable: true
          description: Date when review was created
        modified:
          type: string
          nullable: true
          description: Date when review was last modified
        program_key:
          type: string
          description: The program key identifier
      required:
        - content
        - created
        - modified
        - program_key
        - rating
        - title
        - user_id
        - username
        - visible
    ProgramReviewInfoResponse:
      type: object
      description: Serializer for program review info response.
      properties:
        program_key:
          type: string
          description: The program key associated with the reviews
        avg_rating:
          type: number
          format: double
          nullable: true
          description: Average rating of the program
        count:
          type: integer
          description: Total number of reviews for the program
      required:
        - avg_rating
        - count
        - program_key
    ProgramReviewPaginatedResponse:
      type: object
      description: Paginated response serializer for ProgramReviewQueryView GET endpoint.
      properties:
        count:
          type: integer
          description: Total number of reviews
        next_page:
          type: integer
          nullable: true
          description: Next page number
        previous_page:
          type: integer
          nullable: true
          description: Previous page number
        results:
          type: array
          items:
            $ref: '#/components/schemas/ProgramReview'
          description: List of program reviews
      required:
        - count
        - next_page
        - previous_page
        - results
    ProgramReviewRequest:
      type: object
      description: Request serializer for ProgramReviewUpdateView POST endpoint.
      properties:
        program_key:
          type: string
          description: 'The program key to review (format: program-v1:org+program_id)'
        username:
          type: string
          description: The username of the reviewer
        user_id:
          type: integer
          description: The user ID of the reviewer (alternative to username)
        rating:
          type: number
          format: double
          nullable: true
          description: The rating value (typically 1-5)
        title:
          type: string
          description: The review title
        content:
          type: string
          description: The review content/text
        visible:
          type: boolean
          default: true
          description: Whether the review is visible
        metadata:
          description: Additional review metadata
      required:
        - program_key
        - username
    ProgramSearch:
      type: object
      properties:
        course_list:
          type: array
          items:
            $ref: '#/components/schemas/ProgramCoursePosition'
        program_id:
          type: string
          description: A unique program ID identifiable by edX.
          maxLength: 255
        program_key:
          type: string
          readOnly: true
        name:
          type: string
          description: The verbose name of the program.
          maxLength: 255
        enabled:
          type: boolean
          description: Select if this program should be enabled.
        slug:
          type: string
          nullable: true
          description: An additional unique slug field. (Optional)
          maxLength: 255
          pattern: ^[-a-zA-Z0-9_]+$
        org:
          type: string
        platform_key:
          type: string
          readOnly: true
        program_type:
          type: string
          readOnly: true
        data:
          nullable: true
          description: Metadata
      required:
        - course_list
        - platform_key
        - program_id
        - program_key
        - program_type
    ProgramSuggestionBulkCreate:
      type: object
      description: Request serializer for ProgramSuggestionBulkManagementView POST endpoint
      properties:
        platform_key:
          type: string
          description: The platform for the suggestions
        platform_org:
          type: string
          description: The organization identifier for the platform
        suggestion_data:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: >-
            List of suggestion data objects, each containing program_key,
            user_id, etc.
        department_mode:
          type: boolean
          default: false
          description: Flag to ensure department admins can call the API
      required:
        - platform_key
        - suggestion_data
    ProgramSuggestionCreate:
      type: object
      description: Request serializer for ProgramSuggestionManagementView POST endpoint
      properties:
        platform_key:
          type: string
          description: The platform for the suggestion
        platform_org:
          type: string
          description: The organization identifier for the platform
        program_key:
          type: string
          description: The program key to suggest
        user_id:
          type: string
          description: The user to suggest the program to
        username:
          type: string
          description: The username of the user to suggest the program to
        email:
          type: string
          format: email
          description: The email of the user to suggest the program to
        suggested_by:
          type: string
          description: The user who suggested the program
        direct:
          type: boolean
          default: true
          description: Whether the suggestion is direct
        department_mode:
          type: boolean
          default: false
          description: Flag to ensure department admins can call the API
        accepted:
          type: boolean
          default: false
          description: Whether the suggestion is accepted
        visible:
          type: boolean
          default: true
          description: Whether the suggestion is visible
        metadata:
          type: object
          additionalProperties: {}
          description: Additional suggestion metadata
      required:
        - platform_key
        - program_key
        - user_id
    ProgramSuggestionDetail:
      type: object
      description: Response serializer for program suggestion details
      properties:
        id:
          type: integer
          description: The unique identifier for the suggestion
        user_id:
          type: integer
          description: The ID of the user receiving the suggestion
        username:
          type: string
          description: The username of the user receiving the suggestion
        name:
          type: string
          description: The full name of the user receiving the suggestion
        platform_key:
          type: string
          description: The platform key associated with the suggestion
        accepted:
          type: boolean
          description: Whether the suggestion has been accepted by the user
        visible:
          type: boolean
          description: Whether the suggestion is visible to the user
        created:
          type: string
          format: date-time
          description: When the suggestion was created
        modified:
          type: string
          format: date-time
          description: When the suggestion was last modified
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the suggestion
        program_key:
          type: string
          description: The program key being suggested
        program_name:
          type: string
          description: The name of the program being suggested
      required:
        - accepted
        - created
        - id
        - metadata
        - modified
        - name
        - platform_key
        - program_key
        - program_name
        - user_id
        - username
        - visible
    ProgramTypeEnum:
      enum:
        - bachelors
        - masters
        - phd
        - diploma
        - certificate
        - ungraded
        - other
      type: string
      description: |-
        * `bachelors` - Bachelor's Degree
        * `masters` - Master's Degree
        * `phd` - PhD
        * `diploma` - Diploma
        * `certificate` - Certificate
        * `ungraded` - Ungraded
        * `other` - Other
    Project:
      type: object
      description: >-
        Unified serializer for Project model.


        Write-only fields:

        - mentors_to_add: List of mentor unique IDs to add to the project

        - mentors_to_remove: List of mentor unique IDs to remove from the
        project


        These fields are mutually exclusive and only used during create/update
        operations.

        For create: only mentors_to_add is used

        For update: either can be used, but not both at once
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: Name of the project
          maxLength: 255
        description:
          type: string
          description: Description of the project
        shared:
          type: boolean
          description: Whether this project is shared with others or personal
        owner:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: User who created this project
          readOnly: true
        owner_username:
          type: string
          readOnly: true
        platform:
          type: integer
          readOnly: true
          nullable: true
          description: Platform this project belongs to
        platform_key:
          type: string
          readOnly: true
        platform_name:
          type: string
          readOnly: true
        mentor_count:
          type: integer
          readOnly: true
        is_personal:
          type: boolean
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        mentors:
          type: array
          items:
            $ref: '#/components/schemas/ProjectMentor'
          readOnly: true
        mentors_to_add:
          type: array
          items:
            type: string
            format: uuid
          writeOnly: true
          description: List of mentor unique IDs to add to the project
        mentors_to_remove:
          type: array
          items:
            type: string
            format: uuid
          writeOnly: true
          description: List of mentor unique IDs to remove from the project
      required:
        - created_at
        - id
        - is_personal
        - mentor_count
        - mentors
        - name
        - owner
        - owner_username
        - platform
        - platform_key
        - platform_name
        - updated_at
    ProjectMentor:
      type: object
      description: Serializer for mentors within a project.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
          nullable: true
        unique_id:
          type: string
          format: uuid
          readOnly: true
        slug:
          type: string
          readOnly: true
          pattern: ^[-a-zA-Z0-9_]+$
        created_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
      required:
        - created_at
        - id
        - name
        - slug
        - unique_id
    Prompt:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        mentor:
          type: string
          format: uuid
        tone:
          type: string
          nullable: true
        style:
          type: string
        language:
          type: string
        tags:
          type: array
          items:
            type: integer
        is_system:
          type: boolean
          default: true
        metadata: {}
        category:
          type: string
        prompt:
          type: string
        title:
          type: string
          nullable: true
          maxLength: 255
        description:
          type: string
          nullable: true
        prompt_visibility:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/PromptVisibilityEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        created_by:
          type: string
          nullable: true
          maxLength: 255
        platform:
          type: integer
      required:
        - created_at
        - id
        - platform
        - prompt
        - updated_at
    PromptCategory:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
          nullable: true
          maxLength: 255
        created_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
      required:
        - created_at
        - id
        - name
        - updated_at
    PromptFacet:
      type: object
      description: Serializer for prompt facets
      properties:
        total:
          type: integer
          description: Total number of prompts in this facet
        terms:
          type: object
          additionalProperties: {}
          description: Terms and their counts in this facet
        other:
          type: integer
          description: Count of prompts not in any term
      required:
        - other
        - terms
        - total
    PromptSearchResponse:
      type: object
      description: Response serializer for PromptSearchView
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/Prompt'
          description: List of prompts matching the search criteria
        count:
          type: integer
          description: Total number of prompts matching the search criteria
        next:
          type: string
          format: uri
          nullable: true
          description: URL for the next page of results
        previous:
          type: string
          format: uri
          nullable: true
          description: URL for the previous page of results
        current_page:
          type: integer
          description: Current page number
        num_pages:
          type: integer
          description: Total number of pages
        facets:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/PromptFacet'
          description: Facet information for filtering
      required:
        - count
        - current_page
        - next
        - num_pages
        - previous
        - results
    PromptVisibilityEnum:
      enum:
        - viewable_by_tenant_admins
        - viewable_by_tenant_students
        - viewable_by_anyone
      type: string
      description: |-
        * `viewable_by_tenant_admins` - Viewable By Tenant Admins
        * `viewable_by_tenant_students` - Viewable By Tenant Students
        * `viewable_by_anyone` - Viewable By Anyone
    Provider05cEnum:
      enum:
        - webex
        - slack
        - whatsapp
        - discord
        - teams
      type: string
      description: |-
        * `webex` - Webex
        * `slack` - Slack
        * `whatsapp` - Whatsapp
        * `discord` - Discord
        * `teams` - Teams
    Provider637Enum:
      enum:
        - openai
        - google
        - elevenlabs
      type: string
      description: |-
        * `openai` - Openai
        * `google` - Google
        * `elevenlabs` - Elevenlabs
    Provider63aEnum:
      enum:
        - openai
      type: string
      description: '* `openai` - Openai'
    ProviderBreakdown:
      type: object
      description: Provider cost breakdown.
      properties:
        provider:
          type: string
        cost:
          type: string
          format: decimal
          pattern: ^-?\d{0,9}(?:\.\d{0,3})?$
        percentage:
          type: string
          format: decimal
          pattern: ^-?\d{0,4}(?:\.\d{0,1})?$
      required:
        - cost
        - percentage
        - provider
    QuestionCardTag:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
        difficulty:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
        total_cards:
          type: integer
          readOnly: true
        correct_answers:
          type: integer
          readOnly: true
        correct_rate:
          type: number
          format: double
          readOnly: true
      required:
        - correct_answers
        - correct_rate
        - difficulty
        - id
        - name
        - total_cards
    QuestionRequest:
      type: object
      description: >-
        Serializer for incoming request data that includes initial questions and
        the username.


        Attributes:
            username (str): Username of the requesting student or user.
            initial_questions (list[InputQuestionSerializer]): List of initial questions provided by the LMS.
            question_count (int): Number of questions the mentor (llm) should generate
      properties:
        username:
          type: string
          maxLength: 100
        initial_questions:
          type: array
          items:
            $ref: '#/components/schemas/InputQuestion'
        question_count:
          type: integer
          default: 20
        subject:
          type: string
          maxLength: 100
      required:
        - initial_questions
        - subject
        - username
    QuestionResponse:
      type: object
      description: |-
        Serializer for the response data that returns additional questions.

        Attributes:
            follow_up_questions (list[LLMQuestionSerializer]): List of generated follow-up questions.
      properties:
        questions:
          type: array
          items:
            $ref: '#/components/schemas/LLMQuestion'
      required:
        - questions
    RatingAverageRecord:
      type: object
      description: Serializer for rating average overtime data.
      properties:
        date:
          type: string
        value:
          type: number
          format: double
          description: Average rating value for this time period
      required:
        - date
        - value
    RatingEnum:
      enum:
        - 1
        - -1
      type: integer
      description: |-
        * `1` - Up Vote
        * `-1` - Down Vote
    RatingRecord:
      type: object
      properties:
        time:
          type: string
          format: date-time
        total_ratings:
          type: integer
      required:
        - time
        - total_ratings
    RatingsOvertime:
      type: object
      properties:
        metric:
          type: string
        points:
          type: array
          items:
            $ref: '#/components/schemas/RatingAverageRecord'
      required:
        - metric
        - points
    RbacBaseRole:
      type: object
      description: Serializer for roles.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        platform_key:
          type: string
          description: Platform key where this role belongs
          writeOnly: true
        actions:
          type: array
          items:
            type: string
          description: >-
            List of actions/permissions this role can perform (e.g.,
            ['Ibl.Mentor/Settings/read', 'Ibl.Mentor/Settings/write'])
        data_actions:
          type: array
          items:
            type: string
          description: >-
            List of data actions/permissions this role can perform for
            field-level access (e.g., ['Ibl.Mentor/Settings/name/read',
            'Ibl.Mentor/Settings/email/write'])
      required:
        - id
        - name
        - platform_key
    RbacGroup:
      type: object
      description: Serializer for RBAC groups.
      properties:
        id:
          type: integer
          readOnly: true
        unique_id:
          type: string
          description: The unique identifier for the group
          maxLength: 255
        platform:
          allOf:
            - $ref: '#/components/schemas/RbacPlatform'
          readOnly: true
        platform_key:
          type: string
          description: The platform key
          writeOnly: true
        name:
          type: string
          description: Optional name of the group
          maxLength: 255
        description:
          type: string
          description: Optional group description
        owner:
          allOf:
            - $ref: '#/components/schemas/RbacUser'
          readOnly: true
        users:
          type: array
          items:
            $ref: '#/components/schemas/RbacUser'
          readOnly: true
        users_to_add:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of user IDs to add to this group
        users_to_remove:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of user IDs to remove from this group
        is_internal:
          type: boolean
          readOnly: true
          description: >-
            When True, this group is internal to the system and cannot be viewed
            or modified by tenants via API endpoints.
      required:
        - id
        - is_internal
        - owner
        - platform
        - platform_key
        - unique_id
        - users
    RbacPlatform:
      type: object
      description: Serializer for platforms.
      properties:
        id:
          type: integer
          readOnly: true
        key:
          type: string
          description: The platform key
          maxLength: 200
        name:
          type: string
          nullable: true
          description: The name of the platform
          maxLength: 200
      required:
        - id
        - key
    RbacPolicy:
      type: object
      description: Serializer for policies.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: Policy name. If not supplied, defaults to a UUID4
          maxLength: 255
        role:
          allOf:
            - $ref: '#/components/schemas/RbacBaseRole'
          readOnly: true
          description: Role information (read-only)
        platform:
          allOf:
            - $ref: '#/components/schemas/RbacPlatform'
          readOnly: true
          description: Platform information (read-only)
        resources:
          type: array
          items:
            type: string
          description: >-
            List of resource paths this policy grants access to (e.g.,
            ['/platforms/1/mentors', '/platforms/1/mentors/settings'])
        users:
          type: array
          items:
            $ref: '#/components/schemas/RbacUser'
          readOnly: true
        groups:
          type: array
          items:
            $ref: '#/components/schemas/RbacPolicyGroup'
          readOnly: true
        role_id:
          type: integer
          writeOnly: true
          description: ID of the role this policy applies to
        platform_key:
          type: string
          description: Platform key where this policy applies
          writeOnly: true
        users_to_add:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of user IDs to add to this Policy
        users_to_remove:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of user IDs to remove from this Policy
        groups_to_add:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of group IDs to add to this Policy
        groups_to_remove:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of group IDs to remove from this Policy
        is_internal:
          type: boolean
          readOnly: true
          description: >-
            When True, this policy is internal to the system and cannot be
            viewed or modified by tenants via API endpoints.
      required:
        - groups
        - id
        - is_internal
        - platform
        - platform_key
        - resources
        - role
        - role_id
        - users
    RbacPolicyGroup:
      type: object
      description: |-
        Serializer for RBAC groups when returned in a policy.

        We are limiting the returne data since we don't need everything there
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: Optional name of the group
          maxLength: 255
        unique_id:
          type: string
          description: The unique identifier for the group
          maxLength: 255
        description:
          type: string
          description: Optional group description
      required:
        - id
        - unique_id
    RbacRole:
      type: object
      description: Serializer for roles.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        platform:
          allOf:
            - $ref: '#/components/schemas/RbacPlatform'
          readOnly: true
          description: Platform information (read-only)
        platform_key:
          type: string
          description: Platform key where this role belongs
          writeOnly: true
        actions:
          type: array
          items:
            type: string
          description: >-
            List of actions/permissions this role can perform (e.g.,
            ['Ibl.Mentor/Settings/read', 'Ibl.Mentor/Settings/write'])
        data_actions:
          type: array
          items:
            type: string
          description: >-
            List of data actions/permissions this role can perform for
            field-level access (e.g., ['Ibl.Mentor/Settings/name/read',
            'Ibl.Mentor/Settings/email/write'])
        is_internal:
          type: boolean
          readOnly: true
          description: >-
            When True, this role is internal to the system and cannot be viewed
            or modified by tenants via API endpoints.
      required:
        - id
        - is_internal
        - name
        - platform
        - platform_key
    RbacUser:
      type: object
      description: Serializer for users.
      properties:
        id:
          type: integer
          readOnly: true
          description: edX user ID
        username:
          type: string
          nullable: true
          description: edX username
          maxLength: 100
        email:
          type: string
          format: email
          nullable: true
          description: edX email
          maxLength: 254
      required:
        - id
    RecentlyAccessedMentor:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
          nullable: true
        unique_id:
          type: string
          format: uuid
          readOnly: true
          nullable: true
        slug:
          type: string
          nullable: true
          readOnly: true
        name:
          type: string
          nullable: true
          readOnly: true
        description:
          type: string
          nullable: true
          readOnly: true
        recently_accessed_at:
          type: string
          nullable: true
          readOnly: true
        platform_key:
          type: string
          nullable: true
          readOnly: true
        last_accessed_by:
          type: string
          nullable: true
          readOnly: true
      required:
        - description
        - id
        - last_accessed_by
        - name
        - platform_key
        - recently_accessed_at
        - slug
        - unique_id
    Recipient:
      type: object
      description: Serializer for recipient data
      properties:
        username:
          type: string
        email:
          type: string
          format: email
        status:
          type: string
          default: pending
      required:
        - email
        - username
    RecommendCourseBlock:
      type: object
      properties:
        blocks:
          type: array
          items:
            description: Recommended block data
      required:
        - blocks
    RecommendCourseResponse:
      type: object
      properties:
        courses:
          type: array
          items:
            description: Recommended course data
      required:
        - courses
    RecommendationSearchAPI:
      type: object
      properties:
        search_api_url:
          type: string
          format: uri
      required:
        - search_api_url
    RecommendationTypeEnum:
      enum:
        - mentors
        - catalog
      type: string
      description: |-
        * `mentors` - Mentor Recommendations
        * `catalog` - Catalog Recommendations
    RecommendedCoursesResponse:
      type: object
      description: Response serializer for RecommendedCoursesView
      properties:
        results:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: List of content items matching the search criteria
        count:
          type: integer
          description: Total number of items matching the search criteria
        next:
          type: string
          format: uri
          nullable: true
          description: URL for the next page of results
        previous:
          type: string
          format: uri
          nullable: true
          description: URL for the previous page of results
        current_page:
          type: integer
          description: Current page number
        total_pages:
          type: integer
          description: Total number of pages
        facets:
          type: object
          additionalProperties: {}
          description: Facet information for filtering
      required:
        - count
        - current_page
        - next
        - previous
        - results
        - total_pages
    RedirectTokenRequest:
      type: object
      properties:
        url:
          type: string
          format: uri
      required:
        - url
    RedirectTokenResponse:
      type: object
      properties:
        platform_key:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          maxLength: 200
        token:
          type: string
          format: uuid
          readOnly: true
      required:
        - platform_key
        - token
        - url
    RelatedText:
      type: object
      properties:
        question:
          type: string
      required:
        - question
    RemoveMentorFromDisclaimer:
      type: object
      description: >-
        Serializer for removing a mentor from a disclaimer.


        This serializer validates the mentor_id input and provides proper schema
        documentation

        for the remove_mentor action.
      properties:
        mentor_id:
          type: string
          description: The unique_id of the mentor to remove from the disclaimer.
          maxLength: 255
      required:
        - mentor_id
    ReportCreate:
      type: object
      description: Returns this a report is successfully created
      properties:
        data:
          $ref: '#/components/schemas/ReportStatus'
      required:
        - data
    ReportData:
      type: object
      properties:
        display_name:
          type: string
          description: Report Name
        description:
          type: string
          description: Report Description
        report_name:
          type: string
          description: Report slug
        icon:
          type: string
        extra_query_params:
          type: array
          items: {}
          description: >-
            Extra parameters to be passed to the report create view, e.g
            learner_id
        result_columns:
          type: array
          items: {}
          description: Columns to be available in the report
        status:
          allOf:
            - $ref: '#/components/schemas/ReportStatus'
          default: {}
          description: Report Status if any available
    ReportDetail:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/ReportData'
      required:
        - data
    ReportList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ReportData'
      required:
        - data
    ReportRequest:
      type: object
      properties:
        report_name:
          type: string
          description: Report slug, this is passed when calling the create report endpoint
        params:
          type: object
          additionalProperties: {}
          description: >-
            Advanced report filtering. e,g: {'username': 'username1, username2'
            }
        query:
          type: string
          description: >-

            Advanced Query to run the report, supports SQL Like queries. 


            e.g For date type filtering 

            date_joined > '2021-01-01' 


            See
            https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.query.html#pandas.DataFrame.query
                    
    ReportStatus:
      type: object
      properties:
        report_id:
          type: string
          description: Used to download the report
        report_name:
          type: string
          description: Report slug, this is passed when calling the create report endpoint
        state:
          allOf:
            - $ref: '#/components/schemas/StateEnum'
          description: |-
            Report States

            * `pending` - Pending
            * `running` - Running
            * `accumulating` - Accumulating
            * `processing` - Processing
            * `storing` - Storing
            * `completed` - Completed
            * `cancelled` - Cancelled
            * `error` - Error
            * `expired` - Expired
        started_on:
          type: string
          description: Report request timestamp (ISO 8601)
        owner:
          type: string
          description: Report Owner
        expires:
          type: string
          description: When report would expire and not available for download anymore
        url:
          type: string
          format: uri
          description: Download link for report when available
    ReportedRole:
      type: object
      properties:
        user_id:
          type: integer
        username:
          type: string
        roles:
          type: array
          items:
            $ref: '#/components/schemas/Role'
        data:
          readOnly: true
          nullable: true
      required:
        - data
        - roles
    ReportedRoleCreateUpdateRequest:
      type: object
      description: Serializer for reported role creation/update request parameters.
      properties:
        user_id:
          type: integer
          description: User ID
        username:
          type: string
          description: Username
        roles:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: >-
            List of roles (can be role IDs or objects with name, platform_key,
            etc.)
        data:
          description: Additional data
      required:
        - roles
    ReportedSkill:
      type: object
      properties:
        user_id:
          type: integer
        username:
          type: string
        skills:
          type: array
          items:
            $ref: '#/components/schemas/Skill'
        data:
          readOnly: true
          nullable: true
      required:
        - data
        - skills
    ReportedSkillCreateUpdateRequest:
      type: object
      description: Serializer for reported skill creation/update request parameters.
      properties:
        user_id:
          type: integer
          description: User ID
        username:
          type: string
          description: Username
        skills:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: >-
            List of skills (can be skill IDs or objects with name, platform_key,
            etc.)
        data:
          description: Additional data
      required:
        - skills
    RequestDataVariable:
      type: object
      properties:
        variable_name:
          type: string
          description: Variable Name
        data_set:
          description: Data set to be used for prediction
        number_of_data_points:
          type: integer
          description: Number of Data Points
      required:
        - data_set
        - number_of_data_points
        - variable_name
    Resource:
      type: object
      properties:
        item_id:
          type: string
        id:
          type: integer
          readOnly: true
        name:
          type: string
          readOnly: true
          nullable: true
          description: The display name of the resource.
        url:
          type: string
          readOnly: true
          nullable: true
          description: Resource URL.
        resource_type:
          type: string
          readOnly: true
          nullable: true
          description: Resource type.
        data:
          readOnly: true
          nullable: true
          description: Metadata
        image:
          type: string
          format: uri
          nullable: true
        description:
          type: string
          nullable: true
      required:
        - data
        - id
        - name
        - resource_type
        - url
    ResourceCompletion:
      type: object
      description: >-
        Serializer for resource completion data used in both request and
        response.

        Inherits common completion fields from CompletableBaseSerializer.
      properties:
        completion_percentage:
          type: number
          format: double
          nullable: true
          description: Completion percentage
        completed:
          type: boolean
          nullable: true
          default: false
          description: Whether completable is completed
        last_updated:
          type: string
          format: date-time
          readOnly: true
          description: Last update timestamp
        completion_date:
          type: string
          format: date-time
          nullable: true
          description: Completion timestamp
        completion_data:
          nullable: true
          description: Completion metadata
        skill_points_computed:
          type: boolean
          nullable: true
          default: false
          description: Whether skill points have been evaluated
        resource_id:
          type: integer
          description: The unique identifier for the resource
        resource_type:
          type: string
          description: The type of resource
        user_id:
          type: integer
          description: The user identifier
        username:
          type: string
          readOnly: true
          description: The username associated with the completion
      required:
        - last_updated
        - resource_id
        - resource_type
        - user_id
        - username
    ResourceCompletionRequest:
      type: object
      description: Request serializer for ResourceCompletionManagementView POST endpoint.
      properties:
        resource_id:
          type: integer
          description: The unique identifier for the resource
        user_id:
          type: integer
          description: The ID of the user
        completed:
          type: boolean
          description: Whether the resource is completed
        completion_percentage:
          type: number
          format: double
          nullable: true
          description: Percentage of completion (0.0-1.0)
        completion_date:
          type: string
          format: date-time
          nullable: true
          description: When the resource was completed
        completion_data:
          description: Additional completion metadata
      required:
        - resource_id
        - user_id
    ResourceCreateUpdate:
      type: object
      properties:
        id:
          type: integer
          description: Resource ID for updates
        user_id:
          type: integer
          description: User ID of the resource owner
        username:
          type: string
          description: Username of the resource owner
        resource_type:
          type: string
          description: Type of resource (e.g., video, document)
        url:
          type: string
          format: uri
          description: URL of the resource
        name:
          type: string
          description: Name of the resource
        description:
          type: string
          description: Description of the resource
        skills:
          type: array
          items:
            type: string
          description: List of skill names associated with the resource
        image:
          type: string
          format: uri
          description: Image file
        data:
          description: Additional metadata for the resource
      required:
        - name
        - resource_type
        - url
    ResourceDeleteResponse:
      type: object
      description: Serializer for resource deletion response.
      properties:
        count:
          type: integer
          description: Number of resources deleted
        type:
          type: object
          additionalProperties: {}
          description: Types of objects deleted
      required:
        - count
        - type
    ResourcePoint:
      type: object
      properties:
        name:
          type: string
          nullable: true
          description: The display name of the resource.
          maxLength: 255
        points:
          type: integer
          readOnly: true
      required:
        - points
    ResourceScrappedData:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        status:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/ResourceScrappedDataStatusEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        date_created:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        last_modified:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        resource:
          type: integer
        content:
          type: string
          nullable: true
        content_type:
          type: string
          nullable: true
          maxLength: 50
        extra_data:
          nullable: true
      required:
        - date_created
        - id
        - last_modified
        - resource
    ResourceScrappedDataStatusEnum:
      enum:
        - scrapped
        - failed
        - pending
        - unscrapped
      type: string
      description: |-
        * `scrapped` - Scraped
        * `failed` - Failed
        * `pending` - Pending
        * `unscrapped` - Unscraped
    ResponseDataVariable:
      type: object
      properties:
        variable_name:
          type: string
          description: Variable Name
        predicted_data:
          description: Predicted data
        narrative:
          type: string
          description: Explanation of prediction
      required:
        - narrative
        - predicted_data
        - variable_name
    RetreiverTrainViewRequest:
      type: object
      properties:
        pathway:
          type: string
          description: Pathway for document to be trained in
        url:
          type: string
          description: Url of the document to be trained
      required:
        - pathway
        - url
    RetreiverTrainViewResponse:
      type: object
      properties:
        detail:
          type: string
          description: Status of the training
      required:
        - detail
    RetrieveTask:
      type: object
      properties:
        task:
          type: string
      required:
        - task
    RetrieverDocumentEmbedding:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        metadata:
          nullable: true
        document_name:
          type: string
          nullable: true
        document_type:
          type: string
          nullable: true
        username:
          type: string
        training_status:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/TrainingStatusEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        pathway:
          type: string
        url:
          type: string
          nullable: true
        tokens:
          type: integer
          maximum: 9223372036854776000
          minimum: -9223372036854776000
          format: int64
          nullable: true
        platform_key:
          type: string
        is_trained:
          type: boolean
        access:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/AccessEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        crawler_max_depth:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          nullable: true
        crawler_max_pages_limit:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          nullable: true
        crawler_max_concurrency:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          nullable: true
        crawler_match_patterns:
          description: |-
            List of patterns that the crawler should use to match urls. 
                    Patterns may be a glob pattern or a full regex pattern. 
                    Indicate the specified type in `crawler_pattern_type`.
        crawler_pattern_type:
          oneOf:
            - $ref: '#/components/schemas/CrawlerPatternTypeEnum'
            - $ref: '#/components/schemas/BlankEnum'
        last_trained_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
      required:
        - id
        - last_trained_at
        - pathway
        - platform_key
        - username
    RetrieverDocumentEmbeddingRequest:
      type: object
      properties:
        document_name:
          type: string
          description: The name of the document
        document_type:
          type: string
          description: The type of the document
        pathway:
          type: string
          description: The pathway to retrain the document in
        url:
          type: string
          description: The url of the document
        train:
          type: boolean
          nullable: true
          description: The type of the document
        crawler_max_depth:
          type: integer
          description: The max depth of the crawler
        crawler_max_pages_limit:
          type: integer
          description: The max pages limit of the crawler
        crawler_max_concurrency:
          type: integer
          description: The max concurrency of the crawler
        crawler_match_patterns:
          type: array
          items:
            type: string
          description: >-
            The patterns that the crawler should use to match urls. Patterns may
            be a glob pattern or a full regex pattern. Indicate the specified
            type in `crawler_pattern_type`.
        crawler_pattern_type:
          allOf:
            - $ref: '#/components/schemas/CrawlerPatternTypeEnum'
          description: |-
            Pattern type for the crawler

            * `glob` - Glob
            * `regex` - Regex
        access:
          allOf:
            - $ref: '#/components/schemas/AccessEnum'
          description: |-
            The access of the document.

            * `public` - Public
            * `private` - Private
        google_drive_auth_data:
          description: Authentication and scoped details of google drive.
        dropbox_auth_data:
          description: Authentication and scoped details of dropbox
        custom_metadata:
          description: >-
            Custom metadata to attach to the trained document. Must be a flat
            JSON object with string keys and string, number, or boolean values.
      required:
        - pathway
    RetrieverRequestSearch:
      type: object
      properties:
        query:
          type: string
          description: The query for similarity search
        pathway:
          type: string
          description: The pathway of the docs
      required:
        - pathway
        - query
    RetrieverRequestSearchDocument:
      type: object
      properties:
        source:
          type: string
          description: The source url of the docuemnt
        confidence_level:
          type: number
          format: double
          description: The percentge confidence level of the document retrieved
      required:
        - confidence_level
        - source
    RetrieverResponseSearch:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/PageContent'
          description: Docs from similarity search
      required:
        - results
    ReuestDataVariableList:
      type: object
      properties:
        data_variables:
          type: array
          items:
            $ref: '#/components/schemas/RequestDataVariable'
      required:
        - data_variables
    Role:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          readOnly: true
          nullable: true
          description: The display name of the role.
        slug:
          type: string
          readOnly: true
          nullable: true
          description: An additional unique slug field.
        platform_key:
          type: string
        skills:
          type: array
          items:
            $ref: '#/components/schemas/Skill'
        data:
          readOnly: true
          nullable: true
          description: Metadata
      required:
        - data
        - id
        - name
        - skills
        - slug
    RoleCreateUpdateRequest:
      type: object
      description: Serializer for role creation/update request parameters.
      properties:
        id:
          type: integer
          description: Role ID (for updates)
        name:
          type: string
          description: Role name
        slug:
          type: string
          description: Role slug
        platform_key:
          type: string
          description: Platform key
        data:
          description: Additional role data
      required:
        - name
    RunMentorEval:
      type: object
      properties:
        id:
          type: integer
      required:
        - id
    SCIMAddress:
      type: object
      description: SCIM address object serializer
      properties:
        type:
          type: string
          description: Address type (work, home, etc.)
        formatted:
          type: string
          description: Full formatted address
        streetAddress:
          type: string
          description: Street address
        locality:
          type: string
          description: City
        region:
          type: string
          description: State/region
        postalCode:
          type: string
          description: Postal code
        country:
          type: string
          description: Country
      required:
        - country
        - formatted
        - locality
        - postalCode
        - region
        - streetAddress
        - type
    SCIMEmail:
      type: object
      description: SCIM email object serializer
      properties:
        value:
          type: string
          format: email
          description: Email address
        primary:
          type: boolean
          default: true
          description: Whether this is the primary email
        type:
          type: string
          default: work
          description: Email type (work, home, etc.)
      required:
        - value
    SCIMEnterpriseUser:
      type: object
      description: SCIM enterprise user extension serializer
      properties:
        edxData:
          description: edX user data
        userData:
          description: User metadata
        departments:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: List of department memberships
        groups:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: List of group memberships
        rbacGroups:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: List of RBAC groups the user belongs to
        platforms:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: List of platforms the user has access to
    SCIMGroup:
      type: object
      description: SCIM group serializer for RBAC group management
      properties:
        schemas:
          type: array
          items:
            type: string
          default:
            - urn:ietf:params:scim:schemas:core:2.0:Group
          description: SCIM schema identifiers
        id:
          type: string
          description: RBAC group unique ID (must match existing RBAC group)
        displayName:
          type: string
          description: RBAC group display name
        description:
          type: string
          description: RBAC group description
        members:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: Users to add/remove from the RBAC group
        meta:
          allOf:
            - $ref: '#/components/schemas/SCIMMeta'
          description: Resource metadata
      required:
        - displayName
        - id
    SCIMGroupListResponse:
      type: object
      description: SCIM group list response serializer
      properties:
        schemas:
          type: array
          items:
            type: string
          description: SCIM schema identifiers
        totalResults:
          type: integer
          description: Total number of results
        Resources:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: List of group resources
        startIndex:
          type: integer
          description: Starting index
        itemsPerPage:
          type: integer
          description: Items per page
      required:
        - Resources
        - schemas
        - totalResults
    SCIMMeta:
      type: object
      description: SCIM meta object serializer
      properties:
        resourceType:
          type: string
          description: Resource type
        created:
          type: string
          description: Creation timestamp
        lastModified:
          type: string
          description: Last modification timestamp
        version:
          type: string
          description: Resource version
        location:
          type: string
          description: Resource location URL
    SCIMName:
      type: object
      description: SCIM name object serializer
      properties:
        formatted:
          type: string
          description: Full formatted name
        familyName:
          type: string
          description: Family/last name
        givenName:
          type: string
          description: Given/first name
      required:
        - familyName
        - formatted
        - givenName
    SCIMPhoneNumber:
      type: object
      description: SCIM phone number object serializer
      properties:
        value:
          type: string
          description: Phone number
        type:
          type: string
          description: Phone type (work, home, mobile, etc.)
      required:
        - type
        - value
    SCIMUserCreateRequest:
      type: object
      description: SCIM user creation request serializer
      properties:
        schemas:
          type: array
          items:
            type: string
          default:
            - urn:ietf:params:scim:schemas:core:2.0:User
          description: SCIM schema identifiers
        userName:
          type: string
          description: Unique username/email for the user
        name:
          allOf:
            - $ref: '#/components/schemas/SCIMName'
          description: User's name information
        emails:
          type: array
          items:
            $ref: '#/components/schemas/SCIMEmail'
          description: User's email addresses
        active:
          type: boolean
          default: true
          description: Whether the user is active
        displayName:
          type: string
          description: Display name
        locale:
          type: string
          description: User locale
        timezone:
          type: string
          description: User timezone
        title:
          type: string
          description: Job title
        organization:
          type: string
          description: Organization
        phoneNumbers:
          type: array
          items:
            $ref: '#/components/schemas/SCIMPhoneNumber'
          description: Phone numbers
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/SCIMAddress'
          description: Addresses
        entitlements:
          type: array
          items:
            type: string
          description: User entitlements
        roles:
          type: array
          items:
            type: string
          description: User roles
        x509Certificates:
          type: array
          items:
            type: string
          description: X.509 certificates
        password:
          type: string
          description: User password
        provider:
          type: string
          description: Authentication provider
        tpaUid:
          type: string
          description: Third-party authentication UID
        isStaff:
          type: boolean
          default: false
          description: Whether the user is a staff member
        update:
          type: boolean
          default: false
          description: Whether to update existing user
        platformOrgs:
          type: array
          items:
            type: string
          description: List of platform organizations to link the user to
        departmentIds:
          type: array
          items:
            type: integer
          description: List of department IDs to make the user a member of
        groupIds:
          type: array
          items:
            type: integer
          description: List of group IDs to add the user to
        rbacGroupUniqueIds:
          type: array
          items:
            type: string
          description: List of RBAC group unique IDs to add the user to
        meta:
          allOf:
            - $ref: '#/components/schemas/SCIMMeta'
          description: Resource metadata
      required:
        - emails
        - name
        - userName
    SCIMUserListResponse:
      type: object
      description: SCIM user list response serializer
      properties:
        schemas:
          type: array
          items:
            type: string
          description: SCIM schema identifiers
        totalResults:
          type: integer
          description: Total number of results
        Resources:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: List of user resources
      required:
        - Resources
        - schemas
        - totalResults
    SCIMUserResponse:
      type: object
      description: SCIM user response serializer
      properties:
        schemas:
          type: array
          items:
            type: string
          description: SCIM schema identifiers
        id:
          type: string
          description: User ID
        userName:
          type: string
          description: Username
        name:
          allOf:
            - $ref: '#/components/schemas/SCIMName'
          description: User's name information
        emails:
          type: array
          items:
            $ref: '#/components/schemas/SCIMEmail'
          description: User's email addresses
        active:
          type: boolean
          description: Whether the user is active
        urn_ietf_params_scim_schemas_extension_enterprise_2_0_User:
          allOf:
            - $ref: '#/components/schemas/SCIMEnterpriseUser'
          description: Enterprise user extension data
        meta:
          allOf:
            - $ref: '#/components/schemas/SCIMMeta'
          description: Resource metadata
      required:
        - active
        - emails
        - id
        - name
        - schemas
        - urn_ietf_params_scim_schemas_extension_enterprise_2_0_User
        - userName
    ScanWebhookRequest:
      type: object
      properties:
        file_id:
          type: string
        filename:
          type: string
        status:
          type: string
        message:
          type: string
      required:
        - file_id
        - filename
        - message
        - status
    ScanWebhookResponse:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    ScopeEnum:
      enum:
        - platform
        - mentor
      type: string
      description: |-
        * `platform` - Platform
        * `mentor` - Mentor
    Section:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        course:
          type: integer
        display_name:
          type: string
          maxLength: 255
        status:
          allOf:
            - $ref: '#/components/schemas/Status6eeEnum'
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - course
        - created_at
        - display_name
        - id
        - status
        - updated_at
    SectionWithChildren:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        course:
          type: integer
        display_name:
          type: string
          maxLength: 255
        status:
          allOf:
            - $ref: '#/components/schemas/Status6eeEnum'
          readOnly: true
        subsections:
          type: array
          items:
            $ref: '#/components/schemas/SubSectionWithChildren'
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - course
        - created_at
        - display_name
        - id
        - status
        - subsections
        - updated_at
    SeedMentorsView:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    SendNotification:
      type: object
      description: Request serializer for sending notification
      properties:
        build_id:
          type: string
      required:
        - build_id
    SendNotificationRequest:
      type: object
      properties:
        title:
          type: string
        message:
          type: string
        topic:
          type: string
        notification_type:
          type: string
        channel:
          $ref: '#/components/schemas/ChannelEnum'
        students:
          type: array
          items:
            type: string
      required:
        - channel
    SendResponse:
      type: object
      description: Response serializer for send notification
      properties:
        status:
          type: string
        notifications_sent:
          type: integer
        build_id:
          type: string
          format: uuid
        message:
          type: string
      required:
        - build_id
        - message
        - notifications_sent
        - status
    SentimentSummary:
      type: object
      properties:
        sentiment_distribution:
          type: object
          additionalProperties: {}
        total_sentiments:
          type: integer
      required:
        - sentiment_distribution
        - total_sentiments
    ServiceEnum:
      enum:
        - google_drive
        - google_document
        - google_slides
        - google_calendar
      type: string
      description: |-
        * `google_drive` - Google Drive
        * `google_document` - Google Document
        * `google_slides` - Google Slides
        * `google_calendar` - Google Calendar
    SessionBrowserScreenshot:
      type: object
      properties:
        type:
          type: string
        session_id:
          type: string
        format:
          type: string
        ext:
          type: string
        url:
          type: string
        time:
          type: string
          format: date-time
      required:
        - ext
        - format
        - session_id
        - time
        - type
        - url
    SessionChartPoint:
      type: object
      properties:
        date:
          type: string
          format: date-time
        value:
          type: integer
      required:
        - date
        - value
    SessionDetail:
      type: object
      properties:
        count:
          type: integer
        previous:
          type: string
        next:
          type: string
        results:
          type: array
          items:
            type: string
      required:
        - count
        - next
        - previous
        - results
    SessionMemoryAttachment:
      type: object
      properties:
        attached:
          type: boolean
      required:
        - attached
    SessionMemoryStorage:
      type: object
      properties:
        memory:
          allOf:
            - $ref: '#/components/schemas/MemoryComponentMemory'
          readOnly: true
        updated_at:
          type: string
          readOnly: true
        session_id:
          type: string
          readOnly: true
      required:
        - memory
        - session_id
        - updated_at
    SessionsChart:
      type: object
      properties:
        metric:
          type: string
        points:
          type: array
          items:
            $ref: '#/components/schemas/SessionChartPoint'
      required:
        - metric
        - points
    SetStudentLLMAccess:
      type: object
      description: Serializer for setting student LLM access permissions
      properties:
        platform_key:
          type: string
          description: The platform key where the LLM access should be set
          maxLength: 255
        llm_resources:
          type: array
          items:
            type: string
          description: >-
            List of LLM resource paths. Format: ['llms/openai/models/gpt-4',
            'llms/openai/', 'llms/']. Shorter paths grant access to all
            sub-resources.
      required:
        - llm_resources
        - platform_key
    SetStudentMentorCreationPermission:
      type: object
      description: Serializer for setting student mentor creation permission
      properties:
        platform_key:
          type: string
          description: The platform key where the permission should be changed
          maxLength: 255
        allow_students_to_create_mentors:
          type: boolean
          description: Whether to allow students to create mentors (true) or not (false)
      required:
        - allow_students_to_create_mentors
        - platform_key
    ShareableMentorLink:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        mentor:
          type: integer
          readOnly: true
        token:
          type: string
          readOnly: true
        enabled:
          type: boolean
        inserted_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - id
        - inserted_at
        - mentor
        - token
        - updated_at
    ShellLogs:
      type: object
      properties:
        logs:
          type: string
      required:
        - logs
    Skill:
      type: object
      properties:
        skill_id:
          type: integer
        name:
          type: string
          nullable: true
        slug:
          type: string
          nullable: true
        platform:
          type: string
          nullable: true
      required:
        - skill_id
    SkillCreateUpdateRequest:
      type: object
      description: Serializer for skill creation/update request parameters.
      properties:
        id:
          type: integer
          description: Skill ID (for updates)
        name:
          type: string
          description: Skill name
        slug:
          type: string
          description: Skill slug
        platform_key:
          type: string
          description: Platform key
        data:
          description: Additional skill data
      required:
        - name
    SkillDetail:
      type: object
      properties:
        name:
          type: string
          nullable: true
          description: Display name
          maxLength: 255
        courses:
          type: array
          items:
            $ref: '#/components/schemas/CourseSkill'
        related_skills:
          type: integer
          readOnly: true
      required:
        - courses
        - related_skills
    SkillInfo:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          nullable: true
          description: Display name
          maxLength: 255
        course_count:
          type: integer
          readOnly: true
          description: Number of courses with skill
        user_count:
          type: integer
          readOnly: true
          description: Number of users with skill
        total_points:
          type: integer
          readOnly: true
          description: Total points for skill
        average_points:
          type: number
          format: double
          readOnly: true
          description: Average points for skill
      required:
        - average_points
        - course_count
        - id
        - total_points
        - user_count
    SkillThreshold:
      type: object
      properties:
        name:
          type: string
          description: The name of the threshold e.g Beginner.
          maxLength: 255
        threshold:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          description: The threshold for the skill.
        platform:
          type: string
          description: The platform key
      required:
        - name
        - platform
        - threshold
    SkillsDetail:
      type: object
      properties:
        desired:
          type: array
          items:
            $ref: '#/components/schemas/Skill'
        reported:
          type: array
          items:
            $ref: '#/components/schemas/Skill'
      required:
        - desired
        - reported
    SkillsMetric:
      type: object
      description: Serializer for skills metrics with breakdown.
      properties:
        reported:
          type: integer
        desired:
          type: integer
        assigned:
          type: integer
        total:
          type: integer
        details:
          type: array
          items:
            type: object
            additionalProperties: {}
      required:
        - assigned
        - desired
        - reported
        - total
    SlackConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        bot:
          type: integer
        client_id:
          type: string
          maxLength: 255
        client_secret:
          type: string
          maxLength: 500
        app_token:
          type: string
          maxLength: 500
        verification_token:
          type: string
          maxLength: 500
      required:
        - app_token
        - bot
        - client_id
        - client_secret
        - id
        - verification_token
    SlackUserConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        user:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          readOnly: true
        slack_team_domain:
          type: string
          description: >-
            Team Domain in the stated slack workspace. This is also the
            workspace name.
          maxLength: 200
        slack_username:
          type: string
          description: Username in the stated slack workspace
          maxLength: 200
        date_created:
          type: string
          format: date-time
          readOnly: true
        last_modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - date_created
        - id
        - last_modified
        - slack_team_domain
        - slack_username
        - user
    SlackWebhook:
      type: object
      properties:
        type:
          type: string
        event:
          type: object
          additionalProperties: {}
        command:
          type: string
        response_url:
          type: string
          format: uri
      required:
        - command
        - event
        - response_url
        - type
    Spa:
      type: object
      description: Serializer for SPA
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: >-
            Unique identifier for the SPA (e.g., 'skills', 'mentor', 'admin',
            'mobile')
          maxLength: 100
        description:
          type: string
          description: Human-friendly description of this SPA
          maxLength: 255
      required:
        - id
        - name
    SpacedRepetitionLearningPath:
      type: object
      properties:
        learning_path:
          type: string
      required:
        - learning_path
    SpacedRepetitionQuestionStats:
      type: object
      properties:
        total_questions:
          type: integer
          readOnly: true
        success_rate:
          type: number
          format: double
          readOnly: true
        reviewed_questions:
          type: integer
          readOnly: true
      required:
        - reviewed_questions
        - success_rate
        - total_questions
    StarMentor:
      type: object
      properties:
        is_starred:
          type: boolean
        updated_at:
          type: string
          readOnly: true
        mentor:
          type: string
          readOnly: true
        student:
          type: string
          readOnly: true
        recently_accessed_at:
          type: string
          nullable: true
          readOnly: true
      required:
        - mentor
        - recently_accessed_at
        - student
        - updated_at
    StateEnum:
      enum:
        - pending
        - running
        - accumulating
        - processing
        - storing
        - completed
        - cancelled
        - error
        - expired
      type: string
      description: |-
        * `pending` - Pending
        * `running` - Running
        * `accumulating` - Accumulating
        * `processing` - Processing
        * `storing` - Storing
        * `completed` - Completed
        * `cancelled` - Cancelled
        * `error` - Error
        * `expired` - Expired
    Status6eeEnum:
      enum:
        - published
        - draft
        - error
        - syncing
      type: string
      description: |-
        * `published` - Published
        * `draft` - Unsynced
        * `error` - Error
        * `syncing` - Syncing
    Step:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        title:
          type: string
          maxLength: 400
        description:
          type: string
        status:
          $ref: '#/components/schemas/StepStatusEnum'
        position:
          type: integer
          maximum: 2147483647
          minimum: 0
        job:
          type: integer
      required:
        - id
        - job
        - position
        - title
    StepStatusEnum:
      enum:
        - completed
        - failed
        - pending
      type: string
      description: |-
        * `completed` - Completed
        * `failed` - Failed
        * `pending` - Pending
    StripeBillingPageIdentifierResponse:
      type: object
      properties:
        publishable_key:
          type: string
        pricing_table_id:
          type: string
        pricing_table_js: {}
        payment_link_id:
          type: string
        payment_link_url:
          type: string
        customer_email:
          type: string
          format: email
        client_reference_id:
          type: string
          format: uuid
      required:
        - client_reference_id
        - customer_email
        - payment_link_id
        - payment_link_url
        - pricing_table_id
        - pricing_table_js
        - publishable_key
    StripeCheckoutSessionRequest:
      type: object
      description: Serializer for Stripe checkout session creation requests.
      properties:
        sku:
          type: string
          description: Product SKU
        product:
          type: string
          description: Alternative to SKU
        tenant:
          type: string
          description: Tenant type to create after successful checkout
        success_url:
          type: string
          format: uri
          description: URL to redirect after successful payment
        cancel_url:
          type: string
          format: uri
          description: URL to redirect if checkout cancelled
        mode:
          allOf:
            - $ref: '#/components/schemas/StripeCheckoutSessionRequestModeEnum'
          default: subscription
          description: |-
            Checkout mode

            * `subscription` - subscription
            * `payment` - payment
            * `setup` - setup
        period:
          allOf:
            - $ref: '#/components/schemas/PeriodEnum'
          description: |-
            Billing period

            * `weekly` - weekly
            * `monthly` - monthly
            * `yearly` - yearly
        metered:
          type: boolean
          default: false
          description: Whether to use metered billing
        quantity:
          type: integer
          default: 1
          description: Subscription quantity
          minimum: 1
        coupon:
          type: string
          description: Coupon code to apply
        is_free_trial:
          type: boolean
          default: false
          description: Enable free trial
        trial_days:
          type: integer
          description: Trial period in days
          minimum: 1
        skip_card:
          type: boolean
          default: false
          description: Skip card collection for trial
      required:
        - cancel_url
        - success_url
        - tenant
    StripeCheckoutSessionRequestModeEnum:
      enum:
        - subscription
        - payment
        - setup
      type: string
      description: |-
        * `subscription` - subscription
        * `payment` - payment
        * `setup` - setup
    StripeCheckoutSessionResponse:
      type: object
      description: Stripe checkout session serialized response
      properties:
        redirect_to:
          type: string
          format: uri
      required:
        - redirect_to
    StripeContext:
      type: object
      properties:
        publishable_key:
          type: string
        pricing_table_id:
          type: string
        pricing_table_js: {}
        payment_link_id:
          type: string
        payment_link_url:
          type: string
      required:
        - payment_link_id
        - payment_link_url
        - pricing_table_id
        - pricing_table_js
        - publishable_key
    StripeCustomerPortalRequest:
      type: object
      properties:
        return_url:
          type: string
          format: uri
          description: URL to redirect to when the back button is clicked
        subscription_id:
          type: string
          description: >-
            Provide a subscription id to set the default landing page to
            subscription update
      required:
        - return_url
    StripeCustomerPortalResponse:
      type: object
      properties:
        url:
          type: string
          format: uri
      required:
        - url
    StripeLocalProduct:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        description:
          type: string
          nullable: true
        price:
          type: string
          readOnly: true
        stripe_product_id:
          type: string
          nullable: true
          maxLength: 250
        sku:
          type: string
          maxLength: 255
        platform:
          type: string
          readOnly: true
      required:
        - name
        - platform
        - price
        - sku
    StripeNewUserTenantLaunchRequest:
      type: object
      properties:
        username:
          type: string
        email:
          type: string
          format: email
        firstname:
          type: string
          default: ''
        lastname:
          type: string
          default: ''
        password:
          type: string
        name:
          type: string
          description: Organization name
        key:
          type: string
          description: Unique key for the organization
        ignore_user_exists:
          type: boolean
          default: false
        is_advertising:
          type: boolean
          default: false
          description: >-
            Advertising mode allows a platform to set custom usd balance to
            allocate for its members
        stripe_checkout_id_alt:
          type: string
          description: Stripe Checkout Id to launch the tenant
      required:
        - key
        - name
        - stripe_checkout_id_alt
    StripeSubscriptionRenewalRequest:
      type: object
      properties:
        checkout_session_uuid:
          type: string
        return_url:
          type: string
      required:
        - checkout_session_uuid
        - return_url
    StripeSubscriptionRenewalResponse:
      type: object
      properties:
        subscription_id:
          type: string
      required:
        - subscription_id
    SttProviderEnum:
      enum:
        - openai
        - google
        - deepgram
        - cartesia
      type: string
      description: |-
        * `openai` - Openai
        * `google` - Google
        * `deepgram` - Deepgram
        * `cartesia` - Cartesia
    StudentChatMessage:
      type: object
      properties:
        username:
          type: string
        chat_message_count:
          type: integer
      required:
        - chat_message_count
        - username
    StudentLLMAccessResponse:
      type: object
      description: Serializer for student LLM access responses
      properties:
        platform_key:
          type: string
          description: The platform key
        llm_resources:
          type: array
          items:
            type: string
          description: >-
            List of LLM resource paths that students can access. Format:
            ['llms/openai/models/gpt-4', 'llms/openai/', 'llms/']
      required:
        - llm_resources
        - platform_key
    StudentMentorCreationPermissionResponse:
      type: object
      description: Serializer for student mentor creation permission responses
      properties:
        allow_students_to_create_mentors:
          type: boolean
          description: Whether students can create mentors on this platform
        platform_key:
          type: string
          description: The platform key
        message:
          type: string
          description: Success message (only in set permission response)
      required:
        - allow_students_to_create_mentors
        - platform_key
    StylesView:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        description:
          type: string
      required:
        - description
        - id
    SubSection:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        section:
          type: integer
        display_name:
          type: string
          maxLength: 255
        status:
          allOf:
            - $ref: '#/components/schemas/Status6eeEnum'
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - display_name
        - id
        - section
        - status
        - updated_at
    SubSectionWithChildren:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        section:
          type: integer
        display_name:
          type: string
          maxLength: 255
        status:
          allOf:
            - $ref: '#/components/schemas/Status6eeEnum'
          readOnly: true
        units:
          type: array
          items:
            $ref: '#/components/schemas/UnitWithChildren'
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - display_name
        - id
        - section
        - status
        - units
        - updated_at
    SubTimeChild:
      type: object
      properties:
        display_name:
          type: string
          description: Display name
        id:
          type: string
          description: block id
        block_id:
          type: string
          description: block id
        total_time:
          type: integer
          description: Total time spent
      required:
        - display_name
        - id
    Subject:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
          nullable: true
      required:
        - id
        - name
    Summary:
      type: object
      description: Summary metrics for the invoice.
      properties:
        total_cost:
          type: string
          format: decimal
          pattern: ^-?\d{0,9}(?:\.\d{0,3})?$
        total_sessions:
          type: integer
        active_users:
          type: integer
        cost_per_session:
          type: string
          format: decimal
          pattern: ^-?\d{0,9}(?:\.\d{0,3})?$
      required:
        - active_users
        - cost_per_session
        - total_cost
        - total_sessions
    TagsView:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
          nullable: true
      required:
        - id
        - name
    TargetSystemEnum:
      enum:
        - Safety System
        - Moderation System
      type: string
      description: |-
        * `Safety System` - Safety System
        * `Moderation System` - Moderation System
    TaskView:
      type: object
      properties:
        task_id:
          type: string
      required:
        - task_id
    TeamsConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        bot:
          type: integer
          readOnly: true
        client_id:
          type: string
          maxLength: 500
        client_secret:
          type: string
          maxLength: 500
        verification_token:
          type: string
          maxLength: 500
      required:
        - bot
        - client_id
        - client_secret
        - id
    TeamsWebhook:
      type: object
      properties:
        id:
          type: string
          nullable: true
        type:
          type: string
          nullable: true
        channelData:
          type: object
          additionalProperties: {}
          nullable: true
        entities:
          type: array
          items: {}
          nullable: true
        text:
          type: string
          nullable: true
        locale:
          type: string
          nullable: true
        textFormat:
          type: string
          nullable: true
        recipient:
          type: object
          additionalProperties: {}
          nullable: true
        conversation:
          type: object
          additionalProperties: {}
          nullable: true
        from_:
          type: object
          additionalProperties: {}
          nullable: true
          title: 'From '
        channelId:
          type: string
          nullable: true
        serviceUrl:
          type: string
          nullable: true
        localTimezone:
          type: string
          nullable: true
        localTimestamp:
          type: string
          nullable: true
        timestamp:
          type: string
          nullable: true
    TemplateMentor:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        slug:
          type: string
          maxLength: 255
          pattern: ^[-a-zA-Z0-9_]+$
        unique_id:
          type: string
          format: uuid
        description:
          type: string
          nullable: true
        system_prompt:
          type: string
          nullable: true
        platform_key:
          type: string
          nullable: true
      required:
        - id
        - name
        - platform_key
    TenantLaunchError:
      type: object
      description: An unexpected error occurred during launch process
      properties:
        success:
          type: boolean
          default: false
        message: {}
        data: {}
        id:
          type: string
        timestamp:
          type: string
      required:
        - message
    TenantLaunchFailed:
      type: object
      description: Launch process started but could not complete
      properties:
        success:
          type: boolean
          default: false
        message: {}
        data: {}
        id:
          type: string
        timestamp:
          type: string
        org:
          type: string
        lms_url:
          type: string
        cms_url:
          type: string
        portal_url:
          type: string
        edx_role:
          type: string
      required:
        - cms_url
        - edx_role
        - lms_url
        - message
        - org
        - portal_url
    TenantLaunchRequest:
      type: object
      properties:
        username:
          type: string
        email:
          type: string
          format: email
        firstname:
          type: string
          default: ''
        lastname:
          type: string
          default: ''
        password:
          type: string
        name:
          type: string
          description: Organization name
        key:
          type: string
          description: Unique key for the organization
        ignore_user_exists:
          type: boolean
          default: false
        is_advertising:
          type: boolean
          default: false
          description: >-
            Advertising mode allows a platform to set custom usd balance to
            allocate for its members
      required:
        - email
        - key
        - name
        - username
    TenantLaunchResponse:
      type: object
      description: Launch process completed successfully
      properties:
        success:
          type: boolean
          default: true
        message: {}
        data: {}
        id:
          type: string
        timestamp:
          type: string
        org:
          type: string
        lms_url:
          type: string
        cms_url:
          type: string
        portal_url:
          type: string
        edx_role:
          type: string
      required:
        - cms_url
        - edx_role
        - lms_url
        - message
        - org
        - portal_url
    TenantMentorTraces:
      type: object
      properties:
        tenant:
          type: string
        tenant_total_cost:
          type: number
          format: double
        mentor_data:
          type: array
          items:
            $ref: '#/components/schemas/MentorData'
      required:
        - mentor_data
        - tenant
        - tenant_total_cost
    TestSMTPCredentials:
      type: object
      description: Serializer for testing SMTP credentials
      properties:
        smtp_host:
          type: string
          description: SMTP server hostname
          maxLength: 255
        smtp_port:
          type: integer
          maximum: 65535
          minimum: 1
          description: SMTP server port
        smtp_username:
          type: string
          description: SMTP username
          maxLength: 255
        smtp_password:
          type: string
          writeOnly: true
          description: SMTP password
          maxLength: 255
        use_tls:
          type: boolean
          default: true
          description: Use TLS encryption
        use_ssl:
          type: boolean
          default: false
          description: Use SSL encryption
        test_email:
          type: string
          format: email
          description: Email address to send test email to
        from_email:
          type: string
          format: email
          description: From email address (optional)
      required:
        - smtp_host
        - smtp_password
        - smtp_port
        - smtp_username
        - test_email
    TestSMTPResponse:
      type: object
      description: Serializer for SMTP test response
      properties:
        status:
          type: string
        message:
          type: string
        success:
          type: boolean
      required:
        - message
        - status
        - success
    ThemeEnum:
      enum:
        - dark
        - light
      type: string
      description: |-
        * `dark` - Dark
        * `light` - Light
    TicketMessage:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        ticket:
          type: integer
        sender:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          nullable: true
        message:
          type: string
        timestamp:
          type: string
          format: date-time
          readOnly: true
      required:
        - id
        - message
        - ticket
        - timestamp
    TimeChildData:
      type: object
      properties:
        display_name:
          type: string
          description: Display name
        id:
          type: string
          description: block id
        block_id:
          type: string
          description: block id
        total_time:
          type: integer
          description: Total time spent
        children:
          type: array
          items:
            $ref: '#/components/schemas/SubTimeChild'
      required:
        - children
        - display_name
        - id
    TimeDetail:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/TimeDetailData'
        total:
          type: integer
          description: Total time spent
    TimeDetailChild:
      type: object
      properties:
        average_time:
          type: number
          format: double
          description: Average time spent
        display_name:
          type: string
          description: Subsection Display name
        id:
          type: string
          description: Subsection HTML id
        block_id:
          type: string
          description: Subsection block id
        total_time:
          type: integer
          description: Total time spent
        total_users:
          type: integer
          description: Total users who accessed the subsection
      required:
        - average_time
        - block_id
        - display_name
        - id
    TimeDetailData:
      type: object
      properties:
        average_time:
          type: number
          format: double
          description: Average time spent
        display_name:
          type: string
          description: Chapter name
        id:
          type: string
          description: Chapter Id
        children:
          type: array
          items:
            $ref: '#/components/schemas/TimeDetailChild'
        total_time:
          type: integer
          description: Total time spent
        total_users:
          type: integer
          description: Total users who accessed the chapter
      required:
        - average_time
        - display_name
        - id
    TimeSpentByUsersInCourse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/TimeSpentByUsersInCourseData'
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - pagination
    TimeSpentByUsersInCourseData:
      type: object
      properties:
        username:
          type: string
          description: learner username
        full_name:
          type: string
          description: learner Name
        email:
          type: string
          description: learner email
        assessments:
          type: integer
          description: Total assessments
        time_spent:
          type: string
          description: Time spent formatted in seconds
      required:
        - assessments
        - email
        - full_name
        - time_spent
        - username
    TimeSpentCourse:
      type: object
      properties:
        course_id:
          type: string
        course_name:
          type: string
        platform:
          type: string
          nullable: true
        time_spent:
          type: string
        time_spent_secs:
          type: integer
      required:
        - course_id
        - course_name
        - platform
        - time_spent
        - time_spent_secs
    TimeSpentDetail:
      type: object
      properties:
        courses:
          type: array
          items:
            $ref: '#/components/schemas/TimeSpentCourse'
        total_time_spent:
          type: string
        total_time_spent_secs:
          type: integer
        overtime:
          type: array
          items:
            $ref: '#/components/schemas/OvertimeDataPoint'
          description: Time spent over time data (when overtime=true)
      required:
        - courses
        - total_time_spent
        - total_time_spent_secs
    TimeSpentPerCourse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/TimeSpentPerCourseData'
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - pagination
    TimeSpentPerCourseData:
      type: object
      properties:
        name:
          type: string
          description: Course name
        course_id:
          type: string
          description: Edx Course Id
        time_spent:
          type: integer
          description: Total time spent
        course_start:
          type: string
          description: Course Start
        course_end:
          type: string
          description: Course End
        average_time:
          type: number
          format: double
          description: Average time spent
      required:
        - average_time
        - course_end
        - course_id
        - course_start
        - name
        - time_spent
    TimeSpentPerUserResponse:
      type: object
      properties:
        total_seconds:
          type: integer
      required:
        - total_seconds
    TimeSpentUpdateRequest:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
          description: Time when the event occurred, ensure it is UTC (ISO 8601 format)
        course_id:
          type: string
          description: Course ID to track time spent
        mentor_uuid:
          type: string
          description: Mentor UUID to track time spent
        block_id:
          type: string
          description: Block ID to track time spent
        count:
          type: integer
          description: Time spent in seconds
        url:
          type: string
          description: Source URL
        metadata:
          default: {}
          description: Additional metadata
        session_uuid:
          type: string
          description: Session UUID to track time spent
      required:
        - count
        - timestamp
        - url
    TimeSpentUpdateResponse:
      type: object
      properties:
        success:
          type: boolean
          default: true
        message:
          default: Time spent updated successfully
    TokenProxyInput:
      type: object
      description: Serializer for TokenProxyView POST request input data
      properties:
        user_id:
          type: integer
          description: Edx User ID
        username:
          type: string
          description: Edx Username
        email:
          type: string
          format: email
          description: Edx Email
        platform_key:
          type: string
          description: Platform key axd token should belong to
      required:
        - platform_key
    TokenProxyOutput:
      type: object
      description: The SPA expects this outer data key so we need to create an extra layer
      properties:
        data:
          $ref: '#/components/schemas/TokenProxyOutputSerializerData'
      required:
        - data
    TokenProxyOutputSerializerData:
      type: object
      description: Core data for Response
      properties:
        user:
          allOf:
            - $ref: '#/components/schemas/TokenProxyUser'
          description: User details
        axd_token:
          allOf:
            - $ref: '#/components/schemas/AuthToken'
          description: Axd Token details
        dm_token:
          allOf:
            - $ref: '#/components/schemas/ManagerAuthToken'
          description: DM Token details
      required:
        - axd_token
        - dm_token
        - user
    TokenProxyUser:
      type: object
      description: Serializer for User model for TokenProxyOutputSerializerData
      properties:
        user_id:
          type: integer
          description: Edx User ID
        user_email:
          type: string
          description: User's Edx Email
        user_nicename:
          type: string
          description: Username
        user_display_name:
          type: string
          description: User's display name
        user_fullname:
          type: string
          description: Edx Full Name
          readOnly: true
      required:
        - user_display_name
        - user_email
        - user_fullname
        - user_id
        - user_nicename
    TonesView:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        description:
          type: string
          nullable: true
      required:
        - id
    ToolCategory:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 50
        description:
          type: string
      required:
        - description
        - id
        - name
    ToolResponse:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 500
        display_name:
          type: string
          maxLength: 255
        slug:
          type: string
          maxLength: 50
          pattern: ^[-a-zA-Z0-9_]+$
        category:
          allOf:
            - $ref: '#/components/schemas/ToolCategory'
          readOnly: true
        description:
          type: string
          nullable: true
        logo:
          type: string
          format: uri
          nullable: true
        metadata:
          nullable: true
        allow_base_agent:
          type: boolean
        allow_openai_agent:
          type: boolean
        allow_openai_assistant:
          type: boolean
        allow_google_agent:
          type: boolean
      required:
        - category
        - id
        - name
    TopContent:
      type: object
      description: Serializer for top content information.
      properties:
        course_identifier:
          type: string
          description: Course identifier
        course_name:
          type: string
          description: Name of the course.
        time_spent_seconds:
          type: integer
          description: Time spent on this course in seconds
      required:
        - course_identifier
        - course_name
        - time_spent_seconds
    TopicDetail:
      type: object
      properties:
        name:
          type: string
        messages:
          type: integer
        conversations:
          type: integer
        sessions:
          type: integer
        average_rating:
          type: string
        rating_count:
          type: integer
      required:
        - conversations
        - messages
        - name
        - sessions
    TopicDetails:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/TopicDetail'
        pagination:
          type: object
          additionalProperties: {}
      required:
        - pagination
        - results
    TopicModel:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
      required:
        - name
    TopicRecord:
      type: object
      properties:
        topic_name:
          type: string
        conversation_count:
          type: integer
      required:
        - conversation_count
        - topic_name
    TopicStatistics:
      type: object
      properties:
        name:
          type: string
        conversations:
          type: integer
        messages:
          type: integer
        avg_sentiment:
          type: string
        avg_user_rating:
          type: string
      required:
        - avg_sentiment
        - avg_user_rating
        - conversations
        - messages
        - name
    TopicStatisticsResponse:
      type: object
      properties:
        total_topics:
          type: integer
        total_topics_change_percentage:
          type: number
          format: double
        new_topics:
          type: integer
        new_topics_change_percentage:
          type: number
          format: double
      required:
        - new_topics
        - new_topics_change_percentage
        - total_topics
        - total_topics_change_percentage
    TopicSummaryView:
      type: object
      properties:
        name:
          type: string
        conversation_count:
          type: integer
      required:
        - conversation_count
        - name
    TopicsOverview:
      type: object
      description: Dashboard KPI overview for topics.
      properties:
        topics:
          allOf:
            - $ref: '#/components/schemas/TopicsOverviewMetric'
          description: >-
            Topic metrics including all-time, monthly counts and percentage
            change
        sessions:
          allOf:
            - $ref: '#/components/schemas/TopicsOverviewMetric'
          description: >-
            Session metrics including all-time, monthly counts and percentage
            change
        conversations:
          allOf:
            - $ref: '#/components/schemas/TopicsOverviewMetric'
          description: >-
            Conversation metrics including all-time, monthly counts and
            percentage change
        messages:
          allOf:
            - $ref: '#/components/schemas/TopicsOverviewMetric'
          description: >-
            Message metrics including all-time, monthly counts and percentage
            change
      required:
        - conversations
        - messages
        - sessions
        - topics
    TopicsOverviewMetric:
      type: object
      description: Serializer for individual topic overview metrics.
      properties:
        all_time_total:
          type: integer
          description: Total count since the beginning of time
        this_month:
          type: integer
          description: Count for current month
        last_month:
          type: integer
          description: Count for previous month
        percentage_change:
          type: number
          format: double
          description: Percentage change from last month to this month
      required:
        - all_time_total
        - last_month
        - percentage_change
        - this_month
    Trace:
      type: object
      properties:
        id:
          type: string
        timestamp:
          type: string
          format: date-time
        name:
          type: string
        user_id:
          type: string
          nullable: true
        metadata: {}
        release:
          type: string
          nullable: true
        version:
          type: string
          nullable: true
        tags:
          type: array
          items:
            type: string
        input:
          type: string
          nullable: true
        output:
          type: string
          nullable: true
        session_id:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
        event_ts:
          type: string
          format: date-time
        is_deleted:
          type: integer
          maximum: 255
          minimum: 0
      required:
        - created_at
        - event_ts
        - id
        - is_deleted
        - metadata
        - name
        - tags
        - timestamp
    TrainChatSessionDocumentView:
      type: object
      properties:
        message:
          type: string
          description: Message of the training
      required:
        - message
    TrainChatSessionDocumentViewRequest:
      type: object
      properties:
        file:
          type: string
          format: binary
          description: File to be trained
      required:
        - file
    TrainDocumentViewRequest:
      type: object
      properties:
        pathway:
          type: string
          description: Pathway for document to be trained in
        url:
          type: string
          description: Url of the document to be trained
        text:
          type: string
          description: Search text for wikipedia
        type:
          type: string
          description: Type of document e.g file
        translate:
          type: boolean
          default: false
          description: If file should be translated
        file:
          type: string
          format: binary
          description: File to be trained
        access:
          type: string
          default: private
          description: Accessibilityto the file
        branch:
          type: string
          description: Branch of the repository
        google_drive_auth_data:
          description: Authentication and scoped details of google drive
        dropbox_auth_data:
          description: Authentication and scoped details of dropbox
        crawler_max_depth:
          type: integer
          description: The max depth of the crawler
        crawler_max_pages_limit:
          type: integer
          description: The max pages limit of the crawler
        crawler_max_concurrency:
          type: integer
          description: The max concurrency of the crawler
        crawler_match_patterns:
          type: array
          items:
            type: string
          description: >-
            The patterns that the crawler should use to match urls. Patterns may
            be a glob pattern or a full regex pattern. Indicate the specified
            type in `crawler_pattern_type`.
        crawler_pattern_type:
          allOf:
            - $ref: '#/components/schemas/CrawlerPatternTypeEnum'
          description: |-
            Pattern type for the crawler

            * `glob` - Glob
            * `regex` - Regex
        custom_metadata:
          description: >-
            Custom metadata to attach to the trained document. Must be a flat
            JSON object with string keys and string, number, or boolean values.
        add_to_document_pool:
          type: boolean
          default: false
          description: Adds document to the pool or not.
        document_pool_only:
          type: boolean
          default: false
          description: Only adds document to document pool. Requires pathway to be empty.
      required:
        - type
    TrainDocumentViewResponse:
      type: object
      properties:
        document_id:
          type: string
          description: Document id for document in training
        task_id:
          type: string
          description: Task id for document in training
        message:
          type: string
          description: Message of the training
        error:
          type: string
      required:
        - message
    Training:
      type: object
      properties:
        id:
          type: string
          format: uuid
        dataset:
          $ref: '#/components/schemas/DataSet'
        project_name:
          type: string
          maxLength: 255
        metadata: {}
        status:
          $ref: '#/components/schemas/TrainingStatusEnum'
        retry_attempts:
          type: integer
          maximum: 2147483647
          minimum: 0
        fine_tuned_model:
          type: string
          maxLength: 400
        provider:
          $ref: '#/components/schemas/Provider63aEnum'
        base_model_name:
          type: string
          maxLength: 400
        text_column:
          type: string
          maxLength: 50
        learning_rate:
          type: number
          format: double
        batch_size:
          type: integer
          maximum: 2147483647
          minimum: 0
        num_epochs:
          type: integer
          maximum: 2147483647
          minimum: 0
        block_size:
          type: integer
          maximum: 2147483647
          minimum: 0
        warmup_ratio:
          type: number
          format: double
        lora_r:
          type: integer
          maximum: 2147483647
          minimum: 0
        lora_alpha:
          type: integer
          maximum: 2147483647
          minimum: 0
        lora_dropout:
          type: number
          format: double
        weight_decay:
          type: number
          format: double
        gradient_accumulation:
          type: integer
          maximum: 2147483647
          minimum: 0
        use_peft:
          type: boolean
        use_fp16:
          type: boolean
        use_int4:
          type: boolean
        push_to_hub:
          type: boolean
        repo_id:
          type: string
          maxLength: 400
        preprocess_dataset:
          type: boolean
        prompt_column:
          type: string
          maxLength: 50
        response_column:
          type: string
          maxLength: 50
        prompt_prefix:
          type: string
          maxLength: 50
        prompt_suffix:
          type: string
          maxLength: 50
        response_prefix:
          type: string
          maxLength: 50
        response_suffix:
          type: string
          maxLength: 50
        error_log:
          type: string
        date_created:
          type: string
          format: date-time
          readOnly: true
        last_modified:
          type: string
          format: date-time
          readOnly: true
        platform:
          type: integer
      required:
        - base_model_name
        - dataset
        - date_created
        - last_modified
        - platform
        - project_name
    TrainingCreate:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        project_name:
          type: string
          maxLength: 255
        dataset:
          type: string
          format: uuid
        base_model_name:
          type: string
          maxLength: 400
        provider:
          $ref: '#/components/schemas/Provider63aEnum'
        text_column:
          type: string
          maxLength: 50
        learning_rate:
          type: number
          format: double
        batch_size:
          type: integer
          maximum: 2147483647
          minimum: 0
        num_epochs:
          type: integer
          maximum: 2147483647
          minimum: 0
        block_size:
          type: integer
          maximum: 2147483647
          minimum: 0
        warmup_ratio:
          type: number
          format: double
        lora_r:
          type: integer
          maximum: 2147483647
          minimum: 0
        lora_alpha:
          type: integer
          maximum: 2147483647
          minimum: 0
        lora_dropout:
          type: number
          format: double
        weight_decay:
          type: number
          format: double
        gradient_accumulation:
          type: integer
          maximum: 2147483647
          minimum: 0
        use_peft:
          type: boolean
        use_fp16:
          type: boolean
        use_int4:
          type: boolean
        push_to_hub:
          type: boolean
        repo_id:
          type: string
          maxLength: 400
        preprocess_dataset:
          type: boolean
        prompt_column:
          type: string
          maxLength: 50
        prompt_prefix:
          type: string
          maxLength: 50
        prompt_suffix:
          type: string
          maxLength: 50
        response_prefix:
          type: string
          maxLength: 50
        date_created:
          type: string
          format: date-time
          readOnly: true
        last_modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - base_model_name
        - dataset
        - date_created
        - id
        - last_modified
        - project_name
    TrainingStatusEnum:
      enum:
        - trained
        - failed
        - pending
        - untrained
      type: string
      description: |-
        * `trained` - Trained
        * `failed` - Failed
        * `pending` - Pending
        * `untrained` - Untrained
    TransportEnum:
      enum:
        - sse
        - websocket
        - streamable_http
      type: string
      description: |-
        * `sse` - Sse
        * `websocket` - Websocket
        * `streamable_http` - Streamable Http
    TrendEntry:
      type: object
      properties:
        interval:
          type: string
          format: date-time
        count:
          type: integer
      required:
        - count
        - interval
    TriggerRequest:
      type: object
      properties:
        template:
          type: string
        slug:
          type: string
        parameters: {}
      required:
        - parameters
        - slug
        - template
    TriggerResponse:
      type: object
      properties:
        slug:
          type: string
        template:
          type: string
          nullable: true
          readOnly: true
        platform:
          type: string
          nullable: true
          readOnly: true
        parameters:
          nullable: true
          readOnly: true
      required:
        - parameters
        - platform
        - slug
        - template
    TtsProviderEnum:
      enum:
        - openai
        - google
        - elevenlabs
      type: string
      description: |-
        * `openai` - Openai
        * `google` - Google
        * `elevenlabs` - Elevenlabs
    Type2a5Enum:
      enum:
        - DEFAULT_TEMPLATE
        - APP_REGISTRATION
        - USER_NOTIF_USER_REGISTRATION
        - USER_NOTIF_COURSE_ENROLLMENT
        - ADMIN_NOTIF_COURSE_ENROLLMENT
        - USER_NOTIF_USER_INACTIVITY
        - USER_NOTIF_COURSE_COMPLETION
        - USER_NOTIF_CREDENTIALS
        - CUSTOM_NOTIFICATION
        - PLATFORM_INVITATION
        - PROGRAM_INVITATION
        - COURSE_INVITATION
        - USER_NOTIF_LEARNER_PROGRESS
        - PROACTIVE_LEARNER_NOTIFICATION
        - ROLE_CHANGE
        - COURSE_LICENSE_ASSIGNMENT
        - COURSE_LICENSE_GROUP_ASSIGNMENT
        - PROGRAM_LICENSE_ASSIGNMENT
        - PROGRAM_LICENSE_GROUP_ASSIGNMENT
        - USER_LICENSE_ASSIGNMENT
        - USER_LICENSE_GROUP_ASSIGNMENT
      type: string
      description: |-
        * `DEFAULT_TEMPLATE` - Default Template
        * `APP_REGISTRATION` - App Registration
        * `USER_NOTIF_USER_REGISTRATION` - User Notif User Registration
        * `USER_NOTIF_COURSE_ENROLLMENT` - User Notif Course Enrollment
        * `ADMIN_NOTIF_COURSE_ENROLLMENT` - Admin Notif Course Enrollment
        * `USER_NOTIF_USER_INACTIVITY` - User Notif User Inactivity
        * `USER_NOTIF_COURSE_COMPLETION` - User Notif Course Completion
        * `USER_NOTIF_CREDENTIALS` - User Notif Credentials
        * `CUSTOM_NOTIFICATION` - Custom Notification
        * `PLATFORM_INVITATION` - Platform Invitation
        * `PROGRAM_INVITATION` - Program Invitation
        * `COURSE_INVITATION` - Course Invitation
        * `USER_NOTIF_LEARNER_PROGRESS` - User Notif Learner Progress
        * `PROACTIVE_LEARNER_NOTIFICATION` - Proactive Learner Notification
        * `ROLE_CHANGE` - Role Change
        * `COURSE_LICENSE_ASSIGNMENT` - Course License Assignment
        * `COURSE_LICENSE_GROUP_ASSIGNMENT` - Course License Group Assignment
        * `PROGRAM_LICENSE_ASSIGNMENT` - Program License Assignment
        * `PROGRAM_LICENSE_GROUP_ASSIGNMENT` - Program License Group Assignment
        * `USER_LICENSE_ASSIGNMENT` - User License Assignment
        * `USER_LICENSE_GROUP_ASSIGNMENT` - User License Group Assignment
    TypeC42Enum:
      enum:
        - tutorial
        - assessment
      type: string
      description: |-
        * `tutorial` - Tutorial
        * `assessment` - Assessment
    Unit:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        subsection:
          type: integer
        display_name:
          type: string
          maxLength: 255
        status:
          allOf:
            - $ref: '#/components/schemas/Status6eeEnum'
          readOnly: true
        type:
          $ref: '#/components/schemas/TypeC42Enum'
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - display_name
        - id
        - status
        - subsection
        - updated_at
    UnitWithChildren:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        subsection:
          type: integer
        display_name:
          type: string
          maxLength: 255
        status:
          allOf:
            - $ref: '#/components/schemas/Status6eeEnum'
          readOnly: true
        type:
          $ref: '#/components/schemas/TypeC42Enum'
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        components:
          type: array
          items:
            $ref: '#/components/schemas/ComponentBlock'
      required:
        - components
        - created_at
        - display_name
        - id
        - status
        - subsection
        - updated_at
    UploadedImage:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          nullable: true
          maxLength: 254
        image:
          type: string
          readOnly: true
      required:
        - id
        - image
    UseMainCreds:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    UserAllChatMemoryView:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        username:
          type: string
          maxLength: 500
        platform_key:
          type: string
          maxLength: 500
        content:
          type: string
          nullable: true
        session_id:
          type: string
          format: uuid
          nullable: true
      required:
        - id
        - platform_key
        - username
    UserApp:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        app:
          allOf:
            - $ref: '#/components/schemas/App'
          description: The app details
        platform:
          allOf:
            - $ref: '#/components/schemas/Platform'
          readOnly: true
          description: The platform details
        subscription:
          type: object
          additionalProperties: {}
          nullable: true
          readOnly: true
          description: >-
            The subscription details, would contain identifier, active,
            created_on, last_updated
        provider:
          type: string
        is_admin:
          type: boolean
          readOnly: true
        is_active:
          type: boolean
          readOnly: true
        metadata: {}
        onboarding_completed:
          type: boolean
        free_trial_started:
          type: boolean
        free_trial_expired:
          type: boolean
        has_active_subscription:
          type: boolean
      required:
        - app
        - id
        - is_active
        - is_admin
        - platform
        - provider
        - subscription
    UserCatalogItemMemoryView:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        student:
          type: string
          nullable: true
          description: edX username
        platform:
          type: string
          description: The platform key
        catalog_item:
          type: string
          format: uuid
        lessons: {}
        next_steps: {}
      required:
        - id
        - platform
        - student
    UserChatByPeriod:
      type: object
      properties:
        period:
          type: string
          format: date-time
        user_count:
          type: integer
      required:
        - period
        - user_count
    UserChatFeedback:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        username:
          type: string
        session:
          type: string
        user_text:
          type: string
        ai_response:
          type: string
        reason:
          type: string
        additional_feedback:
          type: string
        rating:
          nullable: true
          maximum: 1
          minimum: -1
          oneOf:
            - $ref: '#/components/schemas/RatingEnum'
            - $ref: '#/components/schemas/NullEnum'
        inserted_at:
          type: string
          format: date-time
        mentor:
          type: integer
        message:
          type: integer
          nullable: true
      required:
        - additional_feedback
        - ai_response
        - id
        - mentor
        - reason
        - session
        - user_text
        - username
    UserChatFeedbackCount:
      type: object
      properties:
        period:
          type: string
          format: date-time
        feedback_count:
          type: integer
      required:
        - feedback_count
        - period
    UserChatMemoryStatusRequestView:
      type: object
      properties:
        enabled:
          type: boolean
          description: Enable or disable memory use
      required:
        - enabled
    UserChatMemoryStatusView:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        username:
          type: string
          maxLength: 500
        platform_key:
          type: string
          maxLength: 500
        enabled:
          type: boolean
      required:
        - id
        - platform_key
        - username
    UserChatMemoryUpdateView:
      type: object
      properties:
        task_id:
          type: string
          description: Id of the schedled task
        message:
          type: string
          description: Message about the scheduled task
      required:
        - message
        - task_id
    UserCountRecord:
      type: object
      properties:
        date:
          type: string
          format: date
        user_count:
          type: integer
      required:
        - date
        - user_count
    UserDeleteAPIError:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    UserDeleteAPIRequest:
      type: object
      properties:
        username:
          type: string
    UserDeleteAPIResponse:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    UserDetail:
      type: object
      properties:
        email:
          type: string
          format: email
        full_name:
          type: string
        messages:
          type: integer
        conversations:
          type: integer
        last_activity:
          type: string
          format: date-time
      required:
        - conversations
        - email
        - full_name
        - last_activity
        - messages
    UserEdxMemory:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        username:
          type: string
          readOnly: true
        student:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
        course_id:
          type: string
          maxLength: 200
        data:
          description: >-
            The course data to be stored. This includes the current page and the
            blocks that have been visited.
        date_created:
          type: string
          format: date-time
          readOnly: true
        last_modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - course_id
        - date_created
        - id
        - last_modified
        - student
        - username
    UserGroupAccess:
      type: object
      description: ModelSerializer for user group access policies
      properties:
        platform_key:
          type: string
          description: Platform key where the groups exist
          writeOnly: true
        user_id:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: ID of the user to manage group access for
          writeOnly: true
        groups_to_add:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of group IDs to grant access to
        groups_to_remove:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of group IDs to revoke access from
        policy_id:
          type: integer
          readOnly: true
          description: Policy ID
        policy_name:
          type: string
          readOnly: true
          description: Policy name
        groups_with_access:
          type: array
          items:
            $ref: '#/components/schemas/UserGroupAccessInfo'
          readOnly: true
          description: Groups with access
      required:
        - groups_with_access
        - platform_key
        - policy_id
        - policy_name
        - user_id
    UserGroupAccessInfo:
      type: object
      description: Serializer for group access information in responses
      properties:
        id:
          type: integer
          description: Group ID
        name:
          type: string
          description: Group name
        description:
          type: string
          description: Group description
        permissions:
          type: array
          items:
            type: string
          description: >-
            List of permissions user has for this group (e.g., ['read',
            'manageMentors'])
      required:
        - description
        - id
        - name
        - permissions
    UserInfo:
      type: object
      description: Serializer for user information.
      properties:
        user_id:
          type: integer
        username:
          type: string
          nullable: true
        email:
          type: string
          format: email
          nullable: true
        name:
          type: string
        is_active:
          type: boolean
          default: true
        last_active:
          type: string
          format: date-time
        date_joined:
          type: string
          format: date-time
      required:
        - email
        - name
        - user_id
        - username
    UserLicenseAssignmentCreate:
      type: object
      description: Request serializer for UserLicenseAssignmentView POST endpoint
      properties:
        license_id:
          type: integer
          description: The ID of the user license
        user_id:
          type: integer
          description: The user ID to assign the license to
        email:
          type: string
          format: email
          description: The email to assign the license to
        platform_key:
          type: string
          description: The unique identifier for the platform
        platform_org:
          type: string
          description: The organization identifier for the platform
        active:
          type: boolean
          default: true
          description: Whether the assignment is active
        fulfilled:
          type: boolean
          default: false
          description: Whether the assignment has been fulfilled
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the assignment
      required:
        - license_id
    UserLicenseAssignmentDetail:
      type: object
      description: Response serializer for user license assignment details
      properties:
        id:
          type: integer
          description: The unique identifier for the assignment
        user_id:
          type: integer
          description: The ID of the user assigned the license
        username:
          type: string
          description: The username of the user assigned the license
        email:
          type: string
          format: email
          nullable: true
          description: The email address of the user assigned the license
        active:
          type: boolean
          description: Whether the assignment is active
        fulfilled:
          type: boolean
          description: Whether the assignment has been fulfilled
        redirect_to:
          type: string
          format: uri
          nullable: true
          description: URL to redirect to after fulfillment
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the assignment
        license_id:
          type: integer
          description: The ID of the user license
        license_name:
          type: string
          description: The name of the user license
        platform_key:
          type: string
          description: The platform key associated with the license
      required:
        - active
        - email
        - fulfilled
        - id
        - license_id
        - license_name
        - metadata
        - platform_key
        - user_id
        - username
    UserLicenseCreate:
      type: object
      description: Request serializer for UserLicenseCreateView POST endpoint
      properties:
        platform_key:
          type: string
          description: The platform to create a license for
        platform_org:
          type: string
          description: The organization identifier for the platform
        name:
          type: string
          description: Display name for the license
        count:
          type: integer
          default: 0
          description: Number of seats purchased
        started:
          type: string
          format: date-time
          description: Date when license should begin
        expired:
          type: string
          format: date-time
          nullable: true
          description: Date when license should expire
        active:
          type: boolean
          default: true
          description: Whether the license is active
        metadata:
          type: object
          additionalProperties: {}
          description: Additional license metadata
        enrollment_config:
          type: object
          additionalProperties: {}
          description: Additional enrollment configuration
        source:
          type: string
          description: Source identifier
        external_id:
          type: string
          nullable: true
          description: External identifier (must be unique)
        transaction_id:
          type: string
          description: Transaction identifier for tracking
        change_type:
          type: string
          default: create
          description: Type of change being made
      required:
        - platform_key
    UserLicenseDetail:
      type: object
      description: Response serializer for user license details
      properties:
        id:
          type: integer
          description: The unique identifier for the license
        created:
          type: string
          format: date-time
          description: When the license was created
        started:
          type: string
          format: date-time
          description: When the license becomes active
        expired:
          type: string
          format: date-time
          nullable: true
          description: When the license expires
        name:
          type: string
          description: The display name of the license
        count:
          type: integer
          description: The number of seats purchased
        active:
          type: boolean
          description: Whether the license is active
        metadata:
          type: object
          additionalProperties: {}
          description: Additional license metadata
        source:
          type: string
          description: The source identifier for the license
        external_id:
          type: string
          nullable: true
          description: External identifier for the license
        platform_key:
          type: string
          description: The platform key associated with the license
        usage_count:
          type: integer
          default: 0
          description: Number of assignments using this license
        assignments:
          description: Assignment counts by status (only included in verbose mode)
      required:
        - active
        - count
        - created
        - expired
        - external_id
        - id
        - metadata
        - name
        - platform_key
        - source
        - started
    UserLicenseGroupAssignmentCreate:
      type: object
      description: Request serializer for UserLicenseGroupAssignmentView POST endpoint
      properties:
        license_id:
          type: integer
          description: The ID of the user license
        group_id:
          type: integer
          description: The ID of the user group to assign the license to
        platform_key:
          type: string
          description: The unique identifier for the platform
        platform_org:
          type: string
          description: The organization identifier for the platform
        active:
          type: boolean
          default: true
          description: Whether the assignment is active
        fulfilled:
          type: boolean
          default: false
          description: Whether the assignment has been fulfilled
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the assignment
      required:
        - group_id
        - license_id
    UserLicenseGroupAssignmentDetail:
      type: object
      description: Response serializer for user license group assignment details
      properties:
        id:
          type: integer
          description: The unique identifier for the assignment
        group_id:
          type: integer
          description: The ID of the group assigned the license
        group_name:
          type: string
          description: The name of the group assigned the license
        active:
          type: boolean
          description: Whether the assignment is active
        fulfilled:
          type: boolean
          description: Whether the assignment has been fulfilled
        redirect_to:
          type: string
          format: uri
          nullable: true
          description: URL to redirect to after fulfillment
        metadata:
          type: object
          additionalProperties: {}
          description: Additional metadata for the assignment
        license_id:
          type: integer
          description: The ID of the user license
        license_name:
          type: string
          description: The name of the user license
        platform_key:
          type: string
          description: The platform key associated with the license
      required:
        - active
        - group_id
        - group_name
        - id
        - license_id
        - license_name
        - metadata
        - platform_key
    UserLicenseUpdate:
      type: object
      description: Request serializer for UserLicenseUpdateView POST endpoint
      properties:
        license_id:
          type: integer
          description: >-
            The ID of the license to update (required if external_id not
            provided)
        external_id:
          type: string
          description: >-
            External identifier of the license to update (required if license_id
            not provided)
        platform_key:
          type: string
          description: The platform key (not updatable)
        platform_org:
          type: string
          description: The platform organization (not updatable)
        name:
          type: string
          description: Updated display name for the license
        count:
          type: integer
          description: Updated number of seats purchased
        started:
          type: string
          format: date-time
          description: Updated date when license should begin
        expired:
          type: string
          format: date-time
          nullable: true
          description: Updated date when license should expire
        active:
          type: boolean
          description: Updated active status
        metadata:
          type: object
          additionalProperties: {}
          description: Updated additional license metadata
        enrollment_config:
          type: object
          additionalProperties: {}
          description: Updated enrollment configuration
        source:
          type: string
          description: Updated source identifier
        transaction_id:
          type: string
          description: Transaction identifier for tracking
        change_type:
          type: string
          default: update
          description: Type of change being made
    UserMemory:
      type: object
      properties:
        mode:
          type: string
          readOnly: true
        name:
          type: string
        email:
          type: string
          nullable: true
          readOnly: true
        unique_id:
          type: string
          format: uuid
        username:
          type: string
          nullable: true
          readOnly: true
        platform:
          type: string
          nullable: true
          readOnly: true
        mentor:
          type: string
          nullable: true
          readOnly: true
        session_id:
          type: string
          nullable: true
          readOnly: true
        catalog_item_type:
          type: string
          nullable: true
          readOnly: true
        catalog_item_id:
          type: string
          nullable: true
          readOnly: true
        entries:
          type: array
          items:
            $ref: '#/components/schemas/UserMemoryEntry'
        inserted_at:
          type: string
          readOnly: true
        updated_at:
          type: string
          readOnly: true
        is_auto_generated:
          type: boolean
        category:
          type: string
          nullable: true
      required:
        - catalog_item_id
        - catalog_item_type
        - email
        - entries
        - inserted_at
        - mentor
        - mode
        - platform
        - session_id
        - updated_at
        - username
    UserMemoryContextRequest:
      type: object
      properties:
        extra_data:
          type: string
          description: Extra custom data to be added to the memory
        use_reported_skills:
          type: boolean
        use_desired_skills:
          type: boolean
        use_credentials:
          type: boolean
        use_enrolled_courses:
          type: boolean
        use_time_spent:
          type: boolean
        use_completed_courses:
          type: boolean
        use_completed_programs:
          type: boolean
    UserMemoryContextResponse:
      type: object
      properties:
        username:
          type: string
          maxLength: 500
        platform_key:
          type: string
          maxLength: 500
        extra_data:
          type: string
          nullable: true
        use_reported_skills:
          type: boolean
        use_desired_skills:
          type: boolean
        use_credentials:
          type: boolean
        use_enrolled_courses:
          type: boolean
        use_time_spent:
          type: boolean
        use_completed_courses:
          type: boolean
        use_completed_programs:
          type: boolean
      required:
        - platform_key
        - username
    UserMemoryEntry:
      type: object
      properties:
        unique_id:
          type: string
          format: uuid
        key:
          type: string
        value:
          type: string
          nullable: true
        inserted_at:
          type: string
          readOnly: true
        updated_at:
          type: string
          readOnly: true
        expires_at:
          type: string
          nullable: true
          readOnly: true
        category:
          type: string
          nullable: true
          readOnly: true
      required:
        - category
        - expires_at
        - inserted_at
        - key
        - updated_at
    UserMemoryEntryRequest:
      type: object
      properties:
        key:
          type: string
        value:
          type: string
        expires_at:
          type: string
          nullable: true
      required:
        - key
        - value
    UserMemoryRequest:
      type: object
      properties:
        mode:
          type: string
          default: all
        name:
          type: string
          nullable: true
        platform:
          type: string
          nullable: true
        mentor_unique_id:
          type: string
          nullable: true
        session_id:
          type: string
          nullable: true
        catalog_item_type:
          type: string
          nullable: true
        catalog_item_id:
          type: string
          nullable: true
        entries:
          type: array
          items:
            $ref: '#/components/schemas/UserMemoryEntryRequest'
        category:
          type: string
          nullable: true
      required:
        - entries
    UserMetric:
      type: object
      properties:
        total:
          type: integer
        change_percentage:
          type: number
          format: double
      required:
        - change_percentage
        - total
    UserMetricsResponse:
      type: object
      properties:
        registered_users:
          $ref: '#/components/schemas/UserMetric'
        new_users:
          $ref: '#/components/schemas/UserMetric'
        unique_users:
          $ref: '#/components/schemas/UserMetric'
        veteran_users:
          $ref: '#/components/schemas/UserMetric'
      required:
        - new_users
        - registered_users
        - unique_users
        - veteran_users
    UserPlatformLink:
      type: object
      properties:
        user_id:
          type: integer
        username:
          type: string
        email:
          type: string
          format: email
        user_active:
          type: boolean
        key:
          type: string
        org:
          type: string
        platform_name:
          type: string
        lms_url:
          type: string
        cms_url:
          type: string
        portal_url:
          type: string
        is_admin:
          type: boolean
        is_staff:
          type: boolean
        added_on:
          type: string
          format: date-time
          nullable: true
        expired_on:
          type: string
          format: date-time
          nullable: true
        public:
          type: string
          readOnly: true
        active:
          type: boolean
      required:
        - cms_url
        - email
        - key
        - lms_url
        - org
        - platform_name
        - portal_url
        - public
        - user_active
        - user_id
        - username
    UserPlatformManagementListViewGetResponse:
      type: object
      properties:
        count:
          type: integer
        next_page:
          type: integer
        previous_page:
          type: integer
        results:
          type: array
          items:
            type: object
            additionalProperties: {}
        allowed_policies:
          type: array
          items:
            type: string
        data:
          type: array
          items:
            type: object
            additionalProperties: {}
      required:
        - count
        - next_page
        - previous_page
        - results
    UserPlatformSelfLinkError:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    UserPlatformSelfLinkForbidden:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    UserPlatformSelfLinkRequest:
      type: object
      properties:
        platform_key:
          type: string
      required:
        - platform_key
    UserPlatformSelfLinkResponse:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    UserPlatformViewPostRequest:
      type: object
      properties:
        user_id:
          type: integer
        platform_key:
          type: string
        added_on:
          type: string
          format: date-time
        expired_on:
          type: string
          format: date-time
        is_admin:
          type: boolean
        active:
          type: boolean
      required:
        - platform_key
        - user_id
    UserPolicyUpdate:
      type: object
      description: >-
        Serializer for updating user policies on a platform.


        Accepts lists of policies to add and remove for a specific user on a
        platform.
      properties:
        user_id:
          type: integer
          writeOnly: true
          description: ID of the user to update policies for
        platform_key:
          type: string
          writeOnly: true
          description: Platform key where the user's policies should be updated
        policies_to_add:
          type: array
          items:
            type: string
          writeOnly: true
          description: List of policy names to add to the user
        policies_to_remove:
          type: array
          items:
            type: string
          writeOnly: true
          description: List of policy names to remove from the user
        policies_to_set:
          type: array
          items:
            type: string
          writeOnly: true
          description: >-
            List of policy names to set for the user (replaces all existing
            policies with these)
      required:
        - platform_key
        - user_id
    UserPolicyUpdateError:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    UserPolicyUpdateForbidden:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    UserPolicyUpdateResponse:
      type: object
      properties:
        user_id:
          type: array
          items:
            type: string
          description: List of policies for the user
      required:
        - user_id
    UserProxyBulkRequest:
      type: object
      properties:
        users:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
      required:
        - users
    UserProxyGetResponse:
      type: object
      properties:
        user_id:
          type: integer
        username:
          type: string
        email:
          type: string
          format: email
        active:
          type: boolean
        edx_data: {}
        data: {}
      required:
        - active
        - data
        - edx_data
        - email
        - user_id
        - username
    UserProxyPostRequest:
      type: object
      properties:
        user_id:
          type: integer
        username:
          type: string
        email:
          type: string
          format: email
        edx_data: {}
        data: {}
      required:
        - data
        - edx_data
        - email
        - user_id
        - username
    UserProxyPostResponse:
      type: object
      properties:
        user_id:
          type: integer
        username:
          type: string
        email:
          type: string
          format: email
        active:
          type: boolean
        edx_data: {}
        data: {}
      required:
        - active
        - data
        - edx_data
        - email
        - user_id
        - username
    UserSearchResponse:
      type: object
      description: Response serializer for UsersSearchView
      properties:
        results:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: >-
            List of search results (can include user_resume, education,
            institution, etc.)
        count:
          type: integer
          description: Total number of results
        next:
          type: string
          format: uri
          nullable: true
          description: URL for the next page of results
        previous:
          type: string
          format: uri
          nullable: true
          description: URL for the previous page of results
        current_page:
          type: integer
          description: Current page number
        total_pages:
          type: integer
          description: Total number of pages
      required:
        - count
        - current_page
        - next
        - previous
        - results
        - total_pages
    UserSearchViewGetResponse:
      type: object
      properties:
        count:
          type: integer
        next_page:
          type: integer
        previous_page:
          type: integer
        results:
          type: array
          items:
            type: object
            additionalProperties: {}
      required:
        - count
        - next_page
        - previous_page
        - results
    UserSentimentCountView:
      type: object
      properties:
        date:
          type: string
          format: date-time
        sentiment_count:
          type: integer
      required:
        - date
        - sentiment_count
    UserSkill:
      type: object
      properties:
        skill:
          $ref: '#/components/schemas/Skill'
        courses:
          type: array
          items:
            $ref: '#/components/schemas/CoursePoint'
          description: Courses with skill and associated points
        resources:
          type: array
          items:
            $ref: '#/components/schemas/ResourcePoint'
          description: Resources with skill and associated points
        total_points:
          type: integer
          readOnly: true
          description: Total points for skill
        percentile:
          type: number
          format: double
          description: Percentile of points for user.
      required:
        - courses
        - resources
        - skill
        - total_points
    UserSkillPointsPercentile:
      type: object
      properties:
        username:
          type: string
        total_points:
          type: number
          format: double
        percentile:
          type: number
          format: double
          description: >-
            Percentile of points for user. If an `org` was provided, this is the
            percentile of the user relative to users within the org.
      required:
        - percentile
        - total_points
        - username
    UserTrendByPeriod:
      type: object
      properties:
        periods:
          type: array
          items:
            type: string
            format: date-time
        new_users:
          type: array
          items:
            type: integer
        veteran_users:
          type: array
          items:
            type: integer
      required:
        - new_users
        - periods
        - veteran_users
    V2GlobalMentorSearchResponse:
      type: object
      description: Response serializer for V2 Global Mentor Search.
      properties:
        results:
          type: array
          items: {}
          description: List of mentor search results
        count:
          type: integer
          description: Total number of results
        next:
          type: string
          nullable: true
          description: URL for next page of results
        previous:
          type: string
          nullable: true
          description: URL for previous page of results
        current_page:
          type: integer
          description: Current page number
        total_pages:
          type: integer
          description: Total number of pages
      required:
        - count
        - current_page
        - results
        - total_pages
    V2PersonalizedMentorsResponse:
      type: object
      description: Response serializer for V2 Personalized Mentors Search.
      properties:
        results:
          type: array
          items: {}
          description: List of personalized mentor search results
        count:
          type: integer
          description: Total number of results
        next:
          type: string
          nullable: true
          description: URL for next page of results
        previous:
          type: string
          nullable: true
          description: URL for previous page of results
        current_page:
          type: integer
          description: Current page number
        total_pages:
          type: integer
          description: Total number of pages
      required:
        - count
        - current_page
        - next
        - previous
        - results
        - total_pages
    V2RecommendationResponse:
      type: object
      description: |-
        Response serializer for V2 Course Recommendations.

        Returns a list of recommended courses with AI-generated reasoning.
        Includes metadata about the recommendation method used (RAG vs LLM).
      properties:
        recommendations:
          type: array
          items:
            $ref: '#/components/schemas/CourseRecommendation'
          description: List of course recommendations with reasoning
        user_context:
          type: object
          additionalProperties: {}
          description: Summary of user context used for recommendations
        recommendation_id:
          type: string
          description: Unique ID for this recommendation set (for tracking)
        generated_at:
          type: string
          format: date-time
          description: When these recommendations were generated
        platform_key:
          type: string
          description: Platform key for these recommendations
        method_used:
          type: string
          description: >-
            Method used to generate recommendations: 'rag_only', 'llm_only', or
            'rag_plus_llm'
        search_query_used:
          type: string
          description: >-
            The actual search query used for RAG similarity search (if
            applicable)
        candidates_retrieved:
          type: integer
          description: >-
            Number of candidates retrieved via RAG before filtering (if
            applicable)
        includes_main_catalog:
          type: boolean
          default: false
          description: Whether the results include items from the 'main' tenant catalog
        processing_time_seconds:
          type: number
          format: double
          description: Time taken to generate recommendations (in seconds)
        success:
          type: boolean
          default: true
          description: Whether the request was successful
        count:
          type: integer
          description: Total number of recommendations available
        next:
          type: string
          format: uri
          nullable: true
          description: URL for the next page of results (if pagination is enabled)
        previous:
          type: string
          format: uri
          nullable: true
          description: URL for the previous page of results (if pagination is enabled)
      required:
        - generated_at
        - platform_key
        - recommendations
    ValidateSourceResponse:
      type: object
      description: Response serializer for source validation
      properties:
        status:
          type: string
        valid_count:
          type: integer
        invalid_entries:
          type: array
          items:
            type: string
        sample_recipients:
          type: array
          items:
            $ref: '#/components/schemas/Recipient'
      required:
        - invalid_entries
        - sample_recipients
        - status
        - valid_count
    Value:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/ValueData'
      required:
        - data
    ValueData:
      type: object
      properties:
        value:
          type: number
          format: double
          description: value
      required:
        - value
    VectorResult:
      type: object
      properties:
        type:
          type: string
          default: document
        title:
          type: string
          default: ''
        snippet:
          type: string
        source:
          type: string
        score:
          type: number
          format: double
        confidence_level:
          type: number
          format: double
        llm_provider:
          type: string
          default: openai
        llm_model:
          type: string
          default: gpt-4o-mini
      required:
        - snippet
    VeoVideoDetail:
      type: object
      properties:
        name:
          type: string
          maxLength: 1024
        data:
          nullable: true
        id:
          type: integer
          readOnly: true
        video_file:
          type: string
          nullable: true
          readOnly: true
        generation_status:
          type: string
          readOnly: true
        prompt_text:
          type: string
          nullable: true
        prompt_image:
          type: string
          nullable: true
          readOnly: true
        thumbnail_image:
          type: string
          nullable: true
          readOnly: true
      required:
        - generation_status
        - id
        - prompt_image
        - thumbnail_image
        - video_file
    VeoVideoList:
      type: object
      properties:
        name:
          type: string
          maxLength: 1024
        data:
          nullable: true
        id:
          type: integer
          readOnly: true
        generation_status:
          type: string
          readOnly: true
      required:
        - generation_status
        - id
    VeoVideoRequest:
      type: object
      properties:
        prompt_image:
          type: string
          format: uri
          nullable: true
          pattern: (?:jpg|jpeg|png|gif|webp)$
        prompt_text:
          type: string
        name:
          type: string
          nullable: true
      required:
        - prompt_text
    VerifyGCPMarketPlaceFailedResponse:
      type: object
      properties:
        sub:
          type: string
          default: ''
        aud:
          type: string
          default: ''
        iat:
          type: string
          default: ''
        exp:
          type: string
          default: ''
        google:
          type: object
          additionalProperties: {}
        iss:
          type: string
          default: ''
        redirect_to:
          type: string
          readOnly: true
        message:
          type: string
          default: ''
        success:
          type: boolean
          default: false
      required:
        - redirect_to
    VerifyGCPMarketPlaceRequest:
      type: object
      properties:
        token:
          type: string
      required:
        - token
    VerifyGCPMarketPlaceResponse:
      type: object
      properties:
        sub:
          type: string
          default: ''
        aud:
          type: string
          default: ''
        iat:
          type: string
          default: ''
        exp:
          type: string
          default: ''
        google:
          type: object
          additionalProperties: {}
        iss:
          type: string
          default: ''
        redirect_to:
          type: string
          readOnly: true
        message:
          type: string
          default: ''
        success:
          type: boolean
          default: true
      required:
        - redirect_to
    VideoBlock:
      type: object
      properties:
        display_name:
          type: string
          description: Video name
        id:
          type: string
          description: Video Id
        total_users:
          type: integer
          description: Total users who have watched the video
      required:
        - display_name
        - id
    VideoCaption:
      type: object
      properties:
        file:
          type: string
          format: uri
      required:
        - file
    VideoEngagementPerCourse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/VideoEngagementPerCourseData'
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - pagination
    VideoEngagementPerCourseData:
      type: object
      properties:
        name:
          type: string
          description: Course name
        course_id:
          type: string
          description: edx Course Id
        num_vids:
          type: integer
          description: Number of videos in course
        num_watched:
          type: integer
          description: 'Number of videos watched '
        time_watched:
          type: integer
          description: Total time spent by all users watching videos
        avg_percent_watched:
          type: number
          format: double
          description: Average percentage of videos watched per user per course
        avg_time_watched:
          type: number
          format: double
          description: Average time spent per learner
      required:
        - avg_percent_watched
        - avg_time_watched
        - course_id
        - name
        - num_vids
        - num_watched
        - time_watched
    VideosCount:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/VideosCountData'
    VideosCountData:
      type: object
      properties:
        count:
          type: string
          description: Total videos (videos watched / Total Course Videos)
      required:
        - count
    VideosInCourseSummary:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/VideosInCourseSummaryData'
    VideosInCourseSummaryData:
      type: object
      properties:
        display_name:
          type: string
          description: Chapter name
        id:
          type: string
          description: Chapter Id
        subsections:
          type: array
          items:
            $ref: '#/components/schemas/VideosWatchedSubSection'
      required:
        - display_name
        - id
    VideosSpecificCourse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/VideosSpecificCourseData'
    VideosSpecificCourseData:
      type: object
      properties:
        display_name:
          type: string
          description: Course name
        id:
          type: string
          description: Video Id
        duration:
          type: integer
          description: Video duration
        total_time:
          type: integer
          description: Total time spent by users watching
        total_users:
          type: integer
          description: Total users who have watched this video
        average_time:
          type: number
          format: double
          description: Average time spent per learner
      required:
        - average_time
        - display_name
        - duration
        - id
        - total_time
        - total_users
    VideosWatchedSubSection:
      type: object
      properties:
        display_name:
          type: string
          description: Subsection name
        id:
          type: string
          description: Subsection Id
        total_watch:
          type: string
          description: Total videos watched. N/A if no record found
        videos:
          type: array
          items:
            $ref: '#/components/schemas/VideoBlock'
          description: Videos
      required:
        - display_name
        - id
        - total_watch
    Voice:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        provider:
          $ref: '#/components/schemas/Provider637Enum'
        language:
          type: string
          maxLength: 255
        description:
          type: string
        audio_url:
          type: string
          readOnly: true
      required:
        - audio_url
        - id
        - name
        - provider
    WatchedVideosPerCourse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/WatchedVideosPerCourseData'
        total:
          type: integer
          description: Total videos Watched for all rows
    WatchedVideosPerCourseData:
      type: object
      properties:
        course_id:
          type: string
          description: Edx Course ID
        name:
          type: string
          description: Course Name
        count:
          type: integer
          description: Number of watched videos
        percentage:
          type: number
          format: double
          description: Percentage ...
      required:
        - count
        - course_id
        - name
        - percentage
    WatchedVideosPerUser:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/WatchedVideosPerUserData'
        total:
          type: integer
          description: Total rows
    WatchedVideosPerUserData:
      type: object
      properties:
        username:
          type: string
          description: learner username
        full_name:
          type: string
          description: learner fullname
        count:
          type: integer
          description: Videos watched count
        percentage:
          type: number
          format: double
          description: Percentage ...
      required:
        - count
        - full_name
        - percentage
        - username
    WebResource:
      type: object
      properties:
        content:
          type: string
        title:
          type: string
        imageUrl:
          type: string
          nullable: true
        source:
          type: string
          default: ''
        metadata:
          nullable: true
        card:
          $ref: '#/components/schemas/WebResourceCard'
      required:
        - content
        - title
    WebResourceCard:
      type: object
      properties:
        title:
          type: string
        description:
          type: string
        imageUrl:
          type: string
        domain:
          type: string
        site_name:
          type: string
      required:
        - description
        - domain
        - imageUrl
        - site_name
        - title
    WebResourcesQuery:
      type: object
      properties:
        query:
          type: string
      required:
        - query
    WebexConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        bot:
          type: integer
          readOnly: true
        webex_bot_id:
          type: string
          description: Bot id from webex
          maxLength: 255
        bot_access_token:
          type: string
          maxLength: 500
        bot_username:
          type: string
          maxLength: 500
      required:
        - bot
        - bot_access_token
        - bot_username
        - id
        - webex_bot_id
    WebexWebhook:
      type: object
      properties:
        data:
          type: object
          additionalProperties: {}
        resource:
          type: string
      required:
        - data
        - resource
    WhatAppWebHook:
      type: object
      properties:
        entry:
          type: array
          items:
            type: object
            additionalProperties: {}
      required:
        - entry
    WhatsappConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        bot:
          type: integer
          readOnly: true
        phone_number_id:
          type: string
          maxLength: 255
        application_secret:
          type: string
          maxLength: 500
        webhook_verification_token:
          type: string
          maxLength: 500
        access_token:
          type: string
          description: Access token to the bot. This can also be a temporary access token.
          maxLength: 500
      required:
        - access_token
        - application_secret
        - bot
        - id
        - phone_number_id
        - webhook_verification_token
    WhatsappUserConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        user:
          type: integer
          maximum: 2147483647
          minimum: 0
          description: edX user ID
          readOnly: true
        phone_number:
          type: string
          maxLength: 128
        date_created:
          type: string
          format: date-time
          readOnly: true
        last_modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - date_created
        - id
        - last_modified
        - phone_number
        - user
    WhitelistedDomain:
      type: object
      properties:
        url:
          type: string
        is_active:
          type: boolean
      required:
        - url
  securitySchemes:
    PlatformApiKeyAuthentication:
      type: apiKey
      in: header
      name: Authorization
      description: 'Example: Api-Key <your-key>'
servers:
  - url: https://base.manager.iblai.app
