openapi: 3.0.3
info:
  title: ibl-data-manager
  version: 4.351.0-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: |-
        Wires RBAC into a DRF view.

        Two responsibilities:

        1. When RBAC is enabled, replace the view's `permission_classes` with
           `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated`
           semantics, plus opt-in acceptance of token-policies PlatformApiKeys for
           views that set `token_policies_enabled = True`).

        2. Detect server-to-server (Django auth) callers via `is_service_account`.
           Server-to-server tokens authenticate as Django auth users with no
           relationship to a platform EdxUser. The convention is "we trust this
           caller — bypass RBAC and serve the request."

           Combine it with the RBAC-disabled check at the top of `initial()` so
           the early exit skips all RBAC prep work:

               if not ConfigFlags.rbac_enabled() or self.is_service_account:
                   return

           Use `is_service_account` at any other touch points where caller
           identity matters (queryset ownership filters, owner attribution on
           create, serializer context, etc.).
      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
      - name: search
        required: false
        in: query
        description: A search term.
        schema:
          type: string
      - in: query
        name: service
        schema:
          type: string
      - 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: |-
        Wires RBAC into a DRF view.

        Two responsibilities:

        1. When RBAC is enabled, replace the view's `permission_classes` with
           `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated`
           semantics, plus opt-in acceptance of token-policies PlatformApiKeys for
           views that set `token_policies_enabled = True`).

        2. Detect server-to-server (Django auth) callers via `is_service_account`.
           Server-to-server tokens authenticate as Django auth users with no
           relationship to a platform EdxUser. The convention is "we trust this
           caller — bypass RBAC and serve the request."

           Combine it with the RBAC-disabled check at the top of `initial()` so
           the early exit skips all RBAC prep work:

               if not ConfigFlags.rbac_enabled() or self.is_service_account:
                   return

           Use `is_service_account` at any other touch points where caller
           identity matters (queryset ownership filters, owner attribution on
           create, serializer context, etc.).
      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: |-
        Wires RBAC into a DRF view.

        Two responsibilities:

        1. When RBAC is enabled, replace the view's `permission_classes` with
           `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated`
           semantics, plus opt-in acceptance of token-policies PlatformApiKeys for
           views that set `token_policies_enabled = True`).

        2. Detect server-to-server (Django auth) callers via `is_service_account`.
           Server-to-server tokens authenticate as Django auth users with no
           relationship to a platform EdxUser. The convention is "we trust this
           caller — bypass RBAC and serve the request."

           Combine it with the RBAC-disabled check at the top of `initial()` so
           the early exit skips all RBAC prep work:

               if not ConfigFlags.rbac_enabled() or self.is_service_account:
                   return

           Use `is_service_account` at any other touch points where caller
           identity matters (queryset ownership filters, owner attribution on
           create, serializer context, etc.).
      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: |-
        Wires RBAC into a DRF view.

        Two responsibilities:

        1. When RBAC is enabled, replace the view's `permission_classes` with
           `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated`
           semantics, plus opt-in acceptance of token-policies PlatformApiKeys for
           views that set `token_policies_enabled = True`).

        2. Detect server-to-server (Django auth) callers via `is_service_account`.
           Server-to-server tokens authenticate as Django auth users with no
           relationship to a platform EdxUser. The convention is "we trust this
           caller — bypass RBAC and serve the request."

           Combine it with the RBAC-disabled check at the top of `initial()` so
           the early exit skips all RBAC prep work:

               if not ConfigFlags.rbac_enabled() or self.is_service_account:
                   return

           Use `is_service_account` at any other touch points where caller
           identity matters (queryset ownership filters, owner attribution on
           create, serializer context, etc.).
      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.
                When name=google, returns both 'google' (service account) and
                'gemini_google_api_key' credentials if they exist.
            unmask_sensitive_fields (optional, bool, default False):
                If true, returns the raw unmasked credential value. Restricted
                to credentials owned by the requested tenant — the
                ``GlobalCredential`` fallback is suppressed when unmasking,
                and the response is ``[]`` instead of 404 if the tenant has
                no own credentials.

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

        Returns:
            Response: List of LLM credentials for the organization. Values
            are masked by default; unmasked when ``unmask_sensitive_fields=true``
            and the credential belongs to the tenant.

        Raises:
            NotFound: When organization is not found, or (in default masked
                mode) when no credentials match the filters even after the
                global-credential fallback.
            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
      - in: query
        name: unmask_sensitive_fields
        schema:
          type: boolean
          default: false
        description: If true and the requester is a platform admin for the org, returns
          full unmasked credential values. Restricted to credentials owned by the
          requested tenant (no main-platform fallback when unmasking). Ignored for
          non-admins.
      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.

        For azure_openai credentials, if credential already exists, merges the new
        models with existing ones instead of replacing.

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

        Returns:
            Response: Created or updated 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.

        For azure_openai credentials, supports partial model updates by deep merging
        the provided model fields with existing ones.

        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.

        For azure_openai credentials, supports deleting a specific model by providing
        the 'model_name' field. If model_name is omitted, deletes the entire credential.

        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
      - in: query
        name: unmask_sensitive_fields
        schema:
          type: boolean
          default: false
        description: If true and the requester is a platform admin for the org, returns
          full unmasked credential values. Restricted to credentials owned by the
          requested tenant (no main-platform fallback when unmasking). Ignored for
          non-admins.
      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}/fallback-llm/:
    get:
      operationId: ai_account_orgs_fallback_llm_list
      description: List all fallback LLM configurations for the tenant and global
        configs.
      summary: List fallback LLM configurations
      parameters:
      - in: query
        name: is_enabled
        schema:
          type: boolean
        description: Filter by enabled status
      - 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: scope
        schema:
          type: string
        description: Filter by scope (model or provider)
      tags:
      - ai-account
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FallbackLLM'
          description: ''
        '403':
          description: Permission denied
    post:
      operationId: ai_account_orgs_fallback_llm_create
      description: "\n        Create a new fallback LLM configuration.\n\n       \
        \ - For model scope: specify source_model_name\n        - For provider scope:\
        \ only source_provider_name is needed\n        - Leave tenant_key empty for\
        \ global configuration\n        "
      summary: Create fallback LLM configuration
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-account
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FallbackLLMCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/FallbackLLMCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/FallbackLLMCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FallbackLLMCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/FallbackLLMCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FallbackLLM'
          description: ''
        '400':
          description: Validation error
        '403':
          description: Permission denied
  /api/ai-account/orgs/{org}/fallback-llm/{id}/:
    get:
      operationId: ai_account_orgs_fallback_llm_retrieve
      description: Retrieve a specific fallback LLM configuration.
      summary: Get fallback LLM configuration
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-account
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FallbackLLM'
          description: ''
        '403':
          description: Permission denied
        '404':
          description: Not found
    put:
      operationId: ai_account_orgs_fallback_llm_update
      description: Update an existing fallback LLM configuration.
      summary: Update fallback LLM configuration
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-account
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FallbackLLMUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/FallbackLLMUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/FallbackLLMUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FallbackLLMUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/FallbackLLMUpdate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FallbackLLM'
          description: ''
        '400':
          description: Validation error
        '403':
          description: Permission denied
        '404':
          description: Not found
    patch:
      operationId: ai_account_orgs_fallback_llm_partial_update
      description: Partially update an existing fallback LLM configuration.
      summary: Partially update fallback LLM configuration
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-account
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedFallbackLLMUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedFallbackLLMUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedFallbackLLMUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedFallbackLLMUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedFallbackLLMUpdate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FallbackLLM'
          description: ''
        '400':
          description: Validation error
        '403':
          description: Permission denied
        '404':
          description: Not found
    delete:
      operationId: ai_account_orgs_fallback_llm_destroy
      description: Delete a fallback LLM configuration.
      summary: Delete fallback LLM configuration
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-account
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Deleted successfully
        '403':
          description: Permission denied
        '404':
          description: Not found
  /api/ai-account/orgs/{org}/integration-credential/:
    get:
      operationId: ai_account_orgs_integration_credential_list
      description: |-
        Retrieve integration credentials for an organization.

        Query Parameters:
            name (optional): Filter results by integration service name
            unmask_sensitive_fields (optional, bool, default False):
                If true and the requester is a platform admin for ``org``,
                returns full unmasked credential values. Restricted to
                credentials owned by the requested tenant — the ``main``
                platform fallback is suppressed when unmasking, so admins
                cannot read another tenant's or the global ``main``
                credentials unmasked. Silently ignored for non-admins;
                students never receive sensitive fields regardless of this
                flag.

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

        Returns:
            Response: List of integration credentials for the organization.
            The response shape differs by caller role:
            - Admins: every credential on the platform, with sensitive
              fields masked (``AdminIntegrationCredentialSerializer`` →
              ``IntegrationCredential.masked_value``).
            - Students: only credentials whose schema declares at least
              one non-sensitive field; sensitive fields are removed
              entirely from each value
              (``StudentIntegrationCredentialSerializer`` →
              ``IntegrationCredential.value``). Visibility is determined
              by ``IntegrationCredential.is_student_visible()`` — schema-
              driven, not a hardcoded provider list.
            If the tenant has no credentials of its own and
            ``ALLOW_TENANTS_TO_USE_MAIN_LLM_CREDENTIALS`` is enabled, the
            view falls back to ``platform__key="main"`` credentials,
            subject to the same role-based filtering.

        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
      - in: query
        name: unmask_sensitive_fields
        schema:
          type: boolean
          default: false
        description: If true and the requester is a platform admin for the org, returns
          full unmasked credential values. Restricted to credentials owned by the
          requested tenant (no main-platform fallback when unmasking). Ignored for
          non-admins.
      tags:
      - ai-account
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AdminIntegrationCredential'
              examples:
                AdminResponse—SensitiveFieldsMasked:
                  value:
                  - - id: 1
                      name: google-drive
                      value:
                        type: service_account
                        project_id: project-id
                        private_key: |
                          -----BEGIN PRIVATE KEY-----
                          ****
                          -----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: Admin response — sensitive fields masked
                  description: Returned to platform admins. Every credential on the
                    platform is included; sensitive fields (as flagged on the linked
                    IntegrationCredentialSchema v2 entry) are masked via IntegrationCredential.masked_value.
                StudentResponse—SensitiveFieldsStripped:
                  value:
                  - - id: 1
                      name: google-drive
                      value:
                        type: service_account
                        project_id: project-id
                        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: Student response — sensitive fields stripped
                  description: Returned to non-admin (student) callers. Only credentials
                    whose schema marks at least one field as non-sensitive are listed;
                    sensitive fields are removed entirely from each value (via IntegrationCredential.value).
                    Credentials with no non-sensitive fields, or whose schema is missing/v1,
                    are omitted from the list.
          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:
              CreateIntegrationCredential—Response:
                value:
                  name: google-drive
                  value:
                    type: service_account
                    project_id: project-id
                    private_key: |
                      -----BEGIN PRIVATE KEY-----
                      ****
                      -----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 — response
                description: Admin-only. The POST response is serialized through IntegrationCredentialSerializer.to_representation,
                  which substitutes IntegrationCredential.masked_value for the raw
                  value, so sensitive fields are always returned masked even though
                  the request body sends them unmasked.
          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:
                CreateIntegrationCredential—Response:
                  value:
                    name: google-drive
                    value:
                      type: service_account
                      project_id: project-id
                      private_key: |
                        -----BEGIN PRIVATE KEY-----
                        ****
                        -----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 — response
                  description: Admin-only. The POST response is serialized through
                    IntegrationCredentialSerializer.to_representation, which substitutes
                    IntegrationCredential.masked_value for the raw value, so sensitive
                    fields are always returned masked even though the request body
                    sends them unmasked.
          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 (deprecated v1 shape).

        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 in v1 shape with
            ``Deprecation`` and ``Link`` headers pointing to the v2 endpoint.
      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
      - in: query
        name: unmask_sensitive_fields
        schema:
          type: boolean
          default: false
        description: If true and the requester is a platform admin for the org, returns
          full unmasked credential values. Restricted to credentials owned by the
          requested tenant (no main-platform fallback when unmasking). Ignored for
          non-admins.
      tags:
      - ai-account
      security:
      - PlatformApiKeyAuthentication: []
      deprecated: true
      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}/integration-credential/schema/v2/:
    get:
      operationId: ai_account_orgs_integration_credential_schema_v2_list
      description: |-
        Retrieve V2 integration credentials schema with sensitivity metadata.

        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 with is_sensitive metadata.
      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
      - in: query
        name: unmask_sensitive_fields
        schema:
          type: boolean
          default: false
        description: If true and the requester is a platform admin for the org, returns
          full unmasked credential values. Restricted to credentials owned by the
          requested tenant (no main-platform fallback when unmasking). Ignored for
          non-admins.
      tags:
      - Integration Credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/IntegrationCredentialSchemaV2'
              examples:
                IntegrationCredentialsSchemaV2Example:
                  value:
                  - - name: drive
                      schema:
                        client_id:
                          type: string
                          is_sensitive: false
                        client_secret:
                          type: string
                          is_sensitive: true
                        developer_key:
                          type: string
                          is_sensitive: false
                      is_student_allowed: true
                  summary: Integration credentials schema v2 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.
                When name=google, returns both 'google' (service account) and
                'gemini_google_api_key' credentials if they exist.
            unmask_sensitive_fields (optional, bool, default False):
                If true, returns the raw unmasked credential value. Restricted
                to credentials owned by the requested tenant — the
                ``GlobalCredential`` fallback is suppressed when unmasking,
                and the response is ``[]`` instead of 404 if the tenant has
                no own credentials.

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

        Returns:
            Response: List of LLM credentials for the organization. Values
            are masked by default; unmasked when ``unmask_sensitive_fields=true``
            and the credential belongs to the tenant.

        Raises:
            NotFound: When organization is not found, or (in default masked
                mode) when no credentials match the filters even after the
                global-credential fallback.
            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
      - in: query
        name: unmask_sensitive_fields
        schema:
          type: boolean
          default: false
        description: If true and the requester is a platform admin for the org, returns
          full unmasked credential values. Restricted to credentials owned by the
          requested tenant (no main-platform fallback when unmasking). Ignored for
          non-admins.
      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.

        For azure_openai credentials, if credential already exists, merges the new
        models with existing ones instead of replacing.

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

        Returns:
            Response: Created or updated 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.

        For azure_openai credentials, supports partial model updates by deep merging
        the provided model fields with existing ones.

        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.

        For azure_openai credentials, supports deleting a specific model by providing
        the 'model_name' field. If model_name is omitted, deletes the entire credential.

        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
      - in: query
        name: unmask_sensitive_fields
        schema:
          type: boolean
          default: false
        description: If true and the requester is a platform admin for the org, returns
          full unmasked credential values. Restricted to credentials owned by the
          requested tenant (no main-platform fallback when unmasking). Ignored for
          non-admins.
      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
      - in: query
        name: unmask_sensitive_fields
        schema:
          type: boolean
          default: false
        description: If true and the requester is a platform admin for the org, returns
          full unmasked credential values. Restricted to credentials owned by the
          requested tenant (no main-platform fallback when unmasking). Ignored for
          non-admins.
      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}/oauth-services/:
    get:
      operationId: ai_account_orgs_oauth_services_list
      description: |-
        Return the list of OAuth services that can be used for connected services.

        Query Parameters:
            name (optional): Filter by exact service name (case-insensitive).
            include_disabled (optional): Set to `true` to include disabled services.
      parameters:
      - 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/OAuthProvider'
              examples:
                OAuthServices:
                  value:
                  - - name: google
                      description: Google OAuth service
                      auth_url: https://accounts.google.com/o/oauth2/v2/auth
                      token_url: https://oauth2.googleapis.com/token
                      scope_map:
                        drive: https://www.googleapis.com/auth/drive
                      scopes:
                      - oauth_service: google
                        name: google_drive
                        scope: https://www.googleapis.com/auth/drive
                  summary: OAuth services
          description: ''
  /api/ai-account/orgs/{org}/oauth-services/{service_name}/scopes/:
    get:
      operationId: ai_account_orgs_oauth_services_scopes_list
      description: |-
        Return the available scopes for the specified OAuth service.

        Query Parameters:
            include_disabled (optional): Set to `true` to include scopes from disabled services.
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: service_name
        schema:
          type: string
        required: true
      tags:
      - ai-account
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OAuthService'
              examples:
                OAuthScopes:
                  value:
                  - - oauth_service: google
                      name: google_drive
                      scope: https://www.googleapis.com/auth/drive
                  summary: OAuth scopes
          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}/chat-privacy-config/:
    get:
      operationId: ai_account_orgs_users_chat_privacy_config_retrieve
      description: Return whether the tenant allows user-controlled chat privacy.
      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:
                $ref: '#/components/schemas/TenantChatPrivacyConfig'
              examples:
                Enabled:
                  value:
                    allow_user_chat_privacy_control: true
                Disabled:
                  value:
                    allow_user_chat_privacy_control: false
          description: Tenant chat-privacy configuration
    patch:
      operationId: ai_account_orgs_users_chat_privacy_config_partial_update
      description: Flip `ALLOW_USER_CHAT_PRIVACY_CONTROL` for the 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-account
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedTenantChatPrivacyConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedTenantChatPrivacyConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedTenantChatPrivacyConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedTenantChatPrivacyConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedTenantChatPrivacyConfig'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantChatPrivacyConfig'
          description: Updated tenant chat-privacy configuration
        '400':
          description: Invalid request body
        '403':
          description: Caller is not a tenant admin
  /api/ai-account/orgs/{org}/users/{user_id}/chat-privacy-effective/:
    get:
      operationId: ai_account_orgs_users_chat_privacy_effective_retrieve
      description: |-
        Get the effective chat-privacy mode for the given (tenant, mentor,
        user, session) tuple.

        Args:
            request: HTTP request. Query params: `mentor` (unique_id, slug, or
                name — unique_id tried first), `session` (uuid).
            org: Platform key.
            user_id: Username of the user whose effective mode is being resolved.
      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: Effective chat privacy mode and source tier
        '404':
          description: User, mentor, or session not found
  /api/ai-account/orgs/{org}/users/{user_id}/chat-privacy-settings/:
    get:
      operationId: ai_account_orgs_users_chat_privacy_settings_retrieve
      description: |-
        Get user's global chat privacy settings.

        Returns the user's current chat privacy mode if the feature is enabled
        for the platform, otherwise indicates the feature is disabled.
      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: User chat privacy settings
    post:
      operationId: ai_account_orgs_users_chat_privacy_settings_create
      description: |-
        Update user's global chat privacy settings.

        Allows users to set their chat privacy preference (normal, anonymized, or disabled)
        if the platform has enabled the ALLOW_USER_CHAT_PRIVACY_CONTROL setting.
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-account
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserChatPrivacySettings'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserChatPrivacySettings'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserChatPrivacySettings'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserChatPrivacySettings'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserChatPrivacySettings'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Updated chat privacy settings
        '400':
          description: Feature not enabled or invalid request
  /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-account/orgs/{org}/users/{user_id}/tenant-settings/:
    get:
      operationId: ai_account_orgs_users_tenant_settings_retrieve
      description: |-
        Get a platform's settings

        Example response:
        ```
        {"teams_bot_mentor": "f2116cf2-95c7-4c1f-b19e-666ad529439f"}

        ```
      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:
                $ref: '#/components/schemas/TenantSetting'
          description: ''
    post:
      operationId: ai_account_orgs_users_tenant_settings_create
      description: |-
        Example Request:

        ```
        {"teams_bot_mentor": "f2116cf2-95c7-4c1f-b19e-666ad529439f"}
        ```
        The value here is the mentor's unique id
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-account
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TenantSetting'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TenantSetting'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TenantSetting'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TenantSetting'
          '*/*':
            schema:
              $ref: '#/components/schemas/TenantSetting'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantSetting'
          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\
          \ \n\n* `y` - y\n* `yes` - yes\n* `true` - true\n* `True` - True\n* `n`\
          \ - n\n* `no` - no\n* `false` - false\n* `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\
          \ \n\n* `y` - y\n* `yes` - yes\n* `true` - true\n* `True` - True\n* `n`\
          \ - n\n* `no` - no\n* `false` - false\n* `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\
          \ \n\n* `y` - y\n* `yes` - yes\n* `true` - true\n* `True` - True\n* `n`\
          \ - n\n* `no` - no\n* `false` - false\n* `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\
          \ \n\n* `y` - y\n* `yes` - yes\n* `true` - true\n* `True` - True\n* `n`\
          \ - n\n* `no` - no\n* `false` - false\n* `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\
          \ \n\n* `y` - y\n* `yes` - yes\n* `true` - true\n* `True` - True\n* `n`\
          \ - n\n* `no` - no\n* `false` - false\n* `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}/agent-detail/:
    get:
      operationId: ai_analytics_orgs_users_agent_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}/agent-summary/:
    get:
      operationId: ai_analytics_orgs_users_agent_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}/agents/{mentor_unique_id}/cost/:
    get:
      operationId: ai_analytics_orgs_users_agents_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}/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'
                    sentiment:
                    - 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/peragent/:
    get:
      operationId: ai_analytics_orgs_users_costs_peragent_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/permentor/:
    get:
      operationId: ai_analytics_orgs_users_costs_permentor_retrieve
      description: |-
        **Deprecated — use `/api/ai-analytics/orgs/{org}/users/{user_id}/costs/peragent/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-analytics/orgs/{org}/users/{user_id}/costs/peragent/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /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: |-
        **Deprecated — use `/api/ai-analytics/orgs/{org}/users/{user_id}/agent-detail/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-analytics/orgs/{org}/users/{user_id}/agent-detail/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-analytics/orgs/{org}/users/{user_id}/mentor-summary/:
    get:
      operationId: ai_analytics_orgs_users_mentor_summary_retrieve
      description: |-
        **Deprecated — use `/api/ai-analytics/orgs/{org}/users/{user_id}/agent-summary/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-analytics/orgs/{org}/users/{user_id}/agent-summary/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-analytics/orgs/{org}/users/{user_id}/mentors/{mentor_unique_id}/cost/:
    get:
      operationId: ai_analytics_orgs_users_mentors_cost_retrieve
      description: |-
        **Deprecated — use `/api/ai-analytics/orgs/{org}/users/{user_id}/agents/{mentor_unique_id}/cost/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-analytics/orgs/{org}/users/{user_id}/agents/{mentor_unique_id}/cost/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /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}/my-chat-history/:
    get:
      operationId: ai_analytics_orgs_users_my_chat_history_list
      description: |-
        API viewset for retrieving a user's own chat message history.

        Permissions:
            - Any authenticated user can access their own data
            - Users cannot access other users' data
      parameters:
      - in: query
        name: end_date
        schema:
          type: string
          format: date
      - 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: ''
  /api/ai-analytics/orgs/{org}/users/{user_id}/my-chat-history-filter/:
    get:
      operationId: ai_analytics_orgs_users_my_chat_history_filter_retrieve
      description: Retrieve filter options for the user's own chat message history.
      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/UserChatHistoryFilterData'
          description: ''
        '403':
          description: Cannot access another user's data
        '404':
          description: Organization not found
  /api/ai-analytics/orgs/{org}/users/{user_id}/my-chat-history-report/:
    get:
      operationId: ai_analytics_orgs_users_my_chat_history_report_retrieve
      description: List all chat history reports created by the user.
      summary: List user chat history reports
      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/UserReportListResponse'
          description: ''
    post:
      operationId: ai_analytics_orgs_users_my_chat_history_report_create
      description: |-
        Create a report for the user's own chat history. Only my-chat-history report is allowed.

        Supported filters in request body:
        - `mentor_id` or `mentor`: Filter by specific mentor ID (single value or list)
        - `topic`: Filter by conversation topic
        - `sentiment`: Filter by sentiment (positive, negative, neutral)
        - `start_date` and `end_date`: Date range filters (YYYY-MM-DD format)
      summary: Create user chat history report
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-analytics
      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/ai-analytics/orgs/{org}/users/{user_id}/my-chat-history-report/{task_id}/:
    get:
      operationId: ai_analytics_orgs_users_my_chat_history_report_retrieve_2
      description: Get the status of a user's own chat history report.
      summary: Get user report status
      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-analytics
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportCreate'
          description: ''
  /api/ai-analytics/orgs/{org}/users/{user_id}/my-chat-history-report/{task_id}/download/:
    get:
      operationId: ai_analytics_orgs_users_my_chat_history_report_download_retrieve
      description: Download a completed user chat history report as CSV or JSON.
      summary: Download user chat history report
      parameters:
      - in: query
        name: columns
        schema:
          type: string
        description: Comma-separated column names to control output order.
      - in: query
        name: format
        schema:
          type: string
          enum:
          - csv
          - json
          default: csv
        description: Download format
      - 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-analytics
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-analytics/orgs/{org}/users/{user_id}/my-chat-history/{id}/:
    get:
      operationId: ai_analytics_orgs_users_my_chat_history_retrieve
      description: |-
        API viewset for retrieving a user's own chat message history.

        Permissions:
            - Any authenticated user can access their own data
            - Users cannot access other users' data
      parameters:
      - in: query
        name: end_date
        schema:
          type: string
          format: date
      - 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: ''
  /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-agent/:
    get:
      operationId: ai_analytics_orgs_users_total_users_by_agent_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}/total-users-by-mentor/:
    get:
      operationId: ai_analytics_orgs_users_total_users_by_mentor_list
      description: |-
        **Deprecated — use `/api/ai-analytics/orgs/{org}/users/{user_id}/total-users-by-agent/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-analytics/orgs/{org}/users/{user_id}/total-users-by-agent/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /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: |-
        DRF view mixin that routes all ORM reads to the read replica.

        Falls back to the primary database if the replica is unreachable.

        Add as the **first** base class on read-only views/viewsets::

            class MyView(ReadReplicaViewMixin, IsPlatformAdminDRFMixin, APIView):
                ...
      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}/:
    get:
      operationId: ai_bot_v1_bots_webhooks_teams_retrieve
      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/TeamsWebhook'
          description: ''
    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-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: Retrieve document settings with RBAC permission checks.
      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: Update document settings with RBAC permission checks.
      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}/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/claw/health/:
    get:
      operationId: ai_mentor_claw_health_retrieve
      description: |-
        Public health endpoint for external monitoring (Pingdom, uptime checks).

        Scoped to managed workers (the infrastructure we operate): returns 500 when a managed,
        non-inactive worker is in error OR its stored TLS certificate is within the near-expiry
        threshold; 200 otherwise. Near-expiry is computed at read time and never stored as an error,
        so it cannot block student routing. Self-hosted workers are the tenant's infrastructure and
        do not drive this alert. Pure DB read, no external calls.
      tags:
      - ai-mentor
      responses:
        '200':
          description: No response body
  /api/ai-mentor/claw/health/detail/:
    get:
      operationId: ai_mentor_claw_health_detail_retrieve
      description: |-
        Detailed health dashboard for DM admins.

        Returns health status for all Claw instances across all orgs,
        including instance details and enabled mentor counts.
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-mentor/langfuse/cost/health/:
    get:
      operationId: ai_mentor_langfuse_cost_health_retrieve
      description: |-
        Health check for the end-to-end cost -> billing pipeline.

        Unlike :class:`LangfuseHealthView` (which only proxies Langfuse's web health
        endpoint), this verifies the *whole* money path in three independent stages so
        a failure pinpoints exactly where cost stopped flowing toward billing:

        * ``ingestion`` -- fake-mentor probe cost reached the raw ClickHouse
          ``traces``/``observations`` tables (probe chat -> Langfuse callback -> SDK
          flush -> ingestion worker -> ClickHouse write -> model-price computation).
        * ``rollup`` -- that cost propagated into ``mv_user_platform_total``, the view
          the credit system actually reconciles against. Raw ingestion can be healthy
          while the rollup is frozen, which would silently halt billing; this stage is
          what catches that gap.
        * ``deduction`` -- the real reconciliation path deducts credits for that usage,
          exercised against the health user's account inside a rolled-back transaction
          (no persistence, no charge).

        Cost ingestion is asynchronous and eventually consistent, so the ingestion
        stage aggregates over a recent window (default 10 minutes). The stages rely on
        the fake-mentor uptime probes (:class:`AIMentorHealthView`) chatting as the
        configured ``LANGFUSE_COST_HEALTH_USERNAME`` so their cost is attributable in
        the rollup and to that user's credit account.

        Requires ``ENABLE_LANGFUSE_FOR_FAKE_MENTORS`` enabled, the ``fake-llm-model``
        price registered (``register_langfuse_health_model``), and the health user's
        credit account provisioned (``setup_langfuse_cost_health``). All three stages always
        run so a healthy result proves the entire path, not a configurable subset.

        Returns:
            HTTP 200: every enabled stage healthy.
            HTTP 503: any stage failed (per-stage breakdown in the body).
      tags:
      - ai-mentor
      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}/agent-skill-resources/:
    get:
      operationId: ai_mentor_orgs_agent_skill_resources_list
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: query
        name: file_type
        schema:
          type: string
          enum:
          - asset
          - reference
          - script
        description: |-
          * `script` - Script
          * `reference` - Reference
          * `asset` - Asset
      - 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
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: skill
        schema:
          type: integer
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAgentSkillResourceList'
          description: ''
    post:
      operationId: ai_mentor_orgs_agent_skill_resources_create
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentSkillResource'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/AgentSkillResource'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AgentSkillResource'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AgentSkillResource'
          '*/*':
            schema:
              $ref: '#/components/schemas/AgentSkillResource'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSkillResource'
          description: ''
  /api/ai-mentor/orgs/{org}/agent-skill-resources/{id}/:
    get:
      operationId: ai_mentor_orgs_agent_skill_resources_retrieve
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Agent skill resource.
        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/AgentSkillResource'
          description: ''
    put:
      operationId: ai_mentor_orgs_agent_skill_resources_update
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Agent skill resource.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentSkillResource'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/AgentSkillResource'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AgentSkillResource'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AgentSkillResource'
          '*/*':
            schema:
              $ref: '#/components/schemas/AgentSkillResource'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSkillResource'
          description: ''
    patch:
      operationId: ai_mentor_orgs_agent_skill_resources_partial_update
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Agent skill resource.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedAgentSkillResource'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedAgentSkillResource'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedAgentSkillResource'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedAgentSkillResource'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedAgentSkillResource'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSkillResource'
          description: ''
    delete:
      operationId: ai_mentor_orgs_agent_skill_resources_destroy
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Agent skill resource.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/agent-skills/:
    get:
      operationId: ai_mentor_orgs_agent_skills_list
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: query
        name: enabled
        schema:
          type: boolean
      - 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
      - in: path
        name: org
        schema:
          type: string
        required: true
      - name: search
        required: false
        in: query
        description: A search term.
        schema:
          type: string
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAgentSkillList'
          description: ''
    post:
      operationId: ai_mentor_orgs_agent_skills_create
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentSkill'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/AgentSkill'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AgentSkill'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AgentSkill'
          '*/*':
            schema:
              $ref: '#/components/schemas/AgentSkill'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSkill'
          description: ''
  /api/ai-mentor/orgs/{org}/agent-skills/{id}/:
    get:
      operationId: ai_mentor_orgs_agent_skills_retrieve
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Agent skill.
        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/AgentSkill'
          description: ''
    put:
      operationId: ai_mentor_orgs_agent_skills_update
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Agent skill.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentSkill'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/AgentSkill'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AgentSkill'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AgentSkill'
          '*/*':
            schema:
              $ref: '#/components/schemas/AgentSkill'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSkill'
          description: ''
    patch:
      operationId: ai_mentor_orgs_agent_skills_partial_update
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Agent skill.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedAgentSkill'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedAgentSkill'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedAgentSkill'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedAgentSkill'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedAgentSkill'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSkill'
          description: ''
    delete:
      operationId: ai_mentor_orgs_agent_skills_destroy
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Agent skill.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/:
    get:
      operationId: ai_mentor_orgs_agents_memory_categories_retrieve
      description: List all active memory categories for a mentor.
      parameters:
      - in: path
        name: mentor_id
        schema:
          type: string
        required: true
      - 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_agents_memory_categories_create
      description: Create a new memory category.
      parameters:
      - in: path
        name: mentor_id
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/{category_id}/:
    patch:
      operationId: ai_mentor_orgs_agents_memory_categories_partial_update
      description: Update a memory category.
      parameters:
      - in: path
        name: category_id
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_id
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    delete:
      operationId: ai_mentor_orgs_agents_memory_categories_destroy
      description: Deactivate a memory category.
      parameters:
      - in: path
        name: category_id
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_id
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/agent-config/:
    get:
      operationId: ai_mentor_orgs_agents_agent_config_retrieve
      description: |-
        Singular AgentConfig nested under a mentor. GET + PATCH only.

        AgentConfig is auto-created by ClawMentorConfig.save(); if a mentor has
        never had a ClawMentorConfig, PATCH will create the AgentConfig on first
        write via get_or_create. DELETE is not supported (the row would be
        immediately recreated by a subsequent ClawMentorConfig.save).
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    patch:
      operationId: ai_mentor_orgs_agents_agent_config_partial_update
      description: |-
        Singular AgentConfig nested under a mentor. GET + PATCH only.

        AgentConfig is auto-created by ClawMentorConfig.save(); if a mentor has
        never had a ClawMentorConfig, PATCH will create the AgentConfig on first
        write via get_or_create. DELETE is not supported (the row would be
        immediately recreated by a subsequent ClawMentorConfig.save).
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/:
    get:
      operationId: ai_mentor_orgs_agents_claw_config_retrieve
      description: |-
        Singular ClawMentorConfig nested under a mentor.

        Supports GET/POST/PATCH/DELETE plus the push-config/ custom action.
        POST creates the (one and only) ClawMentorConfig for this mentor — the
        OneToOne(Mentor) constraint means a duplicate POST returns 400.
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        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/ClawMentorConfig'
          description: ''
    post:
      operationId: ai_mentor_orgs_agents_claw_config_create
      description: |-
        Singular ClawMentorConfig nested under a mentor.

        Supports GET/POST/PATCH/DELETE plus the push-config/ custom action.
        POST creates the (one and only) ClawMentorConfig for this mentor — the
        OneToOne(Mentor) constraint means a duplicate POST returns 400.
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawMentorConfig'
          description: ''
    put:
      operationId: ai_mentor_orgs_agents_claw_config_update
      description: |-
        Singular ClawMentorConfig nested under a mentor.

        Supports GET/POST/PATCH/DELETE plus the push-config/ custom action.
        POST creates the (one and only) ClawMentorConfig for this mentor — the
        OneToOne(Mentor) constraint means a duplicate POST returns 400.
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawMentorConfig'
          description: ''
    patch:
      operationId: ai_mentor_orgs_agents_claw_config_partial_update
      description: |-
        Singular ClawMentorConfig nested under a mentor.

        Supports GET/POST/PATCH/DELETE plus the push-config/ custom action.
        POST creates the (one and only) ClawMentorConfig for this mentor — the
        OneToOne(Mentor) constraint means a duplicate POST returns 400.
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedClawMentorConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedClawMentorConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedClawMentorConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedClawMentorConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedClawMentorConfig'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawMentorConfig'
          description: ''
    delete:
      operationId: ai_mentor_orgs_agents_claw_config_destroy
      description: |-
        Singular ClawMentorConfig nested under a mentor.

        Supports GET/POST/PATCH/DELETE plus the push-config/ custom action.
        POST creates the (one and only) ClawMentorConfig for this mentor — the
        OneToOne(Mentor) constraint means a duplicate POST returns 400.
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/push-config/:
    post:
      operationId: ai_mentor_orgs_agents_claw_config_push_config_create
      description: Push agent_config to the Claw worker. RBAC enforced in initial().
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawMentorConfig'
          description: ''
  /api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/:
    get:
      operationId: ai_mentor_orgs_agents_grader_config_retrieve
      description: Return the mentor's grader configuration.
      summary: Retrieve mentor grader configuration
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        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/MentorGraderConfig'
          description: ''
        '403':
          description: Permission Denied
        '404':
          description: Mentor or grader config not found
    post:
      operationId: ai_mentor_orgs_agents_grader_config_create
      description: Create the grader configuration for a mentor. Fails with 400 if
        a configuration already exists (the resource is 1:1 with the mentor). Criteria
        are added separately via the nested `criteria/` endpoints.
      summary: Create mentor grader configuration
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorGraderConfig'
          description: ''
        '400':
          description: Invalid data, or grader config already exists for this mentor
        '403':
          description: Permission Denied
        '404':
          description: Mentor not found
    put:
      operationId: ai_mentor_orgs_agents_grader_config_update
      description: Replace all writable fields on the grader configuration.
      summary: Replace mentor grader configuration
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorGraderConfig'
          description: ''
        '400':
          description: Invalid data
        '403':
          description: Permission Denied
        '404':
          description: Mentor or grader config not found
    patch:
      operationId: ai_mentor_orgs_agents_grader_config_partial_update
      description: Update one or more writable fields on the grader configuration.
      summary: Partially update mentor grader configuration
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedMentorGraderConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedMentorGraderConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMentorGraderConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedMentorGraderConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedMentorGraderConfig'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorGraderConfig'
          description: ''
        '400':
          description: Invalid data
        '403':
          description: Permission Denied
        '404':
          description: Mentor or grader config not found
  /api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/:
    get:
      operationId: ai_mentor_orgs_agents_grader_config_criteria_list
      description: List the criteria attached to the mentor's grader configuration.
        Supports `search` against the criterion `name` field.
      summary: List grader criteria
      parameters:
      - name: limit
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - name: offset
        required: false
        in: query
        description: The initial index from which to return the results.
        schema:
          type: integer
      - in: path
        name: org
        schema:
          type: string
        required: true
      - name: search
        required: false
        in: query
        description: A search term.
        schema:
          type: string
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedGraderCriterionList'
          description: ''
        '403':
          description: Permission Denied
        '404':
          description: Mentor or grader config not found
    post:
      operationId: ai_mentor_orgs_agents_grader_config_criteria_create
      description: Add a criterion to the mentor's grader configuration. `points`
        must be a positive float; the overall score is computed as earned points /
        total possible points (no sum-to-1 invariant).
      summary: Create grader criterion
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GraderCriterion'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/GraderCriterion'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/GraderCriterion'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/GraderCriterion'
          '*/*':
            schema:
              $ref: '#/components/schemas/GraderCriterion'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GraderCriterion'
          description: ''
        '400':
          description: Invalid data
        '403':
          description: Permission Denied
        '404':
          description: Mentor or grader config not found
  /api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/:
    get:
      operationId: ai_mentor_orgs_agents_grader_config_criteria_retrieve
      description: Retrieve a single criterion by id.
      summary: Retrieve grader criterion
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        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/GraderCriterion'
          description: ''
        '403':
          description: Permission Denied
        '404':
          description: Mentor, grader config, or criterion not found
    put:
      operationId: ai_mentor_orgs_agents_grader_config_criteria_update
      description: Replace all writable fields on a criterion.
      summary: Replace grader criterion
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GraderCriterion'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/GraderCriterion'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/GraderCriterion'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/GraderCriterion'
          '*/*':
            schema:
              $ref: '#/components/schemas/GraderCriterion'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GraderCriterion'
          description: ''
        '400':
          description: Invalid data
        '403':
          description: Permission Denied
        '404':
          description: Mentor, grader config, or criterion not found
    patch:
      operationId: ai_mentor_orgs_agents_grader_config_criteria_partial_update
      description: Update one or more writable fields on a criterion.
      summary: Partially update grader criterion
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedGraderCriterion'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedGraderCriterion'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedGraderCriterion'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedGraderCriterion'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedGraderCriterion'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GraderCriterion'
          description: ''
        '400':
          description: Invalid data
        '403':
          description: Permission Denied
        '404':
          description: Mentor, grader config, or criterion not found
    delete:
      operationId: ai_mentor_orgs_agents_grader_config_criteria_destroy
      description: Delete a criterion. Refuses with 400 if it is the only remaining
        criterion on the config — a config with zero criteria cannot grade.
      summary: Delete grader criterion
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Criterion deleted
        '400':
          description: Cannot delete the last criterion — a grader config must have
            at least one
        '403':
          description: Permission Denied
        '404':
          description: Mentor, grader config, or criterion not found
  /api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-results/:
    get:
      operationId: ai_mentor_orgs_agents_grader_results_list
      description: 'List the grades this mentor has issued, most recent first. Filterable
        by `username`, `email` (both partial matches), `status`, `override_status`,
        and the `graded_at_after` / `graded_at_before` range; orderable by `graded_at`.
        The two status filters cover different failures: `?status=failed` finds grades
        whose original publish did not land, while `?override_status=failed` finds
        human overrides the LMS rejected, which are retried by repeating the PATCH.'
      summary: List mentor grade results
      parameters:
      - in: query
        name: email
        schema:
          type: string
      - in: query
        name: graded_at_after
        schema:
          type: string
          format: date-time
      - in: query
        name: graded_at_before
        schema:
          type: string
          format: date-time
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        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
      - in: query
        name: override_status
        schema:
          type: string
          nullable: true
          enum:
          - failed
          - pending
          - published
        description: |-
          Whether the most recent override reached the LMS, including one that cleared the override — 'published' with a null override_score means the reset back to the AI score is what reached the LMS.

          * `pending` - Pending
          * `published` - Published
          * `failed` - Failed
      - 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: status
        schema:
          type: string
          enum:
          - failed
          - pending
          - published
        description: |-
          Whether the AI score reached the LMS.

          * `pending` - Pending
          * `published` - Published
          * `failed` - Failed
      - in: query
        name: username
        schema:
          type: string
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedGradeResultList'
          description: ''
        '403':
          description: Permission Denied
        '404':
          description: Mentor not found
  /api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-results/{id}/:
    get:
      operationId: ai_mentor_orgs_agents_grader_results_retrieve
      description: Return one grade, including its rubric and publish record.
      summary: Retrieve a grade result
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        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/GradeResultDetail'
          description: ''
        '403':
          description: Permission Denied
        '404':
          description: Mentor or grade not found
    patch:
      operationId: ai_mentor_orgs_agents_grader_results_partial_update
      description: Record a human override and push it to the LMS the grade came from.
        `override_points` is in rubric points (0 to `total_points`); null clears the
        override and restores the AI score. The override is recorded as `pending`
        before the push, then resolved to `published` or `failed`; either outcome
        is retried by repeating the request. A row left at `pending` means the request
        died mid-push and the LMS may or may not hold the score.
      summary: Override a grade result
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedGradeResultOverride'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedGradeResultOverride'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedGradeResultOverride'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedGradeResultOverride'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedGradeResultOverride'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GradeResultDetail'
          description: ''
        '400':
          description: Invalid data, or the grade has no rubric to score against
        '403':
          description: Permission Denied
        '404':
          description: Mentor or grade not found
        '502':
          description: The override was recorded but the LMS rejected it; `override_status`
            is `failed`
  /api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/lti/grant-agent-access/:
    post:
      operationId: ai_mentor_orgs_agents_lti_grant_agent_access_create
      description: |-
        Grants a user Student type access to a mentor that is lti accessible.

        Creates or updates an RBAC policy named LTI-{mentor.unique_id} with the global Student role,
        granting the specified user access to the mentor. Validates that the mentor has LTI access
        enabled and that the user belongs to the specified platform.
      summary: Grant LTI Mentor Access
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        description: Organization slug
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GrantMentorAccessRequest'
            examples:
              GrantAccessRequest:
                value:
                  user_id: 12345
                  mentor_unique_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                summary: Grant Access Request
          application/scim+json:
            schema:
              $ref: '#/components/schemas/GrantMentorAccessRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/GrantMentorAccessRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/GrantMentorAccessRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/GrantMentorAccessRequest'
        required: true
      responses:
        '201':
          description: Policy created and user granted access
        '204':
          description: User already has access, no changes made
        '400':
          description: Invalid request data
        '403':
          description: Mentor is not LTI accessible
        '404':
          description: Mentor, platform, or user not found
        '500':
          description: Global Student role not found
  /api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/:
    get:
      operationId: ai_mentor_orgs_agents_skills_list
      description: Skill assignments nested under a mentor. Full CRUD.
      parameters:
      - in: query
        name: enabled
        schema:
          type: boolean
      - name: limit
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - name: offset
        required: false
        in: query
        description: The initial index from which to return the results.
        schema:
          type: integer
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedMentorSkillAssignmentList'
          description: ''
    post:
      operationId: ai_mentor_orgs_agents_skills_create
      description: Skill assignments nested under a mentor. Full CRUD.
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSkillAssignment'
          description: ''
  /api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/:
    get:
      operationId: ai_mentor_orgs_agents_skills_retrieve
      description: Skill assignments nested under a mentor. Full CRUD.
      parameters:
      - in: path
        name: assignment_pk
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        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/MentorSkillAssignment'
          description: ''
    put:
      operationId: ai_mentor_orgs_agents_skills_update
      description: Skill assignments nested under a mentor. Full CRUD.
      parameters:
      - in: path
        name: assignment_pk
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSkillAssignment'
          description: ''
    patch:
      operationId: ai_mentor_orgs_agents_skills_partial_update
      description: Skill assignments nested under a mentor. Full CRUD.
      parameters:
      - in: path
        name: assignment_pk
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedMentorSkillAssignment'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedMentorSkillAssignment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMentorSkillAssignment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedMentorSkillAssignment'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedMentorSkillAssignment'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSkillAssignment'
          description: ''
    delete:
      operationId: ai_mentor_orgs_agents_skills_destroy
      description: Skill assignments nested under a mentor. Full CRUD.
      parameters:
      - in: path
        name: assignment_pk
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-cap/:
    get:
      operationId: ai_mentor_orgs_agents_spend_cap_retrieve
      description: Retrieve the singleton agent-scoped spend cap for one mentor. The
        mentor is resolved tenant-scoped, so a cross-tenant unique_id 404s.
      summary: Get an agent spend cap
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        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/SpendCap'
          description: ''
        '403':
          description: Permission denied
        '404':
          description: Mentor or agent spend cap not found
    put:
      operationId: ai_mentor_orgs_agents_spend_cap_update
      description: Upsert the singleton agent-scoped spend cap for one mentor. Returns
        201 on first write and 200 on update.
      summary: Create or update an agent spend cap
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpendCap'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SpendCap'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SpendCap'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SpendCap'
          '*/*':
            schema:
              $ref: '#/components/schemas/SpendCap'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendCap'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendCap'
          description: ''
        '400':
          description: Validation error
        '403':
          description: Permission denied
        '404':
          description: Platform or mentor not found
    delete:
      operationId: ai_mentor_orgs_agents_spend_cap_destroy
      description: Remove the singleton agent-scoped spend cap for one mentor.
      summary: Delete an agent spend cap
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Deleted successfully
        '403':
          description: Permission denied
        '404':
          description: Agent spend cap not found
  /api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/:
    get:
      operationId: ai_mentor_orgs_agents_spend_caps_users_list
      description: List every explicit ``(user, agent)`` spend cap configured for
        one mentor. Individual caps are managed via the detail endpoint. Optionally
        filter by username and/or email.
      summary: List per-user caps for an agent
      parameters:
      - in: query
        name: email
        schema:
          type: string
        description: Optional case-insensitive exact email filter
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: username
        schema:
          type: string
        description: Optional exact username filter
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SpendCap'
          description: ''
        '403':
          description: Permission denied
        '404':
          description: Mentor not found
  /api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/{username}/:
    get:
      operationId: ai_mentor_orgs_agents_spend_caps_users_retrieve
      description: Retrieve one explicit ``(user, agent)`` spend cap.
      summary: Get a per-user agent spend cap
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendCap'
          description: ''
        '403':
          description: Permission denied
        '404':
          description: User spend cap not found
    put:
      operationId: ai_mentor_orgs_agents_spend_caps_users_update
      description: Upsert one explicit ``(user, agent)`` spend cap. The username comes
        from the URL, not the body. Returns 201 on first write and 200 on update.
      summary: Create or update a per-user agent spend cap
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpendCap'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SpendCap'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SpendCap'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SpendCap'
          '*/*':
            schema:
              $ref: '#/components/schemas/SpendCap'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendCap'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendCap'
          description: ''
        '400':
          description: Validation error
        '403':
          description: Permission denied
        '404':
          description: Platform, mentor, or user not found
    delete:
      operationId: ai_mentor_orgs_agents_spend_caps_users_destroy
      description: Remove one explicit ``(user, agent)`` spend cap.
      summary: Delete a per-user agent spend cap
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Deleted successfully
        '403':
          description: Permission denied
        '404':
          description: User spend cap not found
  /api/ai-mentor/orgs/{org}/agents/{mentor}/email-inbox/:
    get:
      operationId: ai_mentor_orgs_agents_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}/agents/{mentor}/email-inbox-summary/:
    get:
      operationId: ai_mentor_orgs_agents_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}/agents/{mentor}/email-inbox/{email_prompt_id}/:
    get:
      operationId: ai_mentor_orgs_agents_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}/agents/{mentor}/link-course/:
    get:
      operationId: ai_mentor_orgs_agents_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_agents_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}/agents/by-email/:
    post:
      operationId: ai_mentor_orgs_agents_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'
      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}/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}/claw/instances/:
    get:
      operationId: ai_mentor_orgs_claw_instances_list
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      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
      - in: path
        name: org
        schema:
          type: string
        required: true
      - name: search
        required: false
        in: query
        description: A search term.
        schema:
          type: string
      - in: query
        name: status
        schema:
          type: string
          enum:
          - active
          - error
          - inactive
        description: |-
          * `active` - Active
          * `inactive` - Inactive
          * `error` - Error
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedClawInstanceList'
          description: ''
    post:
      operationId: ai_mentor_orgs_claw_instances_create
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          '*/*':
            schema:
              $ref: '#/components/schemas/ClawInstance'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawInstance'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/instances/{id}/:
    get:
      operationId: ai_mentor_orgs_claw_instances_retrieve
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Claw instance.
        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/ClawInstance'
          description: ''
    put:
      operationId: ai_mentor_orgs_claw_instances_update
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Claw instance.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          '*/*':
            schema:
              $ref: '#/components/schemas/ClawInstance'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawInstance'
          description: ''
    patch:
      operationId: ai_mentor_orgs_claw_instances_partial_update
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Claw instance.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedClawInstance'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedClawInstance'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedClawInstance'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedClawInstance'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedClawInstance'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawInstance'
          description: ''
    delete:
      operationId: ai_mentor_orgs_claw_instances_destroy
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Claw instance.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/claw/instances/{id}/health-check/:
    post:
      operationId: ai_mentor_orgs_claw_instances_health_check_create
      description: |-
        Queue a health check against the Claw instance.

        Offloaded to Celery because the real health check uses a WebSocket
        handshake + RPC, which blocks gevent workers (sockets are not
        monkey-patched). The task updates the server's health fields on
        completion.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Claw instance.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          '*/*':
            schema:
              $ref: '#/components/schemas/ClawInstance'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawInstance'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/instances/{id}/push-providers/:
    post:
      operationId: ai_mentor_orgs_claw_instances_push_providers_create
      description: Push all enabled model providers to the worker.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Claw instance.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          '*/*':
            schema:
              $ref: '#/components/schemas/ClawInstance'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawInstance'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/instances/{id}/refresh-version/:
    post:
      operationId: ai_mentor_orgs_claw_instances_refresh_version_create
      description: Connect to the worker and store Claw version from handshake.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Claw instance.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          '*/*':
            schema:
              $ref: '#/components/schemas/ClawInstance'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawInstance'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/instances/{id}/request-pairing/:
    post:
      operationId: ai_mentor_orgs_claw_instances_request_pairing_create
      description: |-
        Queue a device-pairing request against the worker (#1848).

        The connect handshake is a WebSocket + RPC round-trip that blocks gevent web workers, so it is
        offloaded to Celery rather than run inline. The task mints a pending pairing request (expires
        ~5 min) and writes the result (request id + fingerprint, already-paired, or error) to the
        instance's ``last_pairing`` field; an operator then approves the request id on the worker host.
        This endpoint never approves — approval stays explicit and operator-gated.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Claw instance.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          '*/*':
            schema:
              $ref: '#/components/schemas/ClawInstance'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawInstance'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/instances/{id}/security-audit/:
    post:
      operationId: ai_mentor_orgs_claw_instances_security_audit_create
      description: Run security audit on the worker and store findings.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Claw instance.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          '*/*':
            schema:
              $ref: '#/components/schemas/ClawInstance'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawInstance'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/instances/{id}/test-connectivity/:
    post:
      operationId: ai_mentor_orgs_claw_instances_test_connectivity_create
      description: 'Check connectivity to the Claw instance: TLS reachability + health
        check.'
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Claw instance.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ClawInstance'
          '*/*':
            schema:
              $ref: '#/components/schemas/ClawInstance'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawInstance'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/instances/{id}/usage/:
    get:
      operationId: ai_mentor_orgs_claw_instances_usage_retrieve
      description: |-
        Return per-tenant usage snapshot.

        Cost fields are stripped on managed instances so we don't expose
        our LLM-provider cost basis to the customer. Self-hosted instances
        return the full payload (the customer pays the LLM bill).
        Non-OpenClaw instances return 400 — IronClaw / NemoClaw don't
        expose the same usage RPCs.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Claw instance.
        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/ClawInstance'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/instances/{id}/usage/full/:
    get:
      operationId: ai_mentor_orgs_claw_instances_usage_full_retrieve
      description: |-
        Return unredacted usage snapshot — DM superadmin only.

        Always includes all cost fields regardless of provision_mode.
        Tenants do not see this surface; the tenant-facing
        ``/usage`` endpoint handles per-platform redaction.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Claw instance.
        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/ClawInstance'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/config/:
    get:
      operationId: ai_mentor_orgs_claw_instances_config_retrieve
      description: Returns the openclaw.json snapshot from the worker, with secret
        values replaced by the literal `__OPENCLAW_REDACTED__` sentinel. The `hash`
        field is the optimistic-concurrency token required by subsequent `PATCH config/`
        calls.
      summary: Fetch the OpenClaw config
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: server_pk
        schema:
          type: integer
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawConfigGetResponse'
          description: ''
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
        '504':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
    patch:
      operationId: ai_mentor_orgs_claw_instances_config_partial_update
      description: 'Deep-merges the supplied `patch` into the current openclaw.json.  Nulls
        delete keys, arrays replace wholesale.  Pass `__OPENCLAW_REDACTED__` at a
        secret path to leave the secret unchanged.  Rate limit: 3 writes / 60 s per
        deviceId+clientIp on the worker.'
      summary: Merge-patch the OpenClaw config
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: server_pk
        schema:
          type: integer
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedClawConfigPatchRequest'
            examples:
              SetWorkerMcpIdleTTL:
                value:
                  patch:
                    mcp:
                      sessionIdleTtlMs: 600000
                summary: Set worker mcp idle TTL
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedClawConfigPatchRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedClawConfigPatchRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedClawConfigPatchRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedClawConfigPatchRequest'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawConfigGetResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/cron-jobs/:
    get:
      operationId: ai_mentor_orgs_claw_instances_cron_jobs_list
      description: Manage scheduled cron jobs on a ClawInstance.
      summary: List cron jobs
      parameters:
      - in: query
        name: enabled
        schema:
          enum:
          - all
          - enabled
          - disabled
          type: string
          minLength: 1
        description: |-
          * `all` - all
          * `enabled` - enabled
          * `disabled` - disabled
      - in: query
        name: include_disabled
        schema:
          type: boolean
      - in: query
        name: limit
        schema:
          type: integer
          maximum: 200
          minimum: 1
      - in: query
        name: offset
        schema:
          type: integer
          minimum: 0
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: query
        schema:
          type: string
          minLength: 1
      - in: path
        name: server_pk
        schema:
          type: integer
        required: true
      - in: query
        name: sort_by
        schema:
          enum:
          - nextRunAtMs
          - updatedAtMs
          - name
          type: string
          minLength: 1
        description: |-
          * `nextRunAtMs` - nextRunAtMs
          * `updatedAtMs` - updatedAtMs
          * `name` - name
      - in: query
        name: sort_dir
        schema:
          enum:
          - asc
          - desc
          type: string
          default: desc
          minLength: 1
        description: |-
          * `asc` - asc
          * `desc` - desc
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CronJobListResponse'
          description: ''
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
    post:
      operationId: ai_mentor_orgs_claw_instances_cron_jobs_create
      description: 'Sends `cron.add` to the worker.  Required scope: `operator.admin`.  The
        worker echoes back the assigned `jobId`.'
      summary: Create a cron job
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: server_pk
        schema:
          type: integer
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CronJobCreate'
            examples:
              DailySummaryAt24hInterval:
                value:
                  name: Daily summary
                  agent_id: academic-advisor-agent
                  schedule:
                    kind: every
                    everyMs: 86400000
                  payload:
                    kind: agentTurn
                    message: Summarize the last 24h.
                  session_target: isolated
                  wake_mode: now
                  delete_after_run: false
                  delivery:
                    mode: announce
                    channel: last
                    to: '+233546882609'
                summary: Daily summary at 24h interval
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CronJobCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CronJobCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CronJobCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CronJobCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CronJobResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/cron-jobs/{job_id}/:
    put:
      operationId: ai_mentor_orgs_claw_instances_cron_jobs_update
      description: Manage scheduled cron jobs on a ClawInstance.
      parameters:
      - in: path
        name: job_id
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: server_pk
        schema:
          type: integer
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    patch:
      operationId: ai_mentor_orgs_claw_instances_cron_jobs_partial_update
      description: Forwards the body verbatim as `cron.update.params.patch`.
      summary: Patch a cron job
      parameters:
      - in: path
        name: job_id
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: server_pk
        schema:
          type: integer
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedCronJobPatch'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedCronJobPatch'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedCronJobPatch'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedCronJobPatch'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedCronJobPatch'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CronJobResponse'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
    delete:
      operationId: ai_mentor_orgs_claw_instances_cron_jobs_destroy
      description: Manage scheduled cron jobs on a ClawInstance.
      summary: Remove a cron job
      parameters:
      - in: path
        name: job_id
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: server_pk
        schema:
          type: integer
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/cron-jobs/{job_id}/run/:
    post:
      operationId: ai_mentor_orgs_claw_instances_cron_jobs_run_create
      description: Calls `cron.run` on the worker.  Mode `force` (default) runs unconditionally;
        `due` only runs if the schedule says it's due.
      summary: Trigger a cron job to run now
      parameters:
      - in: path
        name: job_id
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: server_pk
        schema:
          type: integer
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CronRunAction'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CronRunAction'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CronRunAction'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CronRunAction'
          '*/*':
            schema:
              $ref: '#/components/schemas/CronRunAction'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CronRunResult'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/cron-runs/:
    get:
      operationId: ai_mentor_orgs_claw_instances_cron_runs_retrieve
      description: '``GET /claw/instances/<pk>/cron-runs/`` — paginated run-log entries.'
      summary: List cron run history
      parameters:
      - in: query
        name: delivery_status
        schema:
          enum:
          - delivered
          - not-delivered
          - unknown
          - not-requested
          type: string
          minLength: 1
        description: |-
          * `delivered` - delivered
          * `not-delivered` - not-delivered
          * `unknown` - unknown
          * `not-requested` - not-requested
      - in: query
        name: job_id
        schema:
          type: string
          minLength: 1
      - in: query
        name: limit
        schema:
          type: integer
          maximum: 200
          minimum: 1
      - in: query
        name: offset
        schema:
          type: integer
          minimum: 0
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: query
        schema:
          type: string
          minLength: 1
      - in: query
        name: scope
        schema:
          enum:
          - job
          - all
          type: string
          minLength: 1
        description: |-
          * `job` - job
          * `all` - all
      - in: path
        name: server_pk
        schema:
          type: integer
        required: true
      - in: query
        name: sort_dir
        schema:
          enum:
          - asc
          - desc
          type: string
          default: desc
          minLength: 1
        description: |-
          * `asc` - asc
          * `desc` - desc
      - in: query
        name: status
        schema:
          enum:
          - all
          - ok
          - error
          - skipped
          type: string
          minLength: 1
        description: |-
          * `all` - all
          * `ok` - ok
          * `error` - error
          * `skipped` - skipped
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CronRunsResponse'
          description: ''
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/cron-status/:
    get:
      operationId: ai_mentor_orgs_claw_instances_cron_status_retrieve
      description: Returns the worker's `cron.status` summary.
      summary: Cron scheduler health
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: server_pk
        schema:
          type: integer
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CronStatusResponse'
          description: ''
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/mcp-servers/:
    get:
      operationId: ai_mentor_orgs_claw_instances_mcp_servers_list
      description: Reads `mcp.servers.*` from the worker config and returns each entry's
        name + config.  Secret values are surfaced as `__OPENCLAW_REDACTED__`.
      summary: List MCP servers configured on this ClawInstance
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: server_pk
        schema:
          type: integer
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/McpServerListResponse'
          description: ''
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
    post:
      operationId: ai_mentor_orgs_claw_instances_mcp_servers_create
      description: Inserts a new entry at `mcp.servers.<name>` and writes the full
        config back via `config.set` with the current `baseHash`.  Fails with 409
        if the name already exists.
      summary: Add a new MCP server
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: server_pk
        schema:
          type: integer
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/McpServerCreate'
            examples:
              AddApify2(StreamableHTTPTransport):
                value:
                  name: apify2
                  config:
                    url: https://mcp.apify.com
                    transport: streamable-http
                    headers:
                      Authorization: Bearer secret-token
                summary: Add apify2 (Streamable HTTP transport)
          application/scim+json:
            schema:
              $ref: '#/components/schemas/McpServerCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/McpServerCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/McpServerCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/McpServerCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpServerEntry'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/mcp-servers/{mcp_name}/:
    get:
      operationId: ai_mentor_orgs_claw_instances_mcp_servers_retrieve
      description: |-
        Manage MCP server entries on a ClawInstance.

        All operations round-trip the worker's config (read → modify → write
        with baseHash), so existing entries — including
        `__OPENCLAW_REDACTED__` secret placeholders — are preserved verbatim.
        The canonical config path is `mcp.servers.<name>`.
      summary: Retrieve a single MCP server
      parameters:
      - in: path
        name: mcp_name
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: server_pk
        schema:
          type: integer
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpServerEntry'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
    put:
      operationId: ai_mentor_orgs_claw_instances_mcp_servers_update
      description: |-
        Manage MCP server entries on a ClawInstance.

        All operations round-trip the worker's config (read → modify → write
        with baseHash), so existing entries — including
        `__OPENCLAW_REDACTED__` secret placeholders — are preserved verbatim.
        The canonical config path is `mcp.servers.<name>`.
      parameters:
      - in: path
        name: mcp_name
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: server_pk
        schema:
          type: integer
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    patch:
      operationId: ai_mentor_orgs_claw_instances_mcp_servers_partial_update
      description: Deep-merges the `config` patch into the existing entry, preserving
        fields the caller didn't supply — including redacted secret values.  Set `replace=true`
        for a full overwrite of the entry.
      summary: Update an MCP server (deep-merge by default)
      parameters:
      - in: path
        name: mcp_name
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: server_pk
        schema:
          type: integer
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedMcpServerUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedMcpServerUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMcpServerUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedMcpServerUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedMcpServerUpdate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpServerEntry'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
    delete:
      operationId: ai_mentor_orgs_claw_instances_mcp_servers_destroy
      description: |-
        Manage MCP server entries on a ClawInstance.

        All operations round-trip the worker's config (read → modify → write
        with baseHash), so existing entries — including
        `__OPENCLAW_REDACTED__` secret placeholders — are preserved verbatim.
        The canonical config path is `mcp.servers.<name>`.
      summary: Remove an MCP server entry
      parameters:
      - in: path
        name: mcp_name
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: server_pk
        schema:
          type: integer
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/instances/{server_pk}/wake/:
    post:
      operationId: ai_mentor_orgs_claw_instances_wake_create
      description: 'Sends the `wake` RPC.  `mode="now"` (default) injects immediately;
        `mode="next-heartbeat"` defers until the next heartbeat.  Required scope:
        `operator.write`.'
      summary: Inject a wake message into a session
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: server_pk
        schema:
          type: integer
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WakeRequest'
            examples:
              NudgeTheWorkerNow:
                value:
                  text: Check pending advisor tickets.
                  mode: now
                summary: Nudge the worker now
          application/scim+json:
            schema:
              $ref: '#/components/schemas/WakeRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/WakeRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WakeRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/WakeRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WakeResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawRpcError'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/model-providers/:
    get:
      operationId: ai_mentor_orgs_claw_model_providers_list
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: query
        name: enabled
        schema:
          type: boolean
      - 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
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: server
        schema:
          type: integer
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedClawModelProviderList'
          description: ''
    post:
      operationId: ai_mentor_orgs_claw_model_providers_create
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClawModelProvider'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ClawModelProvider'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClawModelProvider'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ClawModelProvider'
          '*/*':
            schema:
              $ref: '#/components/schemas/ClawModelProvider'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawModelProvider'
          description: ''
  /api/ai-mentor/orgs/{org}/claw/model-providers/{id}/:
    get:
      operationId: ai_mentor_orgs_claw_model_providers_retrieve
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Claw model provider.
        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/ClawModelProvider'
          description: ''
    put:
      operationId: ai_mentor_orgs_claw_model_providers_update
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Claw model provider.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClawModelProvider'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ClawModelProvider'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClawModelProvider'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ClawModelProvider'
          '*/*':
            schema:
              $ref: '#/components/schemas/ClawModelProvider'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawModelProvider'
          description: ''
    patch:
      operationId: ai_mentor_orgs_claw_model_providers_partial_update
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Claw model provider.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedClawModelProvider'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedClawModelProvider'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedClawModelProvider'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedClawModelProvider'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedClawModelProvider'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawModelProvider'
          description: ''
    delete:
      operationId: ai_mentor_orgs_claw_model_providers_destroy
      description: Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Claw model provider.
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/mentors/{mentor_id}/memory-categories/:
    get:
      operationId: ai_mentor_orgs_mentors_memory_categories_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/` (`mentor` → `agent`) and will be removed in a future release.

        List all active memory categories for a mentor.
      parameters:
      - in: path
        name: mentor_id
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
      deprecated: true
    post:
      operationId: ai_mentor_orgs_mentors_memory_categories_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/` (`mentor` → `agent`) and will be removed in a future release.

        Create a new memory category.
      parameters:
      - in: path
        name: mentor_id
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor_id}/memory-categories/{category_id}/:
    patch:
      operationId: ai_mentor_orgs_mentors_memory_categories_partial_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/{category_id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/{category_id}/` (`mentor` → `agent`) and will be removed in a future release.

        Update a memory category.
      parameters:
      - in: path
        name: category_id
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_id
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_mentors_memory_categories_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/{category_id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_id}/memory-categories/{category_id}/` (`mentor` → `agent`) and will be removed in a future release.

        Deactivate a memory category.
      parameters:
      - in: path
        name: category_id
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_id
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/agent-config/:
    get:
      operationId: ai_mentor_orgs_mentors_agent_config_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/agent-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/agent-config/` (`mentor` → `agent`) and will be removed in a future release.

        Singular AgentConfig nested under a mentor. GET + PATCH only.

        AgentConfig is auto-created by ClawMentorConfig.save(); if a mentor has
        never had a ClawMentorConfig, PATCH will create the AgentConfig on first
        write via get_or_create. DELETE is not supported (the row would be
        immediately recreated by a subsequent ClawMentorConfig.save).
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
      deprecated: true
    patch:
      operationId: ai_mentor_orgs_mentors_agent_config_partial_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/agent-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/agent-config/` (`mentor` → `agent`) and will be removed in a future release.

        Singular AgentConfig nested under a mentor. GET + PATCH only.

        AgentConfig is auto-created by ClawMentorConfig.save(); if a mentor has
        never had a ClawMentorConfig, PATCH will create the AgentConfig on first
        write via get_or_create. DELETE is not supported (the row would be
        immediately recreated by a subsequent ClawMentorConfig.save).
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/claw-config/:
    get:
      operationId: ai_mentor_orgs_mentors_claw_config_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` (`mentor` → `agent`) and will be removed in a future release.

        Singular ClawMentorConfig nested under a mentor.

        Supports GET/POST/PATCH/DELETE plus the push-config/ custom action.
        POST creates the (one and only) ClawMentorConfig for this mentor — the
        OneToOne(Mentor) constraint means a duplicate POST returns 400.
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        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/ClawMentorConfig'
          description: ''
      deprecated: true
    post:
      operationId: ai_mentor_orgs_mentors_claw_config_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` (`mentor` → `agent`) and will be removed in a future release.

        Singular ClawMentorConfig nested under a mentor.

        Supports GET/POST/PATCH/DELETE plus the push-config/ custom action.
        POST creates the (one and only) ClawMentorConfig for this mentor — the
        OneToOne(Mentor) constraint means a duplicate POST returns 400.
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawMentorConfig'
          description: ''
      deprecated: true
    put:
      operationId: ai_mentor_orgs_mentors_claw_config_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` (`mentor` → `agent`) and will be removed in a future release.

        Singular ClawMentorConfig nested under a mentor.

        Supports GET/POST/PATCH/DELETE plus the push-config/ custom action.
        POST creates the (one and only) ClawMentorConfig for this mentor — the
        OneToOne(Mentor) constraint means a duplicate POST returns 400.
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawMentorConfig'
          description: ''
      deprecated: true
    patch:
      operationId: ai_mentor_orgs_mentors_claw_config_partial_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` (`mentor` → `agent`) and will be removed in a future release.

        Singular ClawMentorConfig nested under a mentor.

        Supports GET/POST/PATCH/DELETE plus the push-config/ custom action.
        POST creates the (one and only) ClawMentorConfig for this mentor — the
        OneToOne(Mentor) constraint means a duplicate POST returns 400.
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedClawMentorConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedClawMentorConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedClawMentorConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedClawMentorConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedClawMentorConfig'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawMentorConfig'
          description: ''
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_mentors_claw_config_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/` (`mentor` → `agent`) and will be removed in a future release.

        Singular ClawMentorConfig nested under a mentor.

        Supports GET/POST/PATCH/DELETE plus the push-config/ custom action.
        POST creates the (one and only) ClawMentorConfig for this mentor — the
        OneToOne(Mentor) constraint means a duplicate POST returns 400.
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/claw-config/push-config/:
    post:
      operationId: ai_mentor_orgs_mentors_claw_config_push_config_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/push-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/claw-config/push-config/` (`mentor` → `agent`) and will be removed in a future release.

        Push agent_config to the Claw worker. RBAC enforced in initial().
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/ClawMentorConfig'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClawMentorConfig'
          description: ''
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-config/:
    get:
      operationId: ai_mentor_orgs_mentors_grader_config_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/` (`mentor` → `agent`) and will be removed in a future release.

        Return the mentor's grader configuration.
      summary: Retrieve mentor grader configuration
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        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/MentorGraderConfig'
          description: ''
        '403':
          description: Permission Denied
        '404':
          description: Mentor or grader config not found
      deprecated: true
    post:
      operationId: ai_mentor_orgs_mentors_grader_config_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/` (`mentor` → `agent`) and will be removed in a future release.

        Create the grader configuration for a mentor. Fails with 400 if a configuration already exists (the resource is 1:1 with the mentor). Criteria are added separately via the nested `criteria/` endpoints.
      summary: Create mentor grader configuration
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorGraderConfig'
          description: ''
        '400':
          description: Invalid data, or grader config already exists for this mentor
        '403':
          description: Permission Denied
        '404':
          description: Mentor not found
      deprecated: true
    put:
      operationId: ai_mentor_orgs_mentors_grader_config_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/` (`mentor` → `agent`) and will be removed in a future release.

        Replace all writable fields on the grader configuration.
      summary: Replace mentor grader configuration
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorGraderConfig'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorGraderConfig'
          description: ''
        '400':
          description: Invalid data
        '403':
          description: Permission Denied
        '404':
          description: Mentor or grader config not found
      deprecated: true
    patch:
      operationId: ai_mentor_orgs_mentors_grader_config_partial_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/` (`mentor` → `agent`) and will be removed in a future release.

        Update one or more writable fields on the grader configuration.
      summary: Partially update mentor grader configuration
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedMentorGraderConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedMentorGraderConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMentorGraderConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedMentorGraderConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedMentorGraderConfig'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorGraderConfig'
          description: ''
        '400':
          description: Invalid data
        '403':
          description: Permission Denied
        '404':
          description: Mentor or grader config not found
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-config/criteria/:
    get:
      operationId: ai_mentor_orgs_mentors_grader_config_criteria_list
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/` (`mentor` → `agent`) and will be removed in a future release.

        List the criteria attached to the mentor's grader configuration. Supports `search` against the criterion `name` field.
      summary: List grader criteria
      parameters:
      - name: limit
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - name: offset
        required: false
        in: query
        description: The initial index from which to return the results.
        schema:
          type: integer
      - in: path
        name: org
        schema:
          type: string
        required: true
      - name: search
        required: false
        in: query
        description: A search term.
        schema:
          type: string
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedGraderCriterionList'
          description: ''
        '403':
          description: Permission Denied
        '404':
          description: Mentor or grader config not found
      deprecated: true
    post:
      operationId: ai_mentor_orgs_mentors_grader_config_criteria_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/` (`mentor` → `agent`) and will be removed in a future release.

        Add a criterion to the mentor's grader configuration. `points` must be a positive float; the overall score is computed as earned points / total possible points (no sum-to-1 invariant).
      summary: Create grader criterion
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GraderCriterion'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/GraderCriterion'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/GraderCriterion'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/GraderCriterion'
          '*/*':
            schema:
              $ref: '#/components/schemas/GraderCriterion'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GraderCriterion'
          description: ''
        '400':
          description: Invalid data
        '403':
          description: Permission Denied
        '404':
          description: Mentor or grader config not found
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-config/criteria/{id}/:
    get:
      operationId: ai_mentor_orgs_mentors_grader_config_criteria_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/` (`mentor` → `agent`) and will be removed in a future release.

        Retrieve a single criterion by id.
      summary: Retrieve grader criterion
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        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/GraderCriterion'
          description: ''
        '403':
          description: Permission Denied
        '404':
          description: Mentor, grader config, or criterion not found
      deprecated: true
    put:
      operationId: ai_mentor_orgs_mentors_grader_config_criteria_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/` (`mentor` → `agent`) and will be removed in a future release.

        Replace all writable fields on a criterion.
      summary: Replace grader criterion
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GraderCriterion'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/GraderCriterion'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/GraderCriterion'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/GraderCriterion'
          '*/*':
            schema:
              $ref: '#/components/schemas/GraderCriterion'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GraderCriterion'
          description: ''
        '400':
          description: Invalid data
        '403':
          description: Permission Denied
        '404':
          description: Mentor, grader config, or criterion not found
      deprecated: true
    patch:
      operationId: ai_mentor_orgs_mentors_grader_config_criteria_partial_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/` (`mentor` → `agent`) and will be removed in a future release.

        Update one or more writable fields on a criterion.
      summary: Partially update grader criterion
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedGraderCriterion'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedGraderCriterion'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedGraderCriterion'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedGraderCriterion'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedGraderCriterion'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GraderCriterion'
          description: ''
        '400':
          description: Invalid data
        '403':
          description: Permission Denied
        '404':
          description: Mentor, grader config, or criterion not found
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_mentors_grader_config_criteria_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-config/criteria/{id}/` (`mentor` → `agent`) and will be removed in a future release.

        Delete a criterion. Refuses with 400 if it is the only remaining criterion on the config — a config with zero criteria cannot grade.
      summary: Delete grader criterion
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Criterion deleted
        '400':
          description: Cannot delete the last criterion — a grader config must have
            at least one
        '403':
          description: Permission Denied
        '404':
          description: Mentor, grader config, or criterion not found
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-results/:
    get:
      operationId: ai_mentor_orgs_mentors_grader_results_list
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-results/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-results/` (`mentor` → `agent`) and will be removed in a future release.

        List the grades this mentor has issued, most recent first. Filterable by `username`, `email` (both partial matches), `status`, `override_status`, and the `graded_at_after` / `graded_at_before` range; orderable by `graded_at`. The two status filters cover different failures: `?status=failed` finds grades whose original publish did not land, while `?override_status=failed` finds human overrides the LMS rejected, which are retried by repeating the PATCH.
      summary: List mentor grade results
      parameters:
      - in: query
        name: email
        schema:
          type: string
      - in: query
        name: graded_at_after
        schema:
          type: string
          format: date-time
      - in: query
        name: graded_at_before
        schema:
          type: string
          format: date-time
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        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
      - in: query
        name: override_status
        schema:
          type: string
          nullable: true
          enum:
          - failed
          - pending
          - published
        description: |-
          Whether the most recent override reached the LMS, including one that cleared the override — 'published' with a null override_score means the reset back to the AI score is what reached the LMS.

          * `pending` - Pending
          * `published` - Published
          * `failed` - Failed
      - 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: status
        schema:
          type: string
          enum:
          - failed
          - pending
          - published
        description: |-
          Whether the AI score reached the LMS.

          * `pending` - Pending
          * `published` - Published
          * `failed` - Failed
      - in: query
        name: username
        schema:
          type: string
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedGradeResultList'
          description: ''
        '403':
          description: Permission Denied
        '404':
          description: Mentor not found
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/grader-results/{id}/:
    get:
      operationId: ai_mentor_orgs_mentors_grader_results_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-results/{id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-results/{id}/` (`mentor` → `agent`) and will be removed in a future release.

        Return one grade, including its rubric and publish record.
      summary: Retrieve a grade result
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        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/GradeResultDetail'
          description: ''
        '403':
          description: Permission Denied
        '404':
          description: Mentor or grade not found
      deprecated: true
    patch:
      operationId: ai_mentor_orgs_mentors_grader_results_partial_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-results/{id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/grader-results/{id}/` (`mentor` → `agent`) and will be removed in a future release.

        Record a human override and push it to the LMS the grade came from. `override_points` is in rubric points (0 to `total_points`); null clears the override and restores the AI score. The override is recorded as `pending` before the push, then resolved to `published` or `failed`; either outcome is retried by repeating the request. A row left at `pending` means the request died mid-push and the LMS may or may not hold the score.
      summary: Override a grade result
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedGradeResultOverride'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedGradeResultOverride'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedGradeResultOverride'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedGradeResultOverride'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedGradeResultOverride'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GradeResultDetail'
          description: ''
        '400':
          description: Invalid data, or the grade has no rubric to score against
        '403':
          description: Permission Denied
        '404':
          description: Mentor or grade not found
        '502':
          description: The override was recorded but the LMS rejected it; `override_status`
            is `failed`
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/lti/grant-mentor-access/:
    post:
      operationId: ai_mentor_orgs_mentors_lti_grant_mentor_access_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/lti/grant-agent-access/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/lti/grant-agent-access/` (`mentor` → `agent`) and will be removed in a future release.

        Grants a user Student type access to a mentor that is lti accessible.

        Creates or updates an RBAC policy named LTI-{mentor.unique_id} with the global Student role,
        granting the specified user access to the mentor. Validates that the mentor has LTI access
        enabled and that the user belongs to the specified platform.
      summary: Grant LTI Mentor Access
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        description: Organization slug
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GrantMentorAccessRequest'
            examples:
              GrantAccessRequest:
                value:
                  user_id: 12345
                  mentor_unique_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                summary: Grant Access Request
          application/scim+json:
            schema:
              $ref: '#/components/schemas/GrantMentorAccessRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/GrantMentorAccessRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/GrantMentorAccessRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/GrantMentorAccessRequest'
        required: true
      responses:
        '201':
          description: Policy created and user granted access
        '204':
          description: User already has access, no changes made
        '400':
          description: Invalid request data
        '403':
          description: Mentor is not LTI accessible
        '404':
          description: Mentor, platform, or user not found
        '500':
          description: Global Student role not found
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/skills/:
    get:
      operationId: ai_mentor_orgs_mentors_skills_list
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/` (`mentor` → `agent`) and will be removed in a future release.

        Skill assignments nested under a mentor. Full CRUD.
      parameters:
      - in: query
        name: enabled
        schema:
          type: boolean
      - name: limit
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - name: offset
        required: false
        in: query
        description: The initial index from which to return the results.
        schema:
          type: integer
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedMentorSkillAssignmentList'
          description: ''
      deprecated: true
    post:
      operationId: ai_mentor_orgs_mentors_skills_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/` (`mentor` → `agent`) and will be removed in a future release.

        Skill assignments nested under a mentor. Full CRUD.
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSkillAssignment'
          description: ''
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/skills/{assignment_pk}/:
    get:
      operationId: ai_mentor_orgs_mentors_skills_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/` (`mentor` → `agent`) and will be removed in a future release.

        Skill assignments nested under a mentor. Full CRUD.
      parameters:
      - in: path
        name: assignment_pk
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        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/MentorSkillAssignment'
          description: ''
      deprecated: true
    put:
      operationId: ai_mentor_orgs_mentors_skills_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/` (`mentor` → `agent`) and will be removed in a future release.

        Skill assignments nested under a mentor. Full CRUD.
      parameters:
      - in: path
        name: assignment_pk
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
          '*/*':
            schema:
              $ref: '#/components/schemas/MentorSkillAssignment'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSkillAssignment'
          description: ''
      deprecated: true
    patch:
      operationId: ai_mentor_orgs_mentors_skills_partial_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/` (`mentor` → `agent`) and will be removed in a future release.

        Skill assignments nested under a mentor. Full CRUD.
      parameters:
      - in: path
        name: assignment_pk
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedMentorSkillAssignment'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedMentorSkillAssignment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMentorSkillAssignment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedMentorSkillAssignment'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedMentorSkillAssignment'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSkillAssignment'
          description: ''
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_mentors_skills_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/skills/{assignment_pk}/` (`mentor` → `agent`) and will be removed in a future release.

        Skill assignments nested under a mentor. Full CRUD.
      parameters:
      - in: path
        name: assignment_pk
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/spend-cap/:
    get:
      operationId: ai_mentor_orgs_mentors_spend_cap_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-cap/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-cap/` (`mentor` → `agent`) and will be removed in a future release.

        Retrieve the singleton agent-scoped spend cap for one mentor. The mentor is resolved tenant-scoped, so a cross-tenant unique_id 404s.
      summary: Get an agent spend cap
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        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/SpendCap'
          description: ''
        '403':
          description: Permission denied
        '404':
          description: Mentor or agent spend cap not found
      deprecated: true
    put:
      operationId: ai_mentor_orgs_mentors_spend_cap_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-cap/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-cap/` (`mentor` → `agent`) and will be removed in a future release.

        Upsert the singleton agent-scoped spend cap for one mentor. Returns 201 on first write and 200 on update.
      summary: Create or update an agent spend cap
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpendCap'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SpendCap'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SpendCap'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SpendCap'
          '*/*':
            schema:
              $ref: '#/components/schemas/SpendCap'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendCap'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendCap'
          description: ''
        '400':
          description: Validation error
        '403':
          description: Permission denied
        '404':
          description: Platform or mentor not found
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_mentors_spend_cap_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-cap/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-cap/` (`mentor` → `agent`) and will be removed in a future release.

        Remove the singleton agent-scoped spend cap for one mentor.
      summary: Delete an agent spend cap
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Deleted successfully
        '403':
          description: Permission denied
        '404':
          description: Agent spend cap not found
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/spend-caps/users/:
    get:
      operationId: ai_mentor_orgs_mentors_spend_caps_users_list
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/` (`mentor` → `agent`) and will be removed in a future release.

        List every explicit ``(user, agent)`` spend cap configured for one mentor. Individual caps are managed via the detail endpoint. Optionally filter by username and/or email.
      summary: List per-user caps for an agent
      parameters:
      - in: query
        name: email
        schema:
          type: string
        description: Optional case-insensitive exact email filter
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: username
        schema:
          type: string
        description: Optional exact username filter
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SpendCap'
          description: ''
        '403':
          description: Permission denied
        '404':
          description: Mentor not found
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor_unique_id}/spend-caps/users/{username}/:
    get:
      operationId: ai_mentor_orgs_mentors_spend_caps_users_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/{username}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/{username}/` (`mentor` → `agent`) and will be removed in a future release.

        Retrieve one explicit ``(user, agent)`` spend cap.
      summary: Get a per-user agent spend cap
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendCap'
          description: ''
        '403':
          description: Permission denied
        '404':
          description: User spend cap not found
      deprecated: true
    put:
      operationId: ai_mentor_orgs_mentors_spend_caps_users_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/{username}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/{username}/` (`mentor` → `agent`) and will be removed in a future release.

        Upsert one explicit ``(user, agent)`` spend cap. The username comes from the URL, not the body. Returns 201 on first write and 200 on update.
      summary: Create or update a per-user agent spend cap
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpendCap'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SpendCap'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SpendCap'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SpendCap'
          '*/*':
            schema:
              $ref: '#/components/schemas/SpendCap'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendCap'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendCap'
          description: ''
        '400':
          description: Validation error
        '403':
          description: Permission denied
        '404':
          description: Platform, mentor, or user not found
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_mentors_spend_caps_users_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/{username}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor_unique_id}/spend-caps/users/{username}/` (`mentor` → `agent`) and will be removed in a future release.

        Remove one explicit ``(user, agent)`` spend cap.
      summary: Delete a per-user agent spend cap
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Deleted successfully
        '403':
          description: Permission denied
        '404':
          description: User spend cap not found
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor}/email-inbox/:
    get:
      operationId: ai_mentor_orgs_mentors_email_inbox_list
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor}/email-inbox/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor}/email-inbox/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor}/email-inbox-summary/:
    get:
      operationId: ai_mentor_orgs_mentors_email_inbox_summary_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor}/email-inbox-summary/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor}/email-inbox-summary/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor}/email-inbox/{email_prompt_id}/:
    get:
      operationId: ai_mentor_orgs_mentors_email_inbox_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor}/email-inbox/{email_prompt_id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor}/email-inbox/{email_prompt_id}/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/{mentor}/link-course/:
    get:
      operationId: ai_mentor_orgs_mentors_link_course_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor}/link-course/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor}/link-course/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
    post:
      operationId: ai_mentor_orgs_mentors_link_course_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/{mentor}/link-course/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/{mentor}/link-course/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
  /api/ai-mentor/orgs/{org}/mentors/by-email/:
    post:
      operationId: ai_mentor_orgs_mentors_by_email_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/agents/by-email/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/agents/by-email/` (`mentor` → `agent`) and will be removed in a future release.

        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'
      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
      deprecated: true
  /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}/offline/agents/{mentor_unique_id}/config/:
    get:
      operationId: ai_mentor_orgs_offline_agents_config_retrieve
      description: |-
        Retrieve mentor configuration for offline use.

        Returns the same data as the mentor settings endpoint, including
        system_prompt, LLM config, safety/moderation settings, and UI settings.

        Args:
            request: The HTTP request.
            org: Organization/platform key.
            mentor_unique_id: The unique ID (UUID) of the mentor.

        Returns:
            Response: Full mentor settings data.
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        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/MentorSettings'
          description: ''
        '403':
          description: Offline mode not enabled
        '404':
          description: Mentor not found
  /api/ai-mentor/orgs/{org}/offline/agents/{mentor_unique_id}/datasets/:
    get:
      operationId: ai_mentor_orgs_offline_agents_datasets_list
      description: |-
        Retrieve paginated list of documents for offline use.

        Args:
            request: The HTTP request.
            org: Organization/platform key.
            mentor_unique_id: The unique ID (UUID) of the mentor.

        Query Parameters:
            limit: Number of results per page (default: 100, max: 500).
            offset: Number of results to skip.
            search: Optional search filter for document_name or url.

        Returns:
            Response: Paginated list of documents with S3 URLs.
      parameters:
      - in: query
        name: limit
        schema:
          type: integer
        description: 'Number of results per page (default: 100, max: 500)'
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: query
        name: offset
        schema:
          type: integer
        description: Number of results to skip for pagination
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: search
        schema:
          type: string
          minLength: 1
        description: Search query to filter documents by name or URL
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedOfflineDocumentList'
              examples:
                OfflineDatasetsResponse:
                  value:
                    count: 123
                    next: http://api.example.org/accounts/?offset=400&limit=100
                    previous: http://api.example.org/accounts/?offset=200&limit=100
                    results:
                    - count: 150
                      next: https://api.example.com/orgs/main/offline/mentors/uuid/datasets/?limit=100&offset=100
                      previous: null
                      results:
                      - id: 1
                        document_name: Introduction_to_AI.pdf
                        document_type: pdf
                        url: https://s3.amazonaws.com/.../Introduction_to_AI.pdf?...
                        tokens: 32150
                        is_trained: true
                        access: private
                        metadata: {}
                        last_trained_at: '2025-07-24T17:32:13.031Z'
                  summary: Offline Datasets Response
          description: ''
        '403':
          description: Offline mode not enabled
        '404':
          description: Mentor not found
  /api/ai-mentor/orgs/{org}/offline/mentors/{mentor_unique_id}/config/:
    get:
      operationId: ai_mentor_orgs_offline_mentors_config_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/offline/agents/{mentor_unique_id}/config/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/offline/agents/{mentor_unique_id}/config/` (`mentor` → `agent`) and will be removed in a future release.

        Retrieve mentor configuration for offline use.

        Returns the same data as the mentor settings endpoint, including
        system_prompt, LLM config, safety/moderation settings, and UI settings.

        Args:
            request: The HTTP request.
            org: Organization/platform key.
            mentor_unique_id: The unique ID (UUID) of the mentor.

        Returns:
            Response: Full mentor settings data.
      parameters:
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        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/MentorSettings'
          description: ''
        '403':
          description: Offline mode not enabled
        '404':
          description: Mentor not found
      deprecated: true
  /api/ai-mentor/orgs/{org}/offline/mentors/{mentor_unique_id}/datasets/:
    get:
      operationId: ai_mentor_orgs_offline_mentors_datasets_list
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/offline/agents/{mentor_unique_id}/datasets/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/offline/agents/{mentor_unique_id}/datasets/` (`mentor` → `agent`) and will be removed in a future release.

        Retrieve paginated list of documents for offline use.

        Args:
            request: The HTTP request.
            org: Organization/platform key.
            mentor_unique_id: The unique ID (UUID) of the mentor.

        Query Parameters:
            limit: Number of results per page (default: 100, max: 500).
            offset: Number of results to skip.
            search: Optional search filter for document_name or url.

        Returns:
            Response: Paginated list of documents with S3 URLs.
      parameters:
      - in: query
        name: limit
        schema:
          type: integer
        description: 'Number of results per page (default: 100, max: 500)'
      - in: path
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: query
        name: offset
        schema:
          type: integer
        description: Number of results to skip for pagination
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: search
        schema:
          type: string
          minLength: 1
        description: Search query to filter documents by name or URL
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedOfflineDocumentList'
              examples:
                OfflineDatasetsResponse:
                  value:
                    count: 123
                    next: http://api.example.org/accounts/?offset=400&limit=100
                    previous: http://api.example.org/accounts/?offset=200&limit=100
                    results:
                    - count: 150
                      next: https://api.example.com/orgs/main/offline/mentors/uuid/datasets/?limit=100&offset=100
                      previous: null
                      results:
                      - id: 1
                        document_name: Introduction_to_AI.pdf
                        document_type: pdf
                        url: https://s3.amazonaws.com/.../Introduction_to_AI.pdf?...
                        tokens: 32150
                        is_trained: true
                        access: private
                        metadata: {}
                        last_trained_at: '2025-07-24T17:32:13.031Z'
                  summary: Offline Datasets Response
          description: ''
        '403':
          description: Offline mode not enabled
        '404':
          description: Mentor not found
      deprecated: true
  /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.

        Session identity is derived from the request itself, never from user
        input: an authenticated caller is attributed via `request.user`
        (tenant-scoped to `org`), while an anonymous caller gets no student
        linkage and is only permitted on `allow_anonymous` mentors.

        Args:
            request: HTTP request containing mentor details.
            org: Organization key identifier.

        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
      security:
      - PlatformApiKeyAuthentication: []
      - {}
      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}/spend-caps/agents/:
    get:
      operationId: ai_mentor_orgs_spend_caps_agents_list
      description: List every agent-scoped spend cap configured for the platform.
        Each item includes mentor identity fields alongside the spend-cap settings
        and reconciled counters. Optionally filter to one mentor with the mentor's
        unique_id.
      summary: List agent spend caps
      parameters:
      - in: query
        name: mentor
        schema:
          type: string
        description: Optional mentor unique_id to filter the agent caps list
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SpendCap'
          description: ''
        '403':
          description: Permission denied
        '404':
          description: Mentor not found
  /api/ai-mentor/orgs/{org}/spend-caps/status/{user_id}/:
    get:
      operationId: ai_mentor_orgs_spend_caps_status_retrieve
      description: Read-only, learner-safe spend-cap status for ``user_id``. A non-admin
        member may read only their own status; an admin may read any user's. Only
        the coarse zone and fill percentage are returned — never raw spend or limit
        dollars. Pass ``?mentor=<unique_id>`` to include that agent's cap and the
        user's per-agent cap.
      summary: Get a user's spend-cap status
      parameters:
      - in: query
        name: mentor
        schema:
          type: string
        description: Optional mentor unique_id to include agent-scoped caps
      - 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/SpendCapStatusSummary'
          description: ''
        '400':
          description: mentor must be a valid unique_id
        '403':
          description: Permission denied
  /api/ai-mentor/orgs/{org}/spend-caps/tenant/:
    get:
      operationId: ai_mentor_orgs_spend_caps_tenant_retrieve
      description: Retrieve the singleton tenant-scoped spend cap for the platform.
        Requires an RBAC policy grant on the platform's spend caps.
      summary: Get the tenant spend cap
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendCap'
          description: ''
        '403':
          description: Permission denied
        '404':
          description: No tenant spend cap configured
    put:
      operationId: ai_mentor_orgs_spend_caps_tenant_update
      description: Upsert the singleton tenant-scoped spend cap. Returns 201 on first
        write and 200 on update. Spend counters are reconciled from ClickHouse and
        ignored if supplied in the body.
      summary: Create or update the tenant spend cap
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpendCap'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SpendCap'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SpendCap'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SpendCap'
          '*/*':
            schema:
              $ref: '#/components/schemas/SpendCap'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendCap'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendCap'
          description: ''
        '400':
          description: Validation error
        '403':
          description: Permission denied
        '404':
          description: Platform not found
    delete:
      operationId: ai_mentor_orgs_spend_caps_tenant_destroy
      description: Remove the singleton tenant-scoped spend cap for the platform.
      summary: Delete the tenant spend cap
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Deleted successfully
        '403':
          description: Permission denied
        '404':
          description: No tenant spend cap configured
  /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: is_featured
        schema:
          type: boolean
        description: Whether the mentor is featured or not
      - 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: query
        name: search
        schema:
          type: string
          maxLength: 255
        description: Search agents by name/description. Results are ranked so that
          exact and then prefix matches on name are returned first. Falls back to
          the `name` query param if not provided (undeclared here since `name` is
          also this viewset's URL lookup field, and declaring it would collide in
          the generated API schema/clients).
      - 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: is_featured
        schema:
          type: boolean
        description: Whether the mentor is featured or not
      - 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: query
        name: search
        schema:
          type: string
          maxLength: 255
        description: Search agents by name/description. Results are ranked so that
          exact and then prefix matches on name are returned first. Falls back to
          the `name` query param if not provided (undeclared here since `name` is
          also this viewset's URL lookup field, and declaring it would collide in
          the generated API schema/clients).
      - 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: is_featured
        schema:
          type: boolean
        description: Whether the mentor is featured or not
      - 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: query
        name: search
        schema:
          type: string
          maxLength: 255
        description: Search agents by name/description. Results are ranked so that
          exact and then prefix matches on name are returned first. Falls back to
          the `name` query param if not provided (undeclared here since `name` is
          also this viewset's URL lookup field, and declaring it would collide in
          the generated API schema/clients).
      - 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: is_featured
        schema:
          type: boolean
        description: Whether the mentor is featured or not
      - 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: query
        name: search
        schema:
          type: string
          maxLength: 255
        description: Search agents by name/description. Results are ranked so that
          exact and then prefix matches on name are returned first. Falls back to
          the `name` query param if not provided (undeclared here since `name` is
          also this viewset's URL lookup field, and declaring it would collide in
          the generated API schema/clients).
      - 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: is_featured
        schema:
          type: boolean
        description: Whether the mentor is featured or not
      - 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: query
        name: search
        schema:
          type: string
          maxLength: 255
        description: Search agents by name/description. Results are ranked so that
          exact and then prefix matches on name are returned first. Falls back to
          the `name` query param if not provided (undeclared here since `name` is
          also this viewset's URL lookup field, and declaring it would collide in
          the generated API schema/clients).
      - 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: is_featured
        schema:
          type: boolean
        description: Whether the mentor is featured or not
      - 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: query
        name: search
        schema:
          type: string
          maxLength: 255
        description: Search agents by name/description. Results are ranked so that
          exact and then prefix matches on name are returned first. Falls back to
          the `name` query param if not provided (undeclared here since `name` is
          also this viewset's URL lookup field, and declaring it would collide in
          the generated API schema/clients).
      - 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}/agent-feedback/{feedback_id}/:
    get:
      operationId: ai_mentor_orgs_users_agent_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.
            Forbidden: If the user doesn't have permission to access this feedback.
      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
      security:
      - PlatformApiKeyAuthentication: []
      - {}
      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_agent_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.
            Forbidden: If the user doesn't have permission to update this feedback.
            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
      security:
      - PlatformApiKeyAuthentication: []
      - {}
      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}/agent-feedback/create/:
    post:
      operationId: ai_mentor_orgs_users_agent_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.
            Forbidden: If the user doesn't have permission to create this feedback.
      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
      security:
      - PlatformApiKeyAuthentication: []
      - {}
      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}/agent-llms/:
    get:
      operationId: ai_mentor_orgs_users_agent_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}/agent-memories/:
    get:
      operationId: ai_mentor_orgs_users_agent_memories_retrieve
      description: List all mentor-specific memories for a user.
      parameters:
      - in: query
        name: email
        schema:
          type: string
        description: Filter by user email (admin only)
      - in: query
        name: end_date
        schema:
          type: string
        description: Filter memories created before this ISO date
      - in: query
        name: mentor
        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: Filter memories created after this ISO date
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      - in: query
        name: user_id
        schema:
          type: string
        description: Filter by user_id (admin only)
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/agent-tools/:
    get:
      operationId: ai_mentor_orgs_users_agent_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}/agent-types/:
    get:
      operationId: ai_mentor_orgs_users_agent_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}/agent-with-settings/:
    post:
      operationId: ai_mentor_orgs_users_agent_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: ''
    put:
      operationId: ai_mentor_orgs_users_agent_with_settings_update
      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/MentorFromTemplate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorFromTemplate'
          application/json:
            schema:
              $ref: '#/components/schemas/MentorFromTemplate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorFromTemplate'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_agent_with_settings_partial_update
      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/PatchedMentorFromTemplate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMentorFromTemplate'
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedMentorFromTemplate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorFromTemplate'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_agent_with_settings_destroy
      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
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/agent/audience/:
    get:
      operationId: ai_mentor_orgs_users_agent_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_agent_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_agent_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.
        '404':
          description: Not Found - Audience does not exist.
        '401':
          description: Unauthorized - Only tenant admins can delete mentor audiences.
  /api/ai-mentor/orgs/{org}/users/{user_id}/agent/categories/:
    get:
      operationId: ai_mentor_orgs_users_agent_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_agent_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_agent_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}/agent/seed/:
    get:
      operationId: ai_mentor_orgs_users_agent_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
    post:
      operationId: ai_mentor_orgs_users_agent_seed_create
      description: |-
        API view for seeding mentors in a tenant.

        This view allows platform administrators to seed initial mentors
        in a tenant from predefined templates.

        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/SeedMentorsView'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SeedMentorsView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SeedMentorsView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SeedMentorsView'
          '*/*':
            schema:
              $ref: '#/components/schemas/SeedMentorsView'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedMentorsView'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_agent_seed_update
      description: |-
        API view for seeding mentors in a tenant.

        This view allows platform administrators to seed initial mentors
        in a tenant from predefined templates.

        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/SeedMentorsView'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SeedMentorsView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SeedMentorsView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SeedMentorsView'
          '*/*':
            schema:
              $ref: '#/components/schemas/SeedMentorsView'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedMentorsView'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_agent_seed_partial_update
      description: |-
        API view for seeding mentors in a tenant.

        This view allows platform administrators to seed initial mentors
        in a tenant from predefined templates.

        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/PatchedSeedMentorsView'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedSeedMentorsView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedSeedMentorsView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedSeedMentorsView'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedSeedMentorsView'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedMentorsView'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_agent_seed_destroy
      description: |-
        API view for seeding mentors in a tenant.

        This view allows platform administrators to seed initial mentors
        in a tenant from predefined templates.

        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
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/:
    get:
      operationId: ai_mentor_orgs_users_agents_agent_memories_retrieve
      description: List mentor-specific memories grouped by category.
      parameters:
      - in: query
        name: email
        schema:
          type: string
        description: Filter by user email (ignored when my_memory=true)
      - in: query
        name: end_date
        schema:
          type: string
        description: Filter memories created before this ISO date
      - in: path
        name: mentor_id
        schema:
          type: string
        required: true
      - in: query
        name: my_memory
        schema:
          type: boolean
        description: If true, returns only the authenticated user's memories (skips
          RBAC and user_id filter)
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: start_date
        schema:
          type: string
        description: Filter memories created after this ISO date
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      - in: query
        name: user_id
        schema:
          type: string
        description: Filter by user_id (ignored when my_memory=true)
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    post:
      operationId: ai_mentor_orgs_users_agents_agent_memories_create
      description: Create a new mentor-specific memory.
      parameters:
      - in: path
        name: mentor_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: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories-list/:
    get:
      operationId: ai_mentor_orgs_users_agents_agent_memories_list_retrieve
      description: List mentor-specific memories with pagination.
      parameters:
      - in: query
        name: category
        schema:
          type: string
        description: Filter by category slug
      - in: query
        name: email
        schema:
          type: string
        description: Filter by user email (ignored when my_memory=true)
      - in: query
        name: end_date
        schema:
          type: string
        description: Filter memories created before this ISO date
      - in: path
        name: mentor_id
        schema:
          type: string
        required: true
      - in: query
        name: my_memory
        schema:
          type: boolean
        description: If true, returns only the authenticated user's memories (skips
          RBAC and user_id filter)
      - 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 results per page (max 100)
      - in: query
        name: start_date
        schema:
          type: string
        description: Filter memories created after this ISO date
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      - in: query
        name: user_id
        schema:
          type: string
        description: Filter by user_id (ignored when my_memory=true)
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/{memory_id}/:
    patch:
      operationId: ai_mentor_orgs_users_agents_agent_memories_partial_update
      description: Update a mentor-specific memory (RBAC ownership-aware).
      parameters:
      - in: path
        name: memory_id
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_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: No response body
    delete:
      operationId: ai_mentor_orgs_users_agents_agent_memories_destroy
      description: Delete a mentor-specific memory (RBAC ownership-aware).
      parameters:
      - in: path
        name: memory_id
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_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:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/:
    get:
      operationId: ai_mentor_orgs_users_agents_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_prompt_caching: false
                    enable_openai_assistant: false
                    enable_total_grounding: false
                    guided_prompt_instructions: you are...
                    enable_guided_prompts: true
                    save_flagged_prompts: true
                    is_featured: 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}/agents/{mentor}/agent-eval/:
    get:
      operationId: ai_mentor_orgs_users_agents_agent_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}}.\n\n The sample answer to the question\
                      \ is {{sample_answer}} \n\n The answer you are evaluating is\
                      \ {{mentor_answer}}. \n\n 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_agents_agent_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}}.\n\n The sample answer to the question\
                      \ is {{sample_answer}} \n\n The answer you are evaluating is\
                      \ {{mentor_answer}}. \n\n 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}/agents/{mentor}/agent-eval-execution/:
    post:
      operationId: ai_mentor_orgs_users_agents_agent_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}/agents/{mentor}/agent-user-settings/:
    get:
      operationId: ai_mentor_orgs_users_agents_agent_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_agents_agent_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: ''
    put:
      operationId: ai_mentor_orgs_users_agents_agent_user_settings_update
      description: |-
        Mixin to set the auditlog actor context for DRF views.

        For Django auth.User (admin users): Uses auditlog's native actor FK.
        For edX users (AuthStudent): Sets edx_actor FK on DMAuditLogEntry.

        IMPORTANT: This mixin only works for views that DO NOT override the
        HTTP/action methods (post, put, patch, delete, create, update, partial_update,
        destroy). For views that define their own methods, use the @with_auditlog_actor
        decorator on those methods instead.
      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':
          description: No response body
    patch:
      operationId: ai_mentor_orgs_users_agents_agent_user_settings_partial_update
      description: |-
        Mixin to set the auditlog actor context for DRF views.

        For Django auth.User (admin users): Uses auditlog's native actor FK.
        For edX users (AuthStudent): Sets edx_actor FK on DMAuditLogEntry.

        IMPORTANT: This mixin only works for views that DO NOT override the
        HTTP/action methods (post, put, patch, delete, create, update, partial_update,
        destroy). For views that define their own methods, use the @with_auditlog_actor
        decorator on those methods instead.
      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':
          description: No response body
    delete:
      operationId: ai_mentor_orgs_users_agents_agent_user_settings_destroy
      description: |-
        Mixin to set the auditlog actor context for DRF views.

        For Django auth.User (admin users): Uses auditlog's native actor FK.
        For edX users (AuthStudent): Sets edx_actor FK on DMAuditLogEntry.

        IMPORTANT: This mixin only works for views that DO NOT override the
        HTTP/action methods (post, put, patch, delete, create, update, partial_update,
        destroy). For views that define their own methods, use the @with_auditlog_actor
        decorator on those methods instead.
      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}/agents/{mentor}/available-tools/:
    get:
      operationId: ai_mentor_orgs_users_agents_available_tools_list
      description: Retrieve tools available for a particular mentor. The 'is_allowed'
        field indicates whether the tool is compatible with the mentor's current LLM
        configuration.
      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
                      is_allowed: true
                      category:
                        id: 1
                        name: Category 1
                        description: description
                    - id: 2
                      name: Trained Documents
                      slug: trained-documents
                      metadata: null
                      is_allowed: true
                      category:
                        id: 2
                        name: Category 2
                        description: description
                    - id: 3
                      name: Image Generation
                      slug: image-generation
                      metadata: null
                      is_allowed: false
                      category:
                        id: 1
                        name: Category 1
                        description: description
                  summary: List of tools
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/create-call-credentials/:
    post:
      operationId: ai_mentor_orgs_users_agents_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}/agents/{mentor}/current-memory/:
    get:
      operationId: ai_mentor_orgs_users_agents_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_agents_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}/agents/{mentor}/custom-voice/:
    get:
      operationId: ai_mentor_orgs_users_agents_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_agents_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}/agents/{mentor}/custom-voice-tts/:
    post:
      operationId: ai_mentor_orgs_users_agents_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}/agents/{mentor}/default/:
    get:
      operationId: ai_mentor_orgs_users_agents_default_retrieve
      description: |-
        Retrieve the user's default mentor for this tenant.

        Returns ``null`` when the user has not set a default mentor.
      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/UserDefaultMentor'
          description: ''
        '404':
          description: Student or platform not found
    put:
      operationId: ai_mentor_orgs_users_agents_default_update
      description: |-
        Set (or replace) the user's default mentor for this tenant.

        The unique (student, platform) constraint guarantees at most one
        default mentor per user per tenant; setting a new one replaces any
        existing default.
      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/UserDefaultMentor'
          description: ''
        '404':
          description: Mentor, student or platform not found
    delete:
      operationId: ai_mentor_orgs_users_agents_default_destroy
      description: |-
        Clear the user's default mentor for this tenant.

        Idempotent: returns 204 whether or not a default was set.
      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: Default mentor cleared
        '404':
          description: Student or platform not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/edit-scenarios/:
    put:
      operationId: ai_mentor_orgs_users_agents_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}/agents/{mentor}/fork/:
    post:
      operationId: ai_mentor_orgs_users_agents_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
    put:
      operationId: ai_mentor_orgs_users_agents_fork_update
      description: |-
        API view for forking (cloning) a mentor.

        This view allows users to create a copy of an existing mentor
        with its settings and configurations.

        Permissions:
            - Restricted to tenant admins and the student themselves
      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':
          description: No response body
    patch:
      operationId: ai_mentor_orgs_users_agents_fork_partial_update
      description: |-
        API view for forking (cloning) a mentor.

        This view allows users to create a copy of an existing mentor
        with its settings and configurations.

        Permissions:
            - Restricted to tenant admins and the student themselves
      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':
          description: No response body
    delete:
      operationId: ai_mentor_orgs_users_agents_fork_destroy
      description: |-
        API view for forking (cloning) a mentor.

        This view allows users to create a copy of an existing mentor
        with its settings and configurations.

        Permissions:
            - Restricted to tenant admins and the student themselves
      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}/agents/{mentor}/historical-memory/:
    get:
      operationId: ai_mentor_orgs_users_agents_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}/agents/{mentor}/memory-progress/:
    get:
      operationId: ai_mentor_orgs_users_agents_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}/agents/{mentor}/memory-settings/:
    get:
      operationId: ai_mentor_orgs_users_agents_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_agents_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}/agents/{mentor}/public-settings/:
    get:
      operationId: ai_mentor_orgs_users_agents_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}/agents/{mentor}/public-sharable-link/:
    get:
      operationId: ai_mentor_orgs_users_agents_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}/agents/{mentor}/reports/{report_id}/agent-eval-report/:
    get:
      operationId: ai_mentor_orgs_users_agents_reports_agent_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}/agents/{mentor}/scenarios/:
    get:
      operationId: ai_mentor_orgs_users_agents_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}/agents/{mentor}/settings/:
    get:
      operationId: ai_mentor_orgs_users_agents_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
    post:
      operationId: ai_mentor_orgs_users_agents_settings_create
      description: |-
        API view to retrieve and update mentor settings.

        Permissions:
            - Only accessible to tenant admins.
      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/MentorSettings'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorSettings'
          application/json:
            schema:
              $ref: '#/components/schemas/MentorSettings'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSettings'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_agents_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
    patch:
      operationId: ai_mentor_orgs_users_agents_settings_partial_update
      description: |-
        API view to retrieve and update mentor settings.

        Permissions:
            - Only accessible to tenant admins.
      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/PatchedMentorSettings'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMentorSettings'
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedMentorSettings'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSettings'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_agents_settings_destroy
      description: |-
        API view to retrieve and update mentor settings.

        Permissions:
            - Only accessible to tenant admins.
      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:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link:
    get:
      operationId: ai_mentor_orgs_users_agents_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_agents_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_agents_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_agents_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}/agents/{mentor}/shared-prompt/:
    get:
      operationId: ai_mentor_orgs_users_agents_shared_prompt_retrieve
      description: |-
        Share one mentor's system prompt with mentors in any tenant.

        The mentor in the URL is the **source**: its own `system_prompt` field is
        the shared prompt, so there is no separate copy to keep in sync. Targets
        resolve to it at chat time and keep their own prompt untouched, which is
        what makes unsharing a clean restore.

        Permissions:
            - The caller must be a platform admin of the source tenant *and* of
              every tenant named in the request. Unlike forking, there is no
              carve-out for the `main` platform.
      summary: List mentors sharing this mentor's system 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
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SharedSystemPromptResponse'
          description: ''
        '404':
          description: Mentor not found
    post:
      operationId: ai_mentor_orgs_users_agents_shared_prompt_create
      description: 'Adds targets to the source mentor''s sharing list. Idempotent:
        a target already consuming this source is left as-is. Requires at least one
        target.'
      summary: Share this mentor's system prompt with more mentors
      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/SharedSystemPromptRequest'
            examples:
              ShareWithTwoTenants:
                value:
                  targets:
                  - platform_key: tenant-b
                    mentor: support-agent
                  - platform_key: tenant-c
                    mentor: support-agent
                summary: Share with two tenants
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SharedSystemPromptRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SharedSystemPromptRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SharedSystemPromptRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/SharedSystemPromptRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SharedSystemPromptResponse'
          description: ''
        '400':
          description: Invalid target or share would chain
        '403':
          description: Not a platform admin of every tenant
        '404':
          description: Mentor or target not found
    put:
      operationId: ai_mentor_orgs_users_agents_shared_prompt_update
      description: |-
        Share one mentor's system prompt with mentors in any tenant.

        The mentor in the URL is the **source**: its own `system_prompt` field is
        the shared prompt, so there is no separate copy to keep in sync. Targets
        resolve to it at chat time and keep their own prompt untouched, which is
        what makes unsharing a clean restore.

        Permissions:
            - The caller must be a platform admin of the source tenant *and* of
              every tenant named in the request. Unlike forking, there is no
              carve-out for the `main` platform.
      summary: Replace the set of mentors sharing this system 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/SharedSystemPromptRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SharedSystemPromptRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SharedSystemPromptRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SharedSystemPromptRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/SharedSystemPromptRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SharedSystemPromptResponse'
          description: ''
        '400':
          description: Invalid target or share would chain
        '403':
          description: Not a platform admin of every tenant
    patch:
      operationId: ai_mentor_orgs_users_agents_shared_prompt_partial_update
      description: |-
        Share one mentor's system prompt with mentors in any tenant.

        The mentor in the URL is the **source**: its own `system_prompt` field is
        the shared prompt, so there is no separate copy to keep in sync. Targets
        resolve to it at chat time and keep their own prompt untouched, which is
        what makes unsharing a clean restore.

        Permissions:
            - The caller must be a platform admin of the source tenant *and* of
              every tenant named in the request. Unlike forking, there is no
              carve-out for the `main` platform.
      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':
          description: No response body
    delete:
      operationId: ai_mentor_orgs_users_agents_shared_prompt_destroy
      description: Removes the named targets from the sharing list. Omit `targets`
        to remove every consumer. Each unshared mentor goes back to its own preserved
        system prompt.
      summary: Stop sharing this mentor's system 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
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SharedSystemPromptResponse'
          description: ''
        '403':
          description: Not a platform admin of every tenant
  /api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/spaced-repetition-question-stats/:
    get:
      operationId: ai_mentor_orgs_users_agents_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}/agents/{mentor}/spaced-repetition-recommended-paths/:
    get:
      operationId: ai_mentor_orgs_users_agents_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_agents_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}/agents/{mentor}/star/:
    get:
      operationId: ai_mentor_orgs_users_agents_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_agents_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}/agents/{mentor}/summaries/{summary_type}/:
    get:
      operationId: ai_mentor_orgs_users_agents_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}/agents/{mentor}/unstar/:
    post:
      operationId: ai_mentor_orgs_users_agents_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}/agents/audit-logs/:
    get:
      operationId: ai_mentor_orgs_users_agents_audit_logs_list
      description: Retrieve audit log entries for mentor-related models (Mentor, MentorSettings,
        Prompt, DocumentEmbedding) within a specific organization. Mentor owners can
        access audit logs for their own mentors when filtering by mentor. Supports
        filtering by mentor, action type, actor, and date range.
      summary: List Mentor Audit Logs
      parameters:
      - in: query
        name: action
        schema:
          type: integer
          enum:
          - 0
          - 1
          - 2
        description: 'Filter by action type: 0=create, 1=update, 2=delete'
      - in: query
        name: actor_email
        schema:
          type: string
        description: Filter by actor's email
      - in: query
        name: actor_username
        schema:
          type: string
        description: Filter by actor's username
      - in: query
        name: from_date
        schema:
          type: string
        description: Inclusive lower bound on timestamp (ISO8601 date, e.g., 2024-01-01)
      - name: limit
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      - in: query
        name: mentor
        schema:
          type: string
        description: Filter by mentor unique_id
      - name: offset
        required: false
        in: query
        description: The initial index from which to return the results.
        schema:
          type: integer
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: to_date
        schema:
          type: string
        description: Inclusive upper bound on timestamp (ISO8601 date, e.g., 2024-12-31)
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedMentorAuditLogEntryList'
              examples:
                AuditLogResponseExample:
                  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: 123
                        timestamp: '2024-03-15T10:30:00Z'
                        actor_username: johndoe
                        actor_email: johndoe@example.com
                        action: update
                        resource_type: mentor
                        resource_id: '506'
                        resource_repr: mentorAI - main
                        changes:
                          enable_moderation:
                          - 'False'
                          - 'True'
                          enable_safety_system:
                          - 'False'
                          - 'True'
                  summary: Audit Log Response Example
          description: ''
        '401':
          description: Authentication required
        '403':
          description: Not a platform administrator
  /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: 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
    post:
      operationId: ai_mentor_orgs_users_artifacts_create
      description: Artifacts cannot be created via API. They are created by LLMs via
        chat messages.
      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/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:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Artifact'
          description: ''
  /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
                    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
                    current_version_number: 2
                    version_count: 3
                  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 session 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}/artifacts/{id}/versions/:
    get:
      operationId: ai_mentor_orgs_users_artifacts_versions_list
      description: Retrieve all versions for a specific artifact.
      summary: List artifact versions
      parameters:
      - in: query
        name: file_extension
        schema:
          type: string
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this artifact.
        required: true
      - in: query
        name: llm_name
        schema:
          type: string
      - in: query
        name: llm_provider
        schema:
          type: string
      - 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
      - name: search
        required: false
        in: query
        description: A search term.
        schema:
          type: string
      - in: query
        name: session_id
        schema:
          type: string
          format: 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/PaginatedArtifactVersionList'
              examples:
                ArtifactVersionsListResponse:
                  value:
                    count: 123
                    next: http://api.example.org/accounts/?page=4
                    previous: http://api.example.org/accounts/?page=2
                    results:
                    - - id: 3
                        artifact:
                          id: 1
                          title: Python Calculator
                          content: ''
                          binary_content: null
                          is_binary: false
                          file_extension: py
                          llm_name: gpt-4
                          llm_provider: openai
                          date_created: '2024-01-15T10:30:00Z'
                          date_updated: '2024-01-15T11:00:00Z'
                          metadata: {}
                          username: johndoe
                          session_id: 550e8400-e29b-41d4-a716-446655440000
                          current_version_number: 2
                          version_count: 2
                        title: Python Calculator
                        content: |-
                          def add(a, b):
                              return a + b

                          def subtract(a, b):
                              return a - b
                        session_id: 550e8400-e29b-41d4-a716-446655440000
                        content_length: 68
                        is_current: true
                        chat_message: null
                        version_number: 2
                        date_created: '2024-01-15T11:00:00Z'
                        created_by: llm
                        change_summary: Added subtract function
                  summary: Artifact Versions List Response
          description: ''
        '404':
          description: Artifact not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/artifacts/{id}/versions/{version_id}/:
    get:
      operationId: ai_mentor_orgs_users_artifacts_versions_retrieve
      description: Retrieve a specific version of an artifact by version ID.
      summary: Get specific artifact version
      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
      - in: path
        name: version_id
        schema:
          type: integer
        description: ID of the version to retrieve
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArtifactVersion'
              examples:
                ArtifactVersionDetailResponse:
                  value:
                    id: 3
                    artifact:
                      id: 1
                      title: Python Calculator
                      content: ''
                      binary_content: null
                      is_binary: false
                      file_extension: py
                      llm_name: gpt-4
                      llm_provider: openai
                      date_created: '2024-01-15T10:30:00Z'
                      date_updated: '2024-01-15T11:00:00Z'
                      metadata: {}
                      username: johndoe
                      session_id: 550e8400-e29b-41d4-a716-446655440000
                      current_version_number: 2
                      version_count: 2
                    title: Python Calculator
                    content: |-
                      def add(a, b):
                          return a + b

                      def subtract(a, b):
                          return a - b
                    session_id: 550e8400-e29b-41d4-a716-446655440000
                    content_length: 68
                    is_current: true
                    chat_message: null
                    version_number: 2
                    date_created: '2024-01-15T11:00:00Z'
                    created_by: llm
                    change_summary: Added subtract function
                  summary: Artifact Version Detail Response
          description: ''
        '404':
          description: Version not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/artifacts/{id}/versions/set-current/:
    post:
      operationId: ai_mentor_orgs_users_artifacts_versions_set_current_create
      description: Mark a specific version as the current/active version for an artifact.
      summary: Set artifact version as current
      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/SetCurrentVersionRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SetCurrentVersionRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SetCurrentVersionRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SetCurrentVersionRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/SetCurrentVersionRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArtifactVersion'
          description: ''
        '400':
          description: Invalid request
        '404':
          description: Version 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-agents/:
    get:
      operationId: ai_mentor_orgs_users_available_template_agents_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}/available-template-mentors/:
    get:
      operationId: ai_mentor_orgs_users_available_template_mentors_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/available-template-agents/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/available-template-agents/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
  /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}/chat-messages/{chat_message_id}/tts/:
    get:
      operationId: ai_mentor_orgs_users_chat_messages_tts_retrieve
      description: Converts the text content of a chat message into MP3 audio using
        the mentor's configured TTS provider (openai or google).
      summary: Synthesize chat message audio
      parameters:
      - in: path
        name: chat_message_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:
                type: string
                format: binary
          description: MP3 audio bytes
        '400':
          description: Empty content or synthesis failure
        '403':
          description: User cannot access this message
        '404':
          description: Chat message not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/chat-run-trackers/:
    get:
      operationId: ai_mentor_orgs_users_chat_run_trackers_list
      description: |-
        Read-only endpoint for viewing chat run tracking data.

        Provides per-request telemetry for chat interactions including timing
        breakdowns, LLM provider info, fallback usage, and failure categories.

        Results are scoped to the platform (org) from the URL and ordered by
        most recent first by default.
      parameters:
      - in: query
        name: end_time
        schema:
          type: string
          format: date-time
      - in: query
        name: failure_category
        schema:
          type: string
          enum:
          - authentication_error
          - authorization_error
          - content_filter
          - input_too_large
          - llm_error
          - moderation_block
          - payment_error
          - privacy_block
          - safety_block
          - timeout
          - unknown
          - validation_error
        description: |-
          * `llm_error` - Llm Error
          * `moderation_block` - Moderation Block
          * `safety_block` - Safety Block
          * `privacy_block` - Privacy Block
          * `authentication_error` - Authentication Error
          * `authorization_error` - Authorization Error
          * `payment_error` - Payment Error
          * `validation_error` - Validation Error
          * `content_filter` - Content Filter
          * `input_too_large` - Input Too Large
          * `timeout` - Timeout
          * `unknown` - Unknown
      - in: query
        name: mentor
        schema:
          type: string
      - in: query
        name: modality
        schema:
          type: string
          enum:
          - multimodal
          - text
          - voice
        description: |-
          * `text` - Text
          * `multimodal` - Multimodal
          * `voice` - Voice
      - 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: start_time
        schema:
          type: string
          format: date-time
      - in: query
        name: status
        schema:
          type: string
          enum:
          - completed
          - failed
          - started
        description: |-
          * `started` - Started
          * `completed` - Completed
          * `failed` - Failed
      - in: query
        name: used_fallback
        schema:
          type: boolean
      - 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/PaginatedChatRunTrackerList'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/chat-run-trackers/{id}/:
    get:
      operationId: ai_mentor_orgs_users_chat_run_trackers_retrieve
      description: |-
        Read-only endpoint for viewing chat run tracking data.

        Provides per-request telemetry for chat interactions including timing
        breakdowns, LLM provider info, fallback usage, and failure categories.

        Results are scoped to the platform (org) from the URL and ordered by
        most recent first by default.
      parameters:
      - in: path
        name: id
        schema:
          type: string
        description: A unique value identifying this chat run tracker.
        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/ChatRunTracker'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/chat/files/upload-url/:
    post:
      operationId: ai_mentor_orgs_users_chat_files_upload_url_create
      description: Generate presigned S3 upload URL for chat file
      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/FileUploadURLRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/FileUploadURLRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/FileUploadURLRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FileUploadURLRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/FileUploadURLRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileUploadURLResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                description: Invalid request
          description: ''
        '401':
          content:
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '403':
          content:
            application/json:
              schema:
                description: Forbidden - session access denied
          description: ''
  /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'
              examples:
                CancelCourseCreationResponse:
                  value:
                    id: 1
                    name: Introduction to Python
                    status: Cancelled
                  summary: Cancel Course Creation Response
          description: ''
        '400':
          description: Task is not in a cancellable state
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation-tasks/{id}/create-course/:
    post:
      operationId: ai_mentor_orgs_users_course_creation_tasks_create_course_create
      description: |-
        Create a blank course on EdX and trigger background settings update.

        Creates the course on EdX synchronously. If successful, schedules a
        background task to generate and apply course settings and images via AI.

        Returns immediately after course creation — settings/images are applied
        asynchronously.
      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:
        '201':
          description: Course created on EdX
        '200':
          description: Course already exists for this task
        '400':
          description: Course creation failed
  /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: |-
        Generate a course outline synchronously.

        Creates the course outline via LLM and pushes it to EdX.
      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':
          description: Outline generated successfully
        '400':
          description: Outline generation failed
    post:
      operationId: ai_mentor_orgs_users_course_creation_tasks_create_course_outline_create
      description: |-
        Generate a course outline synchronously.

        Creates the course outline via LLM and pushes it to EdX.
      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':
          description: Outline generated successfully
        '400':
          description: Outline generation failed
  /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'
              examples:
                StartCourseCreationResponse:
                  value:
                    id: 1
                    name: Introduction to Python
                    status: Scheduled
                    celery_task_id: abc-123
                  summary: Start Course Creation Response
          description: ''
        '400':
          description: Task is not in a schedulable state
  /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: ''
    post:
      operationId: ai_mentor_orgs_users_course_creation_course_create
      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: 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/EdxCourse'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/EdxCourse'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/EdxCourse'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/EdxCourse'
          '*/*':
            schema:
              $ref: '#/components/schemas/EdxCourse'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EdxCourse'
          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}/create-xblock/:
    post:
      operationId: ai_mentor_orgs_users_course_creation_course_create_xblock_create
      description: Create a new xblock under a parent within this course.
      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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateXblock'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CreateXblock'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateXblock'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateXblock'
          '*/*':
            schema:
              $ref: '#/components/schemas/CreateXblock'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/XblockResult'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/XblockResult'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/delete-xblock/:
    post:
      operationId: ai_mentor_orgs_users_course_creation_course_delete_xblock_create
      description: Delete an xblock from this course.
      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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteXblock'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/DeleteXblock'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DeleteXblock'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DeleteXblock'
          '*/*':
            schema:
              $ref: '#/components/schemas/DeleteXblock'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/XblockResult'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/XblockResult'
          description: ''
  /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}/draft-content-for-unit/:
    post:
      operationId: ai_mentor_orgs_users_course_creation_course_draft_content_for_unit_create
      description: |-
        Draft content for a single unit synchronously.

        Only xblock_id is required. The display_name and unit_type are
        fetched from EdX automatically.
      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
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - xblock_id
              properties:
                xblock_id:
                  type: string
                  description: The unit's xblock ID on EdX
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Unit content drafted successfully
        '400':
          description: Content generation failed
        '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 from EdX.

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

        Use ``?include_content=true`` to include component HTML content (slower).

        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':
          description: Full course structure from EdX
        '404':
          description: Course not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/outline/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_course_outline_retrieve
      description: |-
        Fetch and report course outline directly from the LMS

        Outline includes all sections, subsections, units and components.
        This does not include the html content of the components.
      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 structure verified on EdX
        '400':
          description: Verification failed
        '404':
          description: Course not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/reorder-children/:
    post:
      operationId: ai_mentor_orgs_users_course_creation_course_reorder_children_create
      description: |-
        Reorder the children of an xblock within this course.

        This is also useful for moving an element from its parent to another.
        If you set an xblock as a child of another parent, it is automatically removed from its
        previous position and placed in the child position of the current specified parent.
      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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReorderChildren'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ReorderChildren'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ReorderChildren'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ReorderChildren'
          '*/*':
            schema:
              $ref: '#/components/schemas/ReorderChildren'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/XblockResult'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/XblockResult'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/student-progress/:
    get:
      operationId: ai_mentor_orgs_users_course_creation_course_student_progress_retrieve
      description: Fetch a student's completion progress for this course.
      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: query
        name: target_username
        schema:
          type: string
          minLength: 1
        description: Username of the student whose progress to fetch.
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Student progress for the course
        '400':
          description: Missing or invalid parameters
        '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: Publish the course structure on EdX synchronously.
      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 published on EdX
        '400':
          description: Sync failed
        '404':
          description: Course not found
    post:
      operationId: ai_mentor_orgs_users_course_creation_course_sync_to_edx_create
      description: Publish the course structure on EdX synchronously.
      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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EdxCourse'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/EdxCourse'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/EdxCourse'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/EdxCourse'
          '*/*':
            schema:
              $ref: '#/components/schemas/EdxCourse'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Course published on EdX
        '400':
          description: Sync failed
        '404':
          description: Course not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/course/{id}/update-xblock/:
    post:
      operationId: ai_mentor_orgs_users_course_creation_course_update_xblock_create
      description: Update an xblock's display name and/or content.
      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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateXblock'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UpdateXblock'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UpdateXblock'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UpdateXblock'
          '*/*':
            schema:
              $ref: '#/components/schemas/UpdateXblock'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/XblockResult'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/XblockResult'
          description: ''
  /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/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'
              examples:
                CancelCourseCreationResponse:
                  value:
                    id: 1
                    name: Introduction to Python
                    status: Cancelled
                  summary: Cancel Course Creation Response
          description: ''
        '400':
          description: Task is not in a cancellable state
  /api/ai-mentor/orgs/{org}/users/{user_id}/course-creation/tasks/{id}/create-course/:
    post:
      operationId: ai_mentor_orgs_users_course_creation_tasks_create_course_create_2
      description: |-
        Create a blank course on EdX and trigger background settings update.

        Creates the course on EdX synchronously. If successful, schedules a
        background task to generate and apply course settings and images via AI.

        Returns immediately after course creation — settings/images are applied
        asynchronously.
      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:
        '201':
          description: Course created on EdX
        '200':
          description: Course already exists for this task
        '400':
          description: Course creation failed
  /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: |-
        Generate a course outline synchronously.

        Creates the course outline via LLM and pushes it to EdX.
      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':
          description: Outline generated successfully
        '400':
          description: Outline generation failed
    post:
      operationId: ai_mentor_orgs_users_course_creation_tasks_create_course_outline_create_2
      description: |-
        Generate a course outline synchronously.

        Creates the course outline via LLM and pushes it to EdX.
      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':
          description: Outline generated successfully
        '400':
          description: Outline generation failed
  /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'
              examples:
                StartCourseCreationResponse:
                  value:
                    id: 1
                    name: Introduction to Python
                    status: Scheduled
                    celery_task_id: abc-123
                  summary: Start Course Creation Response
          description: ''
        '400':
          description: Task is not in a schedulable state
  /api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/:
    post:
      operationId: ai_mentor_orgs_users_create_agent_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
    put:
      operationId: ai_mentor_orgs_users_create_agent_wizard_update
      description: |-
        API view for creating a mentor using the wizard interface.

        This view allows platform administrators to create new mentors with
        basic configuration through a simplified wizard process.

        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/MentorWizard'
          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:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorWizard'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_create_agent_wizard_partial_update
      description: |-
        API view for creating a mentor using the wizard interface.

        This view allows platform administrators to create new mentors with
        basic configuration through a simplified wizard process.

        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/PatchedMentorWizard'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedMentorWizard'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMentorWizard'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedMentorWizard'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedMentorWizard'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorWizard'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_create_agent_wizard_destroy
      description: |-
        API view for creating a mentor using the wizard interface.

        This view allows platform administrators to create new mentors with
        basic configuration through a simplified wizard process.

        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
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/create-mentor-wizard/:
    post:
      operationId: ai_mentor_orgs_users_create_mentor_wizard_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
    put:
      operationId: ai_mentor_orgs_users_create_mentor_wizard_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/` (`mentor` → `agent`) and will be removed in a future release.

        API view for creating a mentor using the wizard interface.

        This view allows platform administrators to create new mentors with
        basic configuration through a simplified wizard process.

        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/MentorWizard'
          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:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorWizard'
          description: ''
      deprecated: true
    patch:
      operationId: ai_mentor_orgs_users_create_mentor_wizard_partial_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/` (`mentor` → `agent`) and will be removed in a future release.

        API view for creating a mentor using the wizard interface.

        This view allows platform administrators to create new mentors with
        basic configuration through a simplified wizard process.

        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/PatchedMentorWizard'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedMentorWizard'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMentorWizard'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedMentorWizard'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedMentorWizard'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorWizard'
          description: ''
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_users_create_mentor_wizard_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/create-agent-wizard/` (`mentor` → `agent`) and will be removed in a future release.

        API view for creating a mentor using the wizard interface.

        This view allows platform administrators to create new mentors with
        basic configuration through a simplified wizard process.

        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
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
      deprecated: true
  /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}/default-agent/:
    get:
      operationId: ai_mentor_orgs_users_default_agent_retrieve
      description: |-
        Retrieve the user's default mentor for this tenant.

        Returns ``null`` when the user has not set a default 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/UserDefaultMentor'
          description: ''
        '404':
          description: Student or platform not found
    put:
      operationId: ai_mentor_orgs_users_default_agent_update
      description: |-
        Set (or replace) the user's default mentor for this tenant.

        The unique (student, platform) constraint guarantees at most one
        default mentor per user per tenant; setting a new one replaces any
        existing default.
      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/UserDefaultMentor'
          description: ''
        '404':
          description: Mentor, student or platform not found
    delete:
      operationId: ai_mentor_orgs_users_default_agent_destroy
      description: |-
        Clear the user's default mentor for this tenant.

        Idempotent: returns 204 whether or not a default was set.
      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: Default mentor cleared
        '404':
          description: Student or platform not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/default-mentor/:
    get:
      operationId: ai_mentor_orgs_users_default_mentor_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/default-agent/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/default-agent/` (`mentor` → `agent`) and will be removed in a future release.

        Retrieve the user's default mentor for this tenant.

        Returns ``null`` when the user has not set a default 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/UserDefaultMentor'
          description: ''
        '404':
          description: Student or platform not found
      deprecated: true
    put:
      operationId: ai_mentor_orgs_users_default_mentor_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/default-agent/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/default-agent/` (`mentor` → `agent`) and will be removed in a future release.

        Set (or replace) the user's default mentor for this tenant.

        The unique (student, platform) constraint guarantees at most one
        default mentor per user per tenant; setting a new one replaces any
        existing default.
      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/UserDefaultMentor'
          description: ''
        '404':
          description: Mentor, student or platform not found
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_users_default_mentor_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/default-agent/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/default-agent/` (`mentor` → `agent`) and will be removed in a future release.

        Clear the user's default mentor for this tenant.

        Idempotent: returns 204 whether or not a default was set.
      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: Default mentor cleared
        '404':
          description: Student or platform not found
      deprecated: true
  /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
        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}/evaluations/datasets/:
    get:
      operationId: evaluations_datasets_list
      description: List datasets belonging to the tenant. Supports server-side filtering
        by name substring and creator email (matched against the cached `created_by_email`
        in Langfuse metadata).
      summary: List datasets
      parameters:
      - in: query
        name: limit
        schema:
          type: integer
        description: Page size (max 200).
      - in: query
        name: name
        schema:
          type: string
        description: Case-insensitive substring match on the dataset name.
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: page
        schema:
          type: integer
        description: Page number (1-indexed).
      - in: query
        name: user_email
        schema:
          type: string
        description: Filter datasets created by this user (exact match).
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedDatasetList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_evaluations_datasets_create
      description: Create a Langfuse dataset under the tenant. The creator's `username`
        and `user_email` are captured into metadata so future list responses can attribute
        the row without an extra DB lookup.
      summary: Create a dataset
      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/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/Dataset'
          description: ''
        '400':
          description: Validation error.
  /api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/:
    get:
      operationId: ai_mentor_orgs_users_evaluations_datasets_retrieve
      description: Get a single dataset by name.
      summary: Retrieve a dataset
      parameters:
      - in: path
        name: dataset_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/Dataset'
          description: ''
        '403':
          description: Authenticated, but the resource belongs to another tenant.
        '404':
          description: Not found within the tenant.
  /api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/items/:
    get:
      operationId: evaluations_dataset_items_list
      description: List items in a dataset. Pass `?include_trace=true` to attach `trace_input`
        / `trace_output` for items linked to a source trace (one bulk ClickHouse query
        for the page — no per-row fan-out).
      summary: List dataset items
      parameters:
      - in: path
        name: dataset_name
        schema:
          type: string
        required: true
      - in: query
        name: include_trace
        schema:
          type: boolean
        description: When true, populate `trace_input` / `trace_output` from the linked
          trace for items that have a `source_trace_id`.
      - in: query
        name: limit
        schema:
          type: integer
        description: Page size (max 200).
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: page
        schema:
          type: integer
        description: Page number (1-indexed).
      - in: query
        name: status
        schema:
          type: string
          enum:
          - ACTIVE
          - ARCHIVED
        description: Filter by dataset item status (exact match).
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedDatasetItemList'
          description: ''
        '404':
          description: Not found within the tenant.
    post:
      operationId: ai_mentor_orgs_users_evaluations_datasets_items_create
      description: Add items to a dataset. Provide either an `items` array of `{input,
        expected_output}` objects OR a `trace_ids` array to seed items from existing
        traces (input/expected are then copied from the trace). Exactly one of the
        two must be present.
      summary: Add dataset items
      parameters:
      - in: path
        name: dataset_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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DatasetItemCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/DatasetItemCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DatasetItemCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DatasetItemCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/DatasetItemCreate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetItemBulkCreateResponse'
          description: ''
        '400':
          description: Validation error.
        '404':
          description: Not found within the tenant.
  /api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/items/{item_id}/:
    get:
      operationId: ai_mentor_orgs_users_evaluations_datasets_items_retrieve
      description: Retrieve a single dataset item. `trace_input` / `trace_output`
        are always populated when the item has a `source_trace_id` (single-row case,
        no fan-out concern).
      summary: Retrieve a dataset item
      parameters:
      - in: path
        name: dataset_name
        schema:
          type: string
        required: true
      - in: path
        name: item_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/DatasetItem'
          description: ''
        '404':
          description: Not found within the tenant.
    put:
      operationId: ai_mentor_orgs_users_evaluations_datasets_items_update
      description: Update any subset of `input`, `expected_output`, `metadata`, or
        `status` on a dataset item. Uses Langfuse's id-based upsert.
      summary: Update a dataset item
      parameters:
      - in: path
        name: dataset_name
        schema:
          type: string
        required: true
      - in: path
        name: item_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/DatasetItemUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/DatasetItemUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DatasetItemUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DatasetItemUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/DatasetItemUpdate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetItem'
          description: ''
        '400':
          description: Validation error.
        '404':
          description: Not found within the tenant.
    delete:
      operationId: ai_mentor_orgs_users_evaluations_datasets_items_destroy
      description: Queues the item for deletion in Langfuse. List/get endpoints hide
        this id immediately, but Langfuse's worker can take up to a few minutes to
        remove it from its own stores.
      summary: Delete a dataset item
      parameters:
      - in: path
        name: dataset_name
        schema:
          type: string
        required: true
      - in: path
        name: item_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:
        '202':
          description: Deletion queued.
        '404':
          description: Not found within the tenant.
  /api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/items/upload/:
    post:
      operationId: ai_mentor_orgs_users_evaluations_datasets_items_upload_create
      description: Bulk-create items from a CSV (multipart `file` field). The CSV
        must have an `input` column; `expected_output` is optional. Rows with empty
        `input` are skipped.
      summary: Upload a CSV of dataset items
      parameters:
      - in: path
        name: dataset_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
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
              required:
              - file
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetItemBulkCreateResponse'
          description: ''
        '400':
          description: Validation error.
        '404':
          description: Not found within the tenant.
  /api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/runs/:
    get:
      operationId: evaluations_runs_list
      description: List runs for a dataset. The response merges Langfuse-persisted
        runs with in-flight `EvaluationTaskRecord` rows (status `pending` / `in_progress`),
        deduplicated by `run_name`. `pending_count` reports how many pending entries
        are in the page so the UI can badge in-flight work.
      summary: List experiment runs
      parameters:
      - in: path
        name: dataset_name
        schema:
          type: string
        required: true
      - in: query
        name: limit
        schema:
          type: integer
        description: Page size (max 200).
      - in: query
        name: name
        schema:
          type: string
        description: Case-insensitive substring match on the run name. Applies to
          both pending records and Langfuse-persisted runs.
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: page
        schema:
          type: integer
        description: Page number (1-indexed).
      - in: query
        name: user_email
        schema:
          type: string
        description: Filter by the initiator's email. Applies to both pending records
          and Langfuse-persisted runs.
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedRunList'
          description: ''
        '404':
          description: Not found within the tenant.
    post:
      operationId: ai_mentor_orgs_users_evaluations_datasets_runs_create
      description: Dispatch a Celery task that runs the chosen mentor against every
        item in the dataset. Returns immediately (HTTP 202) with the new task record.
        Poll the list endpoint (or the run-detail endpoint once Langfuse persists
        the run) to watch the `pending → in_progress → completed` transition.
      summary: Start an experiment run
      parameters:
      - in: path
        name: dataset_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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExperimentCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ExperimentCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ExperimentCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ExperimentCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/ExperimentCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Run'
          description: ''
        '400':
          description: Validation error.
        '404':
          description: Dataset or mentor not found within the tenant.
  /api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/runs/{run_name}/:
    get:
      operationId: ai_mentor_orgs_users_evaluations_datasets_runs_retrieve
      description: |-
        Returns the run header plus every `dataset_run_item` fully expanded with `input`, `expected_output`, `actual_output`, `trace_id`, and per-item `scores`. Also embeds a `pending_judges` array for any in-flight LLM-as-Judge evaluations against this run.

        Cost: 1 PG query + 2 ClickHouse queries + 1 score query regardless of run size.
      summary: Retrieve experiment run details
      parameters:
      - in: path
        name: dataset_name
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: run_name
        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/RunDetailResponse'
          description: ''
        '403':
          description: Authenticated, but the resource belongs to another tenant.
        '404':
          description: Not found within the tenant.
    delete:
      operationId: ai_mentor_orgs_users_evaluations_datasets_runs_destroy
      description: Queues the run for deletion in Langfuse. List/get endpoints hide
        this run immediately, but Langfuse's worker can take up to a few minutes to
        remove it from its own stores.
      summary: Delete an experiment run
      parameters:
      - in: path
        name: dataset_name
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: run_name
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '202':
          description: Deletion queued.
        '403':
          description: Authenticated, but the resource belongs to another tenant.
        '404':
          description: Not found within the tenant.
  /api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/runs/{run_name}/evaluate/:
    get:
      operationId: evaluations_run_judges_list
      description: Returns every judge task record (any status) targeting this run.
        Useful for showing an 'Evaluations' history on a run-detail view, including
        failed and pending ones.
      summary: List LLM-as-Judge evaluations for a run
      parameters:
      - in: path
        name: dataset_name
        schema:
          type: string
        required: true
      - in: query
        name: limit
        schema:
          type: integer
        description: Page size (max 200).
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: page
        schema:
          type: integer
        description: Page number (1-indexed).
      - in: path
        name: run_name
        schema:
          type: string
        required: true
      - in: query
        name: status
        schema:
          type: string
          enum:
          - completed
          - failed
          - in_progress
          - pending
        description: Filter by task status.
      - in: query
        name: user_email
        schema:
          type: string
        description: Filter by the initiator's email.
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedJudgeList'
          description: ''
    post:
      operationId: evaluations_run_judge_create
      description: |-
        Dispatch a Celery task that runs a separate LLM over every item in the run, scoring the actual output against the input + expected output using the provided criteria. The judge's score lands in Langfuse with `score_name`, and its reasoning is stored in the score's `comment`.

        Returns immediately (HTTP 202) with the new task record. The task transitions through `pending → in_progress → completed` (or `failed`); poll the list endpoint or the run-detail endpoint to watch.
      summary: Start an LLM-as-Judge evaluation
      parameters:
      - in: path
        name: dataset_name
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: run_name
        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/LLMJudge'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/LLMJudge'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/LLMJudge'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/LLMJudge'
          '*/*':
            schema:
              $ref: '#/components/schemas/LLMJudge'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JudgeRecord'
          description: ''
        '400':
          description: Empty run or invalid input.
        '404':
          description: Not found within the tenant.
  /api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/datasets/{dataset_name}/runs/{run_name}/export/:
    get:
      operationId: ai_mentor_orgs_users_evaluations_datasets_runs_export_retrieve
      description: 'Download the run as a CSV. Columns: `item_id`, `input`, `expected_output`,
        `trace_id`, `actual_output`, and one `score_<name>` column per distinct score
        name in the run.'
      summary: Export experiment results as CSV
      parameters:
      - in: path
        name: dataset_name
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: run_name
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            text/csv:
              schema:
                type: string
                format: binary
          description: CSV file download.
        '403':
          description: Authenticated, but the resource belongs to another tenant.
        '404':
          description: Not found within the tenant.
  /api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/judges/:
    get:
      operationId: evaluations_judges_global_list
      description: Returns every judge task record in the tenant, across all datasets
        and runs. Useful for a tenant-wide 'Evaluations' inbox.
      summary: List LLM-as-Judge evaluations (tenant-wide)
      parameters:
      - in: query
        name: dataset_name
        schema:
          type: string
        description: Restrict to one dataset.
      - in: query
        name: limit
        schema:
          type: integer
        description: Page size (max 200).
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: page
        schema:
          type: integer
        description: Page number (1-indexed).
      - in: query
        name: status
        schema:
          type: string
          enum:
          - completed
          - failed
          - in_progress
          - pending
        description: Filter by task status.
      - in: query
        name: user_email
        schema:
          type: string
        description: Filter by the initiator's email.
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedJudgeList'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/score-configs/:
    get:
      operationId: ai_mentor_orgs_users_evaluations_score_configs_retrieve
      description: Score configurations define reusable rubrics (numeric ranges, boolean,
        or categorical labels). They are optional — scores work without one — but
        useful for enforcing consistent grading.
      summary: List score configurations
      parameters:
      - in: query
        name: limit
        schema:
          type: integer
        description: Page size (max 200).
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: page
        schema:
          type: integer
        description: Page number (1-indexed).
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedScoreConfigList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_evaluations_score_configs_create
      description: Create a score configuration.
      summary: Create a score configuration
      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/ScoreConfigCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ScoreConfigCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ScoreConfigCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ScoreConfigCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/ScoreConfigCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScoreConfig'
          description: ''
        '400':
          description: Validation error.
  /api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/scores/:
    get:
      operationId: ai_mentor_orgs_users_evaluations_scores_retrieve
      description: List scores (human annotations and LLM-judge results) with optional
        filters. Pair `dataset_run_id` with a run id to scope to one experiment; pass
        `trace_id` to scope to a single chat turn or mentor invocation.
      summary: List scores
      parameters:
      - in: query
        name: dataset_run_id
        schema:
          type: string
        description: Restrict to scores attached to this Langfuse run.
      - in: query
        name: limit
        schema:
          type: integer
        description: Page size (max 200).
      - in: query
        name: name
        schema:
          type: string
        description: Filter by score name (exact match).
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: page
        schema:
          type: integer
        description: Page number (1-indexed).
      - in: query
        name: trace_id
        schema:
          type: string
        description: Restrict to scores on this trace. The same id is exposed as `generation_id`
          in WebSocket chat frames.
      - in: query
        name: user_email
        schema:
          type: string
        description: Filter by the score creator's email (matched against the `created_by_email`
          key in score metadata).
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedScoreList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_evaluations_scores_create
      description: Create a score on a trace or observation. Use this to record human
        grading of a single chat message (pass the chat frame's `generation_id` as
        `trace_id`) or to score an experiment-run item. Scores on a run item's trace
        automatically appear in the run detail and CSV export; optionally pass `dataset_run_id`
        to additionally tag the score with its run for `dataset_run_id`-filtered listings.
      summary: Create a score
      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/ScoreCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ScoreCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ScoreCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ScoreCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/ScoreCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScoreCreateResponse'
          description: ''
        '400':
          description: Validation error.
  /api/ai-mentor/orgs/{org}/users/{user_id}/evaluations/scores/{score_id}/:
    delete:
      operationId: ai_mentor_orgs_users_evaluations_scores_destroy
      description: Queues the score for deletion in Langfuse. The list endpoint hides
        this id immediately, but Langfuse's worker can take up to a few minutes to
        remove it from its own stores.
      summary: Delete a score
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: score_id
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '202':
          description: Deletion queued.
        '404':
          description: Not found within the tenant.
  /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}/global-memories/:
    get:
      operationId: ai_mentor_orgs_users_global_memories_retrieve
      description: List all global memories for a user.
      parameters:
      - in: query
        name: content
        schema:
          type: string
        description: Search within memory content (case-insensitive)
      - in: query
        name: end_date
        schema:
          type: string
        description: Filter memories created before this ISO datetime
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: session_id
        schema:
          type: string
        description: Filter by source session UUID
      - in: query
        name: start_date
        schema:
          type: string
        description: Filter memories created after this ISO datetime
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      - in: query
        name: user_id
        schema:
          type: string
        description: Filter by user_id (requires permission)
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    post:
      operationId: ai_mentor_orgs_users_global_memories_create
      description: Create a new global memory.
      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}/global-memories/{memory_id}/:
    patch:
      operationId: ai_mentor_orgs_users_global_memories_partial_update
      description: Update a global memory (RBAC ownership-aware).
      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-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    delete:
      operationId: ai_mentor_orgs_users_global_memories_destroy
      description: Delete a global memory (RBAC ownership-aware).
      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-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/ai-mentor/orgs/{org}/users/{user_id}/google-agents/:
    get:
      operationId: ai_mentor_orgs_users_google_agents_list
      description: |-
        Wires RBAC into a DRF view.

        Two responsibilities:

        1. When RBAC is enabled, replace the view's `permission_classes` with
           `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated`
           semantics, plus opt-in acceptance of token-policies PlatformApiKeys for
           views that set `token_policies_enabled = True`).

        2. Detect server-to-server (Django auth) callers via `is_service_account`.
           Server-to-server tokens authenticate as Django auth users with no
           relationship to a platform EdxUser. The convention is "we trust this
           caller — bypass RBAC and serve the request."

           Combine it with the RBAC-disabled check at the top of `initial()` so
           the early exit skips all RBAC prep work:

               if not ConfigFlags.rbac_enabled() or self.is_service_account:
                   return

           Use `is_service_account` at any other touch points where caller
           identity matters (queryset ownership filters, owner attribution on
           create, serializer context, etc.).
      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/PaginatedGoogleAgentDetailList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_google_agents_create
      description: |-
        Sample Request
        ```
        {"name": "my agent", "instruction": "you are a helpful agent",}
        ```
      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/GoogleAgentDetail'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/GoogleAgentDetail'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/GoogleAgentDetail'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/GoogleAgentDetail'
          '*/*':
            schema:
              $ref: '#/components/schemas/GoogleAgentDetail'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleAgentDetail'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/google-agents/{unique_id}/:
    get:
      operationId: ai_mentor_orgs_users_google_agents_retrieve
      description: |-
        Wires RBAC into a DRF view.

        Two responsibilities:

        1. When RBAC is enabled, replace the view's `permission_classes` with
           `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated`
           semantics, plus opt-in acceptance of token-policies PlatformApiKeys for
           views that set `token_policies_enabled = True`).

        2. Detect server-to-server (Django auth) callers via `is_service_account`.
           Server-to-server tokens authenticate as Django auth users with no
           relationship to a platform EdxUser. The convention is "we trust this
           caller — bypass RBAC and serve the request."

           Combine it with the RBAC-disabled check at the top of `initial()` so
           the early exit skips all RBAC prep work:

               if not ConfigFlags.rbac_enabled() or self.is_service_account:
                   return

           Use `is_service_account` at any other touch points where caller
           identity matters (queryset ownership filters, owner attribution on
           create, serializer context, etc.).
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: unique_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/GoogleAgentDetail'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_google_agents_partial_update
      description: |-
        Mainly used to update the sub agent list.

        Sample request:
        ```
        {
          "sub_agents": [
            "adc4bf84-c174-47e1-b11c-7713ef2dcd89",
            "3fb5806d-3be1-4bfd-bcb0-a48558465644",
            "339e44cd-6084-4530-be70-ac2a83759fb6"
        ]
        }
        ```
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: unique_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/PatchedGoogleAgentDetail'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedGoogleAgentDetail'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedGoogleAgentDetail'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedGoogleAgentDetail'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedGoogleAgentDetail'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleAgentDetail'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_google_agents_destroy
      description: |-
        Wires RBAC into a DRF view.

        Two responsibilities:

        1. When RBAC is enabled, replace the view's `permission_classes` with
           `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated`
           semantics, plus opt-in acceptance of token-policies PlatformApiKeys for
           views that set `token_policies_enabled = True`).

        2. Detect server-to-server (Django auth) callers via `is_service_account`.
           Server-to-server tokens authenticate as Django auth users with no
           relationship to a platform EdxUser. The convention is "we trust this
           caller — bypass RBAC and serve the request."

           Combine it with the RBAC-disabled check at the top of `initial()` so
           the early exit skips all RBAC prep work:

               if not ConfigFlags.rbac_enabled() or self.is_service_account:
                   return

           Use `is_service_account` at any other touch points where caller
           identity matters (queryset ownership filters, owner attribution on
           create, serializer context, etc.).
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: unique_id
        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}/mcp-server-connections/:
    get:
      operationId: ai_mentor_orgs_users_mcp_server_connections_list
      description: |-
        Override list to handle object ownership.

        RBAC filtering may remove owned objects if no explicit permissions.
        This adds back user-scoped connections owned by the requesting user.
      parameters:
      - in: query
        name: auth_type
        schema:
          type: string
          enum:
          - none
          - oauth2
          - token
        description: |-
          * `none` - None
          * `token` - Token
          * `oauth2` - Oauth2
      - in: query
        name: is_active
        schema:
          type: boolean
      - in: query
        name: mentor
        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
          - user
        description: |-
          Whether this connection is scoped to a user or shared across a platform.

          * `user` - User
          * `mentor` - Mentor
          * `platform` - Platform
      - name: search
        required: false
        in: query
        description: A search term.
        schema:
          type: string
      - in: query
        name: server
        schema:
          type: number
      - in: query
        name: user
        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/PaginatedMCPServerConnectionList'
          description: ''
    post:
      operationId: ai_mentor_orgs_users_mcp_server_connections_create
      description: |-
        ViewSet for MCP server connections.

        Tenant administrators can create user- or platform-scoped connections that
        encapsulate the authentication configuration for invoking an MCP server.

        RBAC Resource Hierarchy:
            MCPServerConnection is a subresource of MCPServer. Resource paths are:
            - Collection: /platforms/{platform_id}/mcpservers/{server_id}/connections/
            - Object: /platforms/{platform_id}/mcpservers/{server_id}/connections/{connection_id}
      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/MCPServerConnection'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MCPServerConnection'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MCPServerConnection'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MCPServerConnection'
          '*/*':
            schema:
              $ref: '#/components/schemas/MCPServerConnection'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MCPServerConnection'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/mcp-server-connections/{id}/:
    get:
      operationId: ai_mentor_orgs_users_mcp_server_connections_retrieve
      description: Override retrieve to pass is_owner to action enforcement.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this mcp server connection.
        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/MCPServerConnection'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_mcp_server_connections_update
      description: |-
        ViewSet for MCP server connections.

        Tenant administrators can create user- or platform-scoped connections that
        encapsulate the authentication configuration for invoking an MCP server.

        RBAC Resource Hierarchy:
            MCPServerConnection is a subresource of MCPServer. Resource paths are:
            - Collection: /platforms/{platform_id}/mcpservers/{server_id}/connections/
            - Object: /platforms/{platform_id}/mcpservers/{server_id}/connections/{connection_id}
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this mcp server connection.
        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/MCPServerConnection'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/MCPServerConnection'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MCPServerConnection'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MCPServerConnection'
          '*/*':
            schema:
              $ref: '#/components/schemas/MCPServerConnection'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MCPServerConnection'
          description: ''
    patch:
      operationId: ai_mentor_orgs_users_mcp_server_connections_partial_update
      description: |-
        ViewSet for MCP server connections.

        Tenant administrators can create user- or platform-scoped connections that
        encapsulate the authentication configuration for invoking an MCP server.

        RBAC Resource Hierarchy:
            MCPServerConnection is a subresource of MCPServer. Resource paths are:
            - Collection: /platforms/{platform_id}/mcpservers/{server_id}/connections/
            - Object: /platforms/{platform_id}/mcpservers/{server_id}/connections/{connection_id}
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this mcp server connection.
        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/PatchedMCPServerConnection'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedMCPServerConnection'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMCPServerConnection'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedMCPServerConnection'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedMCPServerConnection'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MCPServerConnection'
          description: ''
    delete:
      operationId: ai_mentor_orgs_users_mcp_server_connections_destroy
      description: |-
        ViewSet for MCP server connections.

        Tenant administrators can create user- or platform-scoped connections that
        encapsulate the authentication configuration for invoking an MCP server.

        RBAC Resource Hierarchy:
            MCPServerConnection is a subresource of MCPServer. Resource paths are:
            - Collection: /platforms/{platform_id}/mcpservers/{server_id}/connections/
            - Object: /platforms/{platform_id}/mcpservers/{server_id}/connections/{connection_id}
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this mcp server connection.
        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}/mcp-servers/:
    get:
      operationId: ai_mentor_orgs_users_mcp_servers_list
      description: |-
        List MCP servers with mentor-scoped and platform-scoped filtering.

        Query Parameters:
            - mentor_unique_id (optional): Filter to mentor-scoped servers for this mentor
            - include_global (optional): Include platform-scoped servers (only with mentor_unique_id)

        RBAC Logic:
            - No params: Returns all accessible servers (owned + granted access + platform-scoped)
            - mentor_unique_id only: Returns mentor-scoped servers for that mentor
            - mentor_unique_id + include_global: Returns both mentor-scoped and platform-scoped servers

        Note: Queryset filtering is handled in get_queryset() since rbac_manager.enforce_list_data_access
        will call get_queryset() internally.
      parameters:
      - in: query
        name: auth_scope
        schema:
          type: string
          enum:
          - mentor
          - platform
          - user
        description: |-
          Determines the required authentication granularity. 'platform' uses shared platform credentials, 'mentor' requires mentor-level credentials, and 'user' requires each user to authenticate individually.

          * `platform` - Platform
          * `mentor` - Mentor
          * `user` - User
      - in: query
        name: auth_type
        schema:
          type: string
          enum:
          - none
          - oauth2
          - token
        description: |-
          The type of authentication to use for the MCP server.

          * `none` - None
          * `token` - Token
          * `oauth2` - Oauth2
      - in: query
        name: include_global
        schema:
          type: boolean
          default: false
        description: Include platform-scoped resources when filtering by mentor (only
          relevant with mentor_unique_id)
      - in: query
        name: is_enabled
        schema:
          type: boolean
      - in: query
        name: is_featured
        schema:
          type: boolean
      - in: query
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        description: Optional mentor unique ID to check permissions in mentor context
      - 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: transport
        schema:
          type: string
          enum:
          - sse
          - streamable_http
          - websocket
        description: |-
          * `sse` - Sse
          * `websocket` - Websocket
          * `streamable_http` - Streamable Http
      - in: query
        name: url
        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
                        description: Description of MCP Server 1
                        image: https://base.manager.iblai.app/media/public/mcp-server/image/1.png
                        url: https://mcp-server-1.example.com
                        transport: sse
                        credentials: Bearer ****
                        platform: 1
                        headers:
                          content-type: application/json
                        is_featured: true
                        auth_type: bearer
                        is_enabled: true
                      - id: 2
                        name: MCP Server 2
                        description: Description of MCP Server 2
                        image: https://base.manager.iblai.app/media/public/mcp-server/image/2.png
                        url: https://mcp-server-2.example.com
                        transport: sse
                        platform: 1
                        credentials: ''
                        headers: {}
                        is_featured: false
                        auth_type: none
                        is_enabled: true
                  summary: Successful Response
          description: ''
    post:
      operationId: ai_mentor_orgs_users_mcp_servers_create
      description: |-
        Create a new MCP server with RBAC validation.

        If mentor_unique_id is in request data, validates mentor-scoped creation permissions.
        Otherwise, validates platform-scoped creation permissions.
      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/MCPServer'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MCPServer'
          application/json:
            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: |-
        Retrieve a single MCP server with mentor-aware RBAC validation.

        Validates permissions based on whether the server is mentor-scoped or platform-scoped.
      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: |-
        Update an MCP server with mentor-aware RBAC validation.

        Validates permissions based on whether the server is mentor-scoped or platform-scoped.
      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:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MCPServer'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MCPServer'
          application/json:
            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: Partially update an MCP server with mentor-aware RBAC validation.
      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:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedMCPServer'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMCPServer'
          application/json:
            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: |-
        Delete an MCP server with mentor-aware RBAC validation.

        Validates permissions based on whether the server is mentor-scoped or platform-scoped.
      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}/mcp-servers/oauth-find/:
    post:
      operationId: ai_mentor_orgs_users_mcp_servers_oauth_find_create
      description: |-
        Check that a given mcp server (where the user specifies oauth authentication) either has pre-configured oauth credentials
        or support Dynamic Client Registration.

        This method:
        1. First checks if the MCP server already has a configured OAuth service
        2. If not, attempts to discover and register an OAuth service using Dynamic Client Registration
        3. Returns the OAuth service information if found or registered
      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/MCPServerOauthFind'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MCPServerOauthFind'
          application/json:
            schema:
              $ref: '#/components/schemas/MCPServerOauthFind'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthService'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/memsearch-config/:
    get:
      operationId: ai_mentor_orgs_users_memsearch_config_retrieve
      description: |-
        GET/POST /orgs/{org}/users/{user_id}/memsearch-config/

        Tenant-level memsearch feature flag configuration.
        Restricted 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
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Tenant memsearch configuration
    post:
      operationId: ai_mentor_orgs_users_memsearch_config_create
      description: |-
        GET/POST /orgs/{org}/users/{user_id}/memsearch-config/

        Tenant-level memsearch feature flag configuration.
        Restricted 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:
              type: object
              properties:
                enable_memsearch:
                  type: boolean
              required:
              - enable_memsearch
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Updated tenant memsearch configuration
        '400':
          description: Invalid request payload
  /api/ai-mentor/orgs/{org}/users/{user_id}/memsearch-settings/:
    get:
      operationId: ai_mentor_orgs_users_memsearch_settings_retrieve
      description: |-
        Get user's memory settings.

        Tenant admins may read any user's settings via the ``user_id`` path
        segment; everyone else is pinned to their own username, so a non-admin
        can never read another user's settings regardless of the path they send.
      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
    put:
      operationId: ai_mentor_orgs_users_memsearch_settings_update
      description: |-
        Update user's memory settings.

        Tenant admins may update any user's settings via the ``user_id`` path
        segment; everyone else is pinned to their own username, so a non-admin
        can never mutate another user's settings regardless of the path they send.
      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}/memsearch-status/:
    get:
      operationId: ai_mentor_orgs_users_memsearch_status_retrieve
      description: |-
        GET /orgs/{org}/users/{user_id}/memsearch-status/

        Returns whether memsearch is enabled for the tenant.
        Accessible by students and admins.
      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: Tenant memsearch status
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor-feedback/{feedback_id}/:
    get:
      operationId: ai_mentor_orgs_users_mentor_feedback_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-feedback/{feedback_id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-feedback/{feedback_id}/` (`mentor` → `agent`) and will be removed in a future release.

        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.
            Forbidden: If the user doesn't have permission to access this feedback.
      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
      security:
      - PlatformApiKeyAuthentication: []
      - {}
      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
      deprecated: true
    put:
      operationId: ai_mentor_orgs_users_mentor_feedback_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-feedback/{feedback_id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-feedback/{feedback_id}/` (`mentor` → `agent`) and will be removed in a future release.

        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.
            Forbidden: If the user doesn't have permission to update this feedback.
            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
      security:
      - PlatformApiKeyAuthentication: []
      - {}
      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
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor-feedback/create/:
    post:
      operationId: ai_mentor_orgs_users_mentor_feedback_create_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-feedback/create/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-feedback/create/` (`mentor` → `agent`) and will be removed in a future release.

        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.
            Forbidden: If the user doesn't have permission to create this feedback.
      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
      security:
      - PlatformApiKeyAuthentication: []
      - {}
      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
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor-llms/:
    get:
      operationId: ai_mentor_orgs_users_mentor_llms_list
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-llms/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-llms/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor-memories/:
    get:
      operationId: ai_mentor_orgs_users_mentor_memories_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-memories/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-memories/` (`mentor` → `agent`) and will be removed in a future release.

        List all mentor-specific memories for a user.
      parameters:
      - in: query
        name: email
        schema:
          type: string
        description: Filter by user email (admin only)
      - in: query
        name: end_date
        schema:
          type: string
        description: Filter memories created before this ISO date
      - in: query
        name: mentor
        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: Filter memories created after this ISO date
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      - in: query
        name: user_id
        schema:
          type: string
        description: Filter by user_id (admin only)
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor-tools/:
    get:
      operationId: ai_mentor_orgs_users_mentor_tools_list
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-tools/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-tools/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor-types/:
    get:
      operationId: ai_mentor_orgs_users_mentor_types_list
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-types/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-types/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor-with-settings/:
    post:
      operationId: ai_mentor_orgs_users_mentor_with_settings_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
    put:
      operationId: ai_mentor_orgs_users_mentor_with_settings_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/` (`mentor` → `agent`) and will be removed in a future release.

        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/MentorFromTemplate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorFromTemplate'
          application/json:
            schema:
              $ref: '#/components/schemas/MentorFromTemplate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorFromTemplate'
          description: ''
      deprecated: true
    patch:
      operationId: ai_mentor_orgs_users_mentor_with_settings_partial_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/` (`mentor` → `agent`) and will be removed in a future release.

        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/PatchedMentorFromTemplate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMentorFromTemplate'
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedMentorFromTemplate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorFromTemplate'
          description: ''
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_users_mentor_with_settings_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent-with-settings/` (`mentor` → `agent`) and will be removed in a future release.

        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
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor/audience/:
    get:
      operationId: ai_mentor_orgs_users_mentor_audience_list
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/audience/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/audience/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
    post:
      operationId: ai_mentor_orgs_users_mentor_audience_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/audience/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/audience/` (`mentor` → `agent`) and will be removed in a future release.

        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.
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_users_mentor_audience_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/audience/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/audience/` (`mentor` → `agent`) and will be removed in a future release.

        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.
        '404':
          description: Not Found - Audience does not exist.
        '401':
          description: Unauthorized - Only tenant admins can delete mentor audiences.
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor/categories/:
    get:
      operationId: ai_mentor_orgs_users_mentor_categories_list
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/categories/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/categories/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
    post:
      operationId: ai_mentor_orgs_users_mentor_categories_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/categories/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/categories/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_users_mentor_categories_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/categories/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/categories/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentor/seed/:
    get:
      operationId: ai_mentor_orgs_users_mentor_seed_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
    post:
      operationId: ai_mentor_orgs_users_mentor_seed_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` (`mentor` → `agent`) and will be removed in a future release.

        API view for seeding mentors in a tenant.

        This view allows platform administrators to seed initial mentors
        in a tenant from predefined templates.

        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/SeedMentorsView'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SeedMentorsView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SeedMentorsView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SeedMentorsView'
          '*/*':
            schema:
              $ref: '#/components/schemas/SeedMentorsView'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedMentorsView'
          description: ''
      deprecated: true
    put:
      operationId: ai_mentor_orgs_users_mentor_seed_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` (`mentor` → `agent`) and will be removed in a future release.

        API view for seeding mentors in a tenant.

        This view allows platform administrators to seed initial mentors
        in a tenant from predefined templates.

        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/SeedMentorsView'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SeedMentorsView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SeedMentorsView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SeedMentorsView'
          '*/*':
            schema:
              $ref: '#/components/schemas/SeedMentorsView'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedMentorsView'
          description: ''
      deprecated: true
    patch:
      operationId: ai_mentor_orgs_users_mentor_seed_partial_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` (`mentor` → `agent`) and will be removed in a future release.

        API view for seeding mentors in a tenant.

        This view allows platform administrators to seed initial mentors
        in a tenant from predefined templates.

        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/PatchedSeedMentorsView'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedSeedMentorsView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedSeedMentorsView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedSeedMentorsView'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedSeedMentorsView'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedMentorsView'
          description: ''
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_users_mentor_seed_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agent/seed/` (`mentor` → `agent`) and will be removed in a future release.

        API view for seeding mentors in a tenant.

        This view allows platform administrators to seed initial mentors
        in a tenant from predefined templates.

        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
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor_id}/mentor-memories/:
    get:
      operationId: ai_mentor_orgs_users_mentors_mentor_memories_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/` (`mentor` → `agent`) and will be removed in a future release.

        List mentor-specific memories grouped by category.
      parameters:
      - in: query
        name: email
        schema:
          type: string
        description: Filter by user email (ignored when my_memory=true)
      - in: query
        name: end_date
        schema:
          type: string
        description: Filter memories created before this ISO date
      - in: path
        name: mentor_id
        schema:
          type: string
        required: true
      - in: query
        name: my_memory
        schema:
          type: boolean
        description: If true, returns only the authenticated user's memories (skips
          RBAC and user_id filter)
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: start_date
        schema:
          type: string
        description: Filter memories created after this ISO date
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      - in: query
        name: user_id
        schema:
          type: string
        description: Filter by user_id (ignored when my_memory=true)
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
      deprecated: true
    post:
      operationId: ai_mentor_orgs_users_mentors_mentor_memories_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/` (`mentor` → `agent`) and will be removed in a future release.

        Create a new mentor-specific memory.
      parameters:
      - in: path
        name: mentor_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: No response body
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor_id}/mentor-memories-list/:
    get:
      operationId: ai_mentor_orgs_users_mentors_mentor_memories_list_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories-list/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories-list/` (`mentor` → `agent`) and will be removed in a future release.

        List mentor-specific memories with pagination.
      parameters:
      - in: query
        name: category
        schema:
          type: string
        description: Filter by category slug
      - in: query
        name: email
        schema:
          type: string
        description: Filter by user email (ignored when my_memory=true)
      - in: query
        name: end_date
        schema:
          type: string
        description: Filter memories created before this ISO date
      - in: path
        name: mentor_id
        schema:
          type: string
        required: true
      - in: query
        name: my_memory
        schema:
          type: boolean
        description: If true, returns only the authenticated user's memories (skips
          RBAC and user_id filter)
      - 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 results per page (max 100)
      - in: query
        name: start_date
        schema:
          type: string
        description: Filter memories created after this ISO date
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      - in: query
        name: user_id
        schema:
          type: string
        description: Filter by user_id (ignored when my_memory=true)
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor_id}/mentor-memories/{memory_id}/:
    patch:
      operationId: ai_mentor_orgs_users_mentors_mentor_memories_partial_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/{memory_id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/{memory_id}/` (`mentor` → `agent`) and will be removed in a future release.

        Update a mentor-specific memory (RBAC ownership-aware).
      parameters:
      - in: path
        name: memory_id
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_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: No response body
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_users_mentors_mentor_memories_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/{memory_id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor_id}/agent-memories/{memory_id}/` (`mentor` → `agent`) and will be removed in a future release.

        Delete a mentor-specific memory (RBAC ownership-aware).
      parameters:
      - in: path
        name: memory_id
        schema:
          type: integer
        required: true
      - in: path
        name: mentor_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:
        '204':
          description: No response body
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/:
    get:
      operationId: ai_mentor_orgs_users_mentors_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/` (`mentor` → `agent`) and will be removed in a future release.

        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_prompt_caching: false
                    enable_openai_assistant: false
                    enable_total_grounding: false
                    guided_prompt_instructions: you are...
                    enable_guided_prompts: true
                    save_flagged_prompts: true
                    is_featured: 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: ''
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/available-tools/:
    get:
      operationId: ai_mentor_orgs_users_mentors_available_tools_list
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/available-tools/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/available-tools/` (`mentor` → `agent`) and will be removed in a future release.

        Retrieve tools available for a particular mentor. The 'is_allowed' field indicates whether the tool is compatible with the mentor's current LLM configuration.
      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
                      is_allowed: true
                      category:
                        id: 1
                        name: Category 1
                        description: description
                    - id: 2
                      name: Trained Documents
                      slug: trained-documents
                      metadata: null
                      is_allowed: true
                      category:
                        id: 2
                        name: Category 2
                        description: description
                    - id: 3
                      name: Image Generation
                      slug: image-generation
                      metadata: null
                      is_allowed: false
                      category:
                        id: 1
                        name: Category 1
                        description: description
                  summary: List of tools
          description: ''
      deprecated: true
  /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: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/create-call-credentials/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/create-call-credentials/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/current-memory/:
    get:
      operationId: ai_mentor_orgs_users_mentors_current_memory_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/current-memory/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/current-memory/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
    put:
      operationId: ai_mentor_orgs_users_mentors_current_memory_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/current-memory/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/current-memory/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/custom-voice/:
    get:
      operationId: ai_mentor_orgs_users_mentors_custom_voice_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/custom-voice/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/custom-voice/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
    post:
      operationId: ai_mentor_orgs_users_mentors_custom_voice_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/custom-voice/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/custom-voice/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /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: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/custom-voice-tts/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/custom-voice-tts/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/default/:
    get:
      operationId: ai_mentor_orgs_users_mentors_default_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/default/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/default/` (`mentor` → `agent`) and will be removed in a future release.

        Retrieve the user's default mentor for this tenant.

        Returns ``null`` when the user has not set a default mentor.
      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/UserDefaultMentor'
          description: ''
        '404':
          description: Student or platform not found
      deprecated: true
    put:
      operationId: ai_mentor_orgs_users_mentors_default_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/default/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/default/` (`mentor` → `agent`) and will be removed in a future release.

        Set (or replace) the user's default mentor for this tenant.

        The unique (student, platform) constraint guarantees at most one
        default mentor per user per tenant; setting a new one replaces any
        existing default.
      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/UserDefaultMentor'
          description: ''
        '404':
          description: Mentor, student or platform not found
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_users_mentors_default_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/default/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/default/` (`mentor` → `agent`) and will be removed in a future release.

        Clear the user's default mentor for this tenant.

        Idempotent: returns 204 whether or not a default was set.
      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: Default mentor cleared
        '404':
          description: Student or platform not found
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/edit-scenarios/:
    put:
      operationId: ai_mentor_orgs_users_mentors_edit_scenarios_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/edit-scenarios/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/edit-scenarios/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/fork/:
    post:
      operationId: ai_mentor_orgs_users_mentors_fork_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
    put:
      operationId: ai_mentor_orgs_users_mentors_fork_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/` (`mentor` → `agent`) and will be removed in a future release.

        API view for forking (cloning) a mentor.

        This view allows users to create a copy of an existing mentor
        with its settings and configurations.

        Permissions:
            - Restricted to tenant admins and the student themselves
      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':
          description: No response body
      deprecated: true
    patch:
      operationId: ai_mentor_orgs_users_mentors_fork_partial_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/` (`mentor` → `agent`) and will be removed in a future release.

        API view for forking (cloning) a mentor.

        This view allows users to create a copy of an existing mentor
        with its settings and configurations.

        Permissions:
            - Restricted to tenant admins and the student themselves
      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':
          description: No response body
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_users_mentors_fork_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/fork/` (`mentor` → `agent`) and will be removed in a future release.

        API view for forking (cloning) a mentor.

        This view allows users to create a copy of an existing mentor
        with its settings and configurations.

        Permissions:
            - Restricted to tenant admins and the student themselves
      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
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/historical-memory/:
    get:
      operationId: ai_mentor_orgs_users_mentors_historical_memory_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/historical-memory/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/historical-memory/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/memory-progress/:
    get:
      operationId: ai_mentor_orgs_users_mentors_memory_progress_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/memory-progress/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/memory-progress/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/memory-settings/:
    get:
      operationId: ai_mentor_orgs_users_mentors_memory_settings_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/memory-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/memory-settings/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
    post:
      operationId: ai_mentor_orgs_users_mentors_memory_settings_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/memory-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/memory-settings/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/mentor-eval/:
    get:
      operationId: ai_mentor_orgs_users_mentors_mentor_eval_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-eval/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-eval/` (`mentor` → `agent`) and will be removed in a future release.

        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}}.\n\n The sample answer to the question\
                      \ is {{sample_answer}} \n\n The answer you are evaluating is\
                      \ {{mentor_answer}}. \n\n 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
      deprecated: true
    post:
      operationId: ai_mentor_orgs_users_mentors_mentor_eval_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-eval/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-eval/` (`mentor` → `agent`) and will be removed in a future release.

        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}}.\n\n The sample answer to the question\
                      \ is {{sample_answer}} \n\n The answer you are evaluating is\
                      \ {{mentor_answer}}. \n\n 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
      deprecated: true
  /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: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-eval-execution/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-eval-execution/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /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: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
    post:
      operationId: ai_mentor_orgs_users_mentors_mentor_user_settings_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
    put:
      operationId: ai_mentor_orgs_users_mentors_mentor_user_settings_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` (`mentor` → `agent`) and will be removed in a future release.

        Mixin to set the auditlog actor context for DRF views.

        For Django auth.User (admin users): Uses auditlog's native actor FK.
        For edX users (AuthStudent): Sets edx_actor FK on DMAuditLogEntry.

        IMPORTANT: This mixin only works for views that DO NOT override the
        HTTP/action methods (post, put, patch, delete, create, update, partial_update,
        destroy). For views that define their own methods, use the @with_auditlog_actor
        decorator on those methods instead.
      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':
          description: No response body
      deprecated: true
    patch:
      operationId: ai_mentor_orgs_users_mentors_mentor_user_settings_partial_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` (`mentor` → `agent`) and will be removed in a future release.

        Mixin to set the auditlog actor context for DRF views.

        For Django auth.User (admin users): Uses auditlog's native actor FK.
        For edX users (AuthStudent): Sets edx_actor FK on DMAuditLogEntry.

        IMPORTANT: This mixin only works for views that DO NOT override the
        HTTP/action methods (post, put, patch, delete, create, update, partial_update,
        destroy). For views that define their own methods, use the @with_auditlog_actor
        decorator on those methods instead.
      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':
          description: No response body
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_users_mentors_mentor_user_settings_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/agent-user-settings/` (`mentor` → `agent`) and will be removed in a future release.

        Mixin to set the auditlog actor context for DRF views.

        For Django auth.User (admin users): Uses auditlog's native actor FK.
        For edX users (AuthStudent): Sets edx_actor FK on DMAuditLogEntry.

        IMPORTANT: This mixin only works for views that DO NOT override the
        HTTP/action methods (post, put, patch, delete, create, update, partial_update,
        destroy). For views that define their own methods, use the @with_auditlog_actor
        decorator on those methods instead.
      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
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/public-settings/:
    get:
      operationId: ai_mentor_orgs_users_mentors_public_settings_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/public-settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/public-settings/` (`mentor` → `agent`) and will be removed in a future release.

        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.
      deprecated: true
  /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: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/public-sharable-link/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/public-sharable-link/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
  /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: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/reports/{report_id}/agent-eval-report/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/reports/{report_id}/agent-eval-report/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/scenarios/:
    get:
      operationId: ai_mentor_orgs_users_mentors_scenarios_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/scenarios/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/scenarios/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/settings/:
    get:
      operationId: ai_mentor_orgs_users_mentors_settings_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
    post:
      operationId: ai_mentor_orgs_users_mentors_settings_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` (`mentor` → `agent`) and will be removed in a future release.

        API view to retrieve and update mentor settings.

        Permissions:
            - Only accessible to tenant admins.
      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/MentorSettings'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/MentorSettings'
          application/json:
            schema:
              $ref: '#/components/schemas/MentorSettings'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSettings'
          description: ''
      deprecated: true
    put:
      operationId: ai_mentor_orgs_users_mentors_settings_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
    patch:
      operationId: ai_mentor_orgs_users_mentors_settings_partial_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` (`mentor` → `agent`) and will be removed in a future release.

        API view to retrieve and update mentor settings.

        Permissions:
            - Only accessible to tenant admins.
      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/PatchedMentorSettings'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMentorSettings'
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedMentorSettings'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MentorSettings'
          description: ''
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_users_mentors_settings_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/settings/` (`mentor` → `agent`) and will be removed in a future release.

        API view to retrieve and update mentor settings.

        Permissions:
            - Only accessible to tenant admins.
      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:
        '204':
          description: No response body
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/sharable-link:
    get:
      operationId: ai_mentor_orgs_users_mentors_sharable_link_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
    post:
      operationId: ai_mentor_orgs_users_mentors_sharable_link_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
    put:
      operationId: ai_mentor_orgs_users_mentors_sharable_link_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_users_mentors_sharable_link_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/sharable-link` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/shared-prompt/:
    get:
      operationId: ai_mentor_orgs_users_mentors_shared_prompt_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` (`mentor` → `agent`) and will be removed in a future release.

        Share one mentor's system prompt with mentors in any tenant.

        The mentor in the URL is the **source**: its own `system_prompt` field is
        the shared prompt, so there is no separate copy to keep in sync. Targets
        resolve to it at chat time and keep their own prompt untouched, which is
        what makes unsharing a clean restore.

        Permissions:
            - The caller must be a platform admin of the source tenant *and* of
              every tenant named in the request. Unlike forking, there is no
              carve-out for the `main` platform.
      summary: List mentors sharing this mentor's system 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
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SharedSystemPromptResponse'
          description: ''
        '404':
          description: Mentor not found
      deprecated: true
    post:
      operationId: ai_mentor_orgs_users_mentors_shared_prompt_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` (`mentor` → `agent`) and will be removed in a future release.

        Adds targets to the source mentor's sharing list. Idempotent: a target already consuming this source is left as-is. Requires at least one target.
      summary: Share this mentor's system prompt with more mentors
      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/SharedSystemPromptRequest'
            examples:
              ShareWithTwoTenants:
                value:
                  targets:
                  - platform_key: tenant-b
                    mentor: support-agent
                  - platform_key: tenant-c
                    mentor: support-agent
                summary: Share with two tenants
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SharedSystemPromptRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SharedSystemPromptRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SharedSystemPromptRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/SharedSystemPromptRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SharedSystemPromptResponse'
          description: ''
        '400':
          description: Invalid target or share would chain
        '403':
          description: Not a platform admin of every tenant
        '404':
          description: Mentor or target not found
      deprecated: true
    put:
      operationId: ai_mentor_orgs_users_mentors_shared_prompt_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` (`mentor` → `agent`) and will be removed in a future release.

        Share one mentor's system prompt with mentors in any tenant.

        The mentor in the URL is the **source**: its own `system_prompt` field is
        the shared prompt, so there is no separate copy to keep in sync. Targets
        resolve to it at chat time and keep their own prompt untouched, which is
        what makes unsharing a clean restore.

        Permissions:
            - The caller must be a platform admin of the source tenant *and* of
              every tenant named in the request. Unlike forking, there is no
              carve-out for the `main` platform.
      summary: Replace the set of mentors sharing this system 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/SharedSystemPromptRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SharedSystemPromptRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SharedSystemPromptRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SharedSystemPromptRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/SharedSystemPromptRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SharedSystemPromptResponse'
          description: ''
        '400':
          description: Invalid target or share would chain
        '403':
          description: Not a platform admin of every tenant
      deprecated: true
    patch:
      operationId: ai_mentor_orgs_users_mentors_shared_prompt_partial_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` (`mentor` → `agent`) and will be removed in a future release.

        Share one mentor's system prompt with mentors in any tenant.

        The mentor in the URL is the **source**: its own `system_prompt` field is
        the shared prompt, so there is no separate copy to keep in sync. Targets
        resolve to it at chat time and keep their own prompt untouched, which is
        what makes unsharing a clean restore.

        Permissions:
            - The caller must be a platform admin of the source tenant *and* of
              every tenant named in the request. Unlike forking, there is no
              carve-out for the `main` platform.
      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':
          description: No response body
      deprecated: true
    delete:
      operationId: ai_mentor_orgs_users_mentors_shared_prompt_destroy
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/shared-prompt/` (`mentor` → `agent`) and will be removed in a future release.

        Removes the named targets from the sharing list. Omit `targets` to remove every consumer. Each unshared mentor goes back to its own preserved system prompt.
      summary: Stop sharing this mentor's system 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
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SharedSystemPromptResponse'
          description: ''
        '403':
          description: Not a platform admin of every tenant
      deprecated: true
  /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: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/spaced-repetition-question-stats/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/spaced-repetition-question-stats/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /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: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/spaced-repetition-recommended-paths/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/spaced-repetition-recommended-paths/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
    put:
      operationId: ai_mentor_orgs_users_mentors_spaced_repetition_recommended_paths_update
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/spaced-repetition-recommended-paths/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/spaced-repetition-recommended-paths/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/star/:
    get:
      operationId: ai_mentor_orgs_users_mentors_star_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/star/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/star/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
    post:
      operationId: ai_mentor_orgs_users_mentors_star_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/star/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/star/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/summaries/{summary_type}/:
    get:
      operationId: ai_mentor_orgs_users_mentors_summaries_retrieve
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/summaries/{summary_type}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/summaries/{summary_type}/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/{mentor}/unstar/:
    post:
      operationId: ai_mentor_orgs_users_mentors_unstar_create
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/unstar/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/{mentor}/unstar/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/mentors/audit-logs/:
    get:
      operationId: ai_mentor_orgs_users_mentors_audit_logs_list
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/audit-logs/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/agents/audit-logs/` (`mentor` → `agent`) and will be removed in a future release.

        Retrieve audit log entries for mentor-related models (Mentor, MentorSettings, Prompt, DocumentEmbedding) within a specific organization. Mentor owners can access audit logs for their own mentors when filtering by mentor. Supports filtering by mentor, action type, actor, and date range.
      summary: List Mentor Audit Logs
      parameters:
      - in: query
        name: action
        schema:
          type: integer
          enum:
          - 0
          - 1
          - 2
        description: 'Filter by action type: 0=create, 1=update, 2=delete'
      - in: query
        name: actor_email
        schema:
          type: string
        description: Filter by actor's email
      - in: query
        name: actor_username
        schema:
          type: string
        description: Filter by actor's username
      - in: query
        name: from_date
        schema:
          type: string
        description: Inclusive lower bound on timestamp (ISO8601 date, e.g., 2024-01-01)
      - name: limit
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      - in: query
        name: mentor
        schema:
          type: string
        description: Filter by mentor unique_id
      - name: offset
        required: false
        in: query
        description: The initial index from which to return the results.
        schema:
          type: integer
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: to_date
        schema:
          type: string
        description: Inclusive upper bound on timestamp (ISO8601 date, e.g., 2024-12-31)
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedMentorAuditLogEntryList'
              examples:
                AuditLogResponseExample:
                  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: 123
                        timestamp: '2024-03-15T10:30:00Z'
                        actor_username: johndoe
                        actor_email: johndoe@example.com
                        action: update
                        resource_type: mentor
                        resource_id: '506'
                        resource_repr: mentorAI - main
                        changes:
                          enable_moderation:
                          - 'False'
                          - 'True'
                          enable_safety_system:
                          - 'False'
                          - 'True'
                  summary: Audit Log Response Example
          description: ''
        '401':
          description: Authentication required
        '403':
          description: Not a platform administrator
      deprecated: true
  /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: end_time
        schema:
          type: string
          format: date-time
      - 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: start_time
        schema:
          type: string
          format: date-time
      - in: query
        name: target_system
        schema:
          type: string
          enum:
          - Moderation System
          - PHI System
          - Privacy System
          - Safety System
        description: |-
          * `Safety System` - Safety System
          * `Moderation System` - Moderation System
          * `Privacy System` - Privacy System
          * `PHI System` - Phi 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 sessions for a user.

        Returns a lightweight paginated list of pinned sessions containing:
        - session_id: UUID of the session
        - mentor_unique_id: UUID of the mentor
        - mentor: Object with unique_id (for backward compatibility)
        - title: AI-generated session title
        - messages: Array containing only the first message

        Query Parameters:
            mentor: Filter by mentor unique_id, slug, or name (optional)

        Args:
            request: The HTTP request.
            org: Organization key identifier.
            user_id: The username of the student.

        Returns:
            Response: Paginated list of pinned sessions.
      parameters:
      - in: query
        name: mentor
        schema:
          type: string
          minLength: 1
        description: Filter by mentor unique_id, slug, or name
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: search
        schema:
          type: string
        description: Case-insensitive search across the session title and the content
          of its chat messages (both human and AI).
      - 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/SessionSummary'
              examples:
                RetrievePinnedMessagesExample:
                  value:
                  - - session_id: 550e8400-e29b-41d4-a716-446655440000
                      mentor_unique_id: 550e8400-e29b-41d4-a716-446655440001
                      title: Help with Python loops
                      messages:
                      - id: 123
                        message:
                          type: human
                          data:
                            content: '...'
                        inserted_at: '2024-03-12T12:34:56Z'
                  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
        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}/providers/heygen/video/assets/:
    post:
      operationId: ai_mentor_orgs_users_providers_heygen_video_assets_create
      description: Upload a media asset to HeyGen (image/video/audio, multipart).
      summary: Upload an asset to HeyGen
      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:
              type: object
              properties:
                file:
                  type: string
                  format: binary
              required:
              - file
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Asset with asset_id/url, body verbatim
        '400':
          description: Missing file or over the size cap
        '403':
          description: Permission denied
        '502':
          description: HeyGen credential/availability error
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/avatar-groups/:
    post:
      operationId: ai_mentor_orgs_users_providers_heygen_video_avatar_groups_create
      description: Create a digital-twin or photo avatar (billable).
      summary: Create a HeyGen avatar (digital twin or photo)
      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/HeygenAvatarCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/HeygenAvatarCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/HeygenAvatarCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/HeygenAvatarCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/HeygenAvatarCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Avatar group/item, body verbatim
        '402':
          description: Insufficient credits
        '403':
          description: Permission denied
        '429':
          description: HeyGen rate limit
        '502':
          description: HeyGen credential/availability error
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/avatar-groups/{group_id}/:
    get:
      operationId: ai_mentor_orgs_users_providers_heygen_video_avatar_groups_retrieve
      description: Avatar group detail — the digital-twin training-status poll target.
      summary: Get a HeyGen avatar group (training status)
      parameters:
      - in: path
        name: group_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: Avatar group detail, body verbatim
        '403':
          description: Permission denied
        '404':
          description: Unknown group
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/avatar-groups/{group_id}/consent/:
    post:
      operationId: ai_mentor_orgs_users_providers_heygen_video_avatar_groups_consent_create
      description: Create the consent URL for a digital-twin avatar group.
      summary: Create a HeyGen avatar consent URL
      parameters:
      - in: path
        name: group_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: Consent URL, body verbatim
        '403':
          description: Permission denied
        '404':
          description: Unknown group
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/avatar-groups/{group_id}/looks/:
    get:
      operationId: ai_mentor_orgs_users_providers_heygen_video_avatar_groups_looks_retrieve
      description: List the looks of an avatar group.
      summary: List a HeyGen avatar group's looks
      parameters:
      - in: path
        name: group_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: Looks list, body verbatim
        '403':
          description: Permission denied
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/streaming/avatars/:
    get:
      operationId: ai_mentor_orgs_users_providers_heygen_video_streaming_avatars_retrieve
      description: List interactive-capable streaming avatars.
      summary: List HeyGen interactive streaming avatars
      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: Streaming avatars, body verbatim
        '403':
          description: Permission denied
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/streaming/knowledge-bases/:
    get:
      operationId: ai_mentor_orgs_users_providers_heygen_video_streaming_knowledge_bases_retrieve
      description: List streaming knowledge bases (flattened envelope).
      summary: List HeyGen streaming knowledge bases
      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: 'Flattened list: {"data": [...]}'
        '403':
          description: Permission denied
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/streaming/sessions/:
    post:
      operationId: ai_mentor_orgs_users_providers_heygen_video_streaming_sessions_create
      description: |-
        Create an interactive streaming session (billable).

        Returns ``session_id``/``access_token``/``url`` verbatim — the browser
        connects to LiveKit and the streaming.chat websocket directly with the
        access token; media never touches this server.
      summary: Create a HeyGen interactive streaming session
      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/HeygenStreamingSession'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/HeygenStreamingSession'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/HeygenStreamingSession'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/HeygenStreamingSession'
          '*/*':
            schema:
              $ref: '#/components/schemas/HeygenStreamingSession'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Session with session_id/access_token/url, body verbatim
        '402':
          description: Insufficient credits
        '403':
          description: Permission denied
        '429':
          description: HeyGen rate/session limit
        '502':
          description: HeyGen credential/availability error
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/streaming/sessions/{session_id}/{action}/:
    post:
      operationId: ai_mentor_orgs_users_providers_heygen_video_streaming_sessions_control
      description: '`action` is one of start, stop, interrupt, keep-alive, start-listening,
        stop-listening, task. The session_id comes from the URL; `task` additionally
        takes text/task_type/task_mode.'
      summary: Send a HeyGen streaming session control
      parameters:
      - in: path
        name: action
        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/HeygenStreamingTask'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/HeygenStreamingTask'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/HeygenStreamingTask'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/HeygenStreamingTask'
          '*/*':
            schema:
              $ref: '#/components/schemas/HeygenStreamingTask'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Control result, body verbatim
        '403':
          description: Permission denied
        '404':
          description: Unknown action
        '502':
          description: HeyGen credential/availability error
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/videos/:
    post:
      operationId: ai_mentor_orgs_users_providers_heygen_video_videos_create
      description: Create an avatar or image video (billable).
      summary: Create a HeyGen video (avatar or image)
      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/HeygenVideoCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/HeygenVideoCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/HeygenVideoCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/HeygenVideoCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/HeygenVideoCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Video creation result with video_id
        '402':
          description: Insufficient credits
        '403':
          description: Permission denied
        '429':
          description: HeyGen rate limit
        '502':
          description: HeyGen credential/availability error
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/videos/{video_id}/:
    get:
      operationId: ai_mentor_orgs_users_providers_heygen_video_videos_retrieve
      description: Video detail — the generation-status poll target.
      summary: Get a HeyGen video (generation status)
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      - in: path
        name: video_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Video detail, body verbatim
        '403':
          description: Permission denied
        '404':
          description: Unknown video
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/voices/:
    get:
      operationId: ai_mentor_orgs_users_providers_heygen_video_voices_retrieve
      description: List HeyGen voices (paginated, filterable).
      summary: List HeyGen voices
      parameters:
      - in: query
        name: engine
        schema:
          type: string
      - in: query
        name: gender
        schema:
          type: string
      - in: query
        name: language
        schema:
          type: string
      - in: query
        name: limit
        schema:
          type: integer
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: token
        schema:
          type: string
      - in: query
        name: type
        schema:
          type: string
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: HeyGen voice page, body verbatim
        '403':
          description: Permission denied
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/voices/clone/:
    post:
      operationId: ai_mentor_orgs_users_providers_heygen_video_voices_clone_create
      description: Clone a voice from an uploaded audio asset (billable).
      summary: Clone a HeyGen voice
      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/HeygenVoiceClone'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/HeygenVoiceClone'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/HeygenVoiceClone'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/HeygenVoiceClone'
          '*/*':
            schema:
              $ref: '#/components/schemas/HeygenVoiceClone'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Clone result with voice_clone_id
        '402':
          description: Insufficient credits
        '403':
          description: Permission denied
        '429':
          description: HeyGen rate limit
        '502':
          description: HeyGen credential/availability error
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/heygen/video/voices/speech/:
    post:
      operationId: ai_mentor_orgs_users_providers_heygen_video_voices_speech_create
      description: Generate a TTS speech preview (billable).
      summary: Generate a HeyGen TTS preview
      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/HeygenTtsPreview'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/HeygenTtsPreview'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/HeygenTtsPreview'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/HeygenTtsPreview'
          '*/*':
            schema:
              $ref: '#/components/schemas/HeygenTtsPreview'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Audio URL and timing, body verbatim
        '402':
          description: Insufficient credits
        '403':
          description: Permission denied
        '429':
          description: HeyGen rate limit
        '502':
          description: HeyGen credential/availability error
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/checkout-sessions/:
    get:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_checkout_sessions_list
      description: 'Stripe checkout sessions: list the collection, create a session.'
      summary: List Stripe checkout sessions
      parameters:
      - in: query
        name: ending_before
        schema:
          type: string
      - in: query
        name: limit
        schema:
          type: integer
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: query
        name: starting_after
        schema:
          type: string
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error
    post:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_checkout_sessions_create
      description: 'Stripe checkout sessions: list the collection, create a session.'
      summary: Create a Stripe checkout session
      parameters:
      - in: header
        name: Idempotency-Key
        schema:
          type: string
        description: Forwarded to Stripe verbatim. No server-side retries happen;
          supply this header to make client retries safe.
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionCreate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '402':
          description: Stripe card error, passed through
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error. On a mutating call the
            outcome is indeterminate — the request may have been applied upstream
            (read timeout). Retry only with the same Idempotency-Key.
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/checkout-sessions/{session_id}/:
    get:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_checkout_sessions_retrieve
      description: 'One Stripe checkout session: retrieve (sessions are not updatable
        here).'
      summary: Retrieve a Stripe checkout session
      parameters:
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        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':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/checkout-sessions/{session_id}/expire/:
    post:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_checkout_sessions_expire
      description: Expire an open Stripe checkout session.
      summary: Expire a Stripe checkout session
      parameters:
      - in: header
        name: Idempotency-Key
        schema:
          type: string
        description: Forwarded to Stripe verbatim. No server-side retries happen;
          supply this header to make client retries safe.
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        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':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '402':
          description: Stripe card error, passed through
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error. On a mutating call the
            outcome is indeterminate — the request may have been applied upstream
            (read timeout). Retry only with the same Idempotency-Key.
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/customers/:
    get:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_customers_list
      description: 'Stripe customers: list the collection, create a customer.'
      summary: List Stripe customers
      parameters:
      - in: query
        name: ending_before
        schema:
          type: string
      - in: query
        name: limit
        schema:
          type: integer
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: query
        name: starting_after
        schema:
          type: string
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error
    post:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_customers_create
      description: 'Stripe customers: list the collection, create a customer.'
      summary: Create a Stripe customer
      parameters:
      - in: header
        name: Idempotency-Key
        schema:
          type: string
        description: Forwarded to Stripe verbatim. No server-side retries happen;
          supply this header to make client retries safe.
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripeCustomerCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/StripeCustomerCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StripeCustomerCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StripeCustomerCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/StripeCustomerCreate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '402':
          description: Stripe card error, passed through
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error. On a mutating call the
            outcome is indeterminate — the request may have been applied upstream
            (read timeout). Retry only with the same Idempotency-Key.
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/customers/{customer_id}/:
    get:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_customers_retrieve
      description: 'One Stripe customer: retrieve, update (Stripe updates are POSTs).'
      summary: Retrieve a Stripe customer
      parameters:
      - in: path
        name: customer_id
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error
    post:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_customers_update
      description: 'One Stripe customer: retrieve, update (Stripe updates are POSTs).'
      summary: Update a Stripe customer
      parameters:
      - in: header
        name: Idempotency-Key
        schema:
          type: string
        description: Forwarded to Stripe verbatim. No server-side retries happen;
          supply this header to make client retries safe.
      - in: path
        name: customer_id
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '402':
          description: Stripe card error, passed through
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error. On a mutating call the
            outcome is indeterminate — the request may have been applied upstream
            (read timeout). Retry only with the same Idempotency-Key.
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/customers/search/:
    get:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_customers_search
      description: Search Stripe customers with the Stripe search query language.
      summary: Search Stripe customers
      parameters:
      - in: query
        name: limit
        schema:
          type: integer
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: query
        name: page
        schema:
          type: string
      - in: query
        name: query
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/payment-links/:
    get:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_payment_links_list
      description: 'Stripe payment links: list the collection, create a payment link.'
      summary: List Stripe payment links
      parameters:
      - in: query
        name: ending_before
        schema:
          type: string
      - in: query
        name: limit
        schema:
          type: integer
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: query
        name: starting_after
        schema:
          type: string
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error
    post:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_payment_links_create
      description: 'Stripe payment links: list the collection, create a payment link.'
      summary: Create a Stripe payment link
      parameters:
      - in: header
        name: Idempotency-Key
        schema:
          type: string
        description: Forwarded to Stripe verbatim. No server-side retries happen;
          supply this header to make client retries safe.
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripePaymentLinkCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/StripePaymentLinkCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StripePaymentLinkCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StripePaymentLinkCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/StripePaymentLinkCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '402':
          description: Stripe card error, passed through
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error. On a mutating call the
            outcome is indeterminate — the request may have been applied upstream
            (read timeout). Retry only with the same Idempotency-Key.
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/payment-links/{payment_link_id}/:
    get:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_payment_links_retrieve
      description: 'One Stripe payment link: retrieve, update (e.g. deactivate).'
      summary: Retrieve a Stripe payment link
      parameters:
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: path
        name: payment_link_id
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error
    post:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_payment_links_update
      description: 'One Stripe payment link: retrieve, update (e.g. deactivate).'
      summary: Update a Stripe payment link
      parameters:
      - in: header
        name: Idempotency-Key
        schema:
          type: string
        description: Forwarded to Stripe verbatim. No server-side retries happen;
          supply this header to make client retries safe.
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: path
        name: payment_link_id
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '402':
          description: Stripe card error, passed through
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error. On a mutating call the
            outcome is indeterminate — the request may have been applied upstream
            (read timeout). Retry only with the same Idempotency-Key.
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/paywall/access/:
    get:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_paywall_access_read
      description: 'Answers from, in order: a short cache (grants 60s, denies 15s),
        the platform''s recorded one-time payments, the `session_id` the buyer returned
        with (read-after-write safe — pass it on the checkout return page; Stripe
        search is ~1 min eventually consistent), then a customer search. Subscriptions
        are checked live so cancellation takes effect within the cache window. If
        Stripe is unreachable, recorded payers keep access (`stale: true`); unknown
        users fail closed.'
      summary: Check paywall access for a user
      parameters:
      - in: query
        name: app
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: query
        name: session_id
        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/StripePaywallAccessResponse'
          description: ''
        '400':
          description: Invalid input or missing tenant credential
        '403':
          description: Permission denied
        '404':
          description: Non-member path user
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/paywall/checkout/:
    post:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_paywall_checkout_create
      description: Creates a Stripe Checkout Session on the tenant's account for the
        path user. The price must belong to an active product tagged `metadata.app`;
        `success_url`/`cancel_url` must point at one of the platform's deployed apps,
        its custom domains, or localhost. Mode (one-time vs subscription) follows
        the price type.
      summary: Start a paywall checkout for a user
      parameters:
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripePaywallCheckout'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/StripePaywallCheckout'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StripePaywallCheckout'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StripePaywallCheckout'
          '*/*':
            schema:
              $ref: '#/components/schemas/StripePaywallCheckout'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripePaywallCheckoutResponse'
          description: ''
        '400':
          description: Invalid input, untrusted redirect URL, price/app mismatch,
            or missing tenant credential
        '403':
          description: Permission denied
        '404':
          description: Non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/paywall/payments/:
    get:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_paywall_payments_list
      description: 'Payments and subscriptions the paywall has observed for this platform,
        newest first, served from the DM''s own records — answers ''who paid for app
        X'' without touching Stripe. Rows carry the last observed status; subscriptions
        refresh on every uncached access check. Body: `{count, results}`.'
      summary: List recorded paywall payments
      parameters:
      - in: query
        name: app
        schema:
          type: string
      - in: query
        name: limit
        schema:
          type: integer
      - in: query
        name: offset
        schema:
          type: integer
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      - in: query
        name: username
        schema:
          type: string
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: '`{count, results: [payment, ...]}`, newest first'
        '403':
          description: Permission denied
        '404':
          description: Non-member path user
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/prices/:
    get:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_prices_list
      description: 'Stripe prices: list the collection, create a price.'
      summary: List Stripe prices
      parameters:
      - in: query
        name: ending_before
        schema:
          type: string
      - in: query
        name: limit
        schema:
          type: integer
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: query
        name: starting_after
        schema:
          type: string
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error
    post:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_prices_create
      description: 'Stripe prices: list the collection, create a price.'
      summary: Create a Stripe price
      parameters:
      - in: header
        name: Idempotency-Key
        schema:
          type: string
        description: Forwarded to Stripe verbatim. No server-side retries happen;
          supply this header to make client retries safe.
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripePriceCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/StripePriceCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StripePriceCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StripePriceCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/StripePriceCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '402':
          description: Stripe card error, passed through
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error. On a mutating call the
            outcome is indeterminate — the request may have been applied upstream
            (read timeout). Retry only with the same Idempotency-Key.
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/prices/{price_id}/:
    get:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_prices_retrieve
      description: 'One Stripe price: retrieve, update.'
      summary: Retrieve a Stripe price
      parameters:
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: path
        name: price_id
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error
    post:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_prices_update
      description: 'One Stripe price: retrieve, update.'
      summary: Update a Stripe price
      parameters:
      - in: header
        name: Idempotency-Key
        schema:
          type: string
        description: Forwarded to Stripe verbatim. No server-side retries happen;
          supply this header to make client retries safe.
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: path
        name: price_id
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '402':
          description: Stripe card error, passed through
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error. On a mutating call the
            outcome is indeterminate — the request may have been applied upstream
            (read timeout). Retry only with the same Idempotency-Key.
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/products/:
    get:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_products_list
      description: 'Stripe products: list the collection, create a product.'
      summary: List Stripe products
      parameters:
      - in: query
        name: ending_before
        schema:
          type: string
      - in: query
        name: limit
        schema:
          type: integer
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: query
        name: starting_after
        schema:
          type: string
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error
    post:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_products_create
      description: 'Stripe products: list the collection, create a product.'
      summary: Create a Stripe product
      parameters:
      - in: header
        name: Idempotency-Key
        schema:
          type: string
        description: Forwarded to Stripe verbatim. No server-side retries happen;
          supply this header to make client retries safe.
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripeProductCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/StripeProductCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StripeProductCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StripeProductCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/StripeProductCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '402':
          description: Stripe card error, passed through
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error. On a mutating call the
            outcome is indeterminate — the request may have been applied upstream
            (read timeout). Retry only with the same Idempotency-Key.
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/stripe/payments/products/{product_id}/:
    get:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_products_retrieve
      description: 'One Stripe product: retrieve, update.'
      summary: Retrieve a Stripe product
      parameters:
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: path
        name: product_id
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error
    post:
      operationId: ai_mentor_orgs_users_providers_stripe_payments_products_update
      description: 'One Stripe product: retrieve, update.'
      summary: Update a Stripe product
      parameters:
      - in: header
        name: Idempotency-Key
        schema:
          type: string
        description: Forwarded to Stripe verbatim. No server-side retries happen;
          supply this header to make client retries safe.
      - in: path
        name: org
        schema:
          type: string
        description: Platform **key** (not the platform's `org` value). Must match
          the calling token's platform. OAuth2 client-credentials service accounts
          with superuser rights may name any platform.
        required: true
      - in: path
        name: product_id
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Stripe response body, verbatim
        '400':
          description: Invalid request or missing tenant credential
        '402':
          description: Stripe card error, passed through
        '403':
          description: Permission denied
        '404':
          description: Unknown object or non-member path user
        '429':
          description: Stripe rate limit
        '502':
          description: Stripe credential/availability error. On a mutating call the
            outcome is indeterminate — the request may have been applied upstream
            (read timeout). Retry only with the same Idempotency-Key.
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/vercel/hosting/deployment/:
    get:
      operationId: ai_mentor_orgs_users_providers_vercel_hosting_deployment_retrieve
      description: 'Lists the path user''s hosting projects, merged with live latest-deployment
        state from Vercel (one bulk call). When Vercel is unreachable the cached state
        is served with `stale: true`.'
      summary: List the user's hosting projects
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: provider
        schema:
          type: string
        description: Hosting provider. Only 'vercel' is supported (default).
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Projects with live deployment state
        '403':
          description: Permission denied
    post:
      operationId: ai_mentor_orgs_users_providers_vercel_hosting_deployment_create
      description: 'Validates the upload and credit balance synchronously, spools
        the zip and queues the push to Vercel. Returns 202 with `push_state: pending`;
        poll the detail endpoint for progress. The project is created on first deploy
        as `{platform}-{username}-{project}-<hash>` (the deterministic hash suffix
        keeps names collision-free). The live *.vercel.app host is Vercel''s to mint
        — long names get right-truncated — so read the URL from the response (`url`/`vercel_alias`,
        or the poll''s `deployment.aliases`), never reconstruct it from the name.
        Archive structure (valid zip, safe paths, size/count caps) is rejected synchronously
        with a 400; corruption inside a member is only detectable when the worker
        reads the bytes, so it surfaces asynchronously as `push_state: failed` on
        the poll endpoint.'
      summary: Deploy a project zip to Vercel
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: provider
        schema:
          type: string
        description: Hosting provider. Only 'vercel' is supported (default).
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                project:
                  type: string
                framework:
                  type: string
                  enum:
                  - static
                  - nextjs
                  default: static
                  description: '''nextjs'' uploads app source; Vercel installs from
                    the lockfile and builds — poll ready_state for the build result'
              required:
              - file
              - project
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HostingProject'
          description: ''
        '400':
          description: Validation / credential error
        '402':
          description: Insufficient credits
        '403':
          description: Permission denied
        '409':
          description: Name collision or push in progress
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/vercel/hosting/deployment/{id}/:
    get:
      operationId: ai_mentor_orgs_users_providers_vercel_hosting_deployment_retrieve_2
      description: 'Poll target for deploys. While a push/build is in flight only
        the deployment status is fetched (slim poll); once terminal the full fan-out
        adds project info, domains, recent deployments and — for failed builds — a
        build log tail. Serves cached state with `stale: true` when Vercel is unreachable.'
      summary: Get a hosting project with live deployment state
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: provider
        schema:
          type: string
        description: Hosting provider. Only 'vercel' is supported (default).
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Project with live deployment state
        '403':
          description: Permission denied
        '404':
          description: Not found
    delete:
      operationId: ai_mentor_orgs_users_providers_vercel_hosting_deployment_destroy
      description: Deletes the Vercel project (tolerating out-of-band deletion), its
        mirrored custom-domain rows and the local record.
      summary: Delete a hosting project
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: provider
        schema:
          type: string
        description: Hosting provider. Only 'vercel' is supported (default).
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Deleted
        '400':
          description: No Vercel credential configured
        '403':
          description: Permission denied
        '404':
          description: Not found
  /api/ai-mentor/orgs/{org}/users/{user_id}/providers/vercel/hosting/dns/:
    get:
      operationId: ai_mentor_orgs_users_providers_vercel_hosting_dns_retrieve
      description: 'Without `domain`: list the project''s domains. With `domain`:
        full detail — verification is re-checked and the DNS records the user must
        set (A/CNAME/TXT) are included.'
      summary: List or inspect a project's custom domains
      parameters:
      - in: query
        name: domain
        schema:
          type: string
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: project
        schema:
          type: integer
        required: true
      - in: query
        name: provider
        schema:
          type: string
        description: Hosting provider. Only 'vercel' is supported (default).
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Domain list or detail
        '403':
          description: Permission denied
        '404':
          description: Not found
    post:
      operationId: ai_mentor_orgs_users_providers_vercel_hosting_dns_create
      description: Reserves the domain locally (mirrored into the unified /api/custom-domains/
        listing), attaches it to the Vercel project and returns the DNS records to
        configure at the registrar.
      summary: Attach a custom domain to a hosting project
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: provider
        schema:
          type: string
        description: Hosting provider. Only 'vercel' is supported (default).
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DomainAttach'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/DomainAttach'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DomainAttach'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DomainAttach'
          '*/*':
            schema:
              $ref: '#/components/schemas/DomainAttach'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          description: Domain attached
        '400':
          description: Validation / credential error
        '403':
          description: Permission denied
        '409':
          description: Domain already in use
    delete:
      operationId: ai_mentor_orgs_users_providers_vercel_hosting_dns_destroy
      description: Custom domains on a hosting project, mirrored into CustomDomain.
      summary: Detach a custom domain from a hosting project
      parameters:
      - in: query
        name: domain
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: project
        schema:
          type: integer
        required: true
      - in: query
        name: provider
        schema:
          type: string
        description: Hosting provider. Only 'vercel' is supported (default).
      - in: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Detached
        '400':
          description: Validation / credential error
        '403':
          description: Permission denied
  /api/ai-mentor/orgs/{org}/users/{user_id}/recent-messages/:
    get:
      operationId: ai_mentor_orgs_users_recent_messages_list
      description: Get recent chat sessions of a user within an organization.
      parameters:
      - in: query
        name: mentor
        schema:
          type: string
          minLength: 1
        description: Filter by mentor unique_id, slug, or name
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: search
        schema:
          type: string
        description: Case-insensitive search across the session title and the content
          of its chat messages (both human and AI).
      - 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/SessionSummary'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidQueryParameters'
          description: ''
  /api/ai-mentor/orgs/{org}/users/{user_id}/recently-accessed-agents/:
    get:
      operationId: ai_mentor_orgs_users_recently_accessed_agents_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}/recently-accessed-mentors/:
    get:
      operationId: ai_mentor_orgs_users_recently_accessed_mentors_list
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/recently-accessed-agents/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/recently-accessed-agents/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
  /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: end_time
        schema:
          type: string
          format: date-time
      - 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: start_time
        schema:
          type: string
          format: date-time
      - in: query
        name: target_system
        schema:
          type: string
          enum:
          - Moderation System
          - PHI System
          - Privacy System
          - Safety System
        description: |-
          * `Safety System` - Safety System
          * `Moderation System` - Moderation System
          * `Privacy System` - Privacy System
          * `PHI System` - Phi 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/agents/{mentor}/:
    get:
      operationId: ai_mentor_orgs_users_session_detail_agents_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}/session-detail/mentors/{mentor}/:
    get:
      operationId: ai_mentor_orgs_users_session_detail_mentors_list
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/session-detail/agents/{mentor}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/session-detail/agents/{mentor}/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /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.

        Session identity is derived from the request itself, never from user
        input: an authenticated caller is attributed via `request.user`
        (tenant-scoped to `org`), while an anonymous caller gets no student
        linkage and is only permitted on `allow_anonymous` mentors.

        Args:
            request: HTTP request containing mentor details.
            org: Organization key identifier.

        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
      security:
      - PlatformApiKeyAuthentication: []
      - {}
      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: path
        name: user_id
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      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
                  is_shared: true
                  enable_artifacts: false
                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'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageViewUpdatResponse'
              examples:
                ExampleRequest:
                  value:
                    title: New Title
                    tools:
                    - web-search
                    - image-generation
                    is_shared: true
                    enable_artifacts: false
                  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
      security:
      - PlatformApiKeyAuthentication: []
      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}/disable-chathistory/:
    post:
      operationId: ai_mentor_orgs_users_sessions_disable_chathistory_create
      description: Sets `disable_chathistory=True` on an existing session and nulls
        `Session.student` to sever the user↔session link. Subsequent messages are
        not written to ChatMessageHistory. Pre-toggle messages are NOT retroactively
        removed. The flag cannot be flipped back to False once set.
      summary: Disable chat history on a session (one-way)
      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/SessionDisableChathistoryRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SessionDisableChathistoryRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SessionDisableChathistoryRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SessionDisableChathistoryRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/SessionDisableChathistoryRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionDisableChathistoryResponse'
          description: ''
        '400':
          description: True→False transition rejected (one-way door)
        '404':
          description: Session not found in this org, or caller is not the owner /
            a platform admin.
  /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}/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}/shared/:
    get:
      operationId: ai_mentor_orgs_users_sessions_shared_retrieve
      description: Fetches shared chat messages for a specific session.
      summary: Retrieve Shared Messages
      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/MessageView'
          description: ''
    put:
      operationId: ai_mentor_orgs_users_sessions_shared_update
      description: Allows users to mark their session as shared. Anonymous users can
        only share sessions created in anonymous mode.
      summary: Share 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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SharedSessionUpdateRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/SharedSessionUpdateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SharedSessionUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SharedSessionUpdateRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/SharedSessionUpdateRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SharedSessionUpdateResponse'
          description: ''
  /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-agents/:
    get:
      operationId: ai_mentor_orgs_users_starred_agents_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}/starred-mentors/:
    get:
      operationId: ai_mentor_orgs_users_starred_mentors_list
      description: |-
        **Deprecated — use `/api/ai-mentor/orgs/{org}/users/{user_id}/starred-agents/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-mentor/orgs/{org}/users/{user_id}/starred-agents/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-mentor/orgs/{org}/users/{user_id}/stop-generation/:
    post:
      operationId: ai_mentor_orgs_users_stop_generation_create
      description: Stops an ongoing LLM generation for a mentor chat session. The
        generation_id is returned when starting a chat and can be used to stop the
        generation before it completes.
      summary: Stop an active chat generation
      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/StopGenerationRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/StopGenerationRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StopGenerationRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StopGenerationRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/StopGenerationRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Generation stopped successfully
        '400':
          description: Validation error
        '404':
          description: Generation not found
        '500':
          description: Internal server error
  /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: 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: 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:
          - browser
          - elevenlabs
          - google
          - iblai
          - openai
        description: |-
          * `browser` - Browser
          * `openai` - Openai
          * `google` - Google
          * `iblai` - ibl.ai
          * `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}/v1/chat/completions:
    post:
      operationId: ai_mentor_orgs_v1_chat_completions_create
      description: 'OpenAI-compatible chat completions. Set `stream=true` for a Server-Sent
        Events (`text/event-stream`) response of `chat.completion.chunk` objects terminated
        by `data: [DONE]`; otherwise a single `chat.completion` object is returned.
        Streaming is async-native and served only from the ASGI deployment. The `model`
        field must be in `provider/model` form (e.g. `openai/gpt-4o`).'
      parameters:
      - in: query
        name: format
        schema:
          type: string
          enum:
          - event-stream
          - json
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionRequest'
            text/event-stream:
              schema:
                $ref: '#/components/schemas/ChatCompletionRequest'
          description: ''
  /api/ai-mentor/orgs/{org}/v1/models:
    get:
      operationId: ai_mentor_orgs_v1_models_retrieve
      description: |-
        ``GET /orgs/<org>/v1/models`` — list available models for the tenant.

        Model ids are returned in ``provider/model`` form so they can be passed
        straight back to the chat completions endpoint.
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /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}/workflows/:
    get:
      operationId: ai_mentor_orgs_workflows_list
      description: Retrieve a list of workflows in the platform with optional filtering
        and search.
      summary: List workflows
      parameters:
      - in: query
        name: created_by
        schema:
          type: string
        description: Filter by creator username
      - in: query
        name: is_active
        schema:
          type: boolean
        description: Filter by active status
      - in: query
        name: is_template
        schema:
          type: boolean
        description: Filter by template status
      - 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
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: search
        schema:
          type: string
        description: Search in workflow name and description
      - 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
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedWorkflowList'
          description: ''
    post:
      operationId: ai_mentor_orgs_workflows_create
      description: Create a new workflow definition. Basic ReactFlow JSON validation
        is performed.
      summary: Create a new workflow
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Workflow'
            examples:
              CreateWorkflowRequest:
                value:
                  name: Multi-Mentor Learning Path
                  description: A workflow that chains multiple mentors for comprehensive
                    learning
                  definition:
                    nodes:
                    - id: start-1
                      type: start
                      data:
                        label: Start
                      position:
                        x: 100
                        y: 100
                    - id: mentor-1
                      type: mentor
                      data:
                        mentor_id: test-mentor-1
                        label: Research Mentor
                      position:
                        x: 300
                        y: 100
                    - id: end-1
                      type: end
                      data:
                        label: End
                      position:
                        x: 500
                        y: 100
                    edges:
                    - id: e1
                      source: start-1
                      target: mentor-1
                      type: default
                    - id: e2
                      source: mentor-1
                      target: end-1
                      type: default
                  is_active: true
                  is_template: false
                summary: Create Workflow Request
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Workflow'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Workflow'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Workflow'
          '*/*':
            schema:
              $ref: '#/components/schemas/Workflow'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workflow'
          description: ''
        '400':
          description: Invalid data provided
  /api/ai-mentor/orgs/{org}/workflows/{unique_id}/:
    get:
      operationId: ai_mentor_orgs_workflows_retrieve
      description: Get detailed information about a specific workflow.
      summary: Retrieve a workflow
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workflow'
          description: ''
        '404':
          description: Workflow not found
    put:
      operationId: ai_mentor_orgs_workflows_update
      description: Update workflow information. Basic ReactFlow JSON validation is
        performed.
      summary: Update a workflow
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Workflow'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Workflow'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Workflow'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Workflow'
          '*/*':
            schema:
              $ref: '#/components/schemas/Workflow'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workflow'
          description: ''
        '400':
          description: Invalid data provided
        '403':
          description: Permission denied
    patch:
      operationId: ai_mentor_orgs_workflows_partial_update
      description: |-
        API ViewSet for managing workflows.

        Provides CRUD operations for workflow definitions with platform-scoped access.
        All operations require platform admin permissions.

        Endpoints:
        - GET /orgs/<org>/workflows/ - List workflows in platform
        - POST /orgs/<org>/workflows/ - Create new workflow
        - GET /orgs/<org>/workflows/<unique_id>/ - Retrieve workflow
        - PUT/PATCH /orgs/<org>/workflows/<unique_id>/ - Update workflow
        - DELETE /orgs/<org>/workflows/<unique_id>/ - Delete workflow
        - POST /orgs/<org>/workflows/<unique_id>/validate/ - Validate workflow for execution
        - POST /orgs/<org>/workflows/<unique_id>/publish/ - Save, validate, and activate
        - POST /orgs/<org>/workflows/<unique_id>/activate/ - Validate and activate (no save)
        - POST /orgs/<org>/workflows/<unique_id>/deactivate/ - Take offline
        - POST /orgs/<org>/workflows/<unique_id>/unpublish/ - Alias for deactivate
        - GET/POST /orgs/<org>/workflows/<unique_id>/chat/ - Get entry mentor info for chat

        Query Parameters:
        - search: Search in name and description fields
        - is_active: Filter by active status (true/false)
        - is_template: Filter by template status (true/false)
        - created_by: Filter by creator username
        - sort: Order by field (prefix with - for descending)
          Examples: sort=name, sort=-created_at, sort=updated_at

        Permissions:
        - Uses RBAC for fine-grained access control
        - Owner-based access via created_by field

        Note: The 'org' URL parameter maps to Platform.key (platform key).
        This is a naming convention in the codebase for consistency.
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedWorkflow'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedWorkflow'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedWorkflow'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedWorkflow'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedWorkflow'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workflow'
          description: ''
    delete:
      operationId: ai_mentor_orgs_workflows_destroy
      description: Delete a workflow permanently.
      summary: Delete a workflow
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Workflow deleted successfully
        '403':
          description: Permission denied
  /api/ai-mentor/orgs/{org}/workflows/{unique_id}/activate/:
    post:
      operationId: ai_mentor_orgs_workflows_activate_create
      description: Validate and activate an already-saved workflow. Unlike publish,
        this does not save changes - it uses the current saved state.
      summary: Activate a workflow
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Workflow'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Workflow'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Workflow'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Workflow'
          '*/*':
            schema:
              $ref: '#/components/schemas/Workflow'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Workflow activated
        '400':
          description: Validation failed
  /api/ai-mentor/orgs/{org}/workflows/{unique_id}/chat/:
    post:
      operationId: ai_mentor_orgs_workflows_chat_create
      description: Send a message to the workflow and receive a response. The workflow
        must be active. Messages are routed through the entry mentor.
      summary: Chat with workflow
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                message:
                  type: string
                  description: The message to send
              required:
              - message
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Chat response
        '400':
          description: Bad request
  /api/ai-mentor/orgs/{org}/workflows/{unique_id}/deactivate/:
    post:
      operationId: ai_mentor_orgs_workflows_deactivate_create
      description: Take a workflow offline while preserving its saved state.
      summary: Deactivate a workflow
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Workflow'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Workflow'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Workflow'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Workflow'
          '*/*':
            schema:
              $ref: '#/components/schemas/Workflow'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Workflow deactivated
  /api/ai-mentor/orgs/{org}/workflows/{unique_id}/publish/:
    post:
      operationId: ai_mentor_orgs_workflows_publish_create
      description: Save, validate, and activate a workflow in one operation. Optionally
        accepts partial workflow updates in the request body. If validation fails,
        the workflow is saved but not activated.
      summary: Publish a workflow
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Workflow'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Workflow'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Workflow'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Workflow'
          '*/*':
            schema:
              $ref: '#/components/schemas/Workflow'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Workflow published successfully
        '400':
          description: Validation failed
  /api/ai-mentor/orgs/{org}/workflows/{unique_id}/unpublish/:
    post:
      operationId: ai_mentor_orgs_workflows_unpublish_create
      description: Alias for deactivate. Takes a workflow offline while preserving
        its saved state.
      summary: Unpublish a workflow
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Workflow'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Workflow'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Workflow'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Workflow'
          '*/*':
            schema:
              $ref: '#/components/schemas/Workflow'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Workflow unpublished
  /api/ai-mentor/orgs/{org}/workflows/{unique_id}/validate/:
    post:
      operationId: ai_mentor_orgs_workflows_validate_create
      description: 'Phase 2: Comprehensive execution validation. Validates workflow
        definition for schema, connectivity, security, and executability. This is
        separate from the basic validation done during create/update, allowing users
        to save draft workflows.'
      summary: Validate workflow for execution
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: unique_id
        schema:
          type: string
          format: uuid
        description: Workflow unique identifier
        required: true
      tags:
      - ai-mentor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Workflow'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Workflow'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Workflow'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Workflow'
          '*/*':
            schema:
              $ref: '#/components/schemas/Workflow'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Validation results
        '404':
          description: Workflow not found
  /api/ai-mentor/orgs/{org}/workflows/node-types/:
    get:
      operationId: ai_mentor_orgs_workflows_node_types_retrieve
      description: Returns metadata about all available workflow node types. Use this
        endpoint to populate the workflow editor with available nodes, their categories,
        required fields, and configuration options.
      summary: Get available node types
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-mentor
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Node types metadata
  /api/ai-mentor/voice-transcription/health/:
    get:
      operationId: ai_mentor_voice_transcription_health_retrieve
      description: |-
        Health check for the voice transcription provider.

        Optional query params:
            - ``provider``: one of ``openai``, ``google``, ``groq``. Defaults to ``openai``.
            - ``tenant``: tenant key whose credentials should be used. Falls back
              to global credentials when omitted.

        Returns 200 if the provider transcribed a synthetic silent audio sample
        successfully (an empty transcript is still a successful round-trip).
        Returns 503 with details otherwise.
      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
      security:
      - PlatformApiKeyAuthentication: []
      - {}
      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-proxy/orgs/{org}/services/:
    get:
      operationId: ai_proxy_orgs_services_list
      description: Returns a list of all enabled external proxy services. Use this
        endpoint to discover which services are available for proxying.
      summary: List external proxy services
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - ai-proxy
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ExternalProxyServiceList'
              examples:
                ServicesListResponse:
                  value:
                  - - slug: elevenlabs
                      display_name: ElevenLabs
                      service_type: http
                      is_enabled: true
                      supports_async_jobs: false
                      supports_streaming: true
                      credential_name: elevenlabs
                      endpoint_count: 3
                    - slug: heygen
                      display_name: HeyGen
                      service_type: async
                      is_enabled: true
                      supports_async_jobs: true
                      supports_streaming: false
                      credential_name: heygen
                      endpoint_count: 6
                  summary: Services list response
          description: ''
  /api/ai-proxy/orgs/{org}/services/{service}/:
    get:
      operationId: ai_proxy_orgs_services_retrieve
      description: Returns detailed information about a specific external proxy service,
        including all available endpoints and their configurations. Use this to discover
        what actions are available for a service.
      summary: Get external proxy service details
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: service
        schema:
          type: string
        required: true
      tags:
      - ai-proxy
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalProxyServiceDetail'
              examples:
                ServiceDetailResponse:
                  value:
                    slug: elevenlabs
                    display_name: ElevenLabs
                    base_url: https://api.elevenlabs.io
                    service_type: http
                    auth_mode: header
                    is_enabled: true
                    supports_async_jobs: false
                    supports_streaming: true
                    default_timeout_seconds: 60
                    credential_name: elevenlabs
                    credential_policy:
                      allow_tenant_key: true
                      allow_platform_key: true
                      default_source: tenant
                      fallback_to_platform_key: true
                    credential_schema:
                      key: string
                    endpoints:
                    - slug: list-voices
                      path_template: /v1/voices
                      http_method: GET
                      request_mode: json
                      response_mode: json
                      supports_streaming: false
                      callback_mode: none
                      is_enabled: true
                    - slug: tts
                      path_template: /v1/text-to-speech/{voice_id}
                      http_method: POST
                      request_mode: json
                      response_mode: passthrough
                      supports_streaming: true
                      callback_mode: none
                      is_enabled: true
                  summary: Service detail response
          description: ''
        '404':
          description: Service not found or disabled.
  /api/ai-proxy/orgs/{org}/services/{service}/{action}/:
    post:
      operationId: ai_proxy_orgs_services_create
      description: Proxy a request to an external service endpoint. The service and
        action must be pre-configured in the system. Credentials are automatically
        injected based on the service's credential policy.
      summary: Invoke external service endpoint
      parameters:
      - in: path
        name: action
        schema:
          type: string
        required: true
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: path
        name: service
        schema:
          type: string
        required: true
      tags:
      - ai-proxy
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExternalProxyInvoke'
            examples:
              ElevenLabsTTSRequest:
                value:
                  path_params:
                    voice_id: 21m00Tcm4TlvDq8ikWAM
                  body:
                    text: Hello, this is a test.
                    model_id: eleven_multilingual_v2
                    voice_settings:
                      stability: 0.5
                      similarity_boost: 0.5
                summary: ElevenLabs TTS request
              HeyGenVideoGenerationRequest:
                value:
                  body:
                    test: true
                    video_inputs:
                    - character:
                        type: avatar
                        avatar_id: Abigail_expressive_2024112501
                        avatar_style: normal
                      voice:
                        type: text
                        input_text: Hello, this is a test video.
                        voice_id: f38a635bee7a4d1f9b0a654a31d050d2
                    dimension:
                      width: 1280
                      height: 720
                summary: HeyGen video generation request
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ExternalProxyInvoke'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ExternalProxyInvoke'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ExternalProxyInvoke'
          '*/*':
            schema:
              $ref: '#/components/schemas/ExternalProxyInvoke'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Successful response from the upstream service. Response format
            depends on the endpoint configuration (JSON or binary).
        '400':
          description: Invalid request or credential policy error.
        '404':
          description: Service, endpoint, or credentials not found.
        '502':
          description: Upstream service request failed.
  /api/ai-search/agents/:
    get:
      operationId: v2_global_mentor_search
      description: "\n        Search and filter AI mentors with support for comprehensive\
        \ filtering, pagination, and detailed mentor information.\n        This endpoint\
        \ supports both anonymous and authenticated users with different access levels.\n\
        \n        **Anonymous Users:**\n        - Access to public mentors only (VIEWABLE_BY_ANYONE)\n\
        \        - Limited search capabilities\n        - No personalization\n\n \
        \       **Authenticated Users:**\n        - Full access based on platform\
        \ permissions (scoped to requested platform)\n        - Personalized results\n\
        \        - Access to tenant-specific mentors\n\n        **Required Parameters\
        \ (Authenticated Users):**\n        - `platform_key` OR `tenant`: Platform\
        \ key for RBAC enforcement (required for authenticated requests)\n       \
        \   - Use `platform_key` (preferred) or `tenant` (backward compatibility)\
        \ - both serve the same purpose\n          - If both are provided, `platform_key`\
        \ takes precedence\n\n        **Available Filters:**\n        - `query`: Search\
        \ term to filter mentors by name or description\n        - `tenant`: Filter\
        \ by tenant/organization platform key(s) - can also be used as alias for `platform_key`\
        \ (backward compatibility)\n        - `category`: Filter by mentor category\
        \ (comma-separated)\n        - `subjects`: Filter by mentor subject (comma-separated)\n\
        \        - `types`: Filter by mentor type (comma-separated)\n        - `llm`:\
        \ Filter by LLM provider (comma-separated, e.g., GPT-4, Claude)\n        -\
        \ `visibility`: Filter by visibility level (comma-separated: viewable_by_anyone,\
        \ viewable_by_tenant_students, viewable_by_tenant_admins)\n        - `created_by`:\
        \ Filter mentors created by specific user (for personalized search)\n    \
        \    - `include_main_public_mentors`: Include main tenant public mentors\n\
        \n        **Facets:**\n        The response includes facets with aggregated\
        \ counts for all filterable attributes:\n        - categories, subjects, types,\
        \ llm_providers, visibility\n        All facet values can be used as filter\
        \ parameters in subsequent requests.\n\n        Notes:\n        - Detail view\
        \ is removed; use the ibl_ai_mentor app for mentor details\n        - include_main_public_mentors=true\
        \ shows only VIEWABLE_BY_ANYONE mentors from the main tenant across tenants\n\
        \        - For authenticated requests, either `platform_key` or `tenant` is\
        \ required when username is provided\n        - `tenant` parameter serves\
        \ dual purpose: as a filter for multiple tenants, or as an alias for `platform_key`\
        \ (backward compatibility)\n        - Frontend uses `llm` parameter name (backend\
        \ maps to `llm_provider` automatically)\n        "
      summary: Search and filter AI mentors across the platform
      parameters:
      - in: query
        name: alphabetical
        schema:
          type: boolean
          default: false
        description: Sort alphabetically by name (shorthand for order_by='name').
          When true, overrides order_by parameter.
      - 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: featured
        schema:
          type: boolean
          nullable: true
        description: Filter by featured status (true/false)
      - 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: order_by
        schema:
          type: string
          minLength: 1
        description: Field to sort results by ('created_at', '-created_at', 'recently_accessed_at',
          '-recently_accessed_at', 'name', '-name'). Use '-' prefix for descending
          order.
      - in: query
        name: order_direction
        schema:
          type: string
          default: desc
          minLength: 1
        description: Sort direction ('asc' or 'desc'). Only used if order_by doesn't
          start with '-'. Defaults to 'desc'.
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: Platform key for RBAC enforcement. Required for authenticated
          requests. Can also use 'tenant' parameter as an alias (backward compatibility).
      - in: query
        name: query
        schema:
          type: string
          minLength: 1
        description: Search query for mentors
      - in: query
        name: starred
        schema:
          type: boolean
          nullable: true
        description: Filter by starred status (true/false) - only for authenticated
          users
      - 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). Can be used as a filter for multiple tenants,
          or as an alias for 'platform_key' (backward compatibility).
      - 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/mentors/:
    get:
      operationId: v2_global_mentor_search_2
      description: |-
        **Deprecated — use `/api/ai-search/agents/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-search/agents/` (`mentor` → `agent`) and will be removed in a future release.


                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

                **Required Parameters (Authenticated Users):**
                - `platform_key` OR `tenant`: Platform key for RBAC enforcement (required for authenticated requests)
                  - Use `platform_key` (preferred) or `tenant` (backward compatibility) - both serve the same purpose
                  - If both are provided, `platform_key` takes precedence

                **Available Filters:**
                - `query`: Search term to filter mentors by name or description
                - `tenant`: Filter by tenant/organization platform key(s) - can also be used as alias for `platform_key` (backward compatibility)
                - `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, either `platform_key` or `tenant` is required when username is provided
                - `tenant` parameter serves dual purpose: as a filter for multiple tenants, or as an alias for `platform_key` (backward compatibility)
                - Frontend uses `llm` parameter name (backend maps to `llm_provider` automatically)
      summary: Search and filter AI mentors across the platform
      parameters:
      - in: query
        name: alphabetical
        schema:
          type: boolean
          default: false
        description: Sort alphabetically by name (shorthand for order_by='name').
          When true, overrides order_by parameter.
      - 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: featured
        schema:
          type: boolean
          nullable: true
        description: Filter by featured status (true/false)
      - 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: order_by
        schema:
          type: string
          minLength: 1
        description: Field to sort results by ('created_at', '-created_at', 'recently_accessed_at',
          '-recently_accessed_at', 'name', '-name'). Use '-' prefix for descending
          order.
      - in: query
        name: order_direction
        schema:
          type: string
          default: desc
          minLength: 1
        description: Sort direction ('asc' or 'desc'). Only used if order_by doesn't
          start with '-'. Defaults to 'desc'.
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: Platform key for RBAC enforcement. Required for authenticated
          requests. Can also use 'tenant' parameter as an alias (backward compatibility).
      - in: query
        name: query
        schema:
          type: string
          minLength: 1
        description: Search query for mentors
      - in: query
        name: starred
        schema:
          type: boolean
          nullable: true
        description: Filter by starred status (true/false) - only for authenticated
          users
      - 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). Can be used as a filter for multiple tenants,
          or as an alias for 'platform_key' (backward compatibility).
      - 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
      deprecated: true
  /api/ai-search/orgs/{org}/users/{username}/my-agents/:
    get:
      operationId: ai_search_orgs_users_my_agents_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/orgs/{org}/users/{username}/my-mentors/:
    get:
      operationId: ai_search_orgs_users_my_mentors_retrieve
      description: |-
        **Deprecated — use `/api/ai-search/orgs/{org}/users/{username}/my-agents/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-search/orgs/{org}/users/{username}/my-agents/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/ai-search/personalized-agents/:
    get:
      operationId: v2_personalized_mentors
      description: "\n        Get mentors created by a specific user within a given\
        \ organization/platform.\n        This endpoint provides a personalized view\
        \ of the user's own mentors with\n        support for filtering, pagination,\
        \ and detailed mentor information.\n\n        **Authentication Required:**\n\
        \        - username: Required for personalized mentor access\n        - platform_key\
        \ OR tenant: Required for tenant-specific content (both serve the same purpose)\n\
        \          - Use `platform_key` (preferred) or `tenant` (backward compatibility)\n\
        \          - If both are provided, `platform_key` takes precedence\n\n   \
        \     **Features:**\n        - User's own mentors only\n        - Personalization\
        \ data (access counts, last used)\n        - Filtering and faceted search\n\
        \        - Pagination support\n        - Detail and list views\n        "
      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: featured
        schema:
          type: boolean
          nullable: true
        description: Filter by featured status (true/false)
      - in: query
        name: limit
        schema:
          type: integer
        description: Number of results per page
      - in: query
        name: llm
        schema:
          type: string
          minLength: 1
        description: LLM provider filter (frontend uses 'llm', backend maps to '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 for authenticated requests.
          Can also use 'tenant' parameter as an alias (backward compatibility).
      - 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: starred
        schema:
          type: boolean
          nullable: true
        description: Filter by starred status (true/false)
      - in: query
        name: tags
        schema:
          type: array
          items:
            type: string
        description: Filter by tags
      - in: query
        name: tenant
        schema:
          type: string
          minLength: 1
        description: Tenant key (alias for 'platform_key' for backward compatibility).
          Can be used instead of 'platform_key' - both serve the same purpose.
      - 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/personalized-mentors/:
    get:
      operationId: v2_personalized_mentors_2
      description: |-
        **Deprecated — use `/api/ai-search/personalized-agents/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-search/personalized-agents/` (`mentor` → `agent`) and will be removed in a future release.


                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 OR tenant: Required for tenant-specific content (both serve the same purpose)
                  - Use `platform_key` (preferred) or `tenant` (backward compatibility)
                  - If both are provided, `platform_key` takes precedence

                **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: featured
        schema:
          type: boolean
          nullable: true
        description: Filter by featured status (true/false)
      - in: query
        name: limit
        schema:
          type: integer
        description: Number of results per page
      - in: query
        name: llm
        schema:
          type: string
          minLength: 1
        description: LLM provider filter (frontend uses 'llm', backend maps to '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 for authenticated requests.
          Can also use 'tenant' parameter as an alias (backward compatibility).
      - 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: starred
        schema:
          type: boolean
          nullable: true
        description: Filter by starred status (true/false)
      - in: query
        name: tags
        schema:
          type: array
          items:
            type: string
        description: Filter by tags
      - in: query
        name: tenant
        schema:
          type: string
          minLength: 1
        description: Tenant key (alias for 'platform_key' for backward compatibility).
          Can be used instead of 'platform_key' - both serve the same purpose.
      - 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
      deprecated: true
  /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: "\n        Generate personalized course recommendations using AI\
        \ that considers the user's\n        learning history, organizational goals,\
        \ and available courses.\n\n        **Authentication Required:**\n       \
        \ - User must be authenticated\n        - Platform key must be provided\n\
        \        - User must have access to the specified platform\n\n        **How\
        \ It Works:**\n        1. Fetches tenant's custom recommendation prompt (if\
        \ configured)\n        2. Analyzes user's course completion history and performance\n\
        \        3. Reviews available course catalog\n        4. Uses AI to match\
        \ courses to user's needs and organizational goals\n        5. Returns 3-5\
        \ courses with clear explanations\n\n        **Tenant Prompts:**\n       \
        \ Each organization can configure custom prompts that guide recommendations.\n\
        \        For example: \"Prioritize leadership for sales roles\" or \"Focus\
        \ on technical skills.\"\n\n        **Use Cases:**\n        - Manual recommendation\
        \ requests by users\n        - Post-assessment recommendations\n        -\
        \ Milestone-triggered suggestions\n        - Learning path planning\n    \
        \    "
      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/ai-search/sellable-items/:
    get:
      operationId: v2_sellable_items_search
      description: Search across courses, programs, pathways, and mentors on a platform
        to find items a seller can monetise. Requires authentication and the Ibl.Billing/CanSellItems
        RBAC policy.
      summary: Search for items that can be put up for sale
      parameters:
      - in: query
        name: item_type
        schema:
          type: string
          minLength: 1
        description: 'Filter by item type (CSV): course, program, pathway, mentor.'
      - in: query
        name: limit
        schema:
          type: integer
          maximum: 100
          minimum: 1
          default: 12
        description: Results per page (default 12, max 100).
      - in: query
        name: offset
        schema:
          type: integer
          minimum: 0
          default: 0
        description: Pagination offset.
      - in: query
        name: order_by
        schema:
          enum:
          - name
          - created_at
          type: string
          default: name
          minLength: 1
        description: |-
          Field to sort results by.

          * `name` - name
          * `created_at` - created_at
      - in: query
        name: order_direction
        schema:
          enum:
          - asc
          - desc
          type: string
          default: asc
          minLength: 1
        description: |-
          Sort direction.

          * `asc` - asc
          * `desc` - desc
      - in: query
        name: paywall_status
        schema:
          enum:
          - none
          - enabled
          - disabled
          type: string
          minLength: 1
        description: |-
          Filter by paywall status: 'none' (no paywall configured), 'enabled' (paywall active), 'disabled' (paywall exists but inactive).

          * `none` - none
          * `enabled` - enabled
          * `disabled` - disabled
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: Platform key (required). Items are scoped to a platform.
        required: true
      - in: query
        name: query
        schema:
          type: string
          minLength: 1
        description: Free-text search across item name and description.
      - in: query
        name: return_facets
        schema:
          type: boolean
          default: true
        description: Include facets in response.
      tags:
      - ai-search
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SellableItemsResponse'
          description: ''
        '400':
          description: Invalid parameters
        '401':
          description: Authentication required
        '403':
          description: Permission denied
  /api/analytics/content/:
    get:
      operationId: get_content_analytics
      description: "\n        Retrieve aggregated analytics for catalog content (courses,\
        \ programs, pathways, skills).\n        \n        Returns both summary statistics\
        \ and paginated list of content items with individual analytics.\n       \
        \ When a platform_key is provided, results are filtered to show only content\
        \ consumed by \n        learners associated with that platform.\n        \n\
        \        **RBAC Requirements:**\n        - Requires: Analytics Viewer role\
        \ (Ibl.Analytics/Core/read) or Tenant Admin role (Ibl.*)\n        \n     \
        \   **Metrics supported:**\n        - `course` or `courses`: Course analytics\
        \ with time spent\n        - `program` or `programs`: Program analytics  \n\
        \        - `pathway` or `pathways`: Pathway analytics\n        - `skill` or\
        \ `skills`: Skill analytics\n        \n        **Platform Filtering:**\n \
        \       - Without platform_key: Shows global analytics across all platforms\n\
        \        - With platform_key: Shows analytics filtered by platform learners\
        \ only\n        \n        **Time Spent Analytics:**\n        - Platform-level:\
        \ Total time spent across all content and average per learner\n        - Course-level:\
        \ Total time spent per course and average per enrolled learner\n        -\
        \ Time values are provided in seconds for precision\n        - Overtime: Time\
        \ series data showing platform time spent over last 7 days (courses only,\
        \ and include_overtime=true)\n        \n        **External Content:**\n  \
        \      - Content not owned by the requesting platform but used by its learners\
        \ is marked as \"external\"\n        - External content has limited metadata\
        \ exposure for privacy\n        "
      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: search
        schema:
          type: string
        description: Filter results by name/slug (case-insensitive substring match)
      - in: query
        name: sort_by
        schema:
          enum:
          - name
          - active_enrollments
          type: string
          default: name
          minLength: 1
        description: |-
          Sort order for results. 'active_enrollments' is only supported for course, program, and pathway metrics; it is ignored for skill.

          * `name` - Name (default)
          * `active_enrollments` - Active enrollments (descending)
      - in: query
        name: start_date
        schema:
          type: string
          format: date
      - in: query
        name: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      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)
      - in: query
        name: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      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
      description: |-
        Mixin for RBAC validation for mentor analytics views.

        Mentor analytics endpoints enforce RBAC in two phases:
        1. Endpoint authorization (_perform_mentor_analytics_validation):
           - Aggregate (no mentor_unique_id): requires
             "Ibl.Analytics/CanViewAnalytics/action" on /platforms/{pk}/ AND
             "Ibl.Analytics/Mentors/read" on /platforms/{pk}/mentors/.
           - Per-mentor (mentor_unique_id provided): requires
             "Ibl.Analytics/CanViewMentorAnalytics/action" on
             /platforms/{pk}/mentors/{mentor_id}/. The mentor-owner bypass
             (is_owner) applies via the MENTOR_OWNER well-known role.
        2. Row-level filter (_get_accessible_user_ids_for_mentor_analytics):
           - Enumerates accessible users under
             /platforms/{pk}/mentors/{mentor_id}/users/ using
             "Ibl.Analytics/Mentors/read". Grants on the mentor resource itself
             cascade to its users (full mentor access). Usergroup authorization
             is resolved at platform-level (/platforms/{pk}/usergroups/) —
             mentor-level grants do NOT cascade to usergroup access.

        Special case - Mentor owner unfiltered access:
        If the requesting user owns the mentor AND no usergroup_ids are
        specified, returns None (no filtering) — the analytics query layer is
        already scoped to the mentor. With usergroup_ids provided, the owner
        falls through to normal RBAC filtering and still needs explicit access
        (ownership or grant) to the requested groups.

        Note: Mentor analytics APIs work with platform_key (from query params).
      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
      - in: query
        name: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      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 agent
        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: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      - 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.78900
                    percentage_change: 15.2
                    overtime:
                    - date: '2025-01-01'
                      value: 1.23000
                    - date: '2025-01-02'
                      value: 1.45000
                    - date: '2025-01-03'
                      value: 1.67000
                    - date: '2025-01-04'
                      value: 1.34000
                    - date: '2025-01-05'
                      value: 1.89000
                    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.65400
                      comparison_start: '2024-12-22'
                      comparison_end: '2024-12-31'
                      comparison_days: 10
                      recent_period_value: 45.78900
                  summary: Total Costs Response
                  description: Response for total_costs metric.
                WeeklyCostsResponse:
                  value:
                    metric: weekly_costs
                    filters:
                      granularity: week
                      comparison_days: 10
                    value: 12.47000
                    percentage_change: 8.5
                    overtime:
                    - date: '2025-01-06'
                      value: 2.89000
                    - date: '2025-01-13'
                      value: 3.12000
                    - date: '2025-01-20'
                      value: 3.46000
                    - date: '2025-01-27'
                      value: 3.00000
                    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.50000
                      comparison_start: '2024-12-22'
                      comparison_end: '2024-12-31'
                      comparison_days: 10
                      recent_period_value: 12.47000
                  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.23000
                    percentage_change: -5.2
                    overtime:
                    - date: '2025-01-01'
                      value: 45.67000
                    - date: '2025-02-01'
                      value: 52.34000
                    - date: '2025-03-01'
                      value: 58.22000
                    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.78000
                      comparison_start: '2024-12-01'
                      comparison_end: '2024-12-31'
                      comparison_days: 30
                      recent_period_value: 156.23000
                  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 agent
        - 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 agent
          * `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: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      - 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 agents/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/agent 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 agent 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: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      - 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: "\n        Retrieve a holistic snapshot of a user across catalog\
        \ enrollments, agent\n        engagement, skills, credentials, and time spent\
        \ data. The `metrics` query parameter controls\n        which sections are\
        \ returned and defaults to `courses` when omitted. A user can call this\n\
        \        endpoint for themselves without passing `username`; admins pass `username`\
        \ to target a\n        user in their scope.\n\n        The `mentors` section\
        \ lists every agent the user has engaged, sourced from both their\n      \
        \  sessions and saved agents. Each agent's `interactions` block reports engagement\
        \ depth\n        (`session_count`, `conversation_count`, human/AI message\
        \ counts, `avg_messages_per_session`),\n        recency and stickiness (`first_interaction`,\
        \ `latest_interaction`, `active_days`),\n        affinity (`rating`, `is_starred`),\
        \ and spend (`cost_usd`, in USD). The user's total\n        agent spend is\
        \ `user.total_agent_cost_usd`.\n\n        Optional `course_id` / `program_id`\
        \ / `pathway_id` scope the matching section to a\n        single item (empty\
        \ list if the user is not enrolled — never a 404); omitting them\n       \
        \ returns the full list unchanged. When `course_id` is set, the course block\
        \ is also\n        enriched with the user's live edX Progress data under `edx_progress`\
        \ (completion\n        summary, grade, grade summary) unless `include_edx_progress=false`.\
        \ The edX call is\n        best-effort: on failure `edx_progress` is null\
        \ and the DM data is still returned.\n        `program_id` / `pathway_id`\
        \ get scoping only — no edX enrichment.\n\n        When AI is enabled, three\
        \ additional sections surface the user's conversation\n        analytics for\
        \ the same user:\n        - `conversations`: headline metrics (average messages\
        \ per conversation, rating,\n          and cost) by default, or conversation\
        \ counts over time when\n          `conversation_metric=conversations`.\n\
        \        - `messages`: the user's conversation list with `summary`, `results`,\
        \ and\n          `pagination`. Supports `page`, `limit`, `search`, `min_messages`,\n\
        \          `max_messages`, `sentiment`, and `topic`. All-time unless a date\
        \ filter is\n          supplied.\n        - `message_detail`: one conversation's\
        \ transcript (summary plus human/AI message\n          pairs); requires `session_id`.\
        \ A `session_id` belonging to another user returns\n          403. Optionally\
        \ scope any of these to one agent with `mentor_unique_id`.\n        "
      parameters:
      - in: query
        name: conversation_metric
        schema:
          enum:
          - conversations
          - headline
          type: string
          default: headline
          minLength: 1
        description: |-
          For the `conversations` metric: `headline` (avg messages/rating/cost, the default) or `conversations` (conversation counts over time).

          * `conversations` - conversations
          * `headline` - headline
      - in: query
        name: course_id
        schema:
          type: string
        description: Scope the `courses` and `time_spent` sections to a single course.
          When set, also enriches the course with live edX progress (see `include_edx_progress`).
      - 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_edx_progress
        schema:
          type: boolean
          default: true
        description: When `course_id` is set, fold the learner's live edX Progress-page
          data (completion summary, grade, grade summary) into the course block. Defaults
          to true; set false to skip the edX round-trip.
      - in: query
        name: limit
        schema:
          type: integer
          maximum: 100
          minimum: 1
          default: 20
        description: 'Page size for the `messages` metric (default: 20, max: 100).'
      - in: query
        name: max_messages
        schema:
          type: integer
          minimum: 0
        description: Filter the `messages` list to conversations with at most N messages.
      - in: query
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
      - in: query
        name: metrics
        schema:
          type: string
        description: 'Comma-separated sections to return: courses, programs, pathways,
          agents, skills, credentials, time_spent, conversations, messages, message_detail.
          `agents` is an alias for the agent section. The conversations/messages/message_detail
          sections are available when AI is enabled. Defaults to courses when omitted.'
      - in: query
        name: min_messages
        schema:
          type: integer
          minimum: 0
        description: Filter the `messages` list to conversations with at least N messages.
      - in: query
        name: overtime
        schema:
          type: boolean
          default: false
        description: 'Include overtime metrics for time_spent data (default: false)'
      - in: query
        name: page
        schema:
          type: integer
          minimum: 1
          default: 1
        description: 'Page number for the `messages` metric (default: 1).'
      - in: query
        name: pathway_id
        schema:
          type: string
        description: Scope the `pathways` section to a single pathway.
      - in: query
        name: platform_key
        schema:
          type: string
      - in: query
        name: program_id
        schema:
          type: string
        description: Scope the `programs` section to a single program.
      - in: query
        name: search
        schema:
          type: string
        description: Filter the `messages` list by first user message or username.
      - in: query
        name: sentiment
        schema:
          enum:
          - positive
          - negative
          - neutral
          type: string
          minLength: 1
        description: |-
          Filter the `messages` list by conversation sentiment.

          * `positive` - positive
          * `negative` - negative
          * `neutral` - neutral
      - in: query
        name: session_id
        schema:
          type: string
        description: 'Required for the `message_detail` metric: the conversation to
          fetch.'
      - in: query
        name: start_date
        schema:
          type: string
          format: date
      - in: query
        name: topic
        schema:
          type: string
          minLength: 1
        description: Filter the `messages` list to conversations whose topic contains
          this text.
      - in: query
        name: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      - in: query
        name: username
        schema:
          type: string
      tags:
      - ai-analytics
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LearnerDetailsResponse'
              examples:
                UserDetails:
                  value:
                    user:
                      user_id: 42
                      username: user123
                      email: user@example.com
                      name: Example User
                      date_joined: '2024-01-01T00:00:00Z'
                      last_active: '2024-02-01T12:30:00Z'
                      total_agent_cost_usd: '14.2000'
                    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:
                          session_count: 8
                          conversation_count: 6
                          message_count_human: 41
                          message_count_ai: 47
                          total_messages: 88
                          avg_messages_per_session: 11.0
                          first_interaction: '2024-01-05T00:00:00Z'
                          latest_interaction: '2024-02-01T12:30:00Z'
                          active_days: 5
                          cost_usd: '1.8300'
                          rating: 4.5
                          is_starred: true
                      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: User 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: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      - 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: "\n        Retrieve a paginated list of learners for a specific\
        \ platform with their comprehensive\n        metrics from the UserPlatformSummary\
        \ materialized view. This endpoint is accessible only\n        to platform\
        \ administrators and supports search, sorting, and pagination.\n        "
      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
      - in: query
        name: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      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/llm-usage/:
    get:
      operationId: analytics_llm_usage_retrieve
      description: |-
        Platform-scoped analytics for LLM **cost, token usage, latency, and counts**. One endpoint serves three resources selected by the `resource` param:

        - `metrics` (default) — aggregate measures with optional `group_by` (type|model|tags|environment) and `granularity` (day|week|month) time series.
        - `observations` — row-level generation drill-down, page-paginated; pass `observation_id` to fetch one observation.
        - `traces` — trace list (per-user/per-session drill-down the metrics resource cannot group by); pass `trace_id` to fetch one trace.

        **Tenant isolation:** every *list* query is scoped to the validated request platform via a server-injected `metadata.platform_key` filter. Get-by-id (`trace_id`/`observation_id`) takes only the id, so ownership is verified after the fetch and a cross-tenant record returns **404** (never 403) so its existence is not leaked. The client `platform_key` is used only for RBAC validation, never to scope the upstream call — the analytics store is project-scoped across all tenants.

        **Default time frame:** when no date params are given the query defaults to `date_filter=today` (start=end=today). Widen it with `date_filter=7d|30d|90d`, `date_filter=all_time` for full history, or `date_filter=custom` plus `start_date`/`end_date`.

        **Measures** (csv `measures`): total_cost, input_tokens, output_tokens, total_tokens, count, latency. **Aggregation** applies to every measure: sum|avg|count|min|max|p50|p75|p90|p95|p99.

        **Per-mentor ranking:** the metrics resource cannot group by custom metadata, so use `group_by=tags` — traces carry both `platform_key:<key>` and `mentor_id:<id>` tags, so with the platform filter applied each tag bucket collapses to one mentor. Parse `mentor_id:` out of the returned `tags` array.

        **Recipes**
        ```
        # Total spend today (tenant-wide)
        GET ?platform_key=acme&resource=metrics&measures=total_cost

        # Cost + tokens + calls per service, last 30 days
        GET ?platform_key=acme&resource=metrics&measures=total_cost,total_tokens,count&group_by=type&date_filter=30d

        # Cost per model over a custom range
        GET ?platform_key=acme&resource=metrics&measures=total_cost&group_by=model&date_filter=custom&start_date=2025-01-01&end_date=2025-01-31

        # Per-mentor cost ranking
        GET ?platform_key=acme&resource=metrics&measures=total_cost&group_by=tags

        # Daily cost time series
        GET ?platform_key=acme&resource=metrics&measures=total_cost&granularity=day&date_filter=30d

        # Latency percentiles for the chat service
        GET ?platform_key=acme&resource=metrics&measures=latency&aggregation=p95&trace_name=chat

        # One learner's spend
        GET ?platform_key=acme&resource=metrics&measures=total_cost&username=alice

        # Row-level drill-down for a trace
        GET ?platform_key=acme&resource=observations&trace_id=abc123&page=1&limit=50

        # Fetch a single observation
        GET ?platform_key=acme&resource=observations&observation_id=obs123

        # Recent traces for one learner (newest first)
        GET ?platform_key=acme&resource=traces&username=alice&order_by=timestamp&direction=desc&limit=50

        # All traces in one conversation/session
        GET ?platform_key=acme&resource=traces&session_id=sess123

        # Fetch a single trace
        GET ?platform_key=acme&resource=traces&trace_id=abc123
        ```

        **Limits:** `limit` caps rows (default 50, max 1000). `group_by` cannot use userId/sessionId/mentor_id (the upstream store rejects them); those are filter-only. The metrics query requires bounded timestamps, so `date_filter=all_time` is served from a fixed 2020-01-01 lower bound through today (wide enough to cover all ingested history).
      summary: LLM cost/usage analytics
      parameters:
      - in: query
        name: aggregation
        schema:
          enum:
          - avg
          - count
          - max
          - min
          - p50
          - p75
          - p90
          - p95
          - p99
          - sum
          type: string
          default: sum
          minLength: 1
        description: |-
          Aggregation applied to each measure.

          * `avg` - avg
          * `count` - count
          * `max` - max
          * `min` - min
          * `p50` - p50
          * `p75` - p75
          * `p90` - p90
          * `p95` - p95
          * `p99` - p99
          * `sum` - sum
      - 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: direction
        schema:
          enum:
          - asc
          - desc
          type: string
          default: desc
          minLength: 1
        description: |-
          Ordering direction.

          * `asc` - asc
          * `desc` - desc
      - in: query
        name: end_date
        schema:
          type: string
          format: date
      - in: query
        name: granularity
        schema:
          enum:
          - day
          - month
          - week
          type: string
          minLength: 1
        description: |-
          Time-series bucket size; omit for a flat aggregate.

          * `day` - day
          * `month` - month
          * `week` - week
      - in: query
        name: group_by
        schema:
          enum:
          - environment
          - model
          - tags
          - type
          type: string
          minLength: 1
        description: |-
          Dimension to group by (type|model|tags|environment).

          * `environment` - environment
          * `model` - model
          * `tags` - tags
          * `type` - type
      - in: query
        name: limit
        schema:
          type: integer
          maximum: 1000
          minimum: 1
          default: 50
        description: Row cap (max 1000).
      - in: query
        name: llm_model
        schema:
          type: string
        description: Filter to one model by its provided model name, e.g. gpt-4o-mini.
      - in: query
        name: measures
        schema:
          type: string
          minLength: 1
        description: 'Comma-separated measures: count, input_tokens, latency, output_tokens,
          total_cost, total_tokens'
      - in: query
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
      - in: query
        name: observation_id
        schema:
          type: string
        description: Fetch a single observation by id (observations resource, get-by-id).
      - in: query
        name: order_by
        schema:
          type: string
        description: 'Ordering field. Resource-dependent: for metrics a measure (count,
          input_tokens, latency, output_tokens, total_cost, total_tokens); for traces
          a trace field (name, session_id, timestamp, username, default timestamp).'
      - in: query
        name: page
        schema:
          type: integer
          minimum: 1
          default: 1
        description: 1-based page number for observation drill-down.
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
      - in: query
        name: resource
        schema:
          enum:
          - metrics
          - observations
          - traces
          type: string
          default: metrics
          minLength: 1
        description: |-
          Which analytics resource to query.

          * `metrics` - Aggregate metrics
          * `observations` - Row-level observation drill-down
          * `traces` - Trace list / single trace
      - in: query
        name: session_id
        schema:
          type: string
        description: Filter to one conversation/session (native sessionId). Supported
          on the metrics and traces resources only.
      - in: query
        name: start_date
        schema:
          type: string
          format: date
      - in: query
        name: trace_id
        schema:
          type: string
        description: Single-record selector. On the observations resource, scopes
          the list to one trace's observations; on the traces resource, fetches that
          one trace (get-by-id).
      - in: query
        name: trace_name
        schema:
          type: string
        description: Filter to one service by trace name, e.g. chat, call, memory,
          grading, moderation, embeddings.
      - in: query
        name: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      - in: query
        name: username
        schema:
          type: string
        description: Filter to one learner by their username (native userId). Applies
          to both metrics and observations.
      - in: query
        name: view
        schema:
          enum:
          - observations
          - scores
          type: string
          default: observations
          minLength: 1
        description: |-
          Metrics view (observations|scores).

          * `observations` - observations
          * `scores` - scores
      tags:
      - ai-analytics
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LlmUsageAnalyticsResponse'
              examples:
                MetricsGroupedByModel:
                  value:
                    resource: metrics
                    data:
                    - providedModelName: gpt-4o-mini
                      sum_totalCost: 2.5
                    - providedModelName: claude-3-5-sonnet
                      sum_totalCost: 1.0
                  summary: Metrics grouped by model
                MetricsDailyTimeSeries:
                  value:
                    resource: metrics
                    data:
                    - time_dimension: '2025-01-01'
                      sum_totalCost: 1.23
                    - time_dimension: '2025-01-02'
                      sum_totalCost: 1.45
                  summary: Metrics daily time series
                Per-mentorRanking(groupBy=tags):
                  value:
                    resource: metrics
                    data:
                    - tags:
                      - mentor_id:fb9e5cf7-bc78-4641-af4e-c903b5857151
                      - platform_key:acme
                      sum_totalCost: 0.61
                  summary: Per-mentor ranking (group_by=tags)
                Observations(page-paginated):
                  value:
                    resource: observations
                    data:
                    - id: e51dd10bfec17b86
                      traceId: 713f24c4179041eb41567e2754ce9218
                      type: GENERATION
                      name: chat
                      model: gpt-4o-mini
                      usage:
                        input: 1083
                        output: 79
                        total: 1162
                      calculatedTotalCost: 0.00021
                      latency: 1.119
                    meta:
                      page: 1
                      limit: 50
                      totalItems: 1
                      totalPages: 1
                  summary: Observations (page-paginated)
                Traces(page-paginatedList):
                  value:
                    resource: traces
                    data:
                    - id: 713f24c4179041eb41567e2754ce9218
                      timestamp: '2025-01-02T10:15:00.000Z'
                      name: chat
                      userId: alice
                      sessionId: sess123
                      totalCost: 0.00021
                      latency: 1.119
                      tags:
                      - platform_key:acme
                      - mentor_id:fb9e5cf7
                    meta:
                      page: 1
                      limit: 50
                      totalItems: 1
                      totalPages: 1
                  summary: Traces (page-paginated list)
                SingleTrace(get-by-id):
                  value:
                    resource: traces
                    data:
                      id: 713f24c4179041eb41567e2754ce9218
                      timestamp: '2025-01-02T10:15:00.000Z'
                      name: chat
                      userId: alice
                      sessionId: sess123
                      metadata:
                        platform_key: acme
                        mentor_id: fb9e5cf7
                      totalCost: 0.00021
                  summary: Single trace (get-by-id)
          description: Metrics rows or paginated observation records.
        '400':
          description: Bad Request – invalid query params or a value outside the allowed
            vocabulary.
        '403':
          description: Forbidden – caller lacks analytics access to this platform,
            or requested a mentor-scoped observation drill-down (not supported).
        '404':
          description: Not Found – the requested `trace_id`/`observation_id` does
            not exist or belongs to another tenant (existence is not leaked, so cross-tenant
            get-by-id returns 404 not 403).
        '500':
          description: Internal Server Error
        '502':
          description: Bad Gateway – the upstream analytics provider was unreachable
            or returned an 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
      - in: query
        name: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      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
      - in: query
        name: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      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. Authentication is optional - the API
        supports both authenticated and anonymous requests.

        Methods:
            POST: Submit time spent tracking data

        Authentication:
            Optional - supports both authenticated and anonymous requests.
            - Authenticated requests: User ID is associated with the record
            - Anonymous requests: Records are stored with null user_id

        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
      - in: query
        name: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      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
      description: |-
        Mixin for RBAC validation for mentor analytics views.

        Mentor analytics endpoints enforce RBAC in two phases:
        1. Endpoint authorization (_perform_mentor_analytics_validation):
           - Aggregate (no mentor_unique_id): requires
             "Ibl.Analytics/CanViewAnalytics/action" on /platforms/{pk}/ AND
             "Ibl.Analytics/Mentors/read" on /platforms/{pk}/mentors/.
           - Per-mentor (mentor_unique_id provided): requires
             "Ibl.Analytics/CanViewMentorAnalytics/action" on
             /platforms/{pk}/mentors/{mentor_id}/. The mentor-owner bypass
             (is_owner) applies via the MENTOR_OWNER well-known role.
        2. Row-level filter (_get_accessible_user_ids_for_mentor_analytics):
           - Enumerates accessible users under
             /platforms/{pk}/mentors/{mentor_id}/users/ using
             "Ibl.Analytics/Mentors/read". Grants on the mentor resource itself
             cascade to its users (full mentor access). Usergroup authorization
             is resolved at platform-level (/platforms/{pk}/usergroups/) —
             mentor-level grants do NOT cascade to usergroup access.

        Special case - Mentor owner unfiltered access:
        If the requesting user owns the mentor AND no usergroup_ids are
        specified, returns None (no filtering) — the analytics query layer is
        already scoped to the mentor. With usergroup_ids provided, the owner
        falls through to normal RBAC filtering and still needs explicit access
        (ownership or grant) to the requested groups.

        Note: Mentor analytics APIs work with platform_key (from query params).
      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
      - in: query
        name: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      tags:
      - ai-analytics
      - analytics
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionsChart'
          description: ''
  /api/analytics/time/:
    get:
      operationId: analytics_time_retrieve
      description: "\n        Time Analytics API - User activity patterns by time\
        \ of day and day of week.\n        \n        Provides heatmap data showing\
        \ when users are most active, useful for:\n        - Understanding peak usage\
        \ times\n        - Capacity planning and resource allocation\n        - User\
        \ behavior analysis\n        - Support scheduling optimization\n        \n\
        \        **Key Features:**\n        - Day of week patterns (0=Sunday through\
        \ 6=Saturday)\n        - Hour of day activity levels (0-23)\n        - Flexible\
        \ date range filtering\n        - Platform and agent-specific filtering\n\
        \        - Message count aggregation\n        \n        **Data Structure:**\n\
        \        - `day_of_week`: 0-6 (Sunday-Saturday)\n        - `hour`: 0-23 (24-hour\
        \ format)\n        - `value`: Message count for that time slot\n        "
      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
      - in: query
        name: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      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: "\n        Returns the total time spent (in seconds) for the current\
        \ authenticated user.\n        Can be filtered by platform, date range, course\
        \ ID, URL, mentor UUID, and session UUID.\n        "
      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: mentor_uuid
        schema:
          type: string
          minLength: 1
        description: Mentor UUID to filter by
      - in: query
        name: platform_key
        schema:
          type: string
          nullable: true
          minLength: 1
        description: Platform 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)
      - in: query
        name: username
        schema:
          type: string
          minLength: 1
        description: Username to get data for (admin users only)
      tags:
      - ai-analytics
      security:
      - PlatformApiKeyAuthentication: []
      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
      description: |-
        Returns topics overview analytics for a given platform and agent.

        Permission Required:
        - Platform Admin
        - Ibl.Analytics/Mentors/read
      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
      - in: query
        name: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      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
      description: |-
        Returns topic details Analytics for a given platform and agent.

        Permission Required:
        - Platform Admin
        - Ibl.Analytics/Mentors/read
      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
      - in: query
        name: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      tags:
      - ai-analytics
      - analytics
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopicDetails'
          description: ''
  /api/analytics/user:
    get:
      operationId: analytics_user_retrieve
      description: "\n        Retrieve a holistic snapshot of a user across catalog\
        \ enrollments, agent\n        engagement, skills, credentials, and time spent\
        \ data. The `metrics` query parameter controls\n        which sections are\
        \ returned and defaults to `courses` when omitted. A user can call this\n\
        \        endpoint for themselves without passing `username`; admins pass `username`\
        \ to target a\n        user in their scope.\n\n        The `mentors` section\
        \ lists every agent the user has engaged, sourced from both their\n      \
        \  sessions and saved agents. Each agent's `interactions` block reports engagement\
        \ depth\n        (`session_count`, `conversation_count`, human/AI message\
        \ counts, `avg_messages_per_session`),\n        recency and stickiness (`first_interaction`,\
        \ `latest_interaction`, `active_days`),\n        affinity (`rating`, `is_starred`),\
        \ and spend (`cost_usd`, in USD). The user's total\n        agent spend is\
        \ `user.total_agent_cost_usd`.\n\n        Optional `course_id` / `program_id`\
        \ / `pathway_id` scope the matching section to a\n        single item (empty\
        \ list if the user is not enrolled — never a 404); omitting them\n       \
        \ returns the full list unchanged. When `course_id` is set, the course block\
        \ is also\n        enriched with the user's live edX Progress data under `edx_progress`\
        \ (completion\n        summary, grade, grade summary) unless `include_edx_progress=false`.\
        \ The edX call is\n        best-effort: on failure `edx_progress` is null\
        \ and the DM data is still returned.\n        `program_id` / `pathway_id`\
        \ get scoping only — no edX enrichment.\n\n        When AI is enabled, three\
        \ additional sections surface the user's conversation\n        analytics for\
        \ the same user:\n        - `conversations`: headline metrics (average messages\
        \ per conversation, rating,\n          and cost) by default, or conversation\
        \ counts over time when\n          `conversation_metric=conversations`.\n\
        \        - `messages`: the user's conversation list with `summary`, `results`,\
        \ and\n          `pagination`. Supports `page`, `limit`, `search`, `min_messages`,\n\
        \          `max_messages`, `sentiment`, and `topic`. All-time unless a date\
        \ filter is\n          supplied.\n        - `message_detail`: one conversation's\
        \ transcript (summary plus human/AI message\n          pairs); requires `session_id`.\
        \ A `session_id` belonging to another user returns\n          403. Optionally\
        \ scope any of these to one agent with `mentor_unique_id`.\n        "
      parameters:
      - in: query
        name: conversation_metric
        schema:
          enum:
          - conversations
          - headline
          type: string
          default: headline
          minLength: 1
        description: |-
          For the `conversations` metric: `headline` (avg messages/rating/cost, the default) or `conversations` (conversation counts over time).

          * `conversations` - conversations
          * `headline` - headline
      - in: query
        name: course_id
        schema:
          type: string
        description: Scope the `courses` and `time_spent` sections to a single course.
          When set, also enriches the course with live edX progress (see `include_edx_progress`).
      - 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_edx_progress
        schema:
          type: boolean
          default: true
        description: When `course_id` is set, fold the learner's live edX Progress-page
          data (completion summary, grade, grade summary) into the course block. Defaults
          to true; set false to skip the edX round-trip.
      - in: query
        name: limit
        schema:
          type: integer
          maximum: 100
          minimum: 1
          default: 20
        description: 'Page size for the `messages` metric (default: 20, max: 100).'
      - in: query
        name: max_messages
        schema:
          type: integer
          minimum: 0
        description: Filter the `messages` list to conversations with at most N messages.
      - in: query
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
      - in: query
        name: metrics
        schema:
          type: string
        description: 'Comma-separated sections to return: courses, programs, pathways,
          agents, skills, credentials, time_spent, conversations, messages, message_detail.
          `agents` is an alias for the agent section. The conversations/messages/message_detail
          sections are available when AI is enabled. Defaults to courses when omitted.'
      - in: query
        name: min_messages
        schema:
          type: integer
          minimum: 0
        description: Filter the `messages` list to conversations with at least N messages.
      - in: query
        name: overtime
        schema:
          type: boolean
          default: false
        description: 'Include overtime metrics for time_spent data (default: false)'
      - in: query
        name: page
        schema:
          type: integer
          minimum: 1
          default: 1
        description: 'Page number for the `messages` metric (default: 1).'
      - in: query
        name: pathway_id
        schema:
          type: string
        description: Scope the `pathways` section to a single pathway.
      - in: query
        name: platform_key
        schema:
          type: string
      - in: query
        name: program_id
        schema:
          type: string
        description: Scope the `programs` section to a single program.
      - in: query
        name: search
        schema:
          type: string
        description: Filter the `messages` list by first user message or username.
      - in: query
        name: sentiment
        schema:
          enum:
          - positive
          - negative
          - neutral
          type: string
          minLength: 1
        description: |-
          Filter the `messages` list by conversation sentiment.

          * `positive` - positive
          * `negative` - negative
          * `neutral` - neutral
      - in: query
        name: session_id
        schema:
          type: string
        description: 'Required for the `message_detail` metric: the conversation to
          fetch.'
      - in: query
        name: start_date
        schema:
          type: string
          format: date
      - in: query
        name: topic
        schema:
          type: string
          minLength: 1
        description: Filter the `messages` list to conversations whose topic contains
          this text.
      - in: query
        name: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      - in: query
        name: username
        schema:
          type: string
      tags:
      - ai-analytics
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LearnerDetailsResponse'
              examples:
                UserDetails:
                  value:
                    user:
                      user_id: 42
                      username: user123
                      email: user@example.com
                      name: Example User
                      date_joined: '2024-01-01T00:00:00Z'
                      last_active: '2024-02-01T12:30:00Z'
                      total_agent_cost_usd: '14.2000'
                    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:
                          session_count: 8
                          conversation_count: 6
                          message_count_human: 41
                          message_count_ai: 47
                          total_messages: 88
                          avg_messages_per_session: 11.0
                          first_interaction: '2024-01-05T00:00:00Z'
                          latest_interaction: '2024-02-01T12:30:00Z'
                          active_days: 5
                          cost_usd: '1.8300'
                          rating: 4.5
                          is_starred: true
                      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: User 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/users/:
    get:
      operationId: analytics_users_retrieve
      description: "\n        User Analytics API - Comprehensive user activity metrics\
        \ and trends.\n        \n        Provides real-time and historical user analytics\
        \ including:\n        - Currently active users (last hour)\n        - Active\
        \ users over time periods (7d, 30d, 90d)\n        - Registered user counts\
        \ and growth\n        - Time series charts with customizable granularity\n\
        \        \n        **Key Features:**\n        - Real-time active user counting\n\
        \        - Percentage change calculations vs previous periods\n        - Flexible\
        \ date filtering and granularity\n        - Platform and agent-specific filtering\n\
        \        - Forward-filled time series data\n        \n        **Supported\
        \ Metrics:**\n        - `currently_active`: Users active in last hour\n  \
        \      - `active_users`: Unique users in specified period\n        - `registered_users`:\
        \ Total and new user counts\n        "
      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
      - in: query
        name: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      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: "\n        User Details API - Comprehensive user activity details\
        \ with search and filtering.\n        \n        Provides detailed user information\
        \ including:\n        - User contact information (username, email, full name)\n\
        \        - Activity metrics (message count, last activity)\n        - Search\
        \ functionality across multiple fields\n        - Flexible date range filtering\n\
        \        - CSV export capability\n\n        **Key Features:**\n        - Full-text\
        \ search across username, email, name, and user ID\n        - Date range filtering\
        \ for activity periods\n        - Platform and agent-specific filtering\n\
        \        - Comprehensive pagination with metadata\n        - CSV export for\
        \ data analysis\n        - User aggregation across platforms/agents\n\n  \
        \      **Search Capabilities:**\n        - Username matching\n        - Email\
        \ address matching\n        - Full name search\n        - User ID lookup\n\
        \        - Partial string matching (case-insensitive)\n        \n        **Export\
        \ Options:**\n        - JSON response (default)\n        - CSV export (?export=csv)\n\
        \        - Includes all user fields in export\n        "
      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
      - in: query
        name: usergroup_ids
        schema:
          type: array
          items:
            type: integer
          nullable: true
        description: Optional list of usergroup IDs to filter results
      tags:
      - ai-analytics
      - analytics
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDetail'
              examples:
                UserDetailsResponse:
                  value:
                    results:
                    - username: john.doe
                      email: john.doe@example.com
                      full_name: John Doe
                      messages: 1250
                      last_activity: '2025-01-15T14:30:00Z'
                    - username: jane.smith
                      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: |-
                    username,email,full_name,messages,last_activity
                    john.doe,john.doe@example.com,John Doe,1250,2025-01-15T14:30:00Z
                    jane.smith,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\
          \ \n\n* `y` - y\n* `yes` - yes\n* `true` - true\n* `True` - True\n* `n`\
          \ - n\n* `no` - no\n* `false` - false\n* `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\
          \ \n\n* `y` - y\n* `yes` - yes\n* `true` - true\n* `True` - True\n* `n`\
          \ - n\n* `no` - no\n* `false` - false\n* `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\
          \ \n\n* `y` - y\n* `yes` - yes\n* `true` - true\n* `True` - True\n* `n`\
          \ - n\n* `no` - no\n* `false` - false\n* `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\
          \ \n\n* `y` - y\n* `yes` - yes\n* `true` - true\n* `True` - True\n* `n`\
          \ - n\n* `no` - no\n* `false` - false\n* `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\
          \ \n\n* `y` - y\n* `yes` - yes\n* `true` - true\n* `True` - True\n* `n`\
          \ - n\n* `no` - no\n* `false` - false\n* `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/billing/access-check/{item_type}/{item_id}/:
    get:
      operationId: billing_access_check_retrieve
      description: Check whether the authenticated user has payment access to an item.
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: Platform key. Omit to resolve from request context.
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemAccessCheckResponse'
          description: ''
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemAccessCheckResponse'
          description: ''
  /api/billing/account/:
    get:
      operationId: billing_account_retrieve
      description: Return display credits (available_credits, has_credits, account_id)
        and auto-recharge settings. Pass platform_key (or key) to see platform balance
        if you are a platform admin.
      summary: Get credit account information
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: The unique key of the platform to access. If not provided, defaults
          to 'main' (user's own account).
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditAccountInfo'
          description: ''
    put:
      operationId: billing_account_update
      description: 'Update auto_recharge_threshold_usd, auto_recharge_amount_usd,
        auto_recharge_enabled, and/or auto_recharge_spending_limit_usd. When enabling
        auto-recharge, missing values are calculated: if only limit set, amount =
        20% of limit; if only amount set, limit = 5x amount; if neither set, defaults
        are limit=20, amount=4. Pass platform_key in the request body to update platform
        settings.'
      summary: Update auto-recharge preferences
      tags:
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreditAccountAutoRechargeUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CreditAccountAutoRechargeUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreditAccountAutoRechargeUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreditAccountAutoRechargeUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CreditAccountAutoRechargeUpdate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditAccountInfo'
          description: ''
    patch:
      operationId: billing_account_partial_update
      description: Same as PUT; partial update of auto-recharge fields.
      summary: Partially update auto-recharge preferences
      tags:
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedCreditAccountAutoRechargeUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedCreditAccountAutoRechargeUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedCreditAccountAutoRechargeUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedCreditAccountAutoRechargeUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedCreditAccountAutoRechargeUpdate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditAccountInfo'
          description: ''
  /api/billing/auto-recharge/trigger/:
    post:
      operationId: billing_auto_recharge_trigger_create
      description: 'With amount_usd: manual top-up (charge that amount, add credits;
        no threshold/limit/cooldown). Without amount_usd: run auto-recharge once if
        enabled and balance below threshold. Returns 400 if skipped or failed (e.g.
        no payment method, cooldown). Pass platform_key in request body.'
      summary: Trigger auto-recharge or manual top-up
      tags:
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutoRechargeTriggerRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/AutoRechargeTriggerRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AutoRechargeTriggerRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AutoRechargeTriggerRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/AutoRechargeTriggerRequest'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutoRechargeTriggerResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
          description: ''
  /api/billing/items/{item_unique_id}/access-check/:
    get:
      operationId: billing_items_access_check_retrieve
      description: Check whether the authenticated user has payment access to an item.
      parameters:
      - in: path
        name: item_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: Platform key. Omit to resolve from request context.
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemAccessCheckResponse'
          description: ''
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemAccessCheckResponse'
          description: ''
  /api/billing/items/{item_unique_id}/checkout/:
    post:
      operationId: billing_items_checkout_create
      description: Create a Stripe checkout session for an authenticated user to purchase
        or subscribe to an item.
      summary: Create checkout session
      parameters:
      - in: path
        name: item_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutSessionResponse'
          description: ''
  /api/billing/items/{item_unique_id}/checkout-callback/:
    get:
      operationId: billing_items_checkout_callback_retrieve
      description: Stripe redirects here after checkout. Processes the completed session
        and redirects to the return URL.
      summary: Handle checkout callback
      parameters:
      - in: path
        name: item_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: query
        name: return_url
        schema:
          type: string
          format: uri
          nullable: true
          minLength: 1
      tags:
      - billing
      security:
      - {}
      responses:
        '302':
          description: No response body
  /api/billing/items/{item_unique_id}/checkout-callback/{checkout_session_id}/:
    get:
      operationId: billing_items_checkout_callback_retrieve_2
      description: Stripe redirects here after checkout. Processes the completed session
        and redirects to the return URL.
      summary: Handle checkout callback
      parameters:
      - in: path
        name: checkout_session_id
        schema:
          type: string
        required: true
      - in: path
        name: item_unique_id
        schema:
          type: string
          format: uuid
        required: true
      - in: query
        name: return_url
        schema:
          type: string
          format: uri
          nullable: true
          minLength: 1
      tags:
      - billing
      security:
      - {}
      responses:
        '302':
          description: No response body
  /api/billing/items/{item_unique_id}/checkout-guest/:
    post:
      operationId: billing_items_checkout_guest_create
      description: Create a Stripe checkout session for a guest user (email required).
      summary: Create guest checkout session
      parameters:
      - in: path
        name: item_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutSessionResponse'
          description: ''
  /api/billing/items/{item_unique_id}/paywall/:
    get:
      operationId: billing_items_paywall_retrieve
      description: Retrieve the paywall configuration for an item. Returns default
        (disabled) config if none exists.
      summary: Get paywall configuration
      parameters:
      - in: path
        name: item_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemPaywallConfig'
          description: ''
    post:
      operationId: billing_items_paywall_create
      description: Enable or configure the paywall for an item. Creates a Stripe product
        on first enable.
      summary: Create or update paywall configuration
      parameters:
      - in: path
        name: item_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemPaywallConfig'
          description: ''
    put:
      operationId: billing_items_paywall_update
      description: Same as POST. Update the paywall configuration for an item.
      summary: Update paywall configuration
      parameters:
      - in: path
        name: item_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemPaywallConfig'
          description: ''
    delete:
      operationId: billing_items_paywall_destroy
      description: Disable the paywall for an item. Does not delete the configuration.
      summary: Disable paywall configuration
      parameters:
      - in: path
        name: item_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/billing/items/{item_unique_id}/paywall/prices/:
    get:
      operationId: billing_items_paywall_prices_list
      description: List active prices for an item's paywall configuration.
      summary: List prices
      parameters:
      - in: path
        name: item_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ItemPrice'
          description: ''
    post:
      operationId: billing_items_paywall_prices_create
      description: Create a new price tier for an item. Requires paywall to be enabled
        and Stripe Connect account ready.
      summary: Create a price
      parameters:
      - in: path
        name: item_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemPrice'
          description: ''
  /api/billing/items/{item_unique_id}/pricing/:
    get:
      operationId: billing_items_pricing_retrieve
      description: Retrieve public pricing information for an item. No authentication
        required.
      summary: Get public pricing
      parameters:
      - in: path
        name: item_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicItemPricing'
          description: ''
  /api/billing/items/{item_unique_id}/public-pricing/:
    get:
      operationId: billing_items_public_pricing_retrieve
      description: Retrieve public pricing information for an item. No authentication
        required.
      summary: Get public pricing
      parameters:
      - in: path
        name: item_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicItemPricing'
          description: ''
  /api/billing/items/{item_unique_id}/scoped-access-check/:
    get:
      operationId: billing_items_scoped_access_check_retrieve
      description: Check whether the authenticated user has payment access to an item
        on a scoped platform.
      parameters:
      - in: path
        name: item_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemAccessCheckResponse'
          description: ''
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemAccessCheckResponse'
          description: ''
  /api/billing/items/{item_unique_id}/subscribers/:
    get:
      operationId: billing_items_subscribers_list
      description: List all subscribers for an item. Optionally filter by subscription
        status.
      summary: List item subscribers
      parameters:
      - in: path
        name: item_unique_id
        schema:
          type: string
          format: uuid
        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
          minLength: 1
      - in: query
        name: status
        schema:
          enum:
          - active
          - free
          - grandfathered
          - trialing
          - past_due
          - canceled
          - incomplete
          type: string
          minLength: 1
        description: |-
          * `active` - Active
          * `free` - Free Tier
          * `grandfathered` - Grandfathered
          * `trialing` - Trialing
          * `past_due` - Past Due
          * `canceled` - Canceled
          * `incomplete` - Incomplete
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedItemSubscriptionList'
          description: ''
  /api/billing/items/{item_unique_id}/subscription/:
    get:
      operationId: billing_items_subscription_retrieve
      description: Retrieve the current user's subscription to an item.
      summary: Get user subscription
      parameters:
      - in: path
        name: item_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemSubscription'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
          description: ''
  /api/billing/items/{item_unique_id}/subscription/cancel/:
    post:
      operationId: billing_items_subscription_cancel_create
      description: Cancel the current user's subscription. Returns a Stripe customer
        portal URL for recurring subscriptions, or cancels directly for one-time purchases.
      summary: Cancel subscription
      parameters:
      - in: path
        name: item_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortalUrlResponse'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
          description: ''
  /api/billing/items/prices/{price_unique_id}/:
    get:
      operationId: billing_items_prices_retrieve
      description: Retrieve a specific price by ID.
      summary: Get price details
      parameters:
      - in: path
        name: price_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemPrice'
          description: ''
    put:
      operationId: billing_items_prices_update
      description: Update a price tier. If pricing fields change and a Stripe price
        exists, a new Stripe price is created and the old one deactivated.
      summary: Update a price
      parameters:
      - in: path
        name: price_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemPrice'
          description: ''
    delete:
      operationId: billing_items_prices_destroy
      description: Soft-delete a price tier and deactivate the corresponding Stripe
        price.
      summary: Delete a price
      parameters:
      - in: path
        name: price_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/billing/items/prices/{price_unique_id}/checkout/:
    post:
      operationId: billing_items_prices_checkout_create
      description: Create a Stripe checkout session for an authenticated user to purchase
        or subscribe to an item.
      summary: Create checkout session
      parameters:
      - in: path
        name: price_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutSessionResponse'
          description: ''
  /api/billing/platforms/{platform_key}/items/{item_type}/{item_id}/access-check/:
    get:
      operationId: billing_platforms_items_access_check_retrieve
      description: Check whether the authenticated user has payment access to an item
        on a scoped platform.
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemAccessCheckResponse'
          description: ''
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemAccessCheckResponse'
          description: ''
  /api/billing/platforms/{platform_key}/items/{item_type}/{item_id}/checkout/:
    post:
      operationId: billing_platforms_items_checkout_create
      description: Create a Stripe checkout session for an authenticated user to purchase
        or subscribe to an item.
      summary: Create checkout session
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutSessionResponse'
          description: ''
  /api/billing/platforms/{platform_key}/items/{item_type}/{item_id}/checkout-callback/:
    get:
      operationId: billing_platforms_items_checkout_callback_retrieve
      description: Stripe redirects here after checkout. Processes the completed session
        and redirects to the return URL.
      summary: Handle checkout callback
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: return_url
        schema:
          type: string
          format: uri
          nullable: true
          minLength: 1
      tags:
      - billing
      security:
      - {}
      responses:
        '302':
          description: No response body
  /api/billing/platforms/{platform_key}/items/{item_type}/{item_id}/checkout-callback/{checkout_session_id}/:
    get:
      operationId: billing_platforms_items_checkout_callback_retrieve_2
      description: Stripe redirects here after checkout. Processes the completed session
        and redirects to the return URL.
      summary: Handle checkout callback
      parameters:
      - in: path
        name: checkout_session_id
        schema:
          type: string
        required: true
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: return_url
        schema:
          type: string
          format: uri
          nullable: true
          minLength: 1
      tags:
      - billing
      security:
      - {}
      responses:
        '302':
          description: No response body
  /api/billing/platforms/{platform_key}/items/{item_type}/{item_id}/checkout-guest/:
    post:
      operationId: billing_platforms_items_checkout_guest_create
      description: Create a Stripe checkout session for a guest user (email required).
      summary: Create guest checkout session
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutSessionResponse'
          description: ''
  /api/billing/platforms/{platform_key}/items/{item_type}/{item_id}/paywall/:
    get:
      operationId: billing_platforms_items_paywall_retrieve
      description: Retrieve the paywall configuration for an item. Returns default
        (disabled) config if none exists.
      summary: Get paywall configuration
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemPaywallConfig'
          description: ''
    post:
      operationId: billing_platforms_items_paywall_create
      description: Enable or configure the paywall for an item. Creates a Stripe product
        on first enable.
      summary: Create or update paywall configuration
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemPaywallConfig'
          description: ''
    put:
      operationId: billing_platforms_items_paywall_update
      description: Same as POST. Update the paywall configuration for an item.
      summary: Update paywall configuration
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/ItemPaywallConfigCreate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemPaywallConfig'
          description: ''
    delete:
      operationId: billing_platforms_items_paywall_destroy
      description: Disable the paywall for an item. Does not delete the configuration.
      summary: Disable paywall configuration
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/billing/platforms/{platform_key}/items/{item_type}/{item_id}/paywall/prices/:
    get:
      operationId: billing_platforms_items_paywall_prices_list
      description: List active prices for an item's paywall configuration.
      summary: List prices
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ItemPrice'
          description: ''
    post:
      operationId: billing_platforms_items_paywall_prices_create
      description: Create a new price tier for an item. Requires paywall to be enabled
        and Stripe Connect account ready.
      summary: Create a price
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemPrice'
          description: ''
  /api/billing/platforms/{platform_key}/items/{item_type}/{item_id}/paywall/prices/{price_id}/:
    get:
      operationId: billing_platforms_items_paywall_prices_retrieve
      description: Retrieve a specific price by ID.
      summary: Get price details
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: price_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemPrice'
          description: ''
    put:
      operationId: billing_platforms_items_paywall_prices_update
      description: Update a price tier. If pricing fields change and a Stripe price
        exists, a new Stripe price is created and the old one deactivated.
      summary: Update a price
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: price_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/ItemPriceCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemPrice'
          description: ''
    delete:
      operationId: billing_platforms_items_paywall_prices_destroy
      description: Soft-delete a price tier and deactivate the corresponding Stripe
        price.
      summary: Delete a price
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: price_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/billing/platforms/{platform_key}/items/{item_type}/{item_id}/pricing/:
    get:
      operationId: billing_platforms_items_pricing_retrieve
      description: Retrieve public pricing information for an item. No authentication
        required.
      summary: Get public pricing
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - billing
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicItemPricing'
          description: ''
  /api/billing/platforms/{platform_key}/items/{item_type}/{item_id}/subscribers/:
    get:
      operationId: billing_platforms_items_subscribers_list
      description: List all subscribers for an item. Optionally filter by subscription
        status.
      summary: List item subscribers
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        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: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: search
        schema:
          type: string
          minLength: 1
      - in: query
        name: status
        schema:
          enum:
          - active
          - free
          - grandfathered
          - trialing
          - past_due
          - canceled
          - incomplete
          type: string
          minLength: 1
        description: |-
          * `active` - Active
          * `free` - Free Tier
          * `grandfathered` - Grandfathered
          * `trialing` - Trialing
          * `past_due` - Past Due
          * `canceled` - Canceled
          * `incomplete` - Incomplete
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedItemSubscriptionList'
          description: ''
  /api/billing/platforms/{platform_key}/items/{item_type}/{item_id}/subscription/:
    get:
      operationId: billing_platforms_items_subscription_retrieve
      description: Retrieve the current user's subscription to an item.
      summary: Get user subscription
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemSubscription'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
          description: ''
  /api/billing/platforms/{platform_key}/items/{item_type}/{item_id}/subscription/cancel/:
    post:
      operationId: billing_platforms_items_subscription_cancel_create
      description: Cancel the current user's subscription. Returns a Stripe customer
        portal URL for recurring subscriptions, or cancels directly for one-time purchases.
      summary: Cancel subscription
      parameters:
      - in: path
        name: item_id
        schema:
          type: string
        required: true
      - in: path
        name: item_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortalUrlResponse'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetail'
          description: ''
  /api/billing/platforms/{platform_key}/my-subscriptions/:
    get:
      operationId: billing_platforms_my_subscriptions_list
      description: Paginated list of the current user's subscriptions on a platform.
        Optionally filter by status or item_type.
      summary: List user subscriptions
      parameters:
      - in: query
        name: item_type
        schema:
          type: string
          maxLength: 50
          minLength: 1
      - 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: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: search
        schema:
          type: string
          minLength: 1
      - in: query
        name: status
        schema:
          enum:
          - active
          - free
          - grandfathered
          - trialing
          - past_due
          - canceled
          - incomplete
          type: string
          minLength: 1
        description: |-
          * `active` - Active
          * `free` - Free Tier
          * `grandfathered` - Grandfathered
          * `trialing` - Trialing
          * `past_due` - Past Due
          * `canceled` - Canceled
          * `incomplete` - Incomplete
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedItemSubscriptionListList'
          description: ''
  /api/billing/platforms/{platform_key}/paywalls/:
    get:
      operationId: billing_platforms_paywalls_list
      description: Paginated list of all item paywall configurations on a platform.
        Filterable by item_type and is_enabled.
      summary: List all platform paywall configurations
      parameters:
      - in: query
        name: is_enabled
        schema:
          type: boolean
          nullable: true
      - in: query
        name: item_type
        schema:
          type: string
          maxLength: 50
          minLength: 1
      - 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: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: search
        schema:
          type: string
          minLength: 1
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedItemPaywallConfigList'
          description: ''
  /api/billing/platforms/{platform_key}/revenue/:
    get:
      operationId: billing_platforms_revenue_retrieve
      description: Aggregate sales volume and count for a platform across all item
        types.
      summary: Platform sales summary
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformRevenueSummary'
          description: ''
  /api/billing/platforms/{platform_key}/subscribers/:
    get:
      operationId: billing_platforms_subscribers_list
      description: Paginated list of all subscribers across all items on a platform.
        Filterable by status and item_type.
      summary: List all platform subscribers
      parameters:
      - in: query
        name: item_type
        schema:
          type: string
          maxLength: 50
          minLength: 1
      - 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: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: search
        schema:
          type: string
          minLength: 1
      - in: query
        name: status
        schema:
          enum:
          - active
          - free
          - grandfathered
          - trialing
          - past_due
          - canceled
          - incomplete
          type: string
          minLength: 1
        description: |-
          * `active` - Active
          * `free` - Free Tier
          * `grandfathered` - Grandfathered
          * `trialing` - Trialing
          * `past_due` - Past Due
          * `canceled` - Canceled
          * `incomplete` - Incomplete
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedItemSubscriptionListList'
          description: ''
  /api/billing/prices/{price_unique_id}/checkout-guest/:
    post:
      operationId: billing_prices_checkout_guest_create
      description: Looks up the price by its unique_id, derives platform/item_type/item_id,
        and delegates to the standard guest checkout flow.
      summary: Create guest checkout session by price unique_id
      parameters:
      - in: path
        name: price_unique_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/CheckoutSessionCreate'
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutSessionResponse'
          description: ''
  /api/billing/transactions/:
    get:
      operationId: billing_transactions_retrieve
      description: Paginated transaction history for the credit account. Use platform_key
        query param to list platform account transactions (if permitted). Filter by
        transaction_type, from_date (YYYY-MM-DD), to_date (YYYY-MM-DD).
      summary: List transaction history
      parameters:
      - in: query
        name: from_date
        schema:
          type: string
          format: date
        description: Filter from date (YYYY-MM-DD), inclusive.
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: Platform key. Omit for user's own account.
      - in: query
        name: to_date
        schema:
          type: string
          format: date
        description: Filter to date (YYYY-MM-DD), inclusive.
      - in: query
        name: transaction_type
        schema:
          enum:
          - add
          - subtract
          - reserve
          - release
          - rollover
          - refund
          type: string
          minLength: 1
        description: |-
          Filter by transaction type.

          * `add` - add
          * `subtract` - subtract
          * `reserve` - reserve
          * `release` - release
          * `rollover` - rollover
          * `refund` - refund
      tags:
      - billing
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditTransactionHistory'
          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/applications/platform/:
    get:
      operationId: catalog_applications_platform_retrieve
      description: |-
        Authenticated applicants, including learners on AXD student tokens.

        Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is
        not in the DRF defaults, but learners self-applying use it). An anonymous
        request returns 401, not 403: DRF's ``permission_denied`` raises
        ``NotAuthenticated`` whenever no authenticator succeeded.
      parameters:
      - in: query
        name: form_id
        schema:
          type: integer
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
      - in: query
        name: platform_org
        schema:
          type: string
          minLength: 1
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Own submissions
    post:
      operationId: catalog_applications_platform_create
      description: |-
        Authenticated applicants, including learners on AXD student tokens.

        Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is
        not in the DRF defaults, but learners self-applying use it). An anonymous
        request returns 401, not 403: DRF's ``permission_denied`` raises
        ``NotAuthenticated`` whenever no authenticator succeeded.
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformApplicationCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformApplicationCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformApplicationCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformApplicationDetail'
          description: ''
  /api/catalog/applications/platform/{submission_id}/:
    get:
      operationId: catalog_applications_platform_retrieve_2
      description: |-
        Authenticated applicants, including learners on AXD student tokens.

        Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is
        not in the DRF defaults, but learners self-applying use it). An anonymous
        request returns 401, not 403: DRF's ``permission_denied`` raises
        ``NotAuthenticated`` whenever no authenticator succeeded.
      parameters:
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformApplicationDetail'
          description: ''
    patch:
      operationId: catalog_applications_platform_partial_update
      description: |-
        Authenticated applicants, including learners on AXD student tokens.

        Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is
        not in the DRF defaults, but learners self-applying use it). An anonymous
        request returns 401, not 403: DRF's ``permission_denied`` raises
        ``NotAuthenticated`` whenever no authenticator succeeded.
      parameters:
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationUpdate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformApplicationDetail'
          description: ''
  /api/catalog/applications/platform/{submission_id}/attachments/:
    post:
      operationId: catalog_applications_platform_attachments_create
      description: |-
        Authenticated applicants, including learners on AXD student tokens.

        Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is
        not in the DRF defaults, but learners self-applying use it). An anonymous
        request returns 401, not 403: DRF's ``permission_denied`` raises
        ``NotAuthenticated`` whenever no authenticator succeeded.
      parameters:
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformApplicationAttachmentUpload'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformApplicationAttachmentUpload'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          description: Attachment stored
  /api/catalog/applications/platform/{submission_id}/attachments/{attachment_id}/:
    delete:
      operationId: catalog_applications_platform_attachments_destroy
      description: |-
        Authenticated applicants, including learners on AXD student tokens.

        Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is
        not in the DRF defaults, but learners self-applying use it). An anonymous
        request returns 401, not 403: DRF's ``permission_denied`` raises
        ``NotAuthenticated`` whenever no authenticator succeeded.
      parameters:
      - in: path
        name: attachment_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Attachment removed
  /api/catalog/applications/platform/{submission_id}/submit/:
    post:
      operationId: catalog_applications_platform_submit_create
      description: |-
        Authenticated applicants, including learners on AXD student tokens.

        Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is
        not in the DRF defaults, but learners self-applying use it). An anonymous
        request returns 401, not 403: DRF's ``permission_denied`` raises
        ``NotAuthenticated`` whenever no authenticator succeeded.
      parameters:
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationSubmit'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationSubmit'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformApplicationSubmit'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformApplicationSubmit'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformApplicationSubmit'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformApplicationDetail'
          description: ''
  /api/catalog/applications/platform/{submission_id}/withdraw/:
    post:
      operationId: catalog_applications_platform_withdraw_create
      description: |-
        Authenticated applicants, including learners on AXD student tokens.

        Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is
        not in the DRF defaults, but learners self-applying use it). An anonymous
        request returns 401, not 403: DRF's ``permission_denied`` raises
        ``NotAuthenticated`` whenever no authenticator succeeded.
      parameters:
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformApplicationDetail'
          description: ''
  /api/catalog/applications/platform/form/:
    get:
      operationId: catalog_applications_platform_form_retrieve
      description: |-
        Authenticated applicants, including learners on AXD student tokens.

        Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is
        not in the DRF defaults, but learners self-applying use it). An anonymous
        request returns 401, not 403: DRF's ``permission_denied`` raises
        ``NotAuthenticated`` whenever no authenticator succeeded.
      parameters:
      - in: query
        name: form_id
        schema:
          type: integer
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
      - in: query
        name: platform_org
        schema:
          type: string
          minLength: 1
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Active form
  /api/catalog/applications/platform/forms/manage/:
    get:
      operationId: catalog_applications_platform_forms_manage_retrieve
      description: |-
        Wires RBAC into a DRF view.

        Two responsibilities:

        1. When RBAC is enabled, replace the view's `permission_classes` with
           `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated`
           semantics, plus opt-in acceptance of token-policies PlatformApiKeys for
           views that set `token_policies_enabled = True`).

        2. Detect server-to-server (Django auth) callers via `is_service_account`.
           Server-to-server tokens authenticate as Django auth users with no
           relationship to a platform EdxUser. The convention is "we trust this
           caller — bypass RBAC and serve the request."

           Combine it with the RBAC-disabled check at the top of `initial()` so
           the early exit skips all RBAC prep work:

               if not ConfigFlags.rbac_enabled() or self.is_service_account:
                   return

           Use `is_service_account` at any other touch points where caller
           identity matters (queryset ownership filters, owner attribution on
           create, serializer context, etc.).
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
      - in: query
        name: platform_org
        schema:
          type: string
          minLength: 1
      - in: query
        name: sort
        schema:
          type: string
          minLength: 1
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Forms for the platform
    post:
      operationId: catalog_applications_platform_forms_manage_create
      description: |-
        Wires RBAC into a DRF view.

        Two responsibilities:

        1. When RBAC is enabled, replace the view's `permission_classes` with
           `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated`
           semantics, plus opt-in acceptance of token-policies PlatformApiKeys for
           views that set `token_policies_enabled = True`).

        2. Detect server-to-server (Django auth) callers via `is_service_account`.
           Server-to-server tokens authenticate as Django auth users with no
           relationship to a platform EdxUser. The convention is "we trust this
           caller — bypass RBAC and serve the request."

           Combine it with the RBAC-disabled check at the top of `initial()` so
           the early exit skips all RBAC prep work:

               if not ConfigFlags.rbac_enabled() or self.is_service_account:
                   return

           Use `is_service_account` at any other touch points where caller
           identity matters (queryset ownership filters, owner attribution on
           create, serializer context, etc.).
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
      - in: query
        name: platform_org
        schema:
          type: string
          minLength: 1
      - in: query
        name: sort
        schema:
          type: string
          minLength: 1
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationFormCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationFormCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformApplicationFormCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformApplicationFormCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformApplicationFormCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformApplicationFormDetail'
          description: ''
  /api/catalog/applications/platform/forms/manage/{form_id}/:
    get:
      operationId: catalog_applications_platform_forms_manage_retrieve_2
      description: |-
        Wires RBAC into a DRF view.

        Two responsibilities:

        1. When RBAC is enabled, replace the view's `permission_classes` with
           `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated`
           semantics, plus opt-in acceptance of token-policies PlatformApiKeys for
           views that set `token_policies_enabled = True`).

        2. Detect server-to-server (Django auth) callers via `is_service_account`.
           Server-to-server tokens authenticate as Django auth users with no
           relationship to a platform EdxUser. The convention is "we trust this
           caller — bypass RBAC and serve the request."

           Combine it with the RBAC-disabled check at the top of `initial()` so
           the early exit skips all RBAC prep work:

               if not ConfigFlags.rbac_enabled() or self.is_service_account:
                   return

           Use `is_service_account` at any other touch points where caller
           identity matters (queryset ownership filters, owner attribution on
           create, serializer context, etc.).
      parameters:
      - in: path
        name: form_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
      - in: query
        name: platform_org
        schema:
          type: string
          minLength: 1
      - in: query
        name: sort
        schema:
          type: string
          minLength: 1
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformApplicationFormDetail'
          description: ''
    patch:
      operationId: catalog_applications_platform_forms_manage_partial_update
      description: |-
        Wires RBAC into a DRF view.

        Two responsibilities:

        1. When RBAC is enabled, replace the view's `permission_classes` with
           `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated`
           semantics, plus opt-in acceptance of token-policies PlatformApiKeys for
           views that set `token_policies_enabled = True`).

        2. Detect server-to-server (Django auth) callers via `is_service_account`.
           Server-to-server tokens authenticate as Django auth users with no
           relationship to a platform EdxUser. The convention is "we trust this
           caller — bypass RBAC and serve the request."

           Combine it with the RBAC-disabled check at the top of `initial()` so
           the early exit skips all RBAC prep work:

               if not ConfigFlags.rbac_enabled() or self.is_service_account:
                   return

           Use `is_service_account` at any other touch points where caller
           identity matters (queryset ownership filters, owner attribution on
           create, serializer context, etc.).
      parameters:
      - in: path
        name: form_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
      - in: query
        name: platform_org
        schema:
          type: string
          minLength: 1
      - in: query
        name: sort
        schema:
          type: string
          minLength: 1
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationFormUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationFormUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationFormUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationFormUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationFormUpdate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformApplicationFormDetail'
          description: ''
  /api/catalog/applications/platform/manage/:
    get:
      operationId: catalog_applications_platform_manage_retrieve
      description: |-
        Wires RBAC into a DRF view.

        Two responsibilities:

        1. When RBAC is enabled, replace the view's `permission_classes` with
           `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated`
           semantics, plus opt-in acceptance of token-policies PlatformApiKeys for
           views that set `token_policies_enabled = True`).

        2. Detect server-to-server (Django auth) callers via `is_service_account`.
           Server-to-server tokens authenticate as Django auth users with no
           relationship to a platform EdxUser. The convention is "we trust this
           caller — bypass RBAC and serve the request."

           Combine it with the RBAC-disabled check at the top of `initial()` so
           the early exit skips all RBAC prep work:

               if not ConfigFlags.rbac_enabled() or self.is_service_account:
                   return

           Use `is_service_account` at any other touch points where caller
           identity matters (queryset ownership filters, owner attribution on
           create, serializer context, etc.).
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
      - in: query
        name: platform_org
        schema:
          type: string
          minLength: 1
      - in: query
        name: search
        schema:
          type: string
          minLength: 1
      - in: query
        name: sort
        schema:
          type: string
          minLength: 1
      - in: query
        name: status
        schema:
          type: string
          minLength: 1
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Submissions for the platform
  /api/catalog/applications/platform/manage/{submission_id}/:
    get:
      operationId: catalog_applications_platform_manage_retrieve_2
      description: |-
        Wires RBAC into a DRF view.

        Two responsibilities:

        1. When RBAC is enabled, replace the view's `permission_classes` with
           `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated`
           semantics, plus opt-in acceptance of token-policies PlatformApiKeys for
           views that set `token_policies_enabled = True`).

        2. Detect server-to-server (Django auth) callers via `is_service_account`.
           Server-to-server tokens authenticate as Django auth users with no
           relationship to a platform EdxUser. The convention is "we trust this
           caller — bypass RBAC and serve the request."

           Combine it with the RBAC-disabled check at the top of `initial()` so
           the early exit skips all RBAC prep work:

               if not ConfigFlags.rbac_enabled() or self.is_service_account:
                   return

           Use `is_service_account` at any other touch points where caller
           identity matters (queryset ownership filters, owner attribution on
           create, serializer context, etc.).
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
      - in: query
        name: platform_org
        schema:
          type: string
          minLength: 1
      - in: query
        name: search
        schema:
          type: string
          minLength: 1
      - in: query
        name: sort
        schema:
          type: string
          minLength: 1
      - in: query
        name: status
        schema:
          type: string
          minLength: 1
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Full submission detail
  /api/catalog/applications/platform/manage/{submission_id}/attachments/{attachment_id}/download/:
    get:
      operationId: catalog_applications_platform_manage_attachments_download_retrieve
      description: |-
        Reviewer download: redirect to the storage's (signed, on S3) file URL.

        Gated by ``IsDMAdmin | IsPlatformAdmin`` plus the RBAC verb check on the
        attachment's own platform when RBAC is enabled.
      parameters:
      - in: path
        name: attachment_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '302':
          description: Redirect to the file URL
  /api/catalog/applications/platform/manage/{submission_id}/candidates/{candidate_id}/invite/:
    post:
      operationId: catalog_applications_platform_manage_candidates_invite_create
      description: |-
        Re-run settlement provisioning for one accepted candidate: links them
        if an account with their designated email now exists, or re-issues the
        platform invitation if none is active. Covers the invite-missing state.
      parameters:
      - in: path
        name: candidate_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Candidate after provisioning
  /api/catalog/applications/platform/manage/{submission_id}/candidates/{candidate_id}/link/:
    post:
      operationId: catalog_applications_platform_manage_candidates_link_create
      description: |-
        Manually link an accepted candidate to an existing account (the
        account-unlinked state: the family signed up outside invitation
        redemption, or under a different email than designated).
      parameters:
      - in: path
        name: candidate_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationCandidateLink'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationCandidateLink'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformApplicationCandidateLink'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformApplicationCandidateLink'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformApplicationCandidateLink'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Candidate linked
  /api/catalog/applications/platform/manage/{submission_id}/course-assignments/:
    get:
      operationId: catalog_applications_platform_manage_course_assignments_retrieve
      description: |-
        Course assignments for a submission (#2134): list, and assign courses to
        accepted candidates individually or in bulk. Each successful item issues a
        CourseInvitation that the existing pipeline enrolls.
      parameters:
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Assignments for the submission
    post:
      operationId: catalog_applications_platform_manage_course_assignments_create
      description: |-
        Course assignments for a submission (#2134): list, and assign courses to
        accepted candidates individually or in bulk. Each successful item issues a
        CourseInvitation that the existing pipeline enrolls.
      parameters:
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationCourseAssignment'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationCourseAssignment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformApplicationCourseAssignment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformApplicationCourseAssignment'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformApplicationCourseAssignment'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Per-item assignment results
  /api/catalog/applications/platform/manage/{submission_id}/course-assignments/{assignment_id}/:
    delete:
      operationId: catalog_applications_platform_manage_course_assignments_destroy
      description: |-
        Remove one course assignment (§9.2 "enrollment changes after the school
        year begins" — the record side).

        Deactivates the assignment and cancels its invitation when the student has
        not yet been enrolled through it. It never unenrolls an already-enrolled
        student: platform admins un-enroll deliberately through the catalog
        enrollment endpoints, not from an admissions record.
      parameters:
      - in: path
        name: assignment_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Assignment removed
  /api/catalog/applications/platform/manage/{submission_id}/fee/:
    get:
      operationId: catalog_applications_platform_manage_fee_retrieve
      description: |-
        Reviewer/admin view of a submission's application fee (#2132, §5).

        GET returns the charge and its event history; POST records an out-of-band
        payment or a waiver/refund/credit. Money collection through Stripe is a
        later segment; this is the domain side.
      parameters:
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Charge + events
    post:
      operationId: catalog_applications_platform_manage_fee_create
      description: |-
        Reviewer/admin view of a submission's application fee (#2132, §5).

        GET returns the charge and its event history; POST records an out-of-band
        payment or a waiver/refund/credit. Money collection through Stripe is a
        later segment; this is the domain side.
      parameters:
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationFeeAction'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationFeeAction'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformApplicationFeeAction'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformApplicationFeeAction'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformApplicationFeeAction'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Charge updated
  /api/catalog/applications/platform/manage/{submission_id}/notes/:
    get:
      operationId: catalog_applications_platform_manage_notes_retrieve
      description: |-
        Internal reviewer notes on a submission (#2089, §6). Never surfaced on
        applicant endpoints. GET lists (optional ``kind`` filter); POST adds one.
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
      - in: query
        name: platform_org
        schema:
          type: string
          minLength: 1
      - in: query
        name: search
        schema:
          type: string
          minLength: 1
      - in: query
        name: sort
        schema:
          type: string
          minLength: 1
      - in: query
        name: status
        schema:
          type: string
          minLength: 1
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Notes for the submission
    post:
      operationId: catalog_applications_platform_manage_notes_create
      description: |-
        Internal reviewer notes on a submission (#2089, §6). Never surfaced on
        applicant endpoints. GET lists (optional ``kind`` filter); POST adds one.
      parameters:
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationNote'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationNote'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformApplicationNote'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformApplicationNote'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformApplicationNote'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          description: Note created
  /api/catalog/applications/platform/manage/{submission_id}/notes/{note_id}/:
    patch:
      operationId: catalog_applications_platform_manage_notes_partial_update
      description: Edit or remove a single internal reviewer note.
      parameters:
      - in: path
        name: note_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationNote'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationNote'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationNote'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationNote'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationNote'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Note updated
    delete:
      operationId: catalog_applications_platform_manage_notes_destroy
      description: Edit or remove a single internal reviewer note.
      parameters:
      - in: path
        name: note_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Note removed
  /api/catalog/applications/platform/manage/{submission_id}/placements/:
    get:
      operationId: catalog_applications_platform_manage_placements_retrieve
      description: |-
        Placements for a submission (#2133): list, and assign a new placement
        linking an accepted candidate to the placement mentor.
      parameters:
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Placements for the submission
    post:
      operationId: catalog_applications_platform_manage_placements_create
      description: |-
        Placements for a submission (#2133): list, and assign a new placement
        linking an accepted candidate to the placement mentor.
      parameters:
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationPlacementCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationPlacementCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformApplicationPlacementCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformApplicationPlacementCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformApplicationPlacementCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Per-item placement results
  /api/catalog/applications/platform/manage/{submission_id}/placements/{placement_id}/:
    patch:
      operationId: catalog_applications_platform_manage_placements_partial_update
      description: 'Advance a single placement: status, the agent''s result, admin
        override.'
      parameters:
      - in: path
        name: placement_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationPlacementUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationPlacementUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationPlacementUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationPlacementUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationPlacementUpdate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Placement updated
  /api/catalog/applications/platform/manage/{submission_id}/submit/:
    post:
      operationId: catalog_applications_platform_manage_submit_create
      description: |-
        Admin submit-with-exceptions (§2.1 "administratively waived"): push a
        family's editable application to Submitted, recording a waiver for every
        required item still missing and bypassing an unpaid fee gate (the charge
        stays payable/waivable). Present-but-invalid answers still block (400).
      parameters:
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationAdminSubmit'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationAdminSubmit'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformApplicationAdminSubmit'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformApplicationAdminSubmit'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformApplicationAdminSubmit'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Application submitted
  /api/catalog/applications/platform/manage/{submission_id}/transition/:
    post:
      operationId: catalog_applications_platform_manage_transition_create
      description: |-
        Advance a submission or a single candidate through the review pipeline
        (#2089, §5-6). A ``candidate_id`` scopes the action to one person; without
        it the action applies to every candidate that can legally accept it. When
        ``action`` is ``decline`` and ``block`` is set, the applicant is also added
        to the platform ban-list (deny-with-block).
      parameters:
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationTransition'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationTransition'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformApplicationTransition'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformApplicationTransition'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformApplicationTransition'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Updated submission detail
  /api/catalog/applications/platform/manage/{submission_id}/waivers/:
    post:
      operationId: catalog_applications_platform_manage_waivers_create
      description: |-
        Waive a required item on one application (§2.1 "administratively
        waived"): POST excuses a missing required field so it no longer blocks
        submission; DELETE reinstates it. Waivers excuse absence only — a
        present-but-invalid answer still blocks. The fee is waived through its own
        fee endpoint action, which also settles the money record.
      parameters:
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationWaiver'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationWaiver'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformApplicationWaiver'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformApplicationWaiver'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformApplicationWaiver'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Waiver recorded
    delete:
      operationId: catalog_applications_platform_manage_waivers_destroy
      description: |-
        Waive a required item on one application (§2.1 "administratively
        waived"): POST excuses a missing required field so it no longer blocks
        submission; DELETE reinstates it. Waivers excuse absence only — a
        present-but-invalid answer still blocks. The fee is waived through its own
        fee endpoint action, which also settles the money record.
      parameters:
      - in: path
        name: submission_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Waiver removed
  /api/catalog/applications/platform/manage/blocks/:
    get:
      operationId: catalog_applications_platform_manage_blocks_retrieve
      description: List the active application blocks (ban-list) for a platform.
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
      - in: query
        name: platform_org
        schema:
          type: string
          minLength: 1
      - in: query
        name: search
        schema:
          type: string
          minLength: 1
      - in: query
        name: sort
        schema:
          type: string
          minLength: 1
      - in: query
        name: status
        schema:
          type: string
          minLength: 1
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Active blocks
  /api/catalog/applications/platform/manage/blocks/{block_id}/:
    delete:
      operationId: catalog_applications_platform_manage_blocks_destroy
      description: Lift a single active application block (unblock).
      parameters:
      - in: path
        name: block_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
      - in: query
        name: platform_org
        schema:
          type: string
          minLength: 1
      - in: query
        name: search
        schema:
          type: string
          minLength: 1
      - in: query
        name: sort
        schema:
          type: string
          minLength: 1
      - in: query
        name: status
        schema:
          type: string
          minLength: 1
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Block lifted
  /api/catalog/applications/platform/manage/stats/:
    get:
      operationId: catalog_applications_platform_manage_stats_retrieve
      description: |-
        Wires RBAC into a DRF view.

        Two responsibilities:

        1. When RBAC is enabled, replace the view's `permission_classes` with
           `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated`
           semantics, plus opt-in acceptance of token-policies PlatformApiKeys for
           views that set `token_policies_enabled = True`).

        2. Detect server-to-server (Django auth) callers via `is_service_account`.
           Server-to-server tokens authenticate as Django auth users with no
           relationship to a platform EdxUser. The convention is "we trust this
           caller — bypass RBAC and serve the request."

           Combine it with the RBAC-disabled check at the top of `initial()` so
           the early exit skips all RBAC prep work:

               if not ConfigFlags.rbac_enabled() or self.is_service_account:
                   return

           Use `is_service_account` at any other touch points where caller
           identity matters (queryset ownership filters, owner attribution on
           create, serializer context, etc.).
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
      - in: query
        name: platform_org
        schema:
          type: string
          minLength: 1
      - in: query
        name: search
        schema:
          type: string
          minLength: 1
      - in: query
        name: sort
        schema:
          type: string
          minLength: 1
      - in: query
        name: status
        schema:
          type: string
          minLength: 1
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Per-status counts
  /api/catalog/applications/platform/renew/:
    post:
      operationId: catalog_applications_platform_renew_create
      description: |-
        Start an annual re-enrollment (#2135): a normal draft create whose
        responses are pre-filled from the caller's most recent approved submission
        (current-schema fields only; signatures, consents, files, and fields the
        form flags fresh are re-asked), linked to that prior submission. With no
        prior approved submission this behaves as a plain create.
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformApplicationCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformApplicationCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformApplicationCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformApplicationCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformApplicationDetail'
          description: ''
  /api/catalog/applications/platform/status/:
    get:
      operationId: catalog_applications_platform_status_retrieve
      description: |-
        Authenticated applicants, including learners on AXD student tokens.

        Prepends StudentTokenAuthentication like core UserPlatformSelfLinkView (it is
        not in the DRF defaults, but learners self-applying use it). An anonymous
        request returns 401, not 403: DRF's ``permission_denied`` raises
        ``NotAuthenticated`` whenever no authenticator succeeded.
      parameters:
      - in: query
        name: form_id
        schema:
          type: integer
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
      - in: query
        name: platform_org
        schema:
          type: string
          minLength: 1
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Gate state
  /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: 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: 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: 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: platform_key
        schema:
          type: string
          minLength: 1
        description: Filter by platform key
      - 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: platform_key
        schema:
          type: string
          minLength: 1
        description: Filter by platform key
      - 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: platform_key
        schema:
          type: string
          minLength: 1
        description: Filter by platform key
      - 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: ''
        '404':
          description: Block not found
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
    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: ''
        '404':
          description: User not found
        '401':
          description: Unauthorized
        '403':
          description: Permission denied
  /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/placements/assessments/:
    get:
      operationId: catalog_placements_assessments_retrieve
      description: 'A platform''s placement assessments (#2280): list and create.'
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Assessments for the platform
    post:
      operationId: catalog_placements_assessments_create
      description: 'A platform''s placement assessments (#2280): list and create.'
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlacementAssessment'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlacementAssessment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlacementAssessment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlacementAssessment'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlacementAssessment'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          description: Assessment created
  /api/catalog/placements/assessments/{assessment_id}/:
    get:
      operationId: catalog_placements_assessments_retrieve_2
      description: 'A single placement assessment: view, edit, or delete.'
      parameters:
      - in: path
        name: assessment_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Assessment
    patch:
      operationId: catalog_placements_assessments_partial_update
      description: 'A single placement assessment: view, edit, or delete.'
      parameters:
      - in: path
        name: assessment_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPlacementAssessmentUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedPlacementAssessmentUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPlacementAssessmentUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPlacementAssessmentUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedPlacementAssessmentUpdate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Assessment updated
    delete:
      operationId: catalog_placements_assessments_destroy
      description: 'A single placement assessment: view, edit, or delete.'
      parameters:
      - in: path
        name: assessment_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Assessment deleted
  /api/catalog/placements/course-assignments/:
    get:
      operationId: catalog_placements_course_assignments_retrieve
      description: |-
        Course assignments on a platform (#2280): list (optionally by user), and
        grant a course to a user. Each grant issues a ``CourseInvitation`` the
        existing pipeline enrolls.
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        required: true
      - in: query
        name: user_id
        schema:
          type: integer
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Course assignments
    post:
      operationId: catalog_placements_course_assignments_create
      description: |-
        Course assignments on a platform (#2280): list (optionally by user), and
        grant a course to a user. Each grant issues a ``CourseInvitation`` the
        existing pipeline enrolls.
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        required: true
      - in: query
        name: user_id
        schema:
          type: integer
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlacementCourseAssignmentCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlacementCourseAssignmentCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlacementCourseAssignmentCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlacementCourseAssignmentCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlacementCourseAssignmentCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          description: Course assigned
  /api/catalog/placements/course-assignments/{assignment_id}/:
    delete:
      operationId: catalog_placements_course_assignments_destroy
      description: |-
        Remove one course assignment: deactivate the record and cancel its
        invitation when the student has not yet enrolled through it.
      parameters:
      - in: path
        name: assignment_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Assignment removed
  /api/catalog/placements/program-assignments/:
    get:
      operationId: catalog_placements_program_assignments_retrieve
      description: |-
        Program assignments on a platform (#2280): list (optionally by user), and
        grant a program to a user. Each grant issues a ``ProgramInvitation``.
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        required: true
      - in: query
        name: user_id
        schema:
          type: integer
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Program assignments
    post:
      operationId: catalog_placements_program_assignments_create
      description: |-
        Program assignments on a platform (#2280): list (optionally by user), and
        grant a program to a user. Each grant issues a ``ProgramInvitation``.
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        required: true
      - in: query
        name: user_id
        schema:
          type: integer
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlacementProgramAssignmentCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlacementProgramAssignmentCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlacementProgramAssignmentCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlacementProgramAssignmentCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlacementProgramAssignmentCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          description: Program assigned
  /api/catalog/placements/program-assignments/{assignment_id}/:
    delete:
      operationId: catalog_placements_program_assignments_destroy
      description: |-
        Remove one program assignment: deactivate the record and cancel its
        invitation when the student has not yet enrolled through it.
      parameters:
      - in: path
        name: assignment_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Assignment removed
  /api/catalog/placements/records/:
    get:
      operationId: catalog_placements_records_retrieve
      description: |-
        Placement records on a platform (#2280): list (filter by user, assessment,
        or status), and assign a configured assessment to a user.
      parameters:
      - in: query
        name: assessment_id
        schema:
          type: integer
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        required: true
      - in: query
        name: status
        schema:
          enum:
          - not_assigned
          - assigned
          - started
          - completed
          - reviewed
          - confirmed
          type: string
          minLength: 1
        description: |-
          * `not_assigned` - not_assigned
          * `assigned` - assigned
          * `started` - started
          * `completed` - completed
          * `reviewed` - reviewed
          * `confirmed` - confirmed
      - in: query
        name: user_id
        schema:
          type: integer
      tags:
      - catalog
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Placement records
    post:
      operationId: catalog_placements_records_create
      description: |-
        Placement records on a platform (#2280): list (filter by user, assessment,
        or status), and assign a configured assessment to a user.
      parameters:
      - in: query
        name: assessment_id
        schema:
          type: integer
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        required: true
      - in: query
        name: status
        schema:
          enum:
          - not_assigned
          - assigned
          - started
          - completed
          - reviewed
          - confirmed
          type: string
          minLength: 1
        description: |-
          * `not_assigned` - not_assigned
          * `assigned` - assigned
          * `started` - started
          * `completed` - completed
          * `reviewed` - reviewed
          * `confirmed` - confirmed
      - in: query
        name: user_id
        schema:
          type: integer
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlacementRecordCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlacementRecordCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlacementRecordCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlacementRecordCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlacementRecordCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          description: Placement assigned
  /api/catalog/placements/records/{record_id}/:
    patch:
      operationId: catalog_placements_records_partial_update
      description: |-
        Advance a single placement record: status, the agent's result, an admin
        override, or a note.
      parameters:
      - in: path
        name: record_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - catalog
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationPlacementUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationPlacementUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationPlacementUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationPlacementUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedPlatformApplicationPlacementUpdate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: Record updated
  /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/resources/search/:
    get:
      operationId: catalog_resources_search_retrieve
      description: Paginated list of resources matching query parameters. Accepts
        the same filter parameters as /api/catalog/resources/ and returns the standard
        paginated envelope (count / next_page / previous_page / results). Default
        page size is 50; clients can override via ?page_size= and paginate via ?page=.
        Prefer this endpoint over /api/catalog/resources/ when result counts may be
        large (e.g. listing Heygen avatars).
      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: page
        schema:
          type: integer
        description: Page number (1-indexed)
      - in: query
        name: page_size
        schema:
          type: integer
        description: Items per page (default 50)
      - 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: query
        schema:
          type: string
          minLength: 1
        description: Substring match on resource name (icontains)
      - 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/PaginatedResource'
          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/provision/:
    post:
      operationId: core_consolidated_token_provision_create
      description: |-
        Resolve-or-provision a user, then mint DM + AXD tokens.

        Params:
        - username: str (required)
        - email: str (required)
        - name: str (optional)
        - platform_key: str (required)
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenProvisionInput'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/TokenProvisionInput'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TokenProvisionInput'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TokenProvisionInput'
          '*/*':
            schema:
              $ref: '#/components/schemas/TokenProvisionInput'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenProxyOutput'
          description: ''
  /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-agents/:
    get:
      operationId: core_lti_1p3_provider_lti_agents_list
      description: List your LTI Mentor's
      parameters:
      - in: query
        name: mentor_id
        schema:
          type: string
          minLength: 1
        description: The mentor's unique_id to filter for
      - 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_agents_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-agents/{id}/:
    get:
      operationId: core_lti_1p3_provider_lti_agents_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_agents_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_agents_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-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: |-
        **Deprecated — use `/api/core/lti/1p3/provider/lti-agents/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/core/lti/1p3/provider/lti-agents/` (`mentor` → `agent`) and will be removed in a future release.

        List your LTI Mentor's
      parameters:
      - in: query
        name: mentor_id
        schema:
          type: string
          minLength: 1
        description: The mentor's unique_id to filter for
      - 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: ''
      deprecated: true
    post:
      operationId: core_lti_1p3_provider_lti_mentors_create
      description: |-
        **Deprecated — use `/api/core/lti/1p3/provider/lti-agents/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/core/lti/1p3/provider/lti-agents/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
  /api/core/lti/1p3/provider/lti-mentors/{id}/:
    get:
      operationId: core_lti_1p3_provider_lti_mentors_retrieve
      description: |-
        **Deprecated — use `/api/core/lti/1p3/provider/lti-agents/{id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/core/lti/1p3/provider/lti-agents/{id}/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
    put:
      operationId: core_lti_1p3_provider_lti_mentors_update
      description: |-
        **Deprecated — use `/api/core/lti/1p3/provider/lti-agents/{id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/core/lti/1p3/provider/lti-agents/{id}/` (`mentor` → `agent`) and will be removed in a future release.

        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: ''
      deprecated: true
    delete:
      operationId: core_lti_1p3_provider_lti_mentors_destroy
      description: |-
        **Deprecated — use `/api/core/lti/1p3/provider/lti-agents/{id}/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/core/lti/1p3/provider/lti-agents/{id}/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /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: query
        name: mentor_unique_id
        schema:
          type: string
        description: Optional mentor unique ID for RBAC ownership check
      - 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:
      - 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: Platform key of target platform
        required: true
      tags:
      - core
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPlatformApiKeyList'
          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}:
    get:
      operationId: core_platform_api_tokens_retrieve
      description: Retrieve a single Platform Api Key by name, including the policies
        and groups currently associated with it
      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:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformApiKey'
          description: ''
    patch:
      operationId: core_platform_api_tokens_partial_update
      description: Update a Platform Api Key's mode and associated policies/groups
        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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApiKey'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApiKey'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApiKey'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPlatformApiKey'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedPlatformApiKey'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformApiKey'
          description: ''
    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/api-tokens/field-permissions/:
    get:
      operationId: core_platform_api_tokens_field_permissions_retrieve
      description: 'Per-field write permissions for the create form, as {field: {"write":
        bool}}. Gated on create access like the create endpoint.'
      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:
                $ref: '#/components/schemas/PlatformApiTokenFieldPermissions'
          description: ''
  /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}/{username}/demographics/:
    get:
      operationId: core_platforms_demographics_retrieve
      description: Retrieve demographics for a user. Self-access or platform admin
        required.
      parameters:
      - in: path
        name: platform_key
        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/UserDemographicsResponse'
          description: ''
    put:
      operationId: core_platforms_demographics_update
      description: Create or update demographics for a user. Self-access or platform
        admin required.
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserDemographicsWrite'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserDemographicsWrite'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserDemographicsWrite'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserDemographicsWrite'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserDemographicsWrite'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDemographicsResponse'
          description: ''
    delete:
      operationId: core_platforms_demographics_destroy
      description: Delete demographics for a user. Self-access or platform admin required.
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/core/platforms/{platform_key}/audit-logs/:
    get:
      operationId: core_platforms_audit_logs_list
      description: Retrieve audit log entries scoped to a platform. Includes both
        model changes (RBAC roles/policies/groups, user-platform links, global configuration)
        and manual events (login, export, download). Supports filtering by event type,
        action, actor, and date range.
      summary: List platform audit logs
      parameters:
      - in: query
        name: action
        schema:
          type: integer
          enum:
          - 0
          - 1
          - 2
          - 3
        description: 'Filter by action: 0=create, 1=update, 2=delete, 3=access.'
      - in: query
        name: actor_email
        schema:
          type: string
        description: Filter by actor's email.
      - in: query
        name: actor_username
        schema:
          type: string
        description: Filter by actor's username.
      - in: query
        name: event_type
        schema:
          type: string
        description: Filter by manual event type (e.g. login, export).
      - in: query
        name: from_date
        schema:
          type: string
        description: Inclusive lower bound on timestamp (ISO8601 date).
      - 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
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: to_date
        schema:
          type: string
        description: Inclusive upper bound on timestamp (ISO8601 date).
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAuditLogEntryList'
          description: ''
        '401':
          description: Authentication required
        '403':
          description: Not permitted to read these audit logs
  /api/core/platforms/{platform_key}/demographics/fields/:
    get:
      operationId: core_platforms_demographics_fields_list
      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/DemographicsFieldDefinition'
          description: ''
    post:
      operationId: core_platforms_demographics_fields_create
      description: Create a custom demographics field definition for the platform.
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DemographicsFieldDefinitionWrite'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/DemographicsFieldDefinitionWrite'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DemographicsFieldDefinitionWrite'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DemographicsFieldDefinitionWrite'
          '*/*':
            schema:
              $ref: '#/components/schemas/DemographicsFieldDefinitionWrite'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemographicsFieldDefinition'
          description: ''
  /api/core/platforms/{platform_key}/demographics/fields/{slug}/:
    get:
      operationId: core_platforms_demographics_fields_retrieve
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: slug
        schema:
          type: string
          description: URL-safe identifier used as the key in custom_fields payloads.
        required: true
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemographicsFieldDefinition'
          description: ''
    put:
      operationId: core_platforms_demographics_fields_update
      description: Update a custom demographics field definition.
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: slug
        schema:
          type: string
          description: URL-safe identifier used as the key in custom_fields payloads.
        required: true
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DemographicsFieldDefinitionWrite'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/DemographicsFieldDefinitionWrite'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DemographicsFieldDefinitionWrite'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DemographicsFieldDefinitionWrite'
          '*/*':
            schema:
              $ref: '#/components/schemas/DemographicsFieldDefinitionWrite'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemographicsFieldDefinition'
          description: ''
    patch:
      operationId: core_platforms_demographics_fields_partial_update
      description: Partially update a custom demographics field definition.
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: slug
        schema:
          type: string
          description: URL-safe identifier used as the key in custom_fields payloads.
        required: true
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedDemographicsFieldDefinitionWrite'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedDemographicsFieldDefinitionWrite'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedDemographicsFieldDefinitionWrite'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedDemographicsFieldDefinitionWrite'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedDemographicsFieldDefinitionWrite'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemographicsFieldDefinition'
          description: ''
    delete:
      operationId: core_platforms_demographics_fields_destroy
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: slug
        schema:
          type: string
          description: URL-safe identifier used as the key in custom_fields payloads.
        required: true
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/core/platforms/{platform_key}/demographics/fields/export/:
    get:
      operationId: core_platforms_demographics_fields_export_list
      description: Export all field definitions for the platform as JSON or CSV.
      parameters:
      - in: query
        name: export_format
        schema:
          type: string
          enum:
          - csv
          - json
          default: json
        description: 'Export format: json or csv'
      - 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/DemographicsFieldDefinition'
          description: ''
  /api/core/platforms/{platform_key}/demographics/fields/import/:
    post:
      operationId: core_platforms_demographics_fields_import_create
      description: Import field definitions from JSON or CSV file. Returns 207 on
        partial success.
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FieldDefinitionImport'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FieldDefinitionImport'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/FieldDefinitionImport'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          description: No response body
  /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/actions/definitions/:
    get:
      operationId: core_rbac_actions_definitions_retrieve
      description: Returns a flat dictionary of all available RBAC actions with descriptions
        and assignable resource paths. Assignable resources are returned relative
        to the requestors platform.
      summary: Get RBAC action definitions
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
              examples:
                Example:
                  value:
                    Ibl.Core/Groups/read:
                      description: View group details
                      assignable_resources:
                      - /groups/{}
                    Ibl.Core/Groups/write:
                      description: Modify group information
                      assignable_resources:
                      - /groups/{}
          description: Action definitions
  /api/core/rbac/actions/tree/:
    get:
      operationId: core_rbac_actions_tree_retrieve
      description: Returns a hierarchical tree of all available RBAC actions
      summary: Get RBAC action tree
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
              examples:
                Example:
                  value:
                    Ibl:
                      Core:
                        Groups:
                          read: Read group information
                          write: Modify group information
          description: Action tree
  /api/core/rbac/agent-access/:
    get:
      operationId: core_rbac_agent_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_agent_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/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: |-
        **Deprecated — use `/api/core/rbac/agent-access/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/core/rbac/agent-access/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
    post:
      operationId: core_rbac_mentor_access_create
      description: |-
        **Deprecated — use `/api/core/rbac/agent-access/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/core/rbac/agent-access/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /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.
        Resource paths are relative to your platform (e.g., '/mentors/' or '/usergroups/5/');
        the '/platforms/{pk}/' prefix is added server-side. Service-account callers
        must include `platform_key` in the body; non-SA callers' platform comes from
        the auth token.
      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: string
        required: true
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      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. Service-account callers must include
        `platform_key` in the body; non-SA callers' platform comes from the auth token.
      summary: Update RBAC policy
      parameters:
      - in: path
        name: id
        schema:
          type: string
        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. Service-account callers must include `platform_key` in the
        body; non-SA callers' platform comes from the auth token.
      summary: Partially update RBAC policy
      parameters:
      - in: path
        name: id
        schema:
          type: string
        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: string
        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/resources/:
    get:
      operationId: core_rbac_resources_retrieve
      description: |-
        GET the resource tree node at `path`.

        Platform comes from the request token (service accounts pass platform_key).
      summary: Discover resources for policy building
      parameters:
      - in: query
        name: path
        schema:
          type: string
          default: /
          minLength: 1
        description: Discovery path, e.g. '/', '/mentors/', '/mentors/5/'.
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: An entity node (child collections) or a collection node (list_url
            + search_qps + result_fields).
        '400':
          description: Invalid path or unknown platform
        '403':
          description: Missing resource-discovery access
  /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: include_global_roles
        schema:
          type: boolean
          default: false
        description: Include global roles
      - 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: string
        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: string
        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: string
        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: string
        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-agent-creation/set/:
    post:
      operationId: core_rbac_student_agent_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-agent-creation/status/:
    get:
      operationId: core_rbac_student_agent_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/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: |-
        **Deprecated — use `/api/core/rbac/student-agent-creation/set/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/core/rbac/student-agent-creation/set/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/core/rbac/student-mentor-creation/status/:
    get:
      operationId: core_rbac_student_mentor_creation_status_retrieve
      description: |-
        **Deprecated — use `/api/core/rbac/student-agent-creation/status/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/core/rbac/student-agent-creation/status/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/core/rbac/teams/access/:
    get:
      operationId: core_rbac_teams_access_list
      description: Retrieve current access information for a specific usergroup, including
        all groups and users that have access with their respective roles.
      summary: Get usergroup access status
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
        description: Platform key where the usergroup belongs
        required: true
      - in: query
        name: usergroup_id
        schema:
          type: integer
        description: ID of the usergroup to get access information for
        required: true
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserGroupPolicy'
          description: ''
        '400':
          description: Missing or invalid query parameters
        '403':
          description: Permission denied - ShareUserGroups permission required
        '404':
          description: Platform not found
        '500':
          description: Internal server error
    post:
      operationId: core_rbac_teams_access_create
      description: Create or update RBAC policies to manage group and user access
        to specific UserGroups (teams). Creates role-specific policies and handles
        adding/removing groups and users. Automatically adds users/groups to appropriate
        secondary policies as needed.
      summary: Control which RbacGroups and/or Users have access to a UserGroup (team)
        and with what Role
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserGroupPolicy'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserGroupPolicy'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserGroupPolicy'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserGroupPolicy'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserGroupPolicy'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserGroupPolicy'
          description: ''
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserGroupPolicy'
          description: ''
        '400':
          description: Invalid request data or validation errors
        '403':
          description: Permission denied - ShareUserGroups permission required
        '404':
          description: Platform or usergroup 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_list
      description: Retrieve a list of UserGroups. Can be filtered by platform_key,
        name, and include_users.
      summary: List UserGroups
      parameters:
      - in: query
        name: include_users
        schema:
          type: boolean
          default: false
        description: 'Include user information in response (default: false for performance)'
      - in: query
        name: name
        schema:
          type: string
          minLength: 1
        description: Fuzzy search by group name
      - 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: required_action
        schema:
          type: string
          default: Ibl.Core/UserGroups/read
          minLength: 1
        description: Return user groups (teams) you have this action on
      - in: query
        name: with_permissions
        schema:
          type: boolean
          default: false
        description: Include object-level permissions in response
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedUserGroupList'
          description: ''
    post:
      operationId: core_user_groups_create
      description: Create a new UserGroup for a platform. Users can be assigned during
        creation.
      summary: Create UserGroup
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserGroup'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserGroup'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserGroup'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserGroup'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserGroup'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserGroup'
          description: ''
        '400':
          description: |-
            Invalid input data. Common errors include:
            - Users do not belong to the specified platform
            - Invalid user IDs provided
  /api/core/user-groups/{id}/:
    get:
      operationId: core_user_groups_retrieve
      description: Retrieve details of a specific UserGroup including assigned users.
      summary: Retrieve UserGroup
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this User Group.
        required: true
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserGroup'
          description: ''
        '404':
          description: UserGroup not found
    put:
      operationId: core_user_groups_update
      description: Update an existing UserGroup. Platform validation applies for user
        assignments.
      summary: Update UserGroup
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this User Group.
        required: true
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserGroup'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserGroup'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserGroup'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserGroup'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserGroup'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserGroup'
          description: ''
        '400':
          description: |-
            Invalid input data. Common errors include:
            - Users do not belong to the specified platform
            - Invalid user IDs provided
        '404':
          description: UserGroup not found
    patch:
      operationId: core_user_groups_partial_update
      description: Partially update an existing UserGroup. Platform validation applies
        for user assignments.
      summary: Partially update UserGroup
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this User Group.
        required: true
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedUserGroup'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedUserGroup'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedUserGroup'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedUserGroup'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedUserGroup'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserGroup'
          description: ''
        '400':
          description: |-
            Invalid input data. Common errors include:
            - Users do not belong to the specified platform
            - Invalid user IDs provided
        '404':
          description: UserGroup not found
    delete:
      operationId: core_user_groups_destroy
      description: Delete a UserGroup and all associated user group links.
      summary: Delete UserGroup
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this User Group.
        required: true
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: UserGroup deleted successfully
        '404':
          description: UserGroup not found
  /api/core/user_groups/:
    get:
      operationId: core_user_groups_retrieve_2
      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_2
      description: Create/update a user group
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    delete:
      operationId: core_user_groups_destroy_2
      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/accessible/:
    get:
      operationId: core_users_accessible_list
      description: Users on the caller's platform that they hold `required_action`
        on. A grant covering the whole users collection also requires `Ibl.Core/AccessibleUsers/list`.
      summary: List users you can act on
      parameters:
      - in: query
        name: email
        schema:
          type: string
          minLength: 1
      - in: query
        name: name
        schema:
          type: string
          minLength: 1
      - 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: required_action
        schema:
          type: string
          default: Ibl.Core/Users/read
          minLength: 1
        description: RBAC action the caller must hold on a user to see them, e.g.
          'Ibl.Mentor/Memory/read'.
      - in: query
        name: sort
        schema:
          enum:
          - email
          - name
          - username
          - -email
          - -name
          - -username
          type: string
          default: name
          minLength: 1
        description: |-
          * `email` - email
          * `name` - name
          * `username` - username
          * `-email` - -email
          * `-name` - -name
          * `-username` - -username
      - in: query
        name: username
        schema:
          type: string
          minLength: 1
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAccessibleUserList'
          description: ''
        '400':
          description: Invalid query parameters
        '403':
          description: Permission denied — including a collection-wide grant without
            `Ibl.Core/AccessibleUsers/list`
  /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/platform-metadata/:
    get:
      operationId: core_users_platform_metadata_retrieve
      description: Retrieve user platform metadata.
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
        description: Platform identifier
        required: true
      - in: query
        name: username
        schema:
          type: string
        description: Target user (admin only, defaults to self)
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserPlatformMetadata'
          description: ''
    put:
      operationId: core_users_platform_metadata_update
      description: Replace all user platform metadata.
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
        description: Platform identifier
        required: true
      - in: query
        name: username
        schema:
          type: string
        description: Target user (admin only, defaults to self)
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserPlatformMetadataReplace'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserPlatformMetadataReplace'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserPlatformMetadataReplace'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserPlatformMetadataReplace'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserPlatformMetadataReplace'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserPlatformMetadata'
          description: ''
    patch:
      operationId: core_users_platform_metadata_partial_update
      description: Partial update of user platform metadata (merge keys, delete keys).
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
        description: Platform identifier
        required: true
      - in: query
        name: username
        schema:
          type: string
        description: Target user (admin only, defaults to self)
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedUserPlatformMetadataUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedUserPlatformMetadataUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedUserPlatformMetadataUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedUserPlatformMetadataUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedUserPlatformMetadataUpdate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserPlatformMetadata'
          description: ''
    delete:
      operationId: core_users_platform_metadata_destroy
      description: Clear all user platform metadata.
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
        description: Platform identifier
        required: true
      - in: query
        name: username
        schema:
          type: string
        description: Target user (admin only, defaults to self)
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          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/config/public/:
    get:
      operationId: core_users_platforms_config_public_retrieve
      description: |-
        Anonymous read of public per-platform membership config.

        Query params:
            platform_key: The key of the platform to look up.
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        required: true
      tags:
      - core
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformMembershipConfigPublicResponse'
          description: ''
  /api/core/users/platforms/default/:
    get:
      operationId: core_users_platforms_default_retrieve
      description: Return the authenticated user's default platform (or nulls).
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDefaultPlatformGetResponse'
          description: ''
    post:
      operationId: core_users_platforms_default_create
      description: |-
        Set (upsert) the authenticated user's default platform.

        A user may only set *their own* default, and only to a platform they
        are actively linked to.

        Params:
        platform_key: The key of the platform to make the default
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserDefaultPlatformPostRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/UserDefaultPlatformPostRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserDefaultPlatformPostRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserDefaultPlatformPostRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/UserDefaultPlatformPostRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDefaultPlatformPostResponse'
          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/core/watched-groups/:
    get:
      operationId: core_watched_groups_list
      description: |-
        CRUD for WatchedGroup. Watcher mutations live on the nested /watchers/ endpoint;
        POST here accepts an optional `watchers` array as a create-time convenience.
      summary: List watched groups visible to the caller
      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
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedWatchedGroupListList'
          description: ''
        '403':
          description: Permission denied
        '404':
          description: Platform not found
    post:
      operationId: core_watched_groups_create
      description: |-
        CRUD for WatchedGroup. Watcher mutations live on the nested /watchers/ endpoint;
        POST here accepts an optional `watchers` array as a create-time convenience.
      summary: Create a watched group
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      - in: query
        name: watched_user_limit
        schema:
          type: integer
          maximum: 100
          minimum: 0
          default: 0
        description: Inline up to N watched users in the response (0 = none, max 100).
          Use the nested /watched-users/ endpoint for paginated walks.
      - in: query
        name: watcher_limit
        schema:
          type: integer
          maximum: 100
          minimum: 0
          default: 0
        description: Inline up to N watchers in the response (0 = none, max 100).
          Use the nested /watchers/ endpoint for paginated walks.
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WatchedGroupCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/WatchedGroupCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/WatchedGroupCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WatchedGroupCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/WatchedGroupCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatchedGroupDetail'
          description: ''
        '400':
          description: Invalid request
        '403':
          description: Permission denied
  /api/core/watched-groups/{id}/:
    get:
      operationId: core_watched_groups_retrieve
      description: |-
        CRUD for WatchedGroup. Watcher mutations live on the nested /watchers/ endpoint;
        POST here accepts an optional `watchers` array as a create-time convenience.
      summary: Retrieve a watched group
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Watched Group.
        required: true
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      - in: query
        name: watched_user_limit
        schema:
          type: integer
          maximum: 100
          minimum: 0
          default: 0
        description: Inline up to N watched users in the response (0 = none, max 100).
          Use the nested /watched-users/ endpoint for paginated walks.
      - in: query
        name: watcher_limit
        schema:
          type: integer
          maximum: 100
          minimum: 0
          default: 0
        description: Inline up to N watchers in the response (0 = none, max 100).
          Use the nested /watchers/ endpoint for paginated walks.
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatchedGroupDetail'
          description: ''
        '403':
          description: Permission denied
        '404':
          description: Not found
    put:
      operationId: core_watched_groups_update
      description: |-
        CRUD for WatchedGroup. Watcher mutations live on the nested /watchers/ endpoint;
        POST here accepts an optional `watchers` array as a create-time convenience.
      summary: Update a watched group's name
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Watched Group.
        required: true
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      - in: query
        name: watched_user_limit
        schema:
          type: integer
          maximum: 100
          minimum: 0
          default: 0
        description: Inline up to N watched users in the response (0 = none, max 100).
          Use the nested /watched-users/ endpoint for paginated walks.
      - in: query
        name: watcher_limit
        schema:
          type: integer
          maximum: 100
          minimum: 0
          default: 0
        description: Inline up to N watchers in the response (0 = none, max 100).
          Use the nested /watchers/ endpoint for paginated walks.
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WatchedGroupUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/WatchedGroupUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/WatchedGroupUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WatchedGroupUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/WatchedGroupUpdate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatchedGroupDetail'
          description: ''
        '400':
          description: Invalid request
        '403':
          description: Permission denied
        '404':
          description: Not found
    patch:
      operationId: core_watched_groups_partial_update
      description: |-
        CRUD for WatchedGroup. Watcher mutations live on the nested /watchers/ endpoint;
        POST here accepts an optional `watchers` array as a create-time convenience.
      summary: Partially update a watched group's name
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Watched Group.
        required: true
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      - in: query
        name: watched_user_limit
        schema:
          type: integer
          maximum: 100
          minimum: 0
          default: 0
        description: Inline up to N watched users in the response (0 = none, max 100).
          Use the nested /watched-users/ endpoint for paginated walks.
      - in: query
        name: watcher_limit
        schema:
          type: integer
          maximum: 100
          minimum: 0
          default: 0
        description: Inline up to N watchers in the response (0 = none, max 100).
          Use the nested /watchers/ endpoint for paginated walks.
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedWatchedGroupUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedWatchedGroupUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedWatchedGroupUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedWatchedGroupUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedWatchedGroupUpdate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatchedGroupDetail'
          description: ''
        '400':
          description: Invalid request
        '403':
          description: Permission denied
        '404':
          description: Not found
    delete:
      operationId: core_watched_groups_destroy
      description: |-
        CRUD for WatchedGroup. Watcher mutations live on the nested /watchers/ endpoint;
        POST here accepts an optional `watchers` array as a create-time convenience.
      summary: Delete a watched group
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this Watched Group.
        required: true
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Deleted
        '403':
          description: Permission denied
        '404':
          description: Not found
  /api/core/watched-groups/{watched_group_pk}/watched-users/:
    get:
      operationId: core_watched_groups_watched_users_list
      description: |-
        CRUD-minus-update for watched users (UserGroupLink rows) under a WatchedGroup.

        Resource path: /platforms/{pk}/watchedgroups/{wg_id}/watchedusers/{link_id}/
        No PATCH/PUT — there's nothing meaningful to update on a UserGroupLink for
        this feature. Add via POST, remove via DELETE.
      summary: List watched users in a watched group (paginated)
      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
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      - in: path
        name: watched_group_pk
        schema:
          type: integer
        required: true
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedWatchedUserReadList'
          description: ''
        '403':
          description: Permission denied
        '404':
          description: WatchedGroup not found
    post:
      operationId: core_watched_groups_watched_users_create
      description: |-
        CRUD-minus-update for watched users (UserGroupLink rows) under a WatchedGroup.

        Resource path: /platforms/{pk}/watchedgroups/{wg_id}/watchedusers/{link_id}/
        No PATCH/PUT — there's nothing meaningful to update on a UserGroupLink for
        this feature. Add via POST, remove via DELETE.
      summary: Add a user to the watched group
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      - in: path
        name: watched_group_pk
        schema:
          type: integer
        required: true
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WatchedUserWrite'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/WatchedUserWrite'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/WatchedUserWrite'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WatchedUserWrite'
          '*/*':
            schema:
              $ref: '#/components/schemas/WatchedUserWrite'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatchedUserRead'
          description: ''
        '400':
          description: Invalid payload
        '403':
          description: Permission denied
        '404':
          description: WatchedGroup not found
  /api/core/watched-groups/{watched_group_pk}/watched-users/{id}/:
    get:
      operationId: core_watched_groups_watched_users_retrieve
      description: |-
        CRUD-minus-update for watched users (UserGroupLink rows) under a WatchedGroup.

        Resource path: /platforms/{pk}/watchedgroups/{wg_id}/watchedusers/{link_id}/
        No PATCH/PUT — there's nothing meaningful to update on a UserGroupLink for
        this feature. Add via POST, remove via DELETE.
      summary: Retrieve a single watched-user link
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      - in: path
        name: watched_group_pk
        schema:
          type: integer
        required: true
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatchedUserRead'
          description: ''
        '403':
          description: Permission denied
        '404':
          description: Not found
    delete:
      operationId: core_watched_groups_watched_users_destroy
      description: |-
        CRUD-minus-update for watched users (UserGroupLink rows) under a WatchedGroup.

        Resource path: /platforms/{pk}/watchedgroups/{wg_id}/watchedusers/{link_id}/
        No PATCH/PUT — there's nothing meaningful to update on a UserGroupLink for
        this feature. Add via POST, remove via DELETE.
      summary: Remove a user from the watched group
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      - in: path
        name: watched_group_pk
        schema:
          type: integer
        required: true
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Removed
        '403':
          description: Permission denied
        '404':
          description: Not found
  /api/core/watched-groups/{watched_group_pk}/watchers/:
    get:
      operationId: core_watched_groups_watchers_list
      description: |-
        CRUD for watchers nested under a WatchedGroup.

        Resource path: /platforms/{pk}/watchedgroups/{wg_id}/watchers/{watcher_id}/
        `is_owner` here covers two cases that both deserve owner-level perms on a
        watcher row:
          - the watcher themselves (WATCHER_OWNER well-known role)
          - the parent WatchedGroup's owner (WATCHED_GROUP_OWNER role grants
            `Ibl.Core/Watchers/*`)
      summary: List watchers of a watched group (paginated)
      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
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      - in: path
        name: watched_group_pk
        schema:
          type: integer
        required: true
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedWatcherReadList'
          description: ''
        '403':
          description: Permission denied
        '404':
          description: WatchedGroup not found
    post:
      operationId: core_watched_groups_watchers_create
      description: |-
        CRUD for watchers nested under a WatchedGroup.

        Resource path: /platforms/{pk}/watchedgroups/{wg_id}/watchers/{watcher_id}/
        `is_owner` here covers two cases that both deserve owner-level perms on a
        watcher row:
          - the watcher themselves (WATCHER_OWNER well-known role)
          - the parent WatchedGroup's owner (WATCHED_GROUP_OWNER role grants
            `Ibl.Core/Watchers/*`)
      summary: Add a watcher to a watched group
      parameters:
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      - in: path
        name: watched_group_pk
        schema:
          type: integer
        required: true
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WatcherWrite'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/WatcherWrite'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/WatcherWrite'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WatcherWrite'
          '*/*':
            schema:
              $ref: '#/components/schemas/WatcherWrite'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatcherRead'
          description: ''
        '400':
          description: Invalid payload
        '403':
          description: Permission denied
        '404':
          description: WatchedGroup not found
  /api/core/watched-groups/{watched_group_pk}/watchers/{id}/:
    get:
      operationId: core_watched_groups_watchers_retrieve
      description: |-
        CRUD for watchers nested under a WatchedGroup.

        Resource path: /platforms/{pk}/watchedgroups/{wg_id}/watchers/{watcher_id}/
        `is_owner` here covers two cases that both deserve owner-level perms on a
        watcher row:
          - the watcher themselves (WATCHER_OWNER well-known role)
          - the parent WatchedGroup's owner (WATCHED_GROUP_OWNER role grants
            `Ibl.Core/Watchers/*`)
      summary: Retrieve a single watcher
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      - in: path
        name: watched_group_pk
        schema:
          type: integer
        required: true
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatcherRead'
          description: ''
        '403':
          description: Permission denied
        '404':
          description: Not found
    put:
      operationId: core_watched_groups_watchers_update
      description: |-
        CRUD for watchers nested under a WatchedGroup.

        Resource path: /platforms/{pk}/watchedgroups/{wg_id}/watchers/{watcher_id}/
        `is_owner` here covers two cases that both deserve owner-level perms on a
        watcher row:
          - the watcher themselves (WATCHER_OWNER well-known role)
          - the parent WatchedGroup's owner (WATCHED_GROUP_OWNER role grants
            `Ibl.Core/Watchers/*`)
      summary: Replace a watcher's events
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      - in: path
        name: watched_group_pk
        schema:
          type: integer
        required: true
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WatcherUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/WatcherUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/WatcherUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WatcherUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/WatcherUpdate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatcherRead'
          description: ''
        '400':
          description: Invalid payload
        '403':
          description: Permission denied
        '404':
          description: Not found
    patch:
      operationId: core_watched_groups_watchers_partial_update
      description: |-
        CRUD for watchers nested under a WatchedGroup.

        Resource path: /platforms/{pk}/watchedgroups/{wg_id}/watchers/{watcher_id}/
        `is_owner` here covers two cases that both deserve owner-level perms on a
        watcher row:
          - the watcher themselves (WATCHER_OWNER well-known role)
          - the parent WatchedGroup's owner (WATCHED_GROUP_OWNER role grants
            `Ibl.Core/Watchers/*`)
      summary: Update a watcher's events
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      - in: path
        name: watched_group_pk
        schema:
          type: integer
        required: true
      tags:
      - core
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedWatcherUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedWatcherUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedWatcherUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedWatcherUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedWatcherUpdate'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatcherRead'
          description: ''
        '400':
          description: Invalid payload
        '403':
          description: Permission denied
        '404':
          description: Not found
    delete:
      operationId: core_watched_groups_watchers_destroy
      description: |-
        CRUD for watchers nested under a WatchedGroup.

        Resource path: /platforms/{pk}/watchedgroups/{wg_id}/watchers/{watcher_id}/
        `is_owner` here covers two cases that both deserve owner-level perms on a
        watcher row:
          - the watcher themselves (WATCHER_OWNER well-known role)
          - the parent WatchedGroup's owner (WATCHED_GROUP_OWNER role grants
            `Ibl.Core/Watchers/*`)
      summary: Remove (or unsubscribe) a watcher from a watched group
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      - in: path
        name: watched_group_pk
        schema:
          type: integer
        required: true
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Removed
        '403':
          description: Permission denied
        '404':
          description: Not found
  /api/core/watched-groups/watcher-event-choices/:
    get:
      operationId: core_watched_groups_watcher_event_choices_retrieve
      description: |-
        Return the WatcherEvent choices as `{value: human_readable_label}`.

        Platform-scoped lookup with no per-watched-group context. Gated by
        `Ibl.Core/WatchedGroups/list` on `/platforms/{pk}/watchedgroups/` — the
        same per-platform grant `add_watcher` attaches to every watcher, so any
        watcher (in addition to admins) can fetch the enum.
      summary: 'List WatcherEvent choices as {value: label}'
      parameters:
      - in: query
        name: name
        schema:
          type: string
          minLength: 1
        description: Case-insensitive substring filter against the human-readable
          label. Omit to return all choices.
      - in: query
        name: platform_key
        schema:
          type: string
          minLength: 1
        description: 'Service-account only: target platform key. Non-SA callers''
          platform is sourced from the auth token and this is ignored.'
      tags:
      - core
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
                example:
                  USER_NOTIF_COURSE_ENROLLMENT: Course Enrollment
                  USER_NOTIF_COURSE_COMPLETION: Course Completion
              examples:
                WatcherEventChoices:
                  value:
                    USER_NOTIF_COURSE_ENROLLMENT: Course Enrollment
                    ADMIN_NOTIF_COURSE_ENROLLMENT: 'Admin: Course Enrollment'
                    USER_NOTIF_COURSE_COMPLETION: Course Completion
                    USER_NOTIF_USER_INACTIVITY: User Inactivity
                  summary: Example 200 response
          description: Mapping of event value to human-readable label
        '400':
          description: Invalid query parameters
        '403':
          description: Permission denied
        '404':
          description: Platform not found
  /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/{platform_key}/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: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        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: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        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/{platform_key}/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: 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 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: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        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: 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 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: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        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: 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 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: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/credentials/orgs/{platform_key}/users/{user_id}/{entity_id}/assertions/:
    get:
      operationId: credentials_orgs_users_assertions_retrieve_3
      parameters:
      - in: path
        name: entity_id
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAssertionsResponse'
          description: ''
    post:
      operationId: credentials_orgs_users_assertions_create
      parameters:
      - in: path
        name: entity_id
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        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/{platform_key}/users/{user_id}/{entity_id}/assertions/bulk/:
    post:
      operationId: credentials_orgs_users_assertions_bulk_create
      parameters:
      - in: path
        name: entity_id
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        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/{platform_key}/users/{user_id}/assertions/:
    get:
      operationId: credentials_orgs_users_assertions_retrieve
      description: A GET View that validates QueryParams and returns results to a
        serializer
      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: query
        name: page
        schema:
          type: integer
          minimum: 1
      - in: query
        name: page_size
        schema:
          type: integer
          maximum: 1000
          minimum: 1
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAssertionsResponse'
          description: ''
  /api/credentials/orgs/{platform_key}/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: platform_key
        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: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/credentials/orgs/{platform_key}/users/{user_id}/assertions/{entity_id}:
    get:
      operationId: credentials_orgs_users_assertions_retrieve_2
      parameters:
      - in: path
        name: entity_id
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Assertion'
          description: ''
    put:
      operationId: credentials_orgs_users_assertions_update
      parameters:
      - in: path
        name: entity_id
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        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/{platform_key}/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: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/credentials/orgs/{platform_key}/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: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        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: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/credentials/orgs/{platform_key}/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: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        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: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/credentials/orgs/{platform_key}/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: platform_key
        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: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTime'
          description: ''
  /api/credentials/orgs/{platform_key}/users/{user_id}/course-credentials/:
    get:
      operationId: credentials_orgs_users_course_credentials_list
      description: |-
        DRF view mixin that routes all ORM reads to the read replica.

        Falls back to the primary database if the replica is unreachable.

        Add as the **first** base class on read-only views/viewsets::

            class MyView(ReadReplicaViewMixin, IsPlatformAdminDRFMixin, APIView):
                ...
      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
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/credentials/orgs/{platform_key}/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: platform_key
        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: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTime'
          description: ''
  /api/credentials/orgs/{platform_key}/users/{user_id}/external-mapping/:
    get:
      operationId: credentials_orgs_users_external_mapping_retrieve
      description: |-
        Retrieve external credential mappings for the platform.

        Query Parameters:
            credential_id (str, optional): Filter by credential entity_id
            provider_name (str, optional): Filter by provider name
            page (int, optional): Page number
            page_size (int, optional): Items per page

        Returns all mappings for the platform if the user is an admin.
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalCredentialMapping'
          description: ''
    post:
      operationId: credentials_orgs_users_external_mapping_create
      description: |-
        Create or update an external credential mapping.

        If a mapping doesn't exist for the credential + platform + provider combination,
        it will be created. If it exists, it will be updated.

        Request Body:
            {
                "credential_id": "credential-entity-id",  // Required
                "provider_name": "accredible",            // Required
                "external_template_id": "123456",         // Optional
                "metadata": {}                            // Optional
            }

        Returns:
            - 201 Created: When creating a new mapping
            - 200 OK: When updating an existing mapping
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - credentials
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExternalCredentialMapping'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ExternalCredentialMapping'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ExternalCredentialMapping'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ExternalCredentialMapping'
          '*/*':
            schema:
              $ref: '#/components/schemas/ExternalCredentialMapping'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalCredentialMapping'
          description: ''
    delete:
      operationId: credentials_orgs_users_external_mapping_destroy
      description: |-
        Delete an external credential mapping.

        Request Body:
            {
                "credential_id": "credential-entity-id",  // Required
                "provider_name": "accredible"             // Required
            }

        Returns:
            A JSON response confirming deletion
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/credentials/orgs/{platform_key}/users/{user_id}/images/:
    get:
      operationId: credentials_orgs_users_images_retrieve
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadedImage'
          description: ''
    post:
      operationId: credentials_orgs_users_images_create
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        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/{platform_key}/users/{user_id}/issuers/:
    get:
      operationId: credentials_orgs_users_issuers_retrieve
      description: A GET View that validates QueryParams and returns results to a
        serializer
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: q
        schema:
          type: string
          minLength: 1
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        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: A GET View that validates QueryParams and returns results to a
        serializer
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: q
        schema:
          type: string
          minLength: 1
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        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/{platform_key}/users/{user_id}/issuers/{entity_id}:
    get:
      operationId: credentials_orgs_users_issuers_retrieve_2
      parameters:
      - in: path
        name: entity_id
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Issuer'
          description: ''
    put:
      operationId: credentials_orgs_users_issuers_update
      parameters:
      - in: path
        name: entity_id
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        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
      parameters:
      - in: path
        name: entity_id
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/credentials/orgs/{platform_key}/users/{user_id}/issuers/authority/:
    post:
      operationId: credentials_orgs_users_issuers_authority_create
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        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/orgs/{platform_key}/users/{user_id}/provider-config/:
    get:
      operationId: credentials_orgs_users_provider_config_retrieve
      description: |-
        Retrieve provider configurations for the platform.

        Query Parameters:
            provider_name (str, optional): Filter to a specific provider
            page (int, optional): Page number
            page_size (int, optional): Items per page

        Returns all configurations for the platform if the user is an admin.
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialProviderConfig'
          description: ''
    post:
      operationId: credentials_orgs_users_provider_config_create
      description: |-
        Create or update a provider configuration.

        If a configuration doesn't exist for the platform and provider, it will be created.
        If it exists, it will be updated.

        Request Body:
            {
                "provider_name": "accredible",  // Required
                "config": {...},                 // Optional
                "enabled": true                  // Optional
            }

        Returns:
            - 201 Created: When creating a new configuration
            - 200 OK: When updating an existing configuration
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - credentials
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialProviderConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CredentialProviderConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CredentialProviderConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CredentialProviderConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/CredentialProviderConfig'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialProviderConfig'
          description: ''
    delete:
      operationId: credentials_orgs_users_provider_config_destroy
      description: |-
        Deactivate a provider configuration (sets enabled=False).

        Request Body:
            {
                "provider_name": "accredible"  // Required
            }
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/credentials/orgs/{platform_key}/users/{username}/:
    get:
      operationId: credentials_orgs_users_retrieve_3
      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: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        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_2
      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: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        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/{platform_key}/users/{username}/{entity_id}:
    get:
      operationId: credentials_orgs_users_retrieve_4
      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: 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 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: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        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_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: 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 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: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        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_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: 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 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: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/credentials/orgs/{platform_key}/users/{username}/{entity_id}/assertions/:
    get:
      operationId: credentials_orgs_users_assertions_retrieve_6
      parameters:
      - in: path
        name: entity_id
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        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_2
      parameters:
      - in: path
        name: entity_id
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        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/{platform_key}/users/{username}/{entity_id}/assertions/bulk/:
    post:
      operationId: credentials_orgs_users_assertions_bulk_create_2
      parameters:
      - in: path
        name: entity_id
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        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/{platform_key}/users/{username}/assertions/:
    get:
      operationId: credentials_orgs_users_assertions_retrieve_4
      description: A GET View that validates QueryParams and returns results to a
        serializer
      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: query
        name: page
        schema:
          type: integer
          minimum: 1
      - in: query
        name: page_size
        schema:
          type: integer
          maximum: 1000
          minimum: 1
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAssertionsResponse'
          description: ''
  /api/credentials/orgs/{platform_key}/users/{username}/assertions-over-time/:
    get:
      operationId: credentials_orgs_users_assertions_over_time_retrieve_2
      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: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: start_date
        schema:
          type: string
          minLength: 1
        description: start date. ISO 8601
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OvertimeWithChangeInfo'
          description: ''
  /api/credentials/orgs/{platform_key}/users/{username}/assertions/{entity_id}:
    get:
      operationId: credentials_orgs_users_assertions_retrieve_5
      parameters:
      - in: path
        name: entity_id
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        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_2
      parameters:
      - in: path
        name: entity_id
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        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/{platform_key}/users/{username}/assignments/{assignment_id}:
    delete:
      operationId: credentials_orgs_users_assignments_destroy_2
      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: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/credentials/orgs/{platform_key}/users/{username}/assignments/groups/:
    get:
      operationId: credentials_orgs_users_assignments_groups_retrieve_2
      description: Get group assignments with department-aware filtering
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    post:
      operationId: credentials_orgs_users_assignments_groups_create_2
      description: Create group assignment with department access validation
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/credentials/orgs/{platform_key}/users/{username}/assignments/users/:
    get:
      operationId: credentials_orgs_users_assignments_users_retrieve_2
      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: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
    post:
      operationId: credentials_orgs_users_assignments_users_create_2
      description: Create assignments with department access validation
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/credentials/orgs/{platform_key}/users/{username}/course-assertions-over-time/:
    get:
      operationId: credentials_orgs_users_course_assertions_over_time_retrieve_2
      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: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: start_date
        schema:
          type: string
          minLength: 1
        description: start date. ISO 8601
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTime'
          description: ''
  /api/credentials/orgs/{platform_key}/users/{username}/course-credentials/:
    get:
      operationId: credentials_orgs_users_course_credentials_list_2
      description: |-
        DRF view mixin that routes all ORM reads to the read replica.

        Falls back to the primary database if the replica is unreachable.

        Add as the **first** base class on read-only views/viewsets::

            class MyView(ReadReplicaViewMixin, IsPlatformAdminDRFMixin, APIView):
                ...
      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
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /api/credentials/orgs/{platform_key}/users/{username}/credentials-over-time/:
    get:
      operationId: credentials_orgs_users_credentials_over_time_retrieve_2
      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: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: start_date
        schema:
          type: string
          minLength: 1
        description: start date. ISO 8601
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverTime'
          description: ''
  /api/credentials/orgs/{platform_key}/users/{username}/external-mapping/:
    get:
      operationId: credentials_orgs_users_external_mapping_retrieve_2
      description: |-
        Retrieve external credential mappings for the platform.

        Query Parameters:
            credential_id (str, optional): Filter by credential entity_id
            provider_name (str, optional): Filter by provider name
            page (int, optional): Page number
            page_size (int, optional): Items per page

        Returns all mappings for the platform if the user is an admin.
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalCredentialMapping'
          description: ''
    post:
      operationId: credentials_orgs_users_external_mapping_create_2
      description: |-
        Create or update an external credential mapping.

        If a mapping doesn't exist for the credential + platform + provider combination,
        it will be created. If it exists, it will be updated.

        Request Body:
            {
                "credential_id": "credential-entity-id",  // Required
                "provider_name": "accredible",            // Required
                "external_template_id": "123456",         // Optional
                "metadata": {}                            // Optional
            }

        Returns:
            - 201 Created: When creating a new mapping
            - 200 OK: When updating an existing mapping
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExternalCredentialMapping'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ExternalCredentialMapping'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ExternalCredentialMapping'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ExternalCredentialMapping'
          '*/*':
            schema:
              $ref: '#/components/schemas/ExternalCredentialMapping'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalCredentialMapping'
          description: ''
    delete:
      operationId: credentials_orgs_users_external_mapping_destroy_2
      description: |-
        Delete an external credential mapping.

        Request Body:
            {
                "credential_id": "credential-entity-id",  // Required
                "provider_name": "accredible"             // Required
            }

        Returns:
            A JSON response confirming deletion
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/credentials/orgs/{platform_key}/users/{username}/images/:
    get:
      operationId: credentials_orgs_users_images_retrieve_2
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        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_2
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        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/{platform_key}/users/{username}/issuers/:
    get:
      operationId: credentials_orgs_users_issuers_retrieve_3
      description: A GET View that validates QueryParams and returns results to a
        serializer
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: q
        schema:
          type: string
          minLength: 1
        required: true
      - in: path
        name: username
        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_2
      description: A GET View that validates QueryParams and returns results to a
        serializer
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: q
        schema:
          type: string
          minLength: 1
        required: true
      - in: path
        name: username
        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/{platform_key}/users/{username}/issuers/{entity_id}:
    get:
      operationId: credentials_orgs_users_issuers_retrieve_4
      parameters:
      - in: path
        name: entity_id
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        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_2
      parameters:
      - in: path
        name: entity_id
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        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_2
      parameters:
      - in: path
        name: entity_id
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/credentials/orgs/{platform_key}/users/{username}/issuers/authority/:
    post:
      operationId: credentials_orgs_users_issuers_authority_create_2
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        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/orgs/{platform_key}/users/{username}/provider-config/:
    get:
      operationId: credentials_orgs_users_provider_config_retrieve_2
      description: |-
        Retrieve provider configurations for the platform.

        Query Parameters:
            provider_name (str, optional): Filter to a specific provider
            page (int, optional): Page number
            page_size (int, optional): Items per page

        Returns all configurations for the platform if the user is an admin.
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialProviderConfig'
          description: ''
    post:
      operationId: credentials_orgs_users_provider_config_create_2
      description: |-
        Create or update a provider configuration.

        If a configuration doesn't exist for the platform and provider, it will be created.
        If it exists, it will be updated.

        Request Body:
            {
                "provider_name": "accredible",  // Required
                "config": {...},                 // Optional
                "enabled": true                  // Optional
            }

        Returns:
            - 201 Created: When creating a new configuration
            - 200 OK: When updating an existing configuration
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialProviderConfig'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CredentialProviderConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CredentialProviderConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CredentialProviderConfig'
          '*/*':
            schema:
              $ref: '#/components/schemas/CredentialProviderConfig'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialProviderConfig'
          description: ''
    delete:
      operationId: credentials_orgs_users_provider_config_destroy_2
      description: |-
        Deactivate a provider configuration (sets enabled=False).

        Request Body:
            {
                "provider_name": "accredible"  // Required
            }
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: path
        name: username
        schema:
          type: string
        required: true
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/credentials/providers/:
    get:
      operationId: credentials_providers_retrieve
      description: Get list of enabled credential providers with pagination.
      tags:
      - credentials
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /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/crm/activities/:
    get:
      operationId: crm_activities_list
      description: |-
        Returns a paginated list of Activities in your Platform. Supports filtering by `type`, `is_done`, `owner`, `deal`, `person`, schedule-from ranges, and `metadata__has_key`.

        **Required permission:** `Ibl.CRM/Activities/list`.
      summary: List activities
      parameters:
      - in: query
        name: deal
        schema:
          type: number
      - in: query
        name: is_done
        schema:
          type: boolean
      - in: query
        name: metadata__has_key
        schema:
          type: string
      - in: query
        name: owner
        schema:
          type: number
      - 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: person
        schema:
          type: string
          format: uuid
      - in: query
        name: schedule_from__gte
        schema:
          type: string
          format: date-time
      - in: query
        name: schedule_from__lte
        schema:
          type: string
          format: date-time
      - in: query
        name: type
        schema:
          type: string
          enum:
          - call
          - deadline
          - email
          - lunch
          - meeting
          - note
          - task
        description: |-
          Interaction kind.

          * `call` - Call
          * `meeting` - Meeting
          * `email` - Email
          * `note` - Note
          * `task` - Task
          * `lunch` - Lunch
          * `deadline` - Deadline
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedActivityList'
          description: ''
        '401':
          description: Authentication required.
        '403':
          description: Missing required permission `Ibl.CRM/Activities/list`.
    post:
      operationId: crm_activities_create
      description: |-
        Creates an Activity. Either `deal` or `person` must be supplied; both must belong to your Platform.

        **Required permission:** `Ibl.CRM/Activities/action`.
      summary: Create an activity
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Activity'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Activity'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Activity'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Activity'
          '*/*':
            schema:
              $ref: '#/components/schemas/Activity'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Activity'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Activities/action`.
  /api/crm/activities/{id}/:
    get:
      operationId: crm_activities_retrieve
      description: |-
        Returns a single Activity by id.

        **Required permission:** `Ibl.CRM/Activities/read`.
      summary: Retrieve an activity
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this activity.
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Activity'
          description: ''
        '403':
          description: Missing required permission `Ibl.CRM/Activities/read`.
        '404':
          description: Activity not found.
    put:
      operationId: crm_activities_update
      description: |-
        Replaces all editable fields on the Activity.

        **Required permission:** `Ibl.CRM/Activities/write`.
      summary: Replace an activity
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this activity.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Activity'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Activity'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Activity'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Activity'
          '*/*':
            schema:
              $ref: '#/components/schemas/Activity'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Activity'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Activities/write`.
        '404':
          description: Activity not found.
    patch:
      operationId: crm_activities_partial_update
      description: |-
        Updates only the supplied fields on the Activity.

        **Required permission:** `Ibl.CRM/Activities/write`.
      summary: Update an activity
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this activity.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedActivity'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedActivity'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedActivity'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedActivity'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedActivity'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Activity'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Activities/write`.
        '404':
          description: Activity not found.
    delete:
      operationId: crm_activities_destroy
      description: |-
        Deletes the Activity.

        **Required permission:** `Ibl.CRM/Activities/delete`.
      summary: Delete an activity
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this activity.
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Deleted.
        '403':
          description: Missing required permission `Ibl.CRM/Activities/delete`.
        '404':
          description: Activity not found.
  /api/crm/activities/{id}/done/:
    post:
      operationId: crm_activities_done_create
      description: |-
        Flips `is_done=True` and stamps `done_at` if it isn't already set. Idempotent — calling on an already-done Activity preserves the original `done_at`.

        **Required permission:** `Ibl.CRM/Activities/write`.
      summary: Mark an activity as done
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this activity.
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Activity'
          description: ''
        '403':
          description: Missing required permission `Ibl.CRM/Activities/write`.
        '404':
          description: Activity not found.
  /api/crm/deals/:
    get:
      operationId: crm_deals_list
      description: |-
        Returns a paginated list of Deals in your Platform. Supports filtering by `status`, `pipeline`, `stage`, `owner`, `source`, `person`, `organization`, expected-close-date and created-at ranges, and `metadata__has_key`.

        **Required permission:** `Ibl.CRM/Deals/list`.
      summary: List deals
      parameters:
      - in: query
        name: created_at__gte
        schema:
          type: string
          format: date-time
      - in: query
        name: created_at__lte
        schema:
          type: string
          format: date-time
      - in: query
        name: expected_close_date__gte
        schema:
          type: string
          format: date-time
      - in: query
        name: expected_close_date__lte
        schema:
          type: string
          format: date-time
      - in: query
        name: metadata__has_key
        schema:
          type: string
      - in: query
        name: organization
        schema:
          type: string
          format: uuid
      - in: query
        name: owner
        schema:
          type: number
      - 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: person
        schema:
          type: string
          format: uuid
      - in: query
        name: pipeline
        schema:
          type: number
      - in: query
        name: source
        schema:
          type: number
      - in: query
        name: stage
        schema:
          type: number
      - in: query
        name: status
        schema:
          type: string
          enum:
          - lost
          - open
          - won
        description: |-
          Service-managed (read-only in serializer). Derived from the destination stage's is_won/is_lost.

          * `open` - Open
          * `won` - Won
          * `lost` - Lost
      - in: query
        name: tags
        schema:
          type: string
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedDealList'
          description: ''
        '401':
          description: Authentication required.
        '403':
          description: Missing required permission `Ibl.CRM/Deals/list`.
    post:
      operationId: crm_deals_create
      description: |-
        Creates a new Deal. All FK targets (`person`, `organization`, `pipeline`, `stage`, `source`) must belong to your Platform; `stage` must belong to `pipeline`. `status` and `closed_at` are service-managed — passing them returns `400`.

        **Required permission:** `Ibl.CRM/Deals/action`.
      summary: Create a deal
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Deal'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Deal'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Deal'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Deal'
          '*/*':
            schema:
              $ref: '#/components/schemas/Deal'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deal'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Deals/action`.
  /api/crm/deals/{id}/:
    get:
      operationId: crm_deals_retrieve
      description: |-
        Returns a single Deal by id.

        **Required permission:** `Ibl.CRM/Deals/read`.
      summary: Retrieve a deal
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this deal.
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deal'
          description: ''
        '403':
          description: Missing required permission `Ibl.CRM/Deals/read`.
        '404':
          description: Deal not found.
    put:
      operationId: crm_deals_update
      description: |-
        Replaces all editable fields on the Deal.

        **Required permission:** `Ibl.CRM/Deals/write`.
      summary: Replace a deal
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this deal.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Deal'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Deal'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Deal'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Deal'
          '*/*':
            schema:
              $ref: '#/components/schemas/Deal'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deal'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Deals/write`.
        '404':
          description: Deal not found.
    patch:
      operationId: crm_deals_partial_update
      description: |-
        Updates only the supplied fields on the Deal. Direct writes to `status` or `closed_at` are rejected with `400` — use `POST /deals/{id}/move-stage/`, `won/`, or `lost/`.

        **Required permission:** `Ibl.CRM/Deals/write`.
      summary: Update a deal
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this deal.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedDeal'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedDeal'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedDeal'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedDeal'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedDeal'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deal'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Deals/write`.
        '404':
          description: Deal not found.
    delete:
      operationId: crm_deals_destroy
      description: |-
        Deletes the Deal.

        **Required permission:** `Ibl.CRM/Deals/delete`.
      summary: Delete a deal
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this deal.
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Deleted.
        '403':
          description: Missing required permission `Ibl.CRM/Deals/delete`.
        '404':
          description: Deal not found.
  /api/crm/deals/{id}/lost/:
    post:
      operationId: crm_deals_lost_create
      description: |-
        Moves the Deal into a closed-lost stage and persists `lost_reason`. If `stage_code` is omitted, the first `is_lost=True` stage in the Deal's pipeline (by sort order) is used.

        **Required permission:** `Ibl.CRM/Deals/write`.
      summary: Mark a deal as lost
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this deal.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DealLostRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/DealLostRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DealLostRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DealLostRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/DealLostRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deal'
          description: ''
        '400':
          description: Missing `lost_reason`, no `is_lost` stage configured, or the
            supplied stage_code is not flagged is_lost=True.
        '403':
          description: Missing required permission `Ibl.CRM/Deals/write`.
        '404':
          description: Deal not found.
  /api/crm/deals/{id}/move-stage/:
    post:
      operationId: crm_deals_move_stage_create
      description: |-
        Moves the Deal to the stage identified by `stage_id` or `stage_code`. The target stage must belong to this Deal's pipeline. Records an audit Activity and emits `deal_stage_changed`. `Deal.status` is recomputed from the new stage's `is_won` / `is_lost` flags.

        **Required permission:** `Ibl.CRM/Deals/write`.
      summary: Move a deal to a different stage
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this deal.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DealMoveStageRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/DealMoveStageRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DealMoveStageRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DealMoveStageRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/DealMoveStageRequest'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deal'
          description: ''
        '400':
          description: Validation error (e.g. stage not in pipeline).
        '403':
          description: Missing required permission `Ibl.CRM/Deals/write`.
        '404':
          description: Deal or stage not found.
  /api/crm/deals/{id}/tags/:
    post:
      operationId: crm_deals_tags_create
      description: |-
        Attaches an existing Tag to this record. Both the Tag and the record must belong to your Platform. Returns `409 Conflict` with the existing `assignment_id` if the tag is already attached.

        **Required permission:** `Ibl.CRM/Tags/write`.
      summary: Attach a tag to this record
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this deal.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/_TagAttachRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/_TagAttachRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/_TagAttachRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/_TagAttachRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/_TagAttachRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          description: No response body
        '400':
          description: No response body
        '403':
          description: No response body
        '404':
          description: No response body
        '409':
          description: No response body
  /api/crm/deals/{id}/tags/{tag_id}/:
    delete:
      operationId: crm_deals_tags_destroy
      description: |-
        Removes the Tag with id `tag_id` from this record. Returns `404` if the tag was not attached.

        **Required permission:** `Ibl.CRM/Tags/write`.
      summary: Detach a tag from this record
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this deal.
        required: true
      - in: path
        name: tag_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
        '403':
          description: No response body
        '404':
          description: No response body
  /api/crm/deals/{id}/won/:
    post:
      operationId: crm_deals_won_create
      description: |-
        Moves the Deal into a closed-won stage and sets `status='won'`. If `stage_code` is omitted, the first `is_won=True` stage in the Deal's pipeline (by sort order) is used.

        **Required permission:** `Ibl.CRM/Deals/write`.
      summary: Mark a deal as won
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this deal.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DealWonRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/DealWonRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DealWonRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DealWonRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/DealWonRequest'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deal'
          description: ''
        '400':
          description: No `is_won` stage configured, or the supplied stage_code is
            not flagged is_won=True.
        '403':
          description: Missing required permission `Ibl.CRM/Deals/write`.
        '404':
          description: Deal not found.
  /api/crm/lead-sources/:
    get:
      operationId: crm_lead_sources_list
      description: |-
        Returns a paginated list of LeadSources in your Platform.

        **Required permission:** `Ibl.CRM/Pipelines/list`.
      summary: List lead sources
      parameters:
      - in: query
        name: code
        schema:
          type: string
      - in: query
        name: name
        schema:
          type: string
      - 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:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedLeadSourceList'
          description: ''
        '401':
          description: Authentication required.
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/list`.
    post:
      operationId: crm_lead_sources_create
      description: |-
        Creates a new LeadSource in your Platform. `code` must be unique.

        **Required permission:** `Ibl.CRM/Pipelines/action`.
      summary: Create a lead source
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadSource'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/LeadSource'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/LeadSource'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/LeadSource'
          '*/*':
            schema:
              $ref: '#/components/schemas/LeadSource'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadSource'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/action`.
  /api/crm/lead-sources/{id}/:
    get:
      operationId: crm_lead_sources_retrieve
      description: |-
        Returns a single LeadSource by id.

        **Required permission:** `Ibl.CRM/Pipelines/read`.
      summary: Retrieve a lead source
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this lead source.
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadSource'
          description: ''
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/read`.
        '404':
          description: LeadSource not found.
    put:
      operationId: crm_lead_sources_update
      description: |-
        Replaces all editable fields on the LeadSource.

        **Required permission:** `Ibl.CRM/Pipelines/write`.
      summary: Replace a lead source
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this lead source.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadSource'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/LeadSource'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/LeadSource'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/LeadSource'
          '*/*':
            schema:
              $ref: '#/components/schemas/LeadSource'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadSource'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/write`.
        '404':
          description: LeadSource not found.
    patch:
      operationId: crm_lead_sources_partial_update
      description: |-
        Updates only the supplied fields on the LeadSource.

        **Required permission:** `Ibl.CRM/Pipelines/write`.
      summary: Update a lead source
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this lead source.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedLeadSource'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedLeadSource'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedLeadSource'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedLeadSource'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedLeadSource'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadSource'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/write`.
        '404':
          description: LeadSource not found.
    delete:
      operationId: crm_lead_sources_destroy
      description: |-
        Deletes the LeadSource. Any Deals referencing it have their `source` cleared.

        **Required permission:** `Ibl.CRM/Pipelines/delete`.
      summary: Delete a lead source
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this lead source.
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Deleted.
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/delete`.
        '404':
          description: LeadSource not found.
  /api/crm/organizations/:
    get:
      operationId: crm_organizations_list
      description: |-
        Returns a paginated list of organizations in your Platform. Supports filtering by `owner` and by `name` (case-insensitive substring match).

        **Required permission:** `Ibl.CRM/Organizations/list`.
      summary: List organizations
      parameters:
      - in: query
        name: name
        schema:
          type: string
      - in: query
        name: owner
        schema:
          type: number
      - 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: tags
        schema:
          type: string
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedOrganizationList'
          description: ''
        '401':
          description: Authentication required.
        '403':
          description: Missing required permission `Ibl.CRM/Organizations/list`.
    post:
      operationId: crm_organizations_create
      description: |-
        Creates a new organization in your Platform. The Platform is inferred from your credentials. `name` must be unique within your Platform.

        **Required permission:** `Ibl.CRM/Organizations/action`.
      summary: Create an organization
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Organization'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Organization'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Organization'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Organization'
          '*/*':
            schema:
              $ref: '#/components/schemas/Organization'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
          description: ''
        '400':
          description: Validation error (for example, duplicate name).
        '403':
          description: Missing required permission `Ibl.CRM/Organizations/action`.
  /api/crm/organizations/{id}/:
    get:
      operationId: crm_organizations_retrieve
      description: |-
        Returns a single organization by id.

        **Required permission:** `Ibl.CRM/Organizations/read`.
      summary: Retrieve an organization
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
          description: Opaque UUID — used in API URLs and external references.
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
          description: ''
        '403':
          description: Missing required permission `Ibl.CRM/Organizations/read`.
        '404':
          description: Organization not found.
    put:
      operationId: crm_organizations_update
      description: |-
        Replaces all editable fields on the organization.

        **Required permission:** `Ibl.CRM/Organizations/write`.
      summary: Replace an organization
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
          description: Opaque UUID — used in API URLs and external references.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Organization'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Organization'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Organization'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Organization'
          '*/*':
            schema:
              $ref: '#/components/schemas/Organization'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Organizations/write`.
        '404':
          description: Organization not found.
    patch:
      operationId: crm_organizations_partial_update
      description: |-
        Updates only the supplied fields on the organization.

        **Required permission:** `Ibl.CRM/Organizations/write`.
      summary: Update an organization
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
          description: Opaque UUID — used in API URLs and external references.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedOrganization'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedOrganization'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedOrganization'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedOrganization'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedOrganization'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Organizations/write`.
        '404':
          description: Organization not found.
    delete:
      operationId: crm_organizations_destroy
      description: |-
        Deletes the organization. Any persons linked to it are kept; their organization reference is cleared.

        **Required permission:** `Ibl.CRM/Organizations/delete`.
      summary: Delete an organization
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
          description: Opaque UUID — used in API URLs and external references.
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Deleted.
        '403':
          description: Missing required permission `Ibl.CRM/Organizations/delete`.
        '404':
          description: Organization not found.
  /api/crm/organizations/{id}/tags/:
    post:
      operationId: crm_organizations_tags_create
      description: |-
        Attaches an existing Tag to this record. Both the Tag and the record must belong to your Platform. Returns `409 Conflict` with the existing `assignment_id` if the tag is already attached.

        **Required permission:** `Ibl.CRM/Tags/write`.
      summary: Attach a tag to this record
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
          description: Opaque UUID — used in API URLs and external references.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/_TagAttachRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/_TagAttachRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/_TagAttachRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/_TagAttachRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/_TagAttachRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          description: No response body
        '400':
          description: No response body
        '403':
          description: No response body
        '404':
          description: No response body
        '409':
          description: No response body
  /api/crm/organizations/{id}/tags/{tag_id}/:
    delete:
      operationId: crm_organizations_tags_destroy
      description: |-
        Removes the Tag with id `tag_id` from this record. Returns `404` if the tag was not attached.

        **Required permission:** `Ibl.CRM/Tags/write`.
      summary: Detach a tag from this record
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
          description: Opaque UUID — used in API URLs and external references.
        required: true
      - in: path
        name: tag_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
        '403':
          description: No response body
        '404':
          description: No response body
  /api/crm/persons/:
    get:
      operationId: crm_persons_list
      description: |-
        Returns a paginated list of persons in your Platform. Supports filtering by `lifecycle_stage`, `owner`, `organization`, `created_at__gte`/`created_at__lte`, and `metadata__has_key`.

        **Required permission:** `Ibl.CRM/Persons/list`.
      summary: List persons
      parameters:
      - in: query
        name: created_at__gte
        schema:
          type: string
          format: date-time
      - in: query
        name: created_at__lte
        schema:
          type: string
          format: date-time
      - in: query
        name: lifecycle_stage
        schema:
          type: string
          enum:
          - churned
          - customer
          - lead
          - opportunity
          - qualified
        description: |-
          Funnel position. Transitions are unrestricted — any stage may move to any other.

          * `lead` - Lead
          * `qualified` - Qualified
          * `opportunity` - Opportunity
          * `customer` - Customer
          * `churned` - Churned
      - in: query
        name: metadata__has_key
        schema:
          type: string
      - in: query
        name: organization
        schema:
          type: string
          format: uuid
      - in: query
        name: owner
        schema:
          type: number
      - 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: tags
        schema:
          type: string
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPersonList'
          description: ''
        '401':
          description: Authentication required.
        '403':
          description: Missing required permission `Ibl.CRM/Persons/list`.
    post:
      operationId: crm_persons_create
      description: |-
        Creates a new person in your Platform. The Platform is inferred from your credentials. If `organization` is supplied, it must reference an organization in your Platform.

        **Required permission:** `Ibl.CRM/Persons/action`.
      summary: Create a person
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Person'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Person'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Person'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Person'
          '*/*':
            schema:
              $ref: '#/components/schemas/Person'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Person'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Persons/action`.
  /api/crm/persons/{id}/:
    get:
      operationId: crm_persons_retrieve
      description: |-
        Returns a single person by id.

        **Required permission:** `Ibl.CRM/Persons/read`.
      summary: Retrieve a person
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
          description: Opaque UUID — used in API URLs and external references.
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Person'
          description: ''
        '403':
          description: Missing required permission `Ibl.CRM/Persons/read`.
        '404':
          description: Person not found.
    put:
      operationId: crm_persons_update
      description: |-
        Replaces all editable fields on the person.

        **Required permission:** `Ibl.CRM/Persons/write`.
      summary: Replace a person
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
          description: Opaque UUID — used in API URLs and external references.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Person'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Person'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Person'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Person'
          '*/*':
            schema:
              $ref: '#/components/schemas/Person'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Person'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Persons/write`.
        '404':
          description: Person not found.
    patch:
      operationId: crm_persons_partial_update
      description: |-
        Updates only the supplied fields on the person.

        **Required permission:** `Ibl.CRM/Persons/write`.
      summary: Update a person
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
          description: Opaque UUID — used in API URLs and external references.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPerson'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedPerson'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPerson'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPerson'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedPerson'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Person'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Persons/write`.
        '404':
          description: Person not found.
    delete:
      operationId: crm_persons_destroy
      description: |-
        Deletes the person.

        **Required permission:** `Ibl.CRM/Persons/delete`.
      summary: Delete a person
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
          description: Opaque UUID — used in API URLs and external references.
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Deleted.
        '403':
          description: Missing required permission `Ibl.CRM/Persons/delete`.
        '404':
          description: Person not found.
  /api/crm/persons/{id}/invite/:
    post:
      operationId: crm_persons_invite_create
      description: |-
        Sends a platform invitation to the person's `primary_email`. On acceptance, the invitee joins your Platform with the privileges configured in the request body.

        Returns `409 Conflict` if an active invitation already exists for this email in your Platform, and `422 Unprocessable Entity` if the person is already linked to a platform user.

        **Required permission:** `Ibl.CRM/Invite/action`.
      summary: Invite a person to the platform
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
          description: Opaque UUID — used in API URLs and external references.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PersonInviteRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PersonInviteRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PersonInviteRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PersonInviteRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PersonInviteRequest'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PersonInviteResponse'
          description: ''
        '400':
          description: Person has no `primary_email`; cannot invite.
        '403':
          description: Missing required permission `Ibl.CRM/Invite/action`.
        '404':
          description: Person not found.
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PersonInviteConflict'
          description: ''
        '422':
          description: Person is already linked to a platform user.
  /api/crm/persons/{id}/link-user/:
    post:
      operationId: crm_persons_link_user_create
      description: |-
        Links this person to an existing platform user. The target user must already be a member of your Platform — if they are not, send them an invitation via `POST /persons/{id}/invite/` instead.

        This call is idempotent: linking a person that is already bound to the same user is a no-op. Re-linking a person that is already bound to a *different* user is refused; the existing binding is preserved and the unchanged person is returned.

        **Required permission:** `Ibl.CRM/Persons/write`.
      summary: Bind a person to an existing platform user
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
          description: Opaque UUID — used in API URLs and external references.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PersonLinkUserRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PersonLinkUserRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PersonLinkUserRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PersonLinkUserRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PersonLinkUserRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Person'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Persons/write`, or the
            target user is not a member of your Platform.
        '404':
          description: Person or user not found.
  /api/crm/persons/{id}/tags/:
    post:
      operationId: crm_persons_tags_create
      description: |-
        Attaches an existing Tag to this record. Both the Tag and the record must belong to your Platform. Returns `409 Conflict` with the existing `assignment_id` if the tag is already attached.

        **Required permission:** `Ibl.CRM/Tags/write`.
      summary: Attach a tag to this record
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
          description: Opaque UUID — used in API URLs and external references.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/_TagAttachRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/_TagAttachRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/_TagAttachRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/_TagAttachRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/_TagAttachRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          description: No response body
        '400':
          description: No response body
        '403':
          description: No response body
        '404':
          description: No response body
        '409':
          description: No response body
  /api/crm/persons/{id}/tags/{tag_id}/:
    delete:
      operationId: crm_persons_tags_destroy
      description: |-
        Removes the Tag with id `tag_id` from this record. Returns `404` if the tag was not attached.

        **Required permission:** `Ibl.CRM/Tags/write`.
      summary: Detach a tag from this record
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
          description: Opaque UUID — used in API URLs and external references.
        required: true
      - in: path
        name: tag_id
        schema:
          type: string
          pattern: ^\d+$
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
        '403':
          description: No response body
        '404':
          description: No response body
  /api/crm/persons/merge/:
    post:
      operationId: crm_persons_merge_create
      description: |-
        Marks each person in `duplicate_ids` as inactive and reports how many related records (deals, activities, tags) were re-parented onto `primary_id`.

        All ids — both the primary and every duplicate — must belong to your Platform. `primary_id` may not appear in `duplicate_ids`.

        **Required permission:** `Ibl.CRM/Persons/write`.
      summary: Merge duplicate persons into a primary
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PersonMergeRequest'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PersonMergeRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PersonMergeRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PersonMergeRequest'
          '*/*':
            schema:
              $ref: '#/components/schemas/PersonMergeRequest'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PersonMergeResponse'
          description: ''
        '400':
          description: 'Validation error: the primary appears in duplicates, or one
            or more ids belong to another Platform.'
        '403':
          description: Missing required permission `Ibl.CRM/Persons/write`.
        '404':
          description: Primary person not found.
  /api/crm/pipelines/:
    get:
      operationId: crm_pipelines_list
      description: |-
        Returns a paginated list of Pipelines in your Platform. Each Pipeline includes its ordered `stages` inline.

        **Required permission:** `Ibl.CRM/Pipelines/list`.
      summary: List pipelines
      parameters:
      - in: query
        name: code
        schema:
          type: string
      - in: query
        name: is_default
        schema:
          type: boolean
      - in: query
        name: name
        schema:
          type: string
      - 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:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPipelineList'
          description: ''
        '401':
          description: Authentication required.
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/list`.
    post:
      operationId: crm_pipelines_create
      description: |-
        Creates a new Pipeline. `code` must be unique within your Platform. Promoting another Pipeline to `is_default=true` while one already exists will fail — unset the existing default first.

        **Required permission:** `Ibl.CRM/Pipelines/action`.
      summary: Create a pipeline
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Pipeline'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Pipeline'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Pipeline'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Pipeline'
          '*/*':
            schema:
              $ref: '#/components/schemas/Pipeline'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Pipeline'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/action`.
  /api/crm/pipelines/{pipeline_pk}/stages/:
    get:
      operationId: crm_pipelines_stages_list
      description: |-
        Returns the ordered list of PipelineStages for the given Pipeline.

        **Required permission:** `Ibl.CRM/Pipelines/list`.
      summary: List stages for a pipeline
      parameters:
      - in: query
        name: code
        schema:
          type: string
      - in: query
        name: is_lost
        schema:
          type: boolean
      - in: query
        name: is_won
        schema:
          type: boolean
      - 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: pipeline_pk
        schema:
          type: integer
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedPipelineStageList'
          description: ''
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/list`.
        '404':
          description: Pipeline not found.
    post:
      operationId: crm_pipelines_stages_create
      description: |-
        Creates a new PipelineStage in the URL Pipeline. `code` must be unique within that Pipeline. At most one of `is_won` / `is_lost` may be true.

        **Required permission:** `Ibl.CRM/Pipelines/action`.
      summary: Create a stage
      parameters:
      - in: path
        name: pipeline_pk
        schema:
          type: integer
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PipelineStage'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PipelineStage'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PipelineStage'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PipelineStage'
          '*/*':
            schema:
              $ref: '#/components/schemas/PipelineStage'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelineStage'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/action`.
        '404':
          description: Pipeline not found.
  /api/crm/pipelines/{pipeline_pk}/stages/{id}/:
    get:
      operationId: crm_pipelines_stages_retrieve
      description: |-
        Returns a single PipelineStage by id (must belong to the URL Pipeline).

        **Required permission:** `Ibl.CRM/Pipelines/read`.
      summary: Retrieve a stage
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: path
        name: pipeline_pk
        schema:
          type: integer
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelineStage'
          description: ''
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/read`.
        '404':
          description: Stage not found in this Pipeline.
    put:
      operationId: crm_pipelines_stages_update
      description: |-
        Replaces all editable fields on the PipelineStage.

        **Required permission:** `Ibl.CRM/Pipelines/write`.
      summary: Replace a stage
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: path
        name: pipeline_pk
        schema:
          type: integer
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PipelineStage'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PipelineStage'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PipelineStage'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PipelineStage'
          '*/*':
            schema:
              $ref: '#/components/schemas/PipelineStage'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelineStage'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/write`.
        '404':
          description: Stage not found in this Pipeline.
    patch:
      operationId: crm_pipelines_stages_partial_update
      description: |-
        Updates only the supplied fields on the PipelineStage.

        **Required permission:** `Ibl.CRM/Pipelines/write`.
      summary: Update a stage
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: path
        name: pipeline_pk
        schema:
          type: integer
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPipelineStage'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedPipelineStage'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPipelineStage'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPipelineStage'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedPipelineStage'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelineStage'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/write`.
        '404':
          description: Stage not found in this Pipeline.
    delete:
      operationId: crm_pipelines_stages_destroy
      description: |-
        Deletes the PipelineStage. Fails with `409 Conflict` if any Deal still references it (FK is PROTECTed).

        **Required permission:** `Ibl.CRM/Pipelines/delete`.
      summary: Delete a stage
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: path
        name: pipeline_pk
        schema:
          type: integer
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Deleted.
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/delete`.
        '404':
          description: Stage not found in this Pipeline.
        '409':
          description: Stage still has Deals attached.
  /api/crm/pipelines/{id}/:
    get:
      operationId: crm_pipelines_retrieve
      description: |-
        Returns a single Pipeline by id, including its ordered `stages`.

        **Required permission:** `Ibl.CRM/Pipelines/read`.
      summary: Retrieve a pipeline
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this pipeline.
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Pipeline'
          description: ''
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/read`.
        '404':
          description: Pipeline not found.
    put:
      operationId: crm_pipelines_update
      description: |-
        Replaces all editable fields on the Pipeline.

        **Required permission:** `Ibl.CRM/Pipelines/write`.
      summary: Replace a pipeline
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this pipeline.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Pipeline'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Pipeline'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Pipeline'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Pipeline'
          '*/*':
            schema:
              $ref: '#/components/schemas/Pipeline'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Pipeline'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/write`.
        '404':
          description: Pipeline not found.
    patch:
      operationId: crm_pipelines_partial_update
      description: |-
        Updates only the supplied fields on the Pipeline.

        **Required permission:** `Ibl.CRM/Pipelines/write`.
      summary: Update a pipeline
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this pipeline.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPipeline'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedPipeline'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPipeline'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPipeline'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedPipeline'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Pipeline'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/write`.
        '404':
          description: Pipeline not found.
    delete:
      operationId: crm_pipelines_destroy
      description: |-
        Deletes the Pipeline. Fails with `409 Conflict` if any Deal still references it (FK is PROTECTed).

        **Required permission:** `Ibl.CRM/Pipelines/delete`.
      summary: Delete a pipeline
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this pipeline.
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Deleted.
        '403':
          description: Missing required permission `Ibl.CRM/Pipelines/delete`.
        '404':
          description: Pipeline not found.
        '409':
          description: Pipeline still has Deals attached.
  /api/crm/tags/:
    get:
      operationId: crm_tags_list
      description: |-
        Returns a paginated list of Tags in your Platform. Supports filtering by `name` (case-insensitive substring) and `created_at__gte`/`created_at__lte` ISO timestamp ranges.

        **Required permission:** `Ibl.CRM/Tags/list`.
      summary: List tags
      parameters:
      - in: query
        name: created_at__gte
        schema:
          type: string
          format: date-time
      - in: query
        name: created_at__lte
        schema:
          type: string
          format: date-time
      - in: query
        name: name
        schema:
          type: string
      - 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:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedTagList'
          description: ''
        '401':
          description: Authentication required.
        '403':
          description: Missing required permission `Ibl.CRM/Tags/list`.
    post:
      operationId: crm_tags_create
      description: |-
        Creates a new Tag in your Platform. `name` must be unique within your Platform; supply `color` as a `#RRGGBB` hex string (defaults to `#888888`).

        **Required permission:** `Ibl.CRM/Tags/action`.
      summary: Create a tag
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Tag'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Tag'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Tag'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Tag'
          '*/*':
            schema:
              $ref: '#/components/schemas/Tag'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'
          description: ''
        '400':
          description: Validation error (duplicate name, bad color, etc.).
        '403':
          description: Missing required permission `Ibl.CRM/Tags/action`.
  /api/crm/tags/{id}/:
    get:
      operationId: crm_tags_retrieve
      description: |-
        Returns a single Tag by id.

        **Required permission:** `Ibl.CRM/Tags/read`.
      summary: Retrieve a tag
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this tag.
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'
          description: ''
        '403':
          description: Missing required permission `Ibl.CRM/Tags/read`.
        '404':
          description: Tag not found.
    put:
      operationId: crm_tags_update
      description: |-
        Replaces all editable fields on the Tag.

        **Required permission:** `Ibl.CRM/Tags/write`.
      summary: Replace a tag
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this tag.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Tag'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/Tag'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Tag'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Tag'
          '*/*':
            schema:
              $ref: '#/components/schemas/Tag'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Tags/write`.
        '404':
          description: Tag not found.
    patch:
      operationId: crm_tags_partial_update
      description: |-
        Updates only the supplied fields on the Tag (typically `name` or `color`).

        **Required permission:** `Ibl.CRM/Tags/write`.
      summary: Update a tag
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this tag.
        required: true
      tags:
      - crm
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedTag'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedTag'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedTag'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedTag'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedTag'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'
          description: ''
        '400':
          description: Validation error.
        '403':
          description: Missing required permission `Ibl.CRM/Tags/write`.
        '404':
          description: Tag not found.
    delete:
      operationId: crm_tags_destroy
      description: |-
        Deletes the Tag. All attachments to Persons, Organizations, and Deals are removed atomically via cascade.

        **Required permission:** `Ibl.CRM/Tags/delete`.
      summary: Delete a tag
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this tag.
        required: true
      tags:
      - crm
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: Deleted.
        '403':
          description: Missing required permission `Ibl.CRM/Tags/delete`.
        '404':
          description: Tag not found.
  /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/exim/manage/eligibility/:
    get:
      operationId: exim_manage_eligibility_list
      description: |-
        Admin-only CRUD for CourseExportEligibility records.

        Lookup is by primary key. Filter by ``is_enabled`` and
        ``course__course_id``; search by ``course__course_id``.
      parameters:
      - in: query
        name: course__course_id
        schema:
          type: string
      - in: query
        name: is_enabled
        schema:
          type: boolean
      - name: search
        required: false
        in: query
        description: A search term.
        schema:
          type: string
      tags:
      - exim
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CourseExportEligibility'
          description: ''
    post:
      operationId: exim_manage_eligibility_create
      description: |-
        Admin-only CRUD for CourseExportEligibility records.

        Lookup is by primary key. Filter by ``is_enabled`` and
        ``course__course_id``; search by ``course__course_id``.
      tags:
      - exim
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseExportEligibility'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseExportEligibility'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseExportEligibility'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseExportEligibility'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseExportEligibility'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseExportEligibility'
          description: ''
  /api/exim/manage/eligibility/{id}/:
    get:
      operationId: exim_manage_eligibility_retrieve
      description: |-
        Admin-only CRUD for CourseExportEligibility records.

        Lookup is by primary key. Filter by ``is_enabled`` and
        ``course__course_id``; search by ``course__course_id``.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this course export eligibility.
        required: true
      tags:
      - exim
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseExportEligibility'
          description: ''
    put:
      operationId: exim_manage_eligibility_update
      description: |-
        Admin-only CRUD for CourseExportEligibility records.

        Lookup is by primary key. Filter by ``is_enabled`` and
        ``course__course_id``; search by ``course__course_id``.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this course export eligibility.
        required: true
      tags:
      - exim
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CourseExportEligibility'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/CourseExportEligibility'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CourseExportEligibility'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CourseExportEligibility'
          '*/*':
            schema:
              $ref: '#/components/schemas/CourseExportEligibility'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseExportEligibility'
          description: ''
    patch:
      operationId: exim_manage_eligibility_partial_update
      description: |-
        Admin-only CRUD for CourseExportEligibility records.

        Lookup is by primary key. Filter by ``is_enabled`` and
        ``course__course_id``; search by ``course__course_id``.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this course export eligibility.
        required: true
      tags:
      - exim
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedCourseExportEligibility'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedCourseExportEligibility'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedCourseExportEligibility'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedCourseExportEligibility'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedCourseExportEligibility'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CourseExportEligibility'
          description: ''
    delete:
      operationId: exim_manage_eligibility_destroy
      description: |-
        Admin-only CRUD for CourseExportEligibility records.

        Lookup is by primary key. Filter by ``is_enabled`` and
        ``course__course_id``; search by ``course__course_id``.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this course export eligibility.
        required: true
      tags:
      - exim
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/exim/manage/environments/:
    get:
      operationId: exim_manage_environments_list
      description: Admin-only CRUD for ExportTargetEnvironment records.
      parameters:
      - in: query
        name: is_enabled
        schema:
          type: boolean
      - name: search
        required: false
        in: query
        description: A search term.
        schema:
          type: string
      tags:
      - exim
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ExportTargetEnvironment'
          description: ''
    post:
      operationId: exim_manage_environments_create
      description: Admin-only CRUD for ExportTargetEnvironment records.
      tags:
      - exim
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportTargetEnvironment'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ExportTargetEnvironment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ExportTargetEnvironment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ExportTargetEnvironment'
          '*/*':
            schema:
              $ref: '#/components/schemas/ExportTargetEnvironment'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportTargetEnvironment'
          description: ''
  /api/exim/manage/environments/{id}/:
    get:
      operationId: exim_manage_environments_retrieve
      description: Admin-only CRUD for ExportTargetEnvironment records.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this export target environment.
        required: true
      tags:
      - exim
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportTargetEnvironment'
          description: ''
    put:
      operationId: exim_manage_environments_update
      description: Admin-only CRUD for ExportTargetEnvironment records.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this export target environment.
        required: true
      tags:
      - exim
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportTargetEnvironment'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/ExportTargetEnvironment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ExportTargetEnvironment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ExportTargetEnvironment'
          '*/*':
            schema:
              $ref: '#/components/schemas/ExportTargetEnvironment'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportTargetEnvironment'
          description: ''
    patch:
      operationId: exim_manage_environments_partial_update
      description: Admin-only CRUD for ExportTargetEnvironment records.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this export target environment.
        required: true
      tags:
      - exim
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedExportTargetEnvironment'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedExportTargetEnvironment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedExportTargetEnvironment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedExportTargetEnvironment'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedExportTargetEnvironment'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportTargetEnvironment'
          description: ''
    delete:
      operationId: exim_manage_environments_destroy
      description: Admin-only CRUD for ExportTargetEnvironment records.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this export target environment.
        required: true
      tags:
      - exim
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '204':
          description: No response body
  /api/exim/manage/platform-migrations/:
    get:
      operationId: exim_manage_platform_migrations_list
      description: |-
        Start and poll tenant-data migration runs (the platform_migration lane).

        ``POST`` starts a run and returns its ``run_id`` (kicking the Celery task);
        ``GET`` list/detail surface status + progress + report. Detail lookup is by
        the public ``run_id`` UUID, not the surrogate PK. Gated by the
        feature flag — start is rejected with 503 on non-AI deployments.
      parameters:
      - in: query
        name: direction
        schema:
          type: string
          enum:
          - export
          - import
        description: |-
          * `export` - Export
          * `import` - Import
      - name: ordering
        required: false
        in: query
        description: Which field to use when ordering the results.
        schema:
          type: string
      - in: query
        name: source_key
        schema:
          type: string
      - in: query
        name: status
        schema:
          type: string
          enum:
          - canceled
          - completed
          - failed
          - in_progress
          - pending
        description: |-
          * `pending` - Pending
          * `in_progress` - In Progress
          * `completed` - Completed
          * `failed` - Failed
          * `canceled` - Canceled
      - in: query
        name: target_key
        schema:
          type: string
      tags:
      - exim
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PlatformMigrationRun'
          description: ''
    post:
      operationId: exim_manage_platform_migrations_create
      description: |-
        Start and poll tenant-data migration runs (the platform_migration lane).

        ``POST`` starts a run and returns its ``run_id`` (kicking the Celery task);
        ``GET`` list/detail surface status + progress + report. Detail lookup is by
        the public ``run_id`` UUID, not the surrogate PK. Gated by the
        feature flag — start is rejected with 503 on non-AI deployments.
      tags:
      - exim
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformMigrationRunCreate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformMigrationRunCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformMigrationRunCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformMigrationRunCreate'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformMigrationRunCreate'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformMigrationRunCreate'
          description: ''
  /api/exim/manage/platform-migrations/{run_id}/:
    get:
      operationId: exim_manage_platform_migrations_retrieve
      description: |-
        Start and poll tenant-data migration runs (the platform_migration lane).

        ``POST`` starts a run and returns its ``run_id`` (kicking the Celery task);
        ``GET`` list/detail surface status + progress + report. Detail lookup is by
        the public ``run_id`` UUID, not the surrogate PK. Gated by the
        feature flag — start is rejected with 503 on non-AI deployments.
      parameters:
      - in: path
        name: run_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - exim
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformMigrationRun'
          description: ''
  /api/exim/manage/platform-migrations/{run_id}/cancel/:
    post:
      operationId: exim_manage_platform_migrations_cancel_create
      description: |-
        Cancel a still-pending run. No-op for any other status.

        Conditional UPDATE so we don't race the worker: if it has already flipped
        the row to ``in_progress`` the UPDATE matches zero rows and we return 409.
        A run already executing is not interrupted mid-phase.
      parameters:
      - in: path
        name: run_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - exim
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformMigrationRun'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PlatformMigrationRun'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformMigrationRun'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformMigrationRun'
          '*/*':
            schema:
              $ref: '#/components/schemas/PlatformMigrationRun'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformMigrationRun'
          description: ''
  /api/exim/manage/platform-migrations/{run_id}/download/:
    get:
      operationId: exim_manage_platform_migrations_download_retrieve
      description: |-
        Stream a completed export's bundle as a single ``.zip``.

        Token-gated (IsDMAdmin) REST mirror of the admin "Download .zip" link, so
        a programmatic caller can pull the bundle down to move it to another
        deployment. Only a completed EXPORT with a bundle still on disk is
        downloadable; imports and not-yet-finished runs have nothing to stream.
      parameters:
      - in: path
        name: run_id
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - exim
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformMigrationRun'
          description: ''
  /api/exim/manage/platform-migrations/import-upload/:
    post:
      operationId: exim_manage_platform_migrations_import_upload_create
      description: |-
        Upload a bundle ``.zip`` and start an import run from it (API parity).

        The programmatic mirror of the admin "Import from uploaded ZIP" page, so a
        caller that pulled a bundle off one deployment can push it to another over
        the API alone. Multipart fields: ``bundle_file`` (the zip, required),
        ``target_key`` (required), optional ``selected_components`` (repeatable),
        ``admin_user``, ``email``.

        On an S3 deployment the validated bundle is stored to S3 and the import
        runs from there (any node can execute it); otherwise it stays on local
        disk like the admin flow.
      tags:
      - exim
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PlatformMigrationRun'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PlatformMigrationRun'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformMigrationRun'
          description: ''
  /api/exim/manage/tasks/:
    get:
      operationId: exim_manage_tasks_list
      description: |-
        Admin-only read-only access to EximTask records.

        Tasks are created by signals and the admin sync action; this API
        surfaces them for inspection only. The ``cancel`` action transitions
        a still-pending task to ``canceled`` so it gets skipped by the worker.
      parameters:
      - in: query
        name: course__course_id
        schema:
          type: string
      - name: ordering
        required: false
        in: query
        description: Which field to use when ordering the results.
        schema:
          type: string
      - in: query
        name: status
        schema:
          type: string
          enum:
          - canceled
          - completed
          - failed
          - in_progress
          - pending
        description: |-
          * `pending` - Pending
          * `in_progress` - In Progress
          * `completed` - Completed
          * `failed` - Failed
          * `canceled` - Canceled
      - in: query
        name: target_environment
        schema:
          type: integer
      tags:
      - exim
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EximTask'
          description: ''
  /api/exim/manage/tasks/{id}/:
    get:
      operationId: exim_manage_tasks_retrieve
      description: |-
        Admin-only read-only access to EximTask records.

        Tasks are created by signals and the admin sync action; this API
        surfaces them for inspection only. The ``cancel`` action transitions
        a still-pending task to ``canceled`` so it gets skipped by the worker.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this exim task.
        required: true
      tags:
      - exim
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EximTask'
          description: ''
  /api/exim/manage/tasks/{id}/cancel/:
    post:
      operationId: exim_manage_tasks_cancel_create
      description: |-
        Cancel a pending task. No-op for any other status.

        Uses a conditional UPDATE so that we don't race with the worker:
        if the worker has just locked the row and flipped status to
        ``in_progress``, the UPDATE matches zero rows and we return 409
        instead of overwriting the worker's transition.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: A unique integer value identifying this exim task.
        required: true
      tags:
      - exim
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EximTask'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/EximTask'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/EximTask'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/EximTask'
          '*/*':
            schema:
              $ref: '#/components/schemas/EximTask'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EximTask'
          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. Requires: Ibl.Notifications/Notification/list'
      parameters:
      - in: query
        name: channel
        schema:
          type: string
          minLength: 1
        description: Filter by delivery channel
      - in: query
        name: end_date
        schema:
          type: string
          minLength: 1
        description: Filter notifications until this date
      - in: query
        name: exclude_channel
        schema:
          type: string
          minLength: 1
        description: Exclude notifications from this channel
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: start_date
        schema:
          type: string
          minLength: 1
        description: Filter notifications from this date
      - in: query
        name: status
        schema:
          type: string
          minLength: 1
        description: Filter by notification status
      - in: query
        name: tags
        schema:
          type: string
          minLength: 1
        description: Comma-separated tags to filter by (e.g. 'learning,activity').
          Returns notifications whose template matches ANY of the given tags.
      tags:
      - notifications
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Notification'
          description: ''
    put:
      operationId: notification_v1_orgs_notifications_update
      description: 'Update notification status for a user. Requires: Ibl.Notifications/Notification/write'
      parameters:
      - in: path
        name: org
        schema:
          type: string
        required: true
      tags:
      - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationsUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/NotificationsUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/NotificationsUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/NotificationsUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/NotificationsUpdate'
        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: 'Bulk update notification status for a user. Requires: Ibl.Notifications/Notification/write'
      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. Requires: Ibl.Notifications/Notification/list'
      parameters:
      - in: query
        name: channel
        schema:
          type: string
          minLength: 1
        description: Filter by delivery channel
      - in: query
        name: end_date
        schema:
          type: string
          minLength: 1
        description: Filter notifications until this date
      - in: query
        name: exclude_channel
        schema:
          type: string
          minLength: 1
        description: Exclude notifications from this channel
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: start_date
        schema:
          type: string
          minLength: 1
        description: Filter notifications from this date
      - in: query
        name: status
        schema:
          type: string
          minLength: 1
        description: Filter by notification status
      - in: query
        name: tags
        schema:
          type: string
          minLength: 1
        description: Comma-separated tags to filter by (e.g. 'learning,activity').
          Returns notifications whose template matches ANY of the given tags.
      - 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: 'Update notification status for a user. Requires: Ibl.Notifications/Notification/write'
      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/NotificationsUpdate'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/NotificationsUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/NotificationsUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/NotificationsUpdate'
          '*/*':
            schema:
              $ref: '#/components/schemas/NotificationsUpdate'
        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. Requires: Ibl.Notifications/Notification/list'
      parameters:
      - in: query
        name: channel
        schema:
          type: string
          minLength: 1
        description: Filter count by delivery channel
      - in: path
        name: org
        schema:
          type: string
        required: true
      - in: query
        name: status
        schema:
          enum:
          - READ
          - UNREAD
          - CANCELLED
          type: string
          minLength: 1
        description: |-
          Filter count by notification status

          * `READ` - Read
          * `UNREAD` - Unread
          * `CANCELLED` - Cancelled
      - 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: 'Delete a notification for a user. Requires: Ibl.Notifications/Notification/delete'
      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: 'Bulk update notification status for a user. Requires: Ibl.Notifications/Notification/write'
      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/{platform_key}/campaigns/enable/:
    post:
      operationId: notification_v1_orgs_campaigns_enable_create
      description: 'Re-enable campaigns for a user. Requires: Ibl.Notifications/Campaigns/action'
      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. Requires: Ibl.Notifications/Campaigns/action'
      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. Requires: Ibl.Notifications/Notification/write'
      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. Requires: Ibl.Notifications/SMTP/action'
      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}/notification-preferences/:
    get:
      operationId: notification_v1_platforms_notification_preferences_retrieve
      description: 'Retrieve notification preferences for the authenticated user (or
        another user via ?username= for admins). Auto-creates preferences with defaults
        on first access. RBAC: Ibl.Notifications/Notification/read'
      summary: Get user notification preferences
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: tags
        schema:
          type: string
          minLength: 1
        description: Comma-separated tags to filter by (e.g. 'learning,activity').
          Returns types matching ANY tag.
      - in: query
        name: username
        schema:
          type: string
          minLength: 1
        description: Username to manage preferences for (admin only). Defaults to
          authenticated user.
      tags:
      - notifications
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserNotificationPreferences'
          description: ''
    patch:
      operationId: notification_v1_platforms_notification_preferences_partial_update
      description: 'Partially update global notification preferences. Per-type overrides
        use the /types/{notification_type}/ endpoint. RBAC: Ibl.Notifications/Notification/write'
      summary: Update user notification preferences
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: tags
        schema:
          type: string
          minLength: 1
        description: Comma-separated tags to filter by (e.g. 'learning,activity').
          Returns types matching ANY tag.
      - in: query
        name: username
        schema:
          type: string
          minLength: 1
        description: Username to manage preferences for (admin only). Defaults to
          authenticated user.
      tags:
      - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedUserNotificationPreferences'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedUserNotificationPreferences'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedUserNotificationPreferences'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedUserNotificationPreferences'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedUserNotificationPreferences'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserNotificationPreferences'
          description: ''
  /api/notification/v1/platforms/{platform_key}/notification-preferences/available-types/:
    get:
      operationId: notification_v1_platforms_notification_preferences_available_types_list
      description: 'Returns notification types enabled for this platform, annotated
        with the user''s per-type preferences. RBAC: Ibl.Notifications/Notification/read'
      summary: List available notification types
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: tags
        schema:
          type: string
          minLength: 1
        description: Comma-separated tags to filter by (e.g. 'learning,activity').
          Returns types matching ANY tag.
      - in: query
        name: username
        schema:
          type: string
          minLength: 1
        description: Username to manage preferences for (admin only). Defaults to
          authenticated user.
      tags:
      - notifications
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AvailableNotificationType'
          description: ''
  /api/notification/v1/platforms/{platform_key}/notification-preferences/types/{notification_type}/:
    patch:
      operationId: notification_v1_platforms_notification_preferences_types_partial_update
      description: 'Set enabled/frequency for a single notification type. RBAC: Ibl.Notifications/Notification/write'
      summary: Update per-type notification preference
      parameters:
      - in: path
        name: notification_type
        schema:
          type: string
        required: true
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: tags
        schema:
          type: string
          minLength: 1
        description: Comma-separated tags to filter by (e.g. 'learning,activity').
          Returns types matching ANY tag.
      - in: query
        name: username
        schema:
          type: string
          minLength: 1
        description: Username to manage preferences for (admin only). Defaults to
          authenticated user.
      tags:
      - notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedNotificationTypePreference'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/PatchedNotificationTypePreference'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedNotificationTypePreference'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedNotificationTypePreference'
          '*/*':
            schema:
              $ref: '#/components/schemas/PatchedNotificationTypePreference'
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationTypePreference'
          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. Filter by tags with ?tags=learning,activity
        (comma-separated, OR logic). Requires permission: Ibl.Notifications/NotificationTemplate/list'
      summary: List notification templates
      parameters:
      - in: query
        name: page
        schema:
          type: integer
          minimum: 1
        description: Page number. When provided, response is paginated ({count, next,
          previous, results}). When omitted, returns a flat list.
      - in: query
        name: page_size
        schema:
          type: integer
          maximum: 100
          minimum: 1
          default: 25
        description: Number of templates per page (default 25, max 100).
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      - in: query
        name: tags
        schema:
          type: string
          minLength: 1
        description: Comma-separated tags to filter by (e.g. 'learning,activity').
          Returns templates matching ANY of the given tags.
      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. Requires permission:
        Ibl.Notifications/NotificationTemplate/read'
      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. Requires permission: Ibl.Notifications/NotificationTemplate/write'
      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. Requires permission:
        Ibl.Notifications/NotificationTemplate/write'
      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. Requires
        permission: Ibl.Notifications/NotificationTemplate/action'
      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. Requires permission: Ibl.Notifications/NotificationTemplate/write'
      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/notification/v1/platforms/{platform_key}/templates/tags/:
    get:
      operationId: notification_v1_platforms_templates_tags_retrieve
      description: 'Get all unique tags used across notification templates for this
        platform. Useful for autocomplete / filter UIs. Requires permission: Ibl.Notifications/NotificationTemplate/list'
      summary: List distinct template tags
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - notifications
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
          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: |-
        DRF view mixin that routes all ORM reads to the read replica.

        Falls back to the primary database if the replica is unreachable.

        Add as the **first** base class on read-only views/viewsets::

            class MyView(ReadReplicaViewMixin, IsPlatformAdminDRFMixin, APIView):
                ...
      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: |-
        DRF view mixin that routes all ORM reads to the read replica.

        Falls back to the primary database if the replica is unreachable.

        Add as the **first** base class on read-only views/viewsets::

            class MyView(ReadReplicaViewMixin, IsPlatformAdminDRFMixin, APIView):
                ...
      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:
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponse'
          description: ''
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssociateAccountResponse'
          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:
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponse'
          description: ''
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseResponse'
          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/provision/{config_name}/:
    post:
      operationId: provision_create
      description: |-
        POST
        Update platform provisioning config

        request body:
        {"config_name": "demo_config}
      parameters:
      - in: path
        name: config_name
        schema:
          type: string
        required: true
      tags:
      - commerce
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /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/platforms/{key}/:
    get:
      operationId: reports_platforms_retrieve
      description: Return the reports available on the platform along with the latest
        status for each report previously requested by the caller. When ``mentor_id``
        is supplied, access validation is scoped to that mentor.
      summary: List available reports
      parameters:
      - in: path
        name: key
        schema:
          type: string
        required: true
      - in: query
        name: mentor_id
        schema:
          type: integer
          minimum: 1
        description: Mentor primary key. When provided, access validation is scoped
          to that mentor.
      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.

        Required RBAC Permissions:
            1. CanViewAnalytics (kill switch):
               - Action: "Ibl.Analytics/CanViewAnalytics/action"
               - Resource: /platforms/{platform_pk}/

            2. Reports access to at least one user or usergroup:
               - Action: "Ibl.Analytics/Reports/read"
               - Resource: /platforms/{platform_pk}/users/{user_pk}/ OR
                           /platforms/{platform_pk}/usergroups/{group_pk}/
               - Note: User must have access to at least one user or usergroup resource
                 with Reports/read permission. Unrestricted access to all users
                 (/platforms/{platform_pk}/users/) also satisfies this requirement.
      parameters:
      - in: path
        name: key
        schema:
          type: string
        required: true
      - in: query
        name: mentor_unique_id
        schema:
          type: string
          format: uuid
        description: Mentor unique ID for mentor-specific reports (e.g., ai-mentor-chat-history).
          When provided, ownership is validated - mentor owners can access without
          explicit RBAC permissions.
      - 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}/{task_id}/download:
    get:
      operationId: reports_platforms_download_retrieve
      description: Download a completed report as CSV or JSON. Use the columns parameter
        to control column order.
      summary: Download report
      parameters:
      - in: query
        name: bom
        schema:
          type: boolean
        description: CSV only. When true, prepend a UTF-8 byte-order mark so Excel
          on Windows detects UTF-8 on double-click. Applies to UTF-8 output only.
          Omit to use the platform default.
      - in: query
        name: charset
        schema:
          type: string
        description: CSV only. Character encoding for the download (e.g. utf-8, latin-1,
          cp1252). Defaults to the platform setting (UTF-8). UTF-8 is lossless; other
          codecs replace unrepresentable characters with XML entities.
      - in: query
        name: columns
        schema:
          type: string
        description: Comma-separated column names to control output order. Must be
          a subset of the report's allowed_result_fields. Omit to use the report's
          default order.
      - in: query
        name: format
        schema:
          type: string
          enum:
          - csv
          - json
          default: csv
        description: Download format
      - in: path
        name: key
        schema:
          type: string
        required: true
      - in: path
        name: task_id
        schema:
          type: string
        required: true
      tags:
      - reports
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          description: No response body
  /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
        - mentor: (optional) Mentor unique_id for mentor-specific reports (e.g., ai-mentor-chat-history)
        - usergroup_ids: (optional) List of usergroup IDs to filter report data

        Required RBAC Permissions:
            1. CanViewAnalytics (kill switch):
               - Action: "Ibl.Analytics/CanViewAnalytics/action"
               - Resource: /platforms/{platform_pk}/

            2. Reports access to at least one user or usergroup:
               - Action: "Ibl.Analytics/Reports/read"
               - Resource: /platforms/{platform_pk}/users/{user_pk}/ OR
                           /platforms/{platform_pk}/usergroups/{group_pk}/
               - Note: User must have access to at least one user or usergroup resource
                 with Reports/read permission. Unrestricted access to all users
                 (/platforms/{platform_pk}/users/) also satisfies this requirement.

            3. For mentor-specific reports (e.g., ai-mentor-chat-history):
               - Action: "Ibl.Analytics/Reports/read"
               - Resource: /platforms/{platform_pk}/mentors/{mentor_id}/
               - Note: User must have access to at least one mentor via RBAC OR own at least
                 one mentor (created_by == username). If a specific mentor_unique_id is
                 provided, user must have access to that specific mentor.
               - Raises PermissionDenied if user has no access to any mentors.
      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/agents/:
    get:
      operationId: search_agents_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/agents/{mentor_unique_id}/documents/:
    get:
      operationId: search_agents_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/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: |-
        **Deprecated — use `/api/search/agents/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/search/agents/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/search/mentors/{mentor_unique_id}/documents/:
    get:
      operationId: search_mentors_documents_retrieve
      description: |-
        **Deprecated — use `/api/search/agents/{mentor_unique_id}/documents/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/search/agents/{mentor_unique_id}/documents/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /api/search/orgs/{org}/users/{username}/agents/:
    get:
      operationId: search_orgs_users_agents_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}/mentors/:
    get:
      operationId: search_orgs_users_mentors_retrieve
      description: |-
        **Deprecated — use `/api/search/orgs/{org}/users/{username}/agents/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/search/orgs/{org}/users/{username}/agents/` (`mentor` → `agent`) and will be removed in a future release.

        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
      deprecated: true
  /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/connect/:
    delete:
      operationId: service_platforms_stripe_connect_destroy
      description: Disconnect Stripe Connect account
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - commerce
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          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/service/platforms/{platform_key}/stripe/connect/dashboard/:
    get:
      operationId: service_platforms_stripe_connect_dashboard_retrieve
      description: Get Express Dashboard login link
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - commerce
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripeConnectDashboardLink'
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: Unspecified response body
          description: ''
  /api/service/platforms/{platform_key}/stripe/connect/onboard/:
    post:
      operationId: service_platforms_stripe_connect_onboard_create
      description: Start Stripe Connect onboarding for platform admin
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - commerce
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripeConnectOnboard'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/StripeConnectOnboard'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StripeConnectOnboard'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StripeConnectOnboard'
          '*/*':
            schema:
              $ref: '#/components/schemas/StripeConnectOnboard'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripeConnectOnboardResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: Unspecified response body
          description: ''
  /api/service/platforms/{platform_key}/stripe/connect/onboard/refresh/:
    post:
      operationId: service_platforms_stripe_connect_onboard_refresh_create
      description: Start Stripe Connect onboarding for platform admin
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - commerce
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripeConnectOnboard'
          application/scim+json:
            schema:
              $ref: '#/components/schemas/StripeConnectOnboard'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StripeConnectOnboard'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StripeConnectOnboard'
          '*/*':
            schema:
              $ref: '#/components/schemas/StripeConnectOnboard'
        required: true
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripeConnectOnboardResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
                description: Unspecified response body
          description: ''
  /api/service/platforms/{platform_key}/stripe/connect/status/:
    get:
      operationId: service_platforms_stripe_connect_status_retrieve
      description: Get Connect account status
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - commerce
      security:
      - PlatformApiKeyAuthentication: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripeConnectStatus'
          description: ''
  /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: |-
        Unified callback after successful Stripe checkout.

        Handles both subscription (pricing page) and credit-topup (payment mode)
        checkouts. The checkout type is determined from the Stripe session automatically.

        URL Parameters:
            - checkout_session_id: The Stripe Checkout Session ID (optional in URL,
              can also be passed as ?stripe_checkout_id query param)

        Response:
            - Redirect: Successfully validated and sending to next page
            - 404: Checkout session not found
            - 400: Invalid checkout session or product
      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: |-
        Unified callback after successful Stripe checkout.

        Handles both subscription (pricing page) and credit-topup (payment mode)
        checkouts. The checkout type is determined from the Stripe session automatically.

        URL Parameters:
            - checkout_session_id: The Stripe Checkout Session ID (optional in URL,
              can also be passed as ?stripe_checkout_id query param)

        Response:
            - Redirect: Successfully validated and sending to next page
            - 404: Checkout session not found
            - 400: Invalid checkout session or product
      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: |-
        Unified callback after successful Stripe checkout.

        Handles both subscription (pricing page) and credit-topup (payment mode)
        checkouts. The checkout type is determined from the Stripe session automatically.

        URL Parameters:
            - checkout_session_id: The Stripe Checkout Session ID (optional in URL,
              can also be passed as ?stripe_checkout_id query param)

        Response:
            - Redirect: Successfully validated and sending to next page
            - 404: Checkout session not found
            - 400: Invalid checkout session or product
      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 track user-initiated pricing page checkouts.

        Works for both authenticated and unauthenticated (guest) users.
        Accepts optional `redirect_url` and `source_platform_key` query params.
      parameters:
      - in: path
        name: platform_key
        schema:
          type: string
        required: true
      tags:
      - commerce
      security:
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StripePricingPageSessionResponse'
          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/checkout/redirect/{sku}/:
    get:
      operationId: service_stripe_checkout_redirect_retrieve
      description: |-
        Public GET endpoint that creates a Stripe checkout session and redirects to Stripe.
        After checkout, routes through pricing-page-callback for tenant provisioning.

        URL: /api/service/stripe/checkout/redirect/<sku>/
        Query params:
          - redirect_url (optional): Final destination after successful checkout + provisioning.
                When omitted, the pricing-page-callback uses its default redirect.
          - cancel_url (optional): Where to redirect if checkout is cancelled.
                Defaults to the mentor AI portal.
      parameters:
      - in: path
        name: sku
        schema:
          type: string
        required: true
      tags:
      - commerce
      responses:
        '200':
          description: No response body
  /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 a tenant with a given key, org, or name exists.

        At least one non-empty filter parameter (key, org, or name) is required.
      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. When the user is not
            linked to the platform or has no reported skills, an empty
            ``{"skills": []}`` payload is returned with a 200 status so callers
            can distinguish "no data" from a request error.

        Error Responses:
            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
          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 (ignoring email
            if present). If false (default), return only mentors owned by the user's
            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
          nullable: true
          description: The user ID that mentors belong to when all_mentors is False
      required:
      - mentors
      - user_id
    AccessibleUser:
      type: object
      description: |-
        A user the caller can see, serialized from their UserPlatformLink.

        The entity is the user — `id` is the user's id; the link's own id is a
        storage artifact and isn't surfaced.
      properties:
        id:
          type: integer
          readOnly: true
        username:
          type: string
          readOnly: true
        email:
          type: string
          format: email
          readOnly: true
        name:
          type: string
          readOnly: true
      required:
      - email
      - id
      - name
      - username
    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
    Activity:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
          description: Server-assigned id.
        platform:
          type: integer
          readOnly: true
          description: Platform this Activity belongs to. Set automatically from your
            credentials; you cannot pass another Platform's id.
        title:
          type: string
          description: Short summary (e.g. 'Discovery call', 'Stage changed').
          maxLength: 255
        type:
          allOf:
          - $ref: '#/components/schemas/ActivityTypeEnum'
          description: |-
            Interaction kind. One of `call`, `meeting`, `email`, `note`, `task`, `lunch`, `deadline`.

            * `call` - Call
            * `meeting` - Meeting
            * `email` - Email
            * `note` - Note
            * `task` - Task
            * `lunch` - Lunch
            * `deadline` - Deadline
        location:
          type: string
          default: ''
          description: Meeting location / call dial-in / venue.
          maxLength: 255
        comment:
          type: string
          default: ''
          description: Free-text notes.
        schedule_from:
          type: string
          format: date-time
          nullable: true
          description: Scheduled start. Leave null for instant log entries.
        schedule_to:
          type: string
          format: date-time
          nullable: true
          description: Scheduled end.
        is_done:
          type: boolean
          default: false
          description: Mark the Activity complete. Use `POST /activities/{id}/done/`
            to flip this and automatically stamp `done_at`.
        done_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: Read-only. Set automatically the first time `is_done` flips
            True.
        deal:
          type: integer
          nullable: true
          description: Id of the Deal this Activity is logged against. Either `deal`
            or `person` is required.
        person:
          type: string
          format: uuid
          description: UUID of the Person this Activity is logged against. Either
            `deal` or `person` is required.
          nullable: true
        owner:
          type: integer
          description: Id of the user who scheduled / logged this Activity. Defaults
            to the calling user on create.
          nullable: true
        reminder_at:
          type: string
          format: date-time
          nullable: true
          description: When to remind the owner.
        reminder_sent:
          type: boolean
          readOnly: true
          description: Marks that a reminder has been sent for this Activity; prevents
            the same reminder from firing twice.
        metadata:
          description: Free-form JSON for Platform-defined attributes.
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Creation timestamp.
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Last-modified timestamp.
      required:
      - created_at
      - done_at
      - id
      - platform
      - reminder_sent
      - title
      - type
      - updated_at
    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
    ActivityTypeEnum:
      enum:
      - call
      - meeting
      - email
      - note
      - task
      - lunch
      - deadline
      type: string
      description: |-
        * `call` - Call
        * `meeting` - Meeting
        * `email` - Email
        * `note` - Note
        * `task` - Task
        * `lunch` - Lunch
        * `deadline` - Deadline
    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
    AdminIntegrationCredential:
      type: object
      description: |-
        For admins - returns .masked_value (all fields, sensitive ones masked).
        Admins see that credentials are configured without seeing actual secrets.

        Inherits from StudentIntegrationCredentialSerializer, only overrides get_value.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        value:
          type: string
          readOnly: true
        platform:
          type: string
          description: The platform key
          readOnly: true
        service_info:
          allOf:
          - $ref: '#/components/schemas/ExternalServiceInfo'
          readOnly: true
      required:
      - id
      - name
      - platform
      - service_info
      - value
    AgentSkill:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        unique_id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 255
        slug:
          type: string
          maxLength: 255
          pattern: ^[-a-zA-Z0-9_]+$
        description:
          type: string
        version:
          type: string
          maxLength: 50
        skill_type:
          $ref: '#/components/schemas/SkillTypeEnum'
        category:
          type: string
          description: 'Grouping for the catalog UI: web, code, browser, data, etc.'
          maxLength: 50
        source:
          type: string
          description: Provenance for seeded/imported skills (e.g. iblai-claw-agents/higher-education/skills/canvas).
          maxLength: 255
        is_featured:
          type: boolean
          description: Featured skills on the 'main' platform are visible to all tenants.
        mentor:
          type: string
          format: uuid
          nullable: true
        instruction:
          type: string
          description: SKILL.md body — the agent runbook for this skill.
        metadata:
          description: SKILL.md frontmatter (requires, primaryEnv, emoji, etc.).
        enabled:
          type: boolean
        platform_key:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - created_at
      - id
      - name
      - platform_key
      - slug
      - unique_id
      - updated_at
    AgentSkillResource:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        skill:
          type: integer
        file_type:
          $ref: '#/components/schemas/FileTypeEnum'
        filename:
          type: string
          maxLength: 255
        content:
          type: string
          description: Text content for script/reference resources.
        file:
          type: string
          format: uri
          nullable: true
          description: Binary file for asset resources.
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - created_at
      - file_type
      - filename
      - id
      - skill
      - updated_at
    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: Text content of the artifact; empty for binary artifacts
          readOnly: true
        binary_content:
          type: string
          readOnly: true
          description: Base64-encoded bytes of a binary artifact (pdf, xlsx, ...);
            null for text artifacts. The client chooses the rendering from `file_extension`/`mime_type`.
        is_binary:
          type: boolean
          readOnly: true
          description: True when the artifact carries `binary_content` instead of
            `content`
        mime_type:
          type: string
          readOnly: true
          description: MIME type of a binary artifact, e.g. application/pdf.
        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
        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
          nullable: true
          readOnly: true
        current_version_number:
          type: integer
          description: Version number of the current version
          readOnly: true
        version_count:
          type: integer
          description: Total number of versions for this artifact
          readOnly: true
      required:
      - binary_content
      - content
      - current_version_number
      - date_created
      - date_updated
      - file_extension
      - id
      - is_binary
      - llm_name
      - llm_provider
      - mime_type
      - session_id
      - title
      - username
      - version_count
    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
        is_binary:
          type: boolean
          readOnly: true
          description: True when the artifact carries `binary_content` instead of
            `content`
        mime_type:
          type: string
          readOnly: true
          description: MIME type of a binary artifact, e.g. application/pdf.
        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
          nullable: true
          readOnly: true
        content_length:
          type: integer
          description: Length of the artifact content in characters (bytes for binary
            artifacts)
          readOnly: true
      required:
      - content_length
      - date_created
      - date_updated
      - file_extension
      - id
      - is_binary
      - llm_name
      - llm_provider
      - mime_type
      - session_id
      - title
      - username
    ArtifactVersion:
      type: object
      description: |-
        Serializer for ArtifactVersion model.

        Represents a single version of an artifact with its content and metadata.
      properties:
        id:
          type: integer
          readOnly: true
        artifact:
          $ref: '#/components/schemas/VersionNestedArtifact'
        title:
          type: string
          description: Get the title of the artifact version.
          readOnly: true
        content:
          type: string
          description: The markdown-styled content of this artifact version
        binary_content:
          type: string
          readOnly: true
          description: Base64-encoded bytes when the artifact is binary and this is
            the current version; null otherwise (binary artifacts keep one stored
            payload — fetch the artifact for the bytes).
        session_id:
          type: string
          format: uuid
          description: UUID of the session that generated this artifact version
          readOnly: true
        content_length:
          type: integer
          description: Length of the version content in characters
          readOnly: true
        is_current:
          type: boolean
          readOnly: true
          description: Whether this version is the current/active version
        chat_message:
          type: integer
          readOnly: true
          nullable: true
        version_number:
          type: integer
          readOnly: true
          default: 1
          description: Sequential version number for display purposes
        date_created:
          type: string
          format: date-time
          readOnly: true
          description: When this version was created
        created_by:
          type: string
          description: Identifier for who created this version (e.g., 'llm', 'user:username')
          maxLength: 100
        change_summary:
          type: string
          description: Optional summary of what changed in this version
          maxLength: 500
        interface:
          allOf:
          - $ref: '#/components/schemas/InterfaceEnum'
          readOnly: true
          description: |-
            How this version was created

            * `chat` - Chat
            * `api` - Api
      required:
      - artifact
      - binary_content
      - chat_message
      - content
      - content_length
      - date_created
      - id
      - interface
      - is_current
      - session_id
      - title
      - version_number
    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
    AuditLogEntry:
      type: object
      description: |-
        Read-only representation of a ``DMAuditLogEntry``.

        Handles both model and manual entries; fields that don't apply to a given
        entry come back null (e.g. ``resource_type`` for a login event, ``event_type``
        for a model change).
      properties:
        id:
          type: integer
          description: Audit log entry ID
        timestamp:
          type: string
          format: date-time
          description: When the action occurred
        event_type:
          type: string
          nullable: true
          description: Manual event category; null for model (CRUD) changes.
        action:
          type: string
          description: create, update, delete, or access
        actor_username:
          type: string
          nullable: true
          description: Username of the actor, if any
        actor_email:
          type: string
          nullable: true
          description: Email of the actor, if any
        resource_type:
          type: string
          nullable: true
          description: Model of the affected resource (CRUD entries).
        resource_id:
          type: string
          nullable: true
          description: PK of the affected resource.
        resource_repr:
          type: string
          nullable: true
          description: Human-readable label for the entry.
        changes:
          type: object
          additionalProperties: {}
          nullable: true
          description: Field-level changes (CRUD entries).
        metadata:
          type: object
          additionalProperties: {}
          nullable: true
          description: Event payload (manual events).
        remote_addr:
          type: string
          nullable: true
          description: Client IP, when captured.
      required:
      - action
      - actor_email
      - actor_username
      - changes
      - event_type
      - id
      - metadata
      - remote_addr
      - resource_id
      - resource_repr
      - resource_type
      - timestamp
    AuthModeEnum:
      enum:
      - bearer_token
      - header
      - query_param
      - none
      type: string
      description: |-
        * `bearer_token` - Bearer token
        * `header` - Header
        * `query_param` - Query param
        * `none` - None
    AuthScopeEnum:
      enum:
      - platform
      - mentor
      - user
      type: string
      description: |-
        * `platform` - Platform
        * `mentor` - Mentor
        * `user` - User
    AuthToken:
      type: object
      properties:
        token:
          type: string
          description: Token
        expires:
          type: string
          format: date-time
          description: Token Expiration Date
      required:
      - expires
      - token
    AuthTypeEnum:
      enum:
      - none
      - token
      - oauth2
      type: string
      description: |-
        * `none` - None
        * `token` - Token
        * `oauth2` - Oauth2
    AutoRechargeTriggerRequest:
      type: object
      description: Request schema for POST auto-recharge/trigger/.
      properties:
        platform_key:
          type: string
          description: The unique key of the platform. Defaults to 'main'.
        amount_usd:
          type: string
          format: decimal
          pattern: ^-?\d{0,11}(?:\.\d{0,3})?$
          description: 'Optional. When set, perform manual top-up: charge this amount
            (user USD) and add credits. No threshold, spending limit, or cooldown.
            Omit to run normal auto-recharge once.'
    AutoRechargeTriggerResponse:
      type: object
      description: Response schema for POST auto-recharge/trigger/ (200).
      properties:
        status:
          allOf:
          - $ref: '#/components/schemas/AutoRechargeTriggerResponseStatusEnum'
          description: |-
            'triggered' if a charge was attempted, 'skipped' otherwise.

            * `triggered` - triggered
            * `skipped` - skipped
      required:
      - status
    AutoRechargeTriggerResponseStatusEnum:
      enum:
      - triggered
      - skipped
      type: string
      description: |-
        * `triggered` - triggered
        * `skipped` - skipped
    AvailableNotificationType:
      type: object
      description: Serializer for available notification types with user preferences.
      properties:
        type:
          type: string
          description: Notification type identifier
        name:
          type: string
          description: Human-readable name
        description:
          type: string
          description: Description of the notification type
        tags:
          type: array
          items:
            type: string
          description: Tags from the notification template
        is_enabled:
          type: boolean
          description: Whether this type is enabled for the platform
        user_preference:
          type: object
          additionalProperties: {}
          description: User's per-type preference (enabled, frequency)
      required:
      - description
      - is_enabled
      - name
      - type
    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
      - platform_key
    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
    BusinessTypeEnum:
      enum:
      - individual
      - company
      type: string
      description: |-
        * `individual` - individual
        * `company` - company
    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'
        language:
          type: string
          description: Language code for TTS, STT, and LLM (e.g., 'en', 'en-US', 'es',
            'fr'). Defaults to 'en' (English).
          maxLength: 10
        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)
        screensharing_system_prompt:
          type: string
          description: System prompt to use for screensharing guidance. Defaults to
            VIDEO_GUIDANCE_PROMPT from constants.
        screensharing_proactive_prompt:
          type: string
          description: Proactive prompt used during screensharing calls to guide the
            conversation.
        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
          description: ID of the campaign to enable
        campaign_title:
          type: string
          description: Title of the campaign to enable
        email:
          type: string
          format: email
          description: Email address to enable for the campaign
    CampaignExclusion:
      type: object
      description: Serializer for campaign exclusion requests.
      properties:
        campaign_id:
          type: integer
          description: ID of the campaign to exclude from
        campaign_title:
          type: string
          description: Title of the campaign to exclude from
        email:
          type: string
          format: email
          description: Email address to exclude from the campaign
    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
    ChatCompletionRequest:
      type: object
      description: |-
        Validate the subset of the OpenAI chat completions body we support.

        Unknown fields are ignored (forward-compatible with newer OpenAI clients).
        Sampling parameters are forwarded to the provider as-is; if a provider does
        not support one, the resulting provider error is surfaced to the caller.
      properties:
        model:
          type: string
        messages:
          type: array
          items: {}
        stream:
          type: boolean
          default: false
        stream_options: {}
        temperature:
          type: number
          format: double
          maximum: 2
          minimum: 0
        top_p:
          type: number
          format: double
          maximum: 1
          minimum: 0
        max_tokens:
          type: integer
          minimum: 1
        max_completion_tokens:
          type: integer
          minimum: 1
        n:
          type: integer
          minimum: 1
        presence_penalty:
          type: number
          format: double
          maximum: 2
          minimum: -2
        frequency_penalty:
          type: number
          format: double
          maximum: 2
          minimum: -2
        seed:
          type: integer
        stop: {}
        user:
          type: string
        tools: {}
        tool_choice: {}
        parallel_tool_calls:
          type: boolean
        response_format: {}
      required:
      - messages
      - model
    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
        generation_id:
          type: string
          readOnly: true
          nullable: true
        conversation_id:
          type: string
          format: uuid
          nullable: true
          readOnly: true
        files:
          readOnly: true
        artifact_versions:
          type: array
          items:
            $ref: '#/components/schemas/ArtifactVersion'
        is_human:
          type: boolean
          readOnly: true
          description: True if this is a human message
        is_ai:
          type: boolean
          readOnly: true
          description: True if this is an AI message
      required:
      - artifact_versions
      - conversation_id
      - feedback
      - files
      - generation_id
      - id
      - inserted_at
      - is_ai
      - is_human
      - 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
        client_context:
          nullable: true
      required:
      - content
      - timestamp
      - type
    ChatHistorySessionId:
      type: object
      properties:
        id:
          type: string
      required:
      - id
    ChatPrivacyModeEnum:
      enum:
      - normal
      - anonymized
      - disabled
      type: string
      description: |-
        * `normal` - Normal
        * `anonymized` - Anonymized
        * `disabled` - Disabled
    ChatRunTracker:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        session_id:
          type: string
          format: uuid
          readOnly: true
        mentor_unique_id:
          type: string
          format: uuid
          readOnly: true
        username:
          type: string
          readOnly: true
        email:
          type: string
          format: email
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        generation_id:
          type: string
          readOnly: true
        modality:
          allOf:
          - $ref: '#/components/schemas/ModalityEnum'
          readOnly: true
        status:
          allOf:
          - $ref: '#/components/schemas/ChatRunTrackerStatusEnum'
          readOnly: true
        error_message:
          type: string
          readOnly: true
        failure_category:
          allOf:
          - $ref: '#/components/schemas/FailureCategoryEnum'
          readOnly: true
        llm_provider:
          type: string
          readOnly: true
        llm_model:
          type: string
          readOnly: true
        used_fallback:
          type: boolean
          readOnly: true
        fallback_provider:
          type: string
          readOnly: true
        fallback_model:
          type: string
          readOnly: true
        timing_total:
          type: number
          format: double
          readOnly: true
          nullable: true
        timing_setup:
          type: number
          format: double
          readOnly: true
          nullable: true
        timing_moderation_check:
          type: number
          format: double
          readOnly: true
          nullable: true
        timing_privacy_input_filter:
          type: number
          format: double
          readOnly: true
          nullable: true
        timing_llm_call:
          type: number
          format: double
          readOnly: true
          nullable: true
        timing_fallback_rebuild:
          type: number
          format: double
          readOnly: true
          nullable: true
        timing_llm_call_fallback:
          type: number
          format: double
          readOnly: true
          nullable: true
        timing_post_processing:
          type: number
          format: double
          readOnly: true
          nullable: true
        timing_safety_check:
          type: number
          format: double
          readOnly: true
          nullable: true
        timing_privacy_output_filter:
          type: number
          format: double
          readOnly: true
          nullable: true
        metadata:
          readOnly: true
        started_at:
          type: string
          format: date-time
          readOnly: true
        completed_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
      required:
      - completed_at
      - email
      - error_message
      - failure_category
      - fallback_model
      - fallback_provider
      - generation_id
      - id
      - llm_model
      - llm_provider
      - mentor_unique_id
      - metadata
      - modality
      - platform_key
      - session_id
      - started_at
      - status
      - timing_fallback_rebuild
      - timing_llm_call
      - timing_llm_call_fallback
      - timing_moderation_check
      - timing_post_processing
      - timing_privacy_input_filter
      - timing_privacy_output_filter
      - timing_safety_check
      - timing_setup
      - timing_total
      - used_fallback
      - username
    ChatRunTrackerStatusEnum:
      enum:
      - started
      - completed
      - failed
      type: string
      description: |-
        * `started` - Started
        * `completed` - Completed
        * `failed` - Failed
    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
        disable_chathistory:
          type: boolean
          default: false
          description: Per-session privacy override. When true, no ChatMessageHistory
            rows are written for this conversation and the session is not linked to
            the user. Honored only when the tenant has ALLOW_USER_CHAT_PRIVACY_CONTROL
            enabled and the mentor has not set disable_chathistory.
      required:
      - mentor
    ChatSessionResponse:
      type: object
      properties:
        session_id:
          type: string
          format: uuid
        tools:
          type: array
          items:
            $ref: '#/components/schemas/ToolResponse'
        enable_artifacts:
          type: boolean
        artifacts:
          type: array
          items:
            $ref: '#/components/schemas/NestedArtifact'
      required:
      - artifacts
      - 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
    CheckoutSessionCreate:
      type: object
      properties:
        price_id:
          type: string
          format: uuid
        success_url:
          type: string
          format: uri
          nullable: true
        cancel_url:
          type: string
          format: uri
          nullable: true
        email:
          type: string
          format: email
          nullable: true
    CheckoutSessionResponse:
      type: object
      description: Response returned after creating a Stripe checkout session.
      properties:
        checkout_url:
          type: string
          format: uri
          description: Stripe-hosted checkout page URL.
        session_id:
          type: string
          description: Stripe checkout session ID.
        platform_key:
          type: string
          description: Platform key for this checkout.
      required:
      - checkout_url
      - platform_key
      - session_id
    ClawConfigGetResponse:
      type: object
      description: |-
        Documents the ``config.get`` payload shape.

        Secrets in ``config`` / ``parsed`` are replaced with the literal
        ``"__OPENCLAW_REDACTED__"`` sentinel.
      properties:
        path:
          type: string
        exists:
          type: boolean
        raw:
          type: string
          nullable: true
        parsed:
          type: object
          additionalProperties: {}
        valid:
          type: boolean
        config:
          type: object
          additionalProperties: {}
        hash:
          type: string
        uiHints:
          type: object
          additionalProperties: {}
        issues:
          type: array
          items: {}
        warnings:
          type: array
          items: {}
        legacyIssues:
          type: array
          items: {}
      required:
      - config
      - exists
      - hash
      - path
    ClawInstance:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        claw_type:
          $ref: '#/components/schemas/ClawTypeEnum'
        provision_mode:
          allOf:
          - $ref: '#/components/schemas/ProvisionModeEnum'
          readOnly: true
          description: |-
            Managed = provisioned by us. Self-hosted = tenant provides the server.

            * `managed` - Managed
            * `self_hosted` - Self-hosted
        server_url:
          type: string
          format: uri
          description: HTTPS URL of the Claw worker instance.
          maxLength: 200
        gateway_token:
          type: string
          writeOnly: true
        deployment_backend:
          type: integer
          nullable: true
          description: Backend that deployed this server. Null = manually configured.
        auth_headers:
          writeOnly: true
          description: Per-server auth headers (overrides backend defaults).
        connection_params:
          writeOnly: true
          description: 'Variant-specific connection parameters (write-only in API).
            OpenClaw: device_identity.private_key_pem, timeouts. IronClaw: typically
            empty (bearer token covered by gateway_token).'
        status:
          allOf:
          - $ref: '#/components/schemas/ClawInstanceStatusEnum'
          readOnly: true
        deploy_state:
          allOf:
          - $ref: '#/components/schemas/DeployStateEnum'
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        last_health_check:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        last_health_status:
          type: string
          readOnly: true
          nullable: true
        claw_version:
          type: string
          readOnly: true
          nullable: true
        last_pairing:
          type: object
          additionalProperties: {}
          nullable: true
          description: |-
            The most recent device-pairing result (request id + fingerprint, or status), as written
            by ``request_claw_pairing_task``. Read-only; transient (pairing requests expire ~5 min).
          readOnly: true
        last_upgrade:
          type: object
          additionalProperties: {}
          nullable: true
          description: |-
            The most recent worker-upgrade outcome (by/target/before/after/reason/at), as written
            by ``upgrade_claw_to_target_task``. Read-only.
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - claw_version
      - created_at
      - deploy_state
      - gateway_token
      - id
      - last_health_check
      - last_health_status
      - last_pairing
      - last_upgrade
      - name
      - platform_key
      - provision_mode
      - server_url
      - status
      - updated_at
    ClawInstanceStatusEnum:
      enum:
      - active
      - inactive
      - error
      type: string
      description: |-
        * `active` - Active
        * `inactive` - Inactive
        * `error` - Error
    ClawMentorConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        mentor:
          type: string
          format: uuid
          readOnly: true
        mentor_name:
          type: string
          readOnly: true
        mentor_slug:
          type: string
          readOnly: true
        server:
          type: integer
        server_name:
          type: string
          readOnly: true
        server_status:
          type: string
          readOnly: true
        server_last_health_status:
          type: string
          readOnly: true
          nullable: true
        server_last_health_check:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        agent_config: {}
        agent_id:
          type: string
          readOnly: true
          description: Worker-side agent id. System-minted from the mentor's unique_id
            on creation, immutable and read-only. Legacy configs may carry a hand-entered
            value such as 'main'.
        enabled:
          type: boolean
        auto_push:
          type: boolean
          description: When True, saving the mentor's AgentConfig triggers an async
            config push to the worker.
        last_config_push:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        last_config_push_status:
          type: string
          readOnly: true
          nullable: true
        last_push_warnings:
          readOnly: true
          description: Warnings from the last config push (baseline verification and
            per-agent skill upload).
      required:
      - agent_id
      - id
      - last_config_push
      - last_config_push_status
      - last_push_warnings
      - mentor
      - mentor_name
      - mentor_slug
      - server
      - server_last_health_check
      - server_last_health_status
      - server_name
      - server_status
    ClawModelProvider:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        server:
          type: integer
        server_name:
          type: string
          readOnly: true
        name:
          type: string
          description: Provider identifier in the Claw config (e.g. 'minimax')
          maxLength: 100
        base_url:
          type: string
          format: uri
          description: Provider API endpoint (e.g. https://api.minimax.io/anthropic)
          maxLength: 200
        api_type:
          type: string
          description: Claw provider API type (e.g. 'openai-completions', 'anthropic-messages').
          maxLength: 50
        credential_name:
          type: string
          description: Name of the LLMCredential to resolve the API key from
          maxLength: 255
        credential_key:
          type: string
          description: Key within the LLMCredential value JSON to extract the API
            key
          maxLength: 100
        model_catalog:
          description: 'List of {"id": "...", "name": "..."} entries for the provider
            model catalog'
        enabled:
          type: boolean
        models_mode:
          type: string
          description: '''merge'' adds to built-in models, ''replace'' uses only configured
            providers.'
          maxLength: 20
        last_provider_push:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        last_provider_push_status:
          type: string
          readOnly: true
          nullable: true
        credential_resolved:
          type: boolean
          description: Check if the referenced LLMCredential exists for this platform.
          readOnly: true
      required:
      - api_type
      - base_url
      - credential_name
      - credential_resolved
      - id
      - last_provider_push
      - last_provider_push_status
      - name
      - server
      - server_name
    ClawRpcError:
      type: object
      description: Error envelope returned when the RPC raises.
      properties:
        error:
          type: string
        detail:
          type: string
      required:
      - error
    ClawTypeEnum:
      enum:
      - openclaw
      - ironclaw
      - nemoclaw
      type: string
      description: |-
        * `openclaw` - Openclaw
        * `ironclaw` - Ironclaw
        * `nemoclaw` - Nemoclaw
    Company:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        user:
          type: integer
          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
    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
      required:
      - key
      - value
    ConnectedService:
      type: object
      description: |-
        Serializer for representing connected OAuth services.

        Includes both the legacy `service` / `scope` string values and structured
        representations so that consumers can reason about individual scope names.
      properties:
        id:
          type: integer
          readOnly: true
        provider:
          type: string
          maxLength: 128
        service:
          type: string
          maxLength: 255
        expires_at:
          type: string
          format: date-time
          nullable: true
        scope:
          type: string
        scope_names:
          type: array
          items:
            type: string
          description: Return the canonical list of scope identifiers for the connection.
          readOnly: true
        scopes:
          type: array
          items:
            type: string
          description: Return the OAuth scope strings associated with the connection.
          readOnly: true
        token_type:
          type: string
          maxLength: 32
        service_info:
          allOf:
          - $ref: '#/components/schemas/ExternalServiceInfo'
          readOnly: true
        username:
          type: array
          items:
            type: string
          description: Return the username strings associated with the connection.
          readOnly: true
      required:
      - id
      - provider
      - scope_names
      - scopes
      - service_info
      - username
    ConsumerChannel:
      type: object
      description: Serializer for delivery channel
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          title: Channel name
          description: Channel name (e.g. email, push_notification)
          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:
          type: integer
          nullable: true
        session:
          type: string
          format: uuid
        user:
          type: integer
          nullable: true
        username:
          type: string
          nullable: true
        name:
          type: string
          readOnly: true
        first_user_message:
          type: string
          nullable: true
        topics:
          type: string
          readOnly: true
        message_count:
          type: integer
        user_queries:
          type: integer
        assistant_responses:
          type: integer
        average_sentiment:
          type: number
          format: double
          nullable: true
        sentiment:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
        mentor:
          type: string
          nullable: true
        platform_name:
          type: string
          nullable: true
        platform_key:
          type: string
          nullable: true
        mentor_unique_id:
          type: string
          nullable: true
        model:
          type: string
          nullable: true
        cost:
          type: string
          readOnly: true
      required:
      - assistant_responses
      - average_sentiment
      - cost
      - created_at
      - first_user_message
      - mentor
      - mentor_unique_id
      - message_count
      - model
      - name
      - platform
      - platform_key
      - platform_name
      - sentiment
      - session
      - topics
      - user
      - user_queries
      - username
    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
        is_shared:
          type: boolean
        is_authenticated:
          type: boolean
          description: False if session was created by an anonymous user
        disable_chathistory:
          type: boolean
          description: Per-session override that skips writing ChatMessageHistory
            rows for this conversation. Honored only when the tenant has ALLOW_USER_CHAT_PRIVACY_CONTROL
            enabled. Mirrors Mentor.disable_chathistory but scoped to one session.
        llm_name:
          type: string
          nullable: true
          maxLength: 255
        llm_provider:
          type: string
          nullable: true
          maxLength: 255
        metadata:
          nullable: true
        title:
          type: string
          nullable: true
          description: AI-generated title summarizing the conversation
          maxLength: 255
        is_conversation:
          type: boolean
          description: True if the session has both user and AI messages
        message_count_human:
          type: integer
          description: Count of human messages in this session
        message_count_ai:
          type: integer
          description: Count of AI messages in this session
        first_user_message:
          type: string
          nullable: true
        last_message_at:
          type: string
          format: date-time
          nullable: true
        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
          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
        course_id:
          type: string
          readOnly: true
        provider:
          type: string
          maxLength: 20
        model:
          type: string
          maxLength: 150
        desired_number_of_sections:
          type: integer
        assessment_mentor:
          type: integer
          nullable: true
          description: Optional. If set, mentor-graded assessment xblocks in the created
            course point at this mentor instead of provisioning a new one per unit.
        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
      - course_id
      - 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
        last_activity:
          type: string
          format: date-time
          nullable: true
          description: Timestamp of the user's most recent recorded activity on this
            course; null if the user has no tracked time on it.
        edx_progress:
          description: Full edX Progress-page payload (completion summary, grade,
            grade summary) for this learner in this course. Only present when the
            request scopes a single `course_id` with `include_edx_progress` enabled;
            null if the edX call fails.
      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
    CourseExportEligibility:
      type: object
      description: Full CRUD serializer for course export eligibility records.
      properties:
        id:
          type: integer
          readOnly: true
        course:
          type: integer
        course_id:
          type: string
          readOnly: true
        is_enabled:
          type: boolean
        target_environments:
          type: array
          items:
            type: integer
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - course
      - course_id
      - created_at
      - id
      - updated_at
    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.

        Supports CSV date fields for enrollment_config:
        - course_access_start_date: Maps to enrollment_config['started']
        - course_access_expiration_date: Maps to enrollment_config['expired']
      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
        enrollment_config:
          type: object
          additionalProperties: {}
          description: Enrollment configuration (dates, etc.)
        course_access_start_date:
          type: string
          format: date-time
          nullable: true
          description: Course access start date (maps to enrollment_config['started'])
        course_access_expiration_date:
          type: string
          format: date-time
          nullable: true
          description: Course access expiration date (maps to enrollment_config['expired'])
      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
        edx_data:
          type: object
          additionalProperties: {}
          nullable: true
          description: Full edx_data from CourseInfo model (includes all edX metadata)
      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
    CoursesProgressFrequencyEnum:
      enum:
      - DAILY
      - WEEKLY
      - MONTHLY
      - CUSTOM
      type: string
      description: |-
        * `DAILY` - DAILY
        * `WEEKLY` - WEEKLY
        * `MONTHLY` - MONTHLY
        * `CUSTOM` - CUSTOM
    CoursesProgressLearnerScopeEnum:
      enum:
      - ACTIVE_LEARNERS
      - ALL_LEARNERS
      type: string
      description: |-
        * `ACTIVE_LEARNERS` - ACTIVE_LEARNERS
        * `ALL_LEARNERS` - ALL_LEARNERS
    CrawlerPatternTypeEnum:
      enum:
      - glob
      - regex
      type: string
      description: |-
        * `glob` - Glob
        * `regex` - Regex
    CreateXblock:
      type: object
      description: Validate input for creating an xblock under a parent.
      properties:
        parent_xblock_id:
          type: string
          description: The xblock locator of the parent block.
        xblock_type:
          allOf:
          - $ref: '#/components/schemas/XblockTypeEnum'
          description: |-
            The type of block to create (section, subsection, unit, html, problem, video).

            * `section` - section
            * `subsection` - subsection
            * `unit` - unit
            * `html` - html
            * `problem` - problem
            * `video` - video
        display_name:
          type: string
          description: Display name for the new block.
        position:
          type: string
          default: last
          description: Position within the parent ('first', 'last', or a 1-based index).
        content:
          type: string
          default: ''
          description: HTML content body. Only used for html/problem component types.
        markdown:
          type: string
          default: ''
          description: Markdown source. Only used for problem (multiplechoice) components.
      required:
      - display_name
      - parent_xblock_id
      - xblock_type
    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
    CredentialProviderConfig:
      type: object
      description: |-
        Serializer for CredentialProviderConfig model.

        Serializes provider configuration including platform, provider name,
        config JSON, enabled status, and timestamps.
      properties:
        id:
          type: integer
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        platform_name:
          type: string
          readOnly: true
        provider_name:
          type: string
          description: The credential provider name (references CredentialProvider.name)
          maxLength: 100
        provider_name_display:
          type: string
          description: Get display name from provider if available, otherwise use
            provider_name.
          readOnly: true
        config:
          description: Provider-specific configuration in JSON format
        enabled:
          type: boolean
          description: Whether this provider integration is enabled for the platform
        created:
          type: string
          format: date-time
          readOnly: true
        updated:
          type: string
          format: date-time
          readOnly: true
      required:
      - created
      - id
      - platform_key
      - platform_name
      - provider_name
      - provider_name_display
      - updated
    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
    CreditAccountAutoRechargeUpdate:
      type: object
      description: Partial update for CreditAccount auto-recharge fields.
      properties:
        auto_recharge_threshold_usd:
          type: string
          format: decimal
          pattern: ^-?\d{0,11}(?:\.\d{0,3})?$
          description: Set the balance threshold for auto-recharge (must be non-negative).
        auto_recharge_amount_usd:
          type: string
          format: decimal
          pattern: ^-?\d{0,11}(?:\.\d{0,3})?$
          description: Set the amount to recharge (min $0.50).
        auto_recharge_enabled:
          type: boolean
          description: Enable or disable auto-recharge.
        auto_recharge_spending_limit_usd:
          type: string
          format: decimal
          pattern: ^-?\d{0,11}(?:\.\d{0,3})?$
          description: Cap on auto-recharge + manual top-up per 30-day period (user
            USD). 0 = unlimited. When > 0, backend sets recharge amount to 20% of
            limit (min $0.50).
        platform_key:
          type: string
          readOnly: true
          description: The platform key to update settings for (read-only in update
            context).
      required:
      - platform_key
    CreditAccountInfo:
      type: object
      description: |-
        Credit account information API response (GET).

        Display balance (has_credits, account_id, available_credits) and
        auto-recharge preferences.
      properties:
        has_credits:
          type: boolean
          readOnly: true
          description: True if the account has any credits (or infinite credits).
        account_id:
          type: string
          format: uuid
          readOnly: true
          description: The unique identifier of the credit account.
        available_credits:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,4})?$
          readOnly: true
          description: The current available credit balance in USD.
        auto_recharge_threshold_usd:
          type: string
          format: decimal
          pattern: ^-?\d{0,11}(?:\.\d{0,3})?$
          readOnly: true
          description: The balance threshold below which auto-recharge is triggered.
        auto_recharge_amount_usd:
          type: string
          format: decimal
          pattern: ^-?\d{0,11}(?:\.\d{0,3})?$
          readOnly: true
          description: The amount in USD to recharge when the threshold is reached.
        auto_recharge_enabled:
          type: boolean
          readOnly: true
          description: True if auto-recharge is currently enabled for this account.
        auto_recharge_last_triggered_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: The timestamp when auto-recharge was last successfully triggered.
        platform_key:
          type: string
          readOnly: true
          description: The platform key associated with this account (if applicable).
        pricing_table:
          readOnly: true
          description: Stripe pricing table details for topping up credits.
        free_trial:
          type: boolean
          readOnly: true
          description: True if the account is on the free trial plan (no paid plan
            purchased yet).
        current_plan:
          type: string
          readOnly: true
          nullable: true
          description: Current plan identifier, e.g. 'free_trial' or Stripe product
            SKU.
        previous_plan:
          type: string
          readOnly: true
          nullable: true
          description: Previous plan before the last purchase.
        can_use_auto_recharge:
          type: boolean
          readOnly: true
          description: True if the current plan is not free_trial (paid plans can
            use auto-recharge).
        has_payment_method:
          type: boolean
          readOnly: true
          description: True if the user has a payment method on file (can use manual
            top-up and auto-recharge).
        is_owner:
          type: boolean
          readOnly: true
          description: True if the requesting user is the user that owns this credit
            account (account.user).
        message:
          type: string
          readOnly: true
          description: Message explaining why credits are insufficient (only present
            when has_credits is False).
      required:
      - account_id
      - auto_recharge_amount_usd
      - auto_recharge_enabled
      - auto_recharge_last_triggered_at
      - auto_recharge_threshold_usd
      - available_credits
      - can_use_auto_recharge
      - current_plan
      - free_trial
      - has_credits
      - has_payment_method
      - is_owner
      - message
      - platform_key
      - previous_plan
      - pricing_table
    CreditTransactionHistory:
      type: object
      description: |-
        Serializer for user-facing transaction history.
        NEVER exposes internal USD amounts (amount_usd, usd_balance_*).

        - payment_amount_usd: only shown for ``add`` transactions (real user payment).
        - description: user-friendly label derived from service_name/transaction_type.
        - service_name is excluded from the response (internal detail).
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        transaction_type:
          $ref: '#/components/schemas/TransactionTypeEnum'
        status:
          $ref: '#/components/schemas/CreditTransactionHistoryStatusEnum'
        payment_amount_usd:
          type: string
          readOnly: true
        credits_amount:
          type: string
          readOnly: true
        credits_balance_after:
          type: string
          readOnly: true
        description:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - created_at
      - credits_amount
      - credits_balance_after
      - description
      - id
      - payment_amount_usd
      - transaction_type
    CreditTransactionHistoryStatusEnum:
      enum:
      - pending
      - completed
      - failed
      - cancelled
      type: string
      description: |-
        * `pending` - Pending
        * `completed` - Completed
        * `failed` - Failed
        * `cancelled` - Cancelled
    CronDelivery:
      type: object
      description: Delivery target for a cron run's announce/webhook output.
      properties:
        mode:
          $ref: '#/components/schemas/CronDeliveryModeEnum'
        channel:
          type: string
        to:
          type: string
        threadId:
          type: string
        accountId:
          type: string
        bestEffort:
          type: boolean
      required:
      - mode
    CronDeliveryModeEnum:
      enum:
      - none
      - announce
      - webhook
      type: string
      description: |-
        * `none` - none
        * `announce` - announce
        * `webhook` - webhook
    CronJobCreate:
      type: object
      description: |-
        Body for ``POST cron-jobs/`` — sent to ``cron.add``.

        Field names use camelCase / snake_case as appropriate so they map 1:1 to
        the OpenClawClient wrapper kwargs.
      properties:
        name:
          type: string
        agent_id:
          type: string
        description:
          type: string
          default: ''
        enabled:
          type: boolean
          default: true
        delete_after_run:
          type: boolean
          default: false
        session_target:
          type: string
          default: isolated
        wake_mode:
          allOf:
          - $ref: '#/components/schemas/WakeModeEnum'
          default: now
        schedule:
          $ref: '#/components/schemas/CronSchedule'
        payload:
          $ref: '#/components/schemas/CronPayload'
        delivery:
          $ref: '#/components/schemas/CronDelivery'
      required:
      - name
      - payload
      - schedule
    CronJobListResponse:
      type: object
      description: Response shape for ``GET cron-jobs/``.
      properties:
        jobs:
          type: array
          items:
            $ref: '#/components/schemas/CronJobResponse'
        total:
          type: integer
        limit:
          type: integer
        offset:
          type: integer
      required:
      - jobs
    CronJobResponse:
      type: object
      description: |-
        Documentation-only — describes the ``CronJob`` shape worker returns.

        The view returns the raw dict from the RPC; this serializer is wired into
        ``@extend_schema(responses=...)`` so drf-spectacular knows the shape but
        we don't bother running it on output (the wire dict is authoritative).
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        agentId:
          type: string
        sessionKey:
          type: string
        enabled:
          type: boolean
        deleteAfterRun:
          type: boolean
        createdAtMs:
          type: integer
        updatedAtMs:
          type: integer
        schedule:
          $ref: '#/components/schemas/CronSchedule'
        sessionTarget:
          type: string
        wakeMode:
          $ref: '#/components/schemas/WakeModeEnum'
        payload:
          $ref: '#/components/schemas/CronPayload'
        delivery:
          $ref: '#/components/schemas/CronDelivery'
        state:
          type: object
          additionalProperties: {}
      required:
      - createdAtMs
      - enabled
      - id
      - name
      - payload
      - schedule
      - sessionTarget
      - updatedAtMs
      - wakeMode
    CronPayload:
      type: object
      description: |-
        Discriminated union on ``kind``.

        - ``systemEvent``: requires ``text``.
        - ``agentTurn``: requires ``message``; accepts model/fallbacks/etc.
      properties:
        kind:
          $ref: '#/components/schemas/CronPayloadKindEnum'
        text:
          type: string
        message:
          type: string
        model:
          type: string
        fallbacks:
          type: array
          items:
            type: string
        thinking:
          type: string
        timeoutSeconds:
          type: integer
          minimum: 0
        allowUnsafeExternalContent:
          type: boolean
        lightContext:
          type: boolean
        toolsAllow:
          type: array
          items:
            type: string
      required:
      - kind
    CronPayloadKindEnum:
      enum:
      - systemEvent
      - agentTurn
      type: string
      description: |-
        * `systemEvent` - systemEvent
        * `agentTurn` - agentTurn
    CronRunAction:
      type: object
      description: Body for ``POST cron-jobs/<job_id>/run/``.
      properties:
        mode:
          allOf:
          - $ref: '#/components/schemas/CronRunActionModeEnum'
          default: force
    CronRunActionModeEnum:
      enum:
      - due
      - force
      type: string
      description: |-
        * `due` - due
        * `force` - force
    CronRunLogEntry:
      type: object
      description: One row from ``cron.runs.entries`` — the ``finished`` snapshot.
      properties:
        ts:
          type: integer
        jobId:
          type: string
        action:
          type: string
        status:
          $ref: '#/components/schemas/CronRunLogEntryStatusEnum'
        error:
          type: string
        summary:
          type: string
        runAtMs:
          type: integer
        durationMs:
          type: integer
        nextRunAtMs:
          type: integer
        model:
          type: string
        provider:
          type: string
        usage:
          type: object
          additionalProperties: {}
        deliveryStatus:
          $ref: '#/components/schemas/DeliveryStatusEnum'
        deliveryError:
          type: string
        sessionId:
          type: string
        sessionKey:
          type: string
        runId:
          type: string
        jobName:
          type: string
      required:
      - action
      - jobId
      - ts
    CronRunLogEntryStatusEnum:
      enum:
      - ok
      - error
      - skipped
      type: string
      description: |-
        * `ok` - ok
        * `error` - error
        * `skipped` - skipped
    CronRunResult:
      type: object
      description: Response shape for ``cron.run``.
      properties:
        ok:
          type: boolean
        ran:
          type: boolean
        reason:
          type: string
      required:
      - ok
      - ran
    CronRunsResponse:
      type: object
      description: Response shape for ``GET cron-runs/``.
      properties:
        entries:
          type: array
          items:
            $ref: '#/components/schemas/CronRunLogEntry'
        total:
          type: integer
        limit:
          type: integer
        offset:
          type: integer
      required:
      - entries
    CronSchedule:
      type: object
      description: |-
        Discriminated union on ``kind``.

        - ``at``: one-shot at an ISO 8601 instant — requires ``at``.
        - ``every``: interval — requires ``everyMs`` (≥ 1).
        - ``cron``: cron expression — requires ``expr``.
      properties:
        kind:
          $ref: '#/components/schemas/CronScheduleKindEnum'
        at:
          type: string
        everyMs:
          type: integer
          minimum: 1
        anchorMs:
          type: integer
          minimum: 0
        expr:
          type: string
        tz:
          type: string
        staggerMs:
          type: integer
          minimum: 0
      required:
      - kind
    CronScheduleKindEnum:
      enum:
      - at
      - every
      - cron
      type: string
      description: |-
        * `at` - at
        * `every` - every
        * `cron` - cron
    CronStatusResponse:
      type: object
      description: |-
        Documents the ``cron.status`` response.

        The upstream shape (scheduler health summary from ``context.cron.status()``)
        is not fully pinned in the published docs; fields here are best-effort.
        Additional fields may be present.
      properties:
        healthy:
          type: boolean
        pendingJobs:
          type: integer
        runningJobs:
          type: integer
        nextRunAtMs:
          type: integer
        lastTickAtMs:
          type: integer
    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
    DataTypeEnum:
      enum:
      - NUMERIC
      - BOOLEAN
      - CATEGORICAL
      type: string
      description: |-
        * `NUMERIC` - NUMERIC
        * `BOOLEAN` - BOOLEAN
        * `CATEGORICAL` - CATEGORICAL
    Dataset:
      type: object
      description: Read shape for a single dataset.
      properties:
        name:
          type: string
        description:
          type: string
        metadata:
          type: object
          additionalProperties: {}
        created_at:
          type: string
        updated_at:
          type: string
        username:
          type: string
          readOnly: true
        user_email:
          type: string
          readOnly: true
      required:
      - created_at
      - description
      - name
      - updated_at
      - user_email
      - username
    DatasetCreate:
      type: object
      description: Validates dataset creation requests.
      properties:
        name:
          type: string
          maxLength: 255
        description:
          type: string
          default: ''
        metadata:
          type: object
          additionalProperties: {}
      required:
      - name
    DatasetItem:
      type: object
      description: |-
        Read shape for a dataset item.

        ``trace_input`` / ``trace_output`` are present whenever ``source_trace_id``
        is set (values may be ``null`` if the trace can't be resolved); the keys
        are omitted otherwise.
      properties:
        id:
          type: string
        input:
          nullable: true
        expected_output:
          nullable: true
        metadata:
          type: object
          additionalProperties: {}
        status:
          type: string
          nullable: true
        source_trace_id:
          type: string
          nullable: true
        source_observation_id:
          type: string
          nullable: true
        created_at:
          type: string
        updated_at:
          type: string
        trace_input:
          nullable: true
        trace_output:
          nullable: true
      required:
      - created_at
      - id
      - input
      - updated_at
    DatasetItemBulkCreateResponse:
      type: object
      properties:
        created:
          type: integer
        items:
          type: array
          items:
            $ref: '#/components/schemas/DatasetItem'
      required:
      - created
      - items
    DatasetItemCreate:
      type: object
      description: |-
        Validates dataset item creation — either from direct items or trace IDs.

        Exactly one of ``items`` or ``trace_ids`` must be provided.
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/DatasetItemInput'
        trace_ids:
          type: array
          items:
            type: string
    DatasetItemInput:
      type: object
      description: Single dataset item with input and optional expected output.
      properties:
        input:
          type: string
        expected_output:
          type: string
          nullable: true
      required:
      - input
    DatasetItemUpdate:
      type: object
      description: Validates dataset item update requests.
      properties:
        input: {}
        expected_output:
          nullable: true
        metadata:
          type: object
          additionalProperties: {}
        status:
          $ref: '#/components/schemas/DatasetItemUpdateStatusEnum'
    DatasetItemUpdateStatusEnum:
      enum:
      - ACTIVE
      - ARCHIVED
      type: string
      description: |-
        * `ACTIVE` - ACTIVE
        * `ARCHIVED` - ARCHIVED
    DatasetRunItem:
      type: object
      description: 'A fully-expanded dataset run item: input/expected/actual + scores.'
      properties:
        id:
          type: string
        dataset_item_id:
          type: string
        trace_id:
          type: string
        observation_id:
          type: string
          nullable: true
        created_at:
          type: string
        input:
          nullable: true
        expected_output:
          nullable: true
        actual_output:
          nullable: true
        error:
          type: string
          nullable: true
        scores:
          type: array
          items:
            $ref: '#/components/schemas/Score'
      required:
      - actual_output
      - created_at
      - dataset_item_id
      - expected_output
      - id
      - input
      - scores
      - trace_id
    DateRange:
      type: object
      properties:
        start_date:
          type: string
          format: date
        end_date:
          type: string
          format: date
      required:
      - end_date
      - start_date
    Deal:
      type: object
      description: |-
        Adds a read-only ``tags`` field to a host serializer.

        Emits ``[{id, name, color}]``. Cheap when the host queryset uses
        ``prefetch_related("tag_assignments__tag")`` — without that prefetch
        every record triggers two extra queries.
      properties:
        id:
          type: integer
          readOnly: true
          description: Server-assigned id.
        platform:
          type: integer
          readOnly: true
          description: Platform this Deal belongs to. Set automatically from your
            credentials; you cannot pass another Platform's id.
        title:
          type: string
          description: Short display name (e.g. 'Acme renewal — 2026').
          maxLength: 255
        description:
          type: string
          default: ''
          description: Free-text notes about scope, requirements, etc.
        lead_value:
          type: string
          format: decimal
          pattern: ^-?\d{0,12}(?:\.\d{0,2})?$
          default: '0.00'
          description: Estimated deal value in `currency`.
        currency:
          type: string
          default: USD
          description: ISO 4217 currency code.
          maxLength: 3
        status:
          allOf:
          - $ref: '#/components/schemas/DealStatusEnum'
          readOnly: true
          description: |-
            Read-only. Set by the move-stage/won/lost actions and derived from the destination stage's `is_won`/`is_lost`. Direct writes are rejected with `400`; use `POST /deals/{id}/move-stage/` (or `won/` / `lost/`).

            * `open` - Open
            * `won` - Won
            * `lost` - Lost
        lost_reason:
          type: string
          default: ''
          description: Set on a `lost` transition (e.g. 'Chose competitor').
          maxLength: 255
        expected_close_date:
          type: string
          format: date
          nullable: true
          description: Forecasted close date — used by revenue projections.
        closed_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: Read-only. Set automatically when the Deal enters a won/lost
            stage and cleared when it re-opens.
        person:
          type: string
          format: uuid
          description: UUID of the primary contact for this Deal. The person must
            belong to your Platform.
        organization:
          type: string
          format: uuid
          description: UUID of an organization the Deal is with. Optional; must belong
            to your Platform.
          nullable: true
        pipeline:
          type: integer
          description: Pipeline this Deal flows through. Must belong to your Platform.
        stage:
          type: integer
          description: Current PipelineStage. On create, must belong to `pipeline`.
            Use `POST /deals/{id}/move-stage/` to change after creation.
        source:
          type: integer
          nullable: true
          description: Where the Deal originated. Optional; must belong to your Platform.
        owner:
          type: integer
          description: Id of the platform user responsible for this Deal (sales rep).
            Defaults to the calling user on create.
          nullable: true
        tags:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
              color:
                type: string
                example: '#3F6BFF'
            required:
            - id
            - name
            - color
          readOnly: true
        metadata:
          description: Free-form JSON for Platform-defined attributes.
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Creation timestamp.
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Last-modified timestamp.
      required:
      - closed_at
      - created_at
      - id
      - person
      - pipeline
      - platform
      - stage
      - status
      - tags
      - title
      - updated_at
    DealLostRequest:
      type: object
      properties:
        lost_reason:
          type: string
          description: Free-text reason persisted on `Deal.lost_reason`.
          maxLength: 255
        stage_code:
          type: string
          description: Optional `code` of a specific `is_lost=True` stage to move
            to. When omitted, the first lost stage in the pipeline (by sort order)
            is used.
      required:
      - lost_reason
    DealMoveStageRequest:
      type: object
      properties:
        stage_id:
          type: integer
          description: Id of the destination PipelineStage. One of `stage_id` or `stage_code`
            is required.
        stage_code:
          type: string
          description: Stable `code` of the destination PipelineStage within this
            Deal's Pipeline. Use this when integrating across environments where ids
            differ but codes are stable.
    DealStatusEnum:
      enum:
      - open
      - won
      - lost
      type: string
      description: |-
        * `open` - Open
        * `won` - Won
        * `lost` - Lost
    DealWonRequest:
      type: object
      properties:
        stage_code:
          type: string
          description: Optional `code` of a specific `is_won=True` stage to move to.
            When omitted, the first won stage in the pipeline (by sort order) is used.
    DeleteXblock:
      type: object
      description: Validate input for deleting an xblock.
      properties:
        xblock_id:
          type: string
          description: The xblock locator to delete.
      required:
      - xblock_id
    DeliveryStatusEnum:
      enum:
      - delivered
      - not-delivered
      - unknown
      - not-requested
      type: string
      description: |-
        * `delivered` - delivered
        * `not-delivered` - not-delivered
        * `unknown` - unknown
        * `not-requested` - not-requested
    DemographicsFieldDefinition:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: Human-readable field label displayed in forms.
          maxLength: 255
        slug:
          type: string
          description: URL-safe identifier used as the key in custom_fields payloads.
          maxLength: 255
          pattern: ^[-a-zA-Z0-9_]+$
        field_type:
          allOf:
          - $ref: '#/components/schemas/FieldTypeEnum'
          description: |-
            Data type for this field. One of: text, number, date, boolean, select, multi_select.

            * `text` - Text
            * `number` - Number
            * `date` - Date
            * `boolean` - Boolean
            * `select` - Select
            * `multi_select` - Multi-select
        required:
          type: boolean
          description: Whether this field must be filled in by the user.
        choices:
          description: List of valid options for select/multi_select fields. Must
            be empty for other types.
        display_order:
          type: integer
          description: Sort order for rendering fields in the UI. Lower values appear
            first.
        active:
          type: boolean
          description: Inactive fields are hidden from forms and excluded from responses.
        description:
          type: string
          description: Optional description or instructions shown alongside the field.
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - created_at
      - field_type
      - id
      - name
      - slug
      - updated_at
    DemographicsFieldDefinitionWrite:
      type: object
      properties:
        name:
          type: string
          description: Human-readable field label displayed in forms.
          maxLength: 255
        slug:
          type: string
          description: URL-safe identifier used as the key in custom_fields payloads.
          maxLength: 255
          pattern: ^[-a-zA-Z0-9_]+$
        field_type:
          allOf:
          - $ref: '#/components/schemas/FieldTypeEnum'
          description: |-
            Data type for this field. One of: text, number, date, boolean, select, multi_select.

            * `text` - Text
            * `number` - Number
            * `date` - Date
            * `boolean` - Boolean
            * `select` - Select
            * `multi_select` - Multi-select
        required:
          type: boolean
          description: Whether this field must be filled in by the user.
        choices:
          description: List of valid options for select/multi_select fields. Must
            be empty for other types.
        display_order:
          type: integer
          description: Sort order for rendering fields in the UI. Lower values appear
            first.
        active:
          type: boolean
          description: Inactive fields are hidden from forms and excluded from responses.
        description:
          type: string
          description: Optional description or instructions shown alongside the field.
      required:
      - field_type
      - name
      - slug
    DeployStateEnum:
      enum:
      - pending
      - deploying
      - ready
      - teardown
      - failed
      type: string
      description: |-
        * `pending` - Pending
        * `deploying` - Deploying
        * `ready` - Ready
        * `teardown` - Teardown
        * `failed` - Failed
    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
    DirectionEnum:
      enum:
      - export
      - import
      type: string
      description: |-
        * `export` - Export
        * `import` - Import
    DisabilityStatusEnum:
      enum:
      - 'yes'
      - 'no'
      - prefer_not_to_say
      type: string
      description: |-
        * `yes` - Yes
        * `no` - No
        * `prefer_not_to_say` - Prefer not to say
    Disclaimer:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        scope:
          $ref: '#/components/schemas/DisclaimerScopeEnum'
        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
          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
    DisclaimerScopeEnum:
      enum:
      - platform
      - mentor
      type: string
      description: |-
        * `platform` - Platform
        * `mentor` - Mentor
    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
          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
          nullable: true
    DomainAttach:
      type: object
      properties:
        project:
          type: integer
          minimum: 1
          description: Hosting project id
        domain:
          type: string
          maxLength: 253
          pattern: ^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$
      required:
      - domain
      - project
    Education:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        user:
          type: integer
          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
        course_id:
          type: string
          readOnly: true
        task:
          type: integer
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - course_id
      - created_at
      - id
      - name
      - number
      - run
      - updated_at
      - xblock_id
    EdxJwtToken:
      type: object
      description: edX JWT minted server-to-server for the user (provisioning only).
      properties:
        token:
          type: string
          description: edX JWT
        expires:
          type: string
          format: date-time
          nullable: true
          description: Token expiration
      required:
      - token
    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
    EnforcementEnum:
      enum:
      - block
      - alert_only
      type: string
      description: |-
        * `block` - Block
        * `alert_only` - Alert only
    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
    Error:
      type: object
      properties:
        error:
          type: string
      required:
      - error
    ErrorDetail:
      type: object
      description: Schema for error responses with a single detail message (e.g. 400).
      properties:
        detail:
          type: string
          description: Human-readable error message.
      required:
      - detail
    ErrorResponse:
      type: object
      description: Generic error response serializer
      properties:
        status:
          type: string
        message:
          type: string
        details: {}
      required:
      - message
      - status
    EthnicityEnum:
      enum:
      - american_indian_alaska_native
      - asian
      - black_african_american
      - hispanic_latino
      - native_hawaiian_pacific_islander
      - white
      - two_or_more
      - prefer_not_to_say
      - other
      type: string
      description: |-
        * `american_indian_alaska_native` - American Indian or Alaska Native
        * `asian` - Asian
        * `black_african_american` - Black or African American
        * `hispanic_latino` - Hispanic or Latino
        * `native_hawaiian_pacific_islander` - Native Hawaiian or Other Pacific Islander
        * `white` - White
        * `two_or_more` - Two or more races
        * `prefer_not_to_say` - Prefer not to say
        * `other` - Other
    EventsEnum:
      enum:
      - USER_NOTIF_COURSE_ENROLLMENT
      - ADMIN_NOTIF_COURSE_ENROLLMENT
      - USER_NOTIF_USER_INACTIVITY
      - USER_NOTIF_COURSE_COMPLETION
      - USER_NOTIF_CREDENTIALS
      - USER_NOTIF_LEARNER_PROGRESS
      - PROACTIVE_LEARNER_NOTIFICATION
      - ACTIVITY_NEW_CONTENT
      - ACTIVITY_COURSE_MILESTONE
      - SKILL_MASTERY_CHANGE
      - PROGRAM_ENROLLMENT_CONFIRMATION
      - PATHWAY_ENROLLMENT_CONFIRMATION
      - COURSE_SCHEDULE_CHANGE
      - COURSES_PROGRESS_SUMMARY
      - SUBSECTION_GRADE_UPDATE
      type: string
      description: |-
        * `USER_NOTIF_COURSE_ENROLLMENT` - Course Enrollment
        * `ADMIN_NOTIF_COURSE_ENROLLMENT` - Admin: Course Enrollment
        * `USER_NOTIF_USER_INACTIVITY` - User Inactivity
        * `USER_NOTIF_COURSE_COMPLETION` - Course Completion
        * `USER_NOTIF_CREDENTIALS` - Credentials Issued
        * `USER_NOTIF_LEARNER_PROGRESS` - Learner Progress
        * `PROACTIVE_LEARNER_NOTIFICATION` - Proactive Learner Notification
        * `ACTIVITY_NEW_CONTENT` - New Activity Content
        * `ACTIVITY_COURSE_MILESTONE` - Course Milestone Reached
        * `SKILL_MASTERY_CHANGE` - Skill Mastery Change
        * `PROGRAM_ENROLLMENT_CONFIRMATION` - Program Enrollment Confirmed
        * `PATHWAY_ENROLLMENT_CONFIRMATION` - Pathway Enrollment Confirmed
        * `COURSE_SCHEDULE_CHANGE` - Course Schedule Change
        * `COURSES_PROGRESS_SUMMARY` - User Progress Summary
        * `SUBSECTION_GRADE_UPDATE` - Subsection Grade Update
    EximTask:
      type: object
      description: |-
        Read-only serializer for EximTask records.

        Tasks are created by the Course post_save signal and the admin sync
        action; nothing should create or modify them through this API.
      properties:
        id:
          type: integer
          readOnly: true
        course:
          type: integer
          readOnly: true
        course_id:
          type: string
          readOnly: true
        target_environment:
          type: integer
          readOnly: true
        target_environment_name:
          type: string
          readOnly: true
        status:
          allOf:
          - $ref: '#/components/schemas/Status147Enum'
          readOnly: true
        published_at:
          type: string
          format: date-time
          readOnly: true
          description: Time the publish signal was received; used for FIFO ordering
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        started_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        finished_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        export_download_url:
          type: string
          readOnly: true
          description: URL to download the exported course file
        import_filename:
          type: string
          readOnly: true
          description: Filename of uploaded archive used to track import on target
            environment
        error_message:
          type: string
          readOnly: true
      required:
      - course
      - course_id
      - created_at
      - error_message
      - export_download_url
      - finished_at
      - id
      - import_filename
      - published_at
      - started_at
      - status
      - target_environment
      - target_environment_name
      - updated_at
    Experience:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        user:
          type: integer
          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
    ExperimentCreate:
      type: object
      description: Validates experiment (dataset run) creation.
      properties:
        mentor_unique_id:
          type: string
        run_name:
          type: string
          maxLength: 255
        metadata:
          type: object
          additionalProperties: {}
      required:
      - mentor_unique_id
    ExportTargetEnvironment:
      type: object
      description: |-
        Full CRUD serializer for target environments.

        The bearer ``token`` field is write-only so credentials never leak via
        GET responses. Model-level validation (oauth credentials OR token must
        be provided) is enforced by calling ``ExportTargetEnvironment.clean()``
        during ``validate()``.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 100
        studio_base_url:
          type: string
          format: uri
          description: Base URL for Studio (CMS) API
          maxLength: 200
        is_enabled:
          type: boolean
        oauth_credentials:
          type: integer
          nullable: true
          description: OAuth credentials for API authentication
        token:
          type: string
          writeOnly: true
          description: Manual bearer token (fallback if OAuth not configured)
      required:
      - id
      - name
      - studio_base_url
    ExternalCredentialMapping:
      type: object
      description: |-
        Serializer for ExternalCredentialMapping model.

        Serializes external credential mappings including credential, platform,
        provider, external_template_id, and metadata.
      properties:
        id:
          type: integer
          readOnly: true
        credential_id:
          type: string
          readOnly: true
        credential_name:
          type: string
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        platform_name:
          type: string
          readOnly: true
        provider:
          type: integer
          readOnly: true
          nullable: true
          description: The credential provider
        provider_name:
          type: string
          description: The credential provider name (references CredentialProvider.name)
          maxLength: 100
        provider_name_display:
          type: string
          description: Get display name from provider if available, otherwise use
            provider_name.
          readOnly: true
        external_template_id:
          type: string
          nullable: true
          description: The template ID in the external system (e.g., Accredible template
            ID)
          maxLength: 255
        group_id:
          type: string
          nullable: true
          description: The group ID in the external system (e.g., Accredible group
            ID). If not set, will fall back to the provider config's group_id.
          maxLength: 255
        metadata:
          description: Additional metadata stored as JSON (for general mapping information,
            not sync status)
        created:
          type: string
          format: date-time
          readOnly: true
        updated:
          type: string
          format: date-time
          readOnly: true
      required:
      - created
      - credential_id
      - credential_name
      - id
      - platform_key
      - platform_name
      - provider
      - provider_name
      - provider_name_display
      - updated
    ExternalProxyInvoke:
      type: object
      description: |-
        Serializer for invoking external proxy endpoints.

        For multipart file uploads, send the file as a standard multipart form field
        (e.g., 'file' field) alongside the JSON body. Files are extracted from
        request.FILES and forwarded to the upstream service.

        Example multipart request:
            - Form field 'body': JSON string with request body
            - Form field 'path_params': JSON string with path parameters
            - Form field 'query': JSON string with query parameters
            - Form field 'file': The binary file to upload
      properties:
        body: {}
        query:
          type: object
          additionalProperties:
            type: string
        headers:
          type: object
          additionalProperties:
            type: string
        path_params:
          type: object
          additionalProperties:
            type: string
    ExternalProxyServiceDetail:
      type: object
      description: Serializer for external proxy service details including endpoints.
      properties:
        slug:
          type: string
          maxLength: 50
          pattern: ^[-a-zA-Z0-9_]+$
        display_name:
          type: string
          maxLength: 255
        base_url:
          type: string
          format: uri
          maxLength: 200
        service_type:
          $ref: '#/components/schemas/ServiceTypeEnum'
        auth_mode:
          $ref: '#/components/schemas/AuthModeEnum'
        is_enabled:
          type: boolean
        supports_async_jobs:
          type: boolean
        supports_streaming:
          type: boolean
        default_timeout_seconds:
          type: integer
        credential_name:
          type: string
          maxLength: 255
        credential_policy:
          type: object
          additionalProperties: {}
          nullable: true
          readOnly: true
        credential_schema:
          type: object
          additionalProperties: {}
          description: Return the expected credential schema for this service.
          readOnly: true
        endpoints:
          type: array
          items:
            type: object
            additionalProperties: {}
          readOnly: true
      required:
      - base_url
      - credential_name
      - credential_policy
      - credential_schema
      - display_name
      - endpoints
      - slug
    ExternalProxyServiceList:
      type: object
      description: Serializer for listing external proxy services.
      properties:
        slug:
          type: string
          maxLength: 50
          pattern: ^[-a-zA-Z0-9_]+$
        display_name:
          type: string
          maxLength: 255
        service_type:
          $ref: '#/components/schemas/ServiceTypeEnum'
        is_enabled:
          type: boolean
        supports_async_jobs:
          type: boolean
        supports_streaming:
          type: boolean
        credential_name:
          type: string
          maxLength: 255
        endpoint_count:
          type: integer
          readOnly: true
      required:
      - credential_name
      - display_name
      - endpoint_count
      - slug
    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
    FailureCategoryEnum:
      enum:
      - llm_error
      - moderation_block
      - safety_block
      - privacy_block
      - authentication_error
      - authorization_error
      - payment_error
      - validation_error
      - content_filter
      - input_too_large
      - timeout
      - unknown
      type: string
      description: |-
        * `llm_error` - Llm Error
        * `moderation_block` - Moderation Block
        * `safety_block` - Safety Block
        * `privacy_block` - Privacy Block
        * `authentication_error` - Authentication Error
        * `authorization_error` - Authorization Error
        * `payment_error` - Payment Error
        * `validation_error` - Validation Error
        * `content_filter` - Content Filter
        * `input_too_large` - Input Too Large
        * `timeout` - Timeout
        * `unknown` - Unknown
    FallbackLLM:
      type: object
      description: Serializer for FallbackLLM configuration.
      properties:
        id:
          type: integer
          readOnly: true
        scope:
          allOf:
          - $ref: '#/components/schemas/ScopeC1dEnum'
          default: provider
          description: |-
            Whether this fallback applies to a specific model or entire provider

            * `model` - Model Specific
            * `provider` - Provider Wide
        source_provider:
          type: integer
          description: The provider whose models this fallback applies to
        source_provider_detail:
          allOf:
          - $ref: '#/components/schemas/LLMProviderMinimal'
          readOnly: true
        source_model:
          type: integer
          nullable: true
          description: Specific model this fallback applies to (only for model scope)
        source_model_detail:
          allOf:
          - $ref: '#/components/schemas/LLMModelRegistryMinimal'
          readOnly: true
        fallback_provider:
          type: integer
          description: The provider to use as fallback
        fallback_provider_detail:
          allOf:
          - $ref: '#/components/schemas/LLMProviderMinimal'
          readOnly: true
        fallback_model:
          type: integer
          description: The model to use as fallback
        fallback_model_detail:
          allOf:
          - $ref: '#/components/schemas/LLMModelRegistryMinimal'
          readOnly: true
        tenant:
          type: integer
          nullable: true
          description: Tenant this config applies to. Null means global.
        tenant_key:
          type: string
          readOnly: true
        is_enabled:
          type: boolean
          description: Whether this fallback configuration is active
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - created_at
      - fallback_model
      - fallback_model_detail
      - fallback_provider
      - fallback_provider_detail
      - id
      - source_model
      - source_model_detail
      - source_provider
      - source_provider_detail
      - tenant
      - tenant_key
      - updated_at
    FallbackLLMCreate:
      type: object
      description: Serializer for creating FallbackLLM configuration.
      properties:
        scope:
          allOf:
          - $ref: '#/components/schemas/ScopeC1dEnum'
          description: |-
            Whether this fallback applies to a specific model or entire provider

            * `model` - Model Specific
            * `provider` - Provider Wide
        tenant_key:
          type: string
          description: Tenant key. Leave empty for global configuration.
          nullable: true
        source_provider_name:
          allOf:
          - $ref: '#/components/schemas/NameEnum'
          description: Source provider name (e.g., 'openai')
        source_model_name:
          type: string
          description: Source model name (required for model scope)
          nullable: true
        fallback_provider_name:
          allOf:
          - $ref: '#/components/schemas/NameEnum'
          description: Fallback provider name
        fallback_model_name:
          type: string
          description: Fallback model name
        is_enabled:
          type: boolean
          description: Whether this fallback configuration is active
      required:
      - fallback_model_name
      - fallback_provider_name
      - source_provider_name
    FallbackLLMUpdate:
      type: object
      description: Serializer for updating FallbackLLM configuration.
      properties:
        scope:
          allOf:
          - $ref: '#/components/schemas/ScopeC1dEnum'
          description: |-
            Whether this fallback applies to a specific model or entire provider

            * `model` - Model Specific
            * `provider` - Provider Wide
        source_provider:
          type: integer
          description: The provider whose models this fallback applies to
        source_model:
          type: integer
          nullable: true
          description: Specific model this fallback applies to (only for model scope)
        fallback_provider:
          type: integer
          description: The provider to use as fallback
        fallback_model:
          type: integer
          description: The model to use as fallback
        is_enabled:
          type: boolean
          description: Whether this fallback configuration is active
      required:
      - fallback_model
      - fallback_provider
      - source_provider
    FeedbackModeEnum:
      enum:
      - overall
      - per_criteria
      - both
      type: string
      description: |-
        * `overall` - overall
        * `per_criteria` - per_criteria
        * `both` - both
    FieldDefinitionImport:
      type: object
      properties:
        definitions:
          type: array
          items:
            type: object
            additionalProperties: {}
        file:
          type: string
          format: uri
    FieldTypeEnum:
      enum:
      - text
      - number
      - date
      - boolean
      - select
      - multi_select
      type: string
      description: |-
        * `text` - Text
        * `number` - Number
        * `date` - Date
        * `boolean` - Boolean
        * `select` - Select
        * `multi_select` - Multi-select
    FileTypeEnum:
      enum:
      - script
      - reference
      - asset
      type: string
      description: |-
        * `script` - Script
        * `reference` - Reference
        * `asset` - Asset
    FileUploadURLRequest:
      type: object
      description: Request serializer for generating presigned upload URL
      properties:
        session_id:
          type: string
          format: uuid
          description: Chat session ID
        file_name:
          type: string
          description: Original filename
          maxLength: 500
        content_type:
          type: string
          description: MIME type of the file
          maxLength: 255
        file_size:
          type: integer
          minimum: 1
          description: File size in bytes
      required:
      - content_type
      - file_name
      - file_size
      - session_id
    FileUploadURLResponse:
      type: object
      description: Response serializer for presigned upload URL
      properties:
        upload_url:
          type: string
          format: uri
          description: Presigned S3 upload URL
        file_key:
          type: string
          description: S3 object key for the uploaded file
        file_id:
          type: string
          format: uuid
          description: Unique identifier for the ChatFile record
        expires_in:
          type: integer
          description: URL expiration time in seconds
        upload_method:
          type: string
          default: PUT
          description: HTTP method to use for upload (PUT or POST)
      required:
      - expires_in
      - file_id
      - file_key
      - upload_url
    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
    FlowTypeEnum:
      enum:
      - payment_method_update
      - subscription_update
      - subscription_cancel
      type: string
      description: |-
        * `payment_method_update` - Payment Method Update
        * `subscription_update` - Subscription Update
        * `subscription_cancel` - Subscription Cancel
    FreeUsageCount:
      type: object
      properties:
        count:
          type: integer
      required:
      - count
    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
    GenderEnum:
      enum:
      - male
      - female
      - non_binary
      - prefer_not_to_say
      - other
      type: string
      description: |-
        * `male` - Male
        * `female` - Female
        * `non_binary` - Non-binary
        * `prefer_not_to_say` - Prefer not to say
        * `other` - Other
    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
    GoogleAgentDetail:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        sub_agents:
          type: string
          readOnly: true
        platform:
          type: string
          readOnly: true
        unique_id:
          type: string
          format: uuid
        model:
          type: string
        name:
          type: string
        description:
          type: string
        instruction:
          type: string
        output_key:
          type: string
          nullable: true
        inserted_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        created_by:
          type: integer
          description: edX user ID
          nullable: true
      required:
      - description
      - id
      - inserted_at
      - instruction
      - model
      - name
      - platform
      - sub_agents
      - updated_at
    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
          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
    GradePostedNotifyModeEnum:
      enum:
      - every
      - first_only
      type: string
      description: |-
        * `every` - every
        * `first_only` - first_only
    GradeResult:
      type: object
      description: 'List representation: enough to render a gradebook row.'
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        mentor:
          allOf:
          - $ref: '#/components/schemas/GradeResultMentor'
          readOnly: true
        student:
          allOf:
          - $ref: '#/components/schemas/GradeResultStudent'
          readOnly: true
        platform:
          allOf:
          - $ref: '#/components/schemas/GradeResultPlatform'
          readOnly: true
        score:
          type: number
          format: double
          readOnly: true
          description: Normalized percentage score between 0 and 1.
        override_score:
          type: number
          format: double
          readOnly: true
          nullable: true
          description: Normalized percentage score between 0 and 1.
        effective_score:
          type: number
          format: double
          readOnly: true
        status:
          allOf:
          - $ref: '#/components/schemas/Status869Enum'
          readOnly: true
          description: |-
            Whether the AI score reached the LMS.

            * `pending` - Pending
            * `published` - Published
            * `failed` - Failed
        override_status:
          readOnly: true
          nullable: true
          description: |-
            Whether the most recent override reached the LMS, including one that cleared the override — 'published' with a null override_score means the reset back to the AI score is what reached the LMS.

            * `pending` - Pending
            * `published` - Published
            * `failed` - Failed
          oneOf:
          - $ref: '#/components/schemas/OverrideStatusEnum'
          - $ref: '#/components/schemas/NullEnum'
        graded_at:
          type: string
          format: date-time
          readOnly: true
        overridden_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
      required:
      - effective_score
      - graded_at
      - id
      - mentor
      - overridden_at
      - override_score
      - override_status
      - platform
      - score
      - status
      - student
    GradeResultDetail:
      type: object
      description: |-
        Full representation, including the override and publish record.

        ``publish_error`` / ``override_publish_error`` are deliberately absent:
        they hold raw exception text meant for operators, so the API exposes only
        the status that says a publish failed.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        mentor:
          allOf:
          - $ref: '#/components/schemas/GradeResultMentor'
          readOnly: true
        student:
          allOf:
          - $ref: '#/components/schemas/GradeResultStudent'
          readOnly: true
        platform:
          allOf:
          - $ref: '#/components/schemas/GradeResultPlatform'
          readOnly: true
        score:
          type: number
          format: double
          readOnly: true
          description: Normalized percentage score between 0 and 1.
        override_score:
          type: number
          format: double
          readOnly: true
          nullable: true
          description: Normalized percentage score between 0 and 1.
        effective_score:
          type: number
          format: double
          readOnly: true
        status:
          allOf:
          - $ref: '#/components/schemas/Status869Enum'
          readOnly: true
          description: |-
            Whether the AI score reached the LMS.

            * `pending` - Pending
            * `published` - Published
            * `failed` - Failed
        override_status:
          readOnly: true
          nullable: true
          description: |-
            Whether the most recent override reached the LMS, including one that cleared the override — 'published' with a null override_score means the reset back to the AI score is what reached the LMS.

            * `pending` - Pending
            * `published` - Published
            * `failed` - Failed
          oneOf:
          - $ref: '#/components/schemas/OverrideStatusEnum'
          - $ref: '#/components/schemas/NullEnum'
        graded_at:
          type: string
          format: date-time
          readOnly: true
        overridden_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        session_id:
          type: string
          format: uuid
          readOnly: true
        feedback:
          type: string
          readOnly: true
        rubric_snapshot:
          readOnly: true
          nullable: true
          description: Snapshot of the rubric used at grading time.
        evaluation_metadata:
          readOnly: true
          nullable: true
          description: Additional metadata from the evaluation (e.g. per-criterion
            scores).
        total_points:
          type: number
          format: double
          readOnly: true
        lms_context:
          readOnly: true
          description: 'LMS identifiers: type, course_id, usage_id, etc.'
        published_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        override_points:
          type: number
          format: double
          nullable: true
          description: The override expressed the way the rubric author wrote it.
          readOnly: true
        override_feedback:
          type: string
          readOnly: true
        overridden_by:
          type: string
          nullable: true
          description: edX username
          readOnly: true
      required:
      - effective_score
      - evaluation_metadata
      - feedback
      - graded_at
      - id
      - lms_context
      - mentor
      - overridden_at
      - overridden_by
      - override_feedback
      - override_points
      - override_score
      - override_status
      - platform
      - published_at
      - rubric_snapshot
      - score
      - session_id
      - status
      - student
      - total_points
    GradeResultMentor:
      type: object
      properties:
        unique_id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          readOnly: true
      required:
      - name
      - unique_id
    GradeResultPlatform:
      type: object
      properties:
        platform_key:
          type: string
          readOnly: true
      required:
      - platform_key
    GradeResultStudent:
      type: object
      properties:
        username:
          type: string
          readOnly: true
        email:
          type: string
          format: email
          readOnly: true
        name:
          type: string
          readOnly: true
      required:
      - email
      - name
      - username
    GraderCriterion:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: Name for the criteria (accuracy, clarity, etc.)
          maxLength: 200
        criteria:
          type: string
          description: The requirements to evaluate this criterion against.
        points:
          type: number
          format: double
          description: Raw point value for this criterion (e.g. 6 for a 6-point criterion).
            Normalized against the sum of all criteria points at grading time.
      required:
      - criteria
      - id
      - name
    GradingModeEnum:
      enum:
      - submission
      - conversation
      type: string
      description: |-
        * `submission` - Submission
        * `conversation` - Conversation
    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
    GrandfatheringStrategyEnum:
      enum:
      - free_forever
      - require_subscription
      type: string
      description: |-
        * `free_forever` - Free Forever - Existing users get unlimited free access
        * `require_subscription` - Require Subscription - All users must subscribe (no grandfathering)
    GrantMentorAccessRequest:
      type: object
      description: Request serializer for granting LTI mentor access
      properties:
        user_id:
          type: integer
          writeOnly: true
          description: User ID to grant access to
      required:
      - user_id
    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
    HeygenAvatarCreate:
      type: object
      description: POST /v3/avatars — one endpoint creates both avatar kinds.
      properties:
        type:
          $ref: '#/components/schemas/HeygenAvatarCreateTypeEnum'
        name:
          type: string
        file:
          type: object
          additionalProperties: {}
      required:
      - file
      - name
      - type
    HeygenAvatarCreateTypeEnum:
      enum:
      - digital_twin
      - photo
      type: string
      description: |-
        * `digital_twin` - digital_twin
        * `photo` - photo
    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
    HeygenStreamingSession:
      type: object
      description: Declared fields are validated; undeclared ones pass through verbatim.
      properties:
        avatar_name:
          type: string
        quality:
          type: string
        voice:
          type: object
          additionalProperties: {}
        language:
          type: string
        knowledge_base_id:
          type: string
        disable_idle_timeout:
          type: boolean
        activity_idle_timeout:
          type: integer
    HeygenStreamingTask:
      type: object
      description: Declared fields are validated; undeclared ones pass through verbatim.
      properties:
        text:
          type: string
        task_type:
          $ref: '#/components/schemas/TaskTypeEnum'
        task_mode:
          $ref: '#/components/schemas/TaskModeEnum'
      required:
      - text
    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
    HeygenTtsPreview:
      type: object
      description: Declared fields are validated; undeclared ones pass through verbatim.
      properties:
        voice_id:
          type: string
        text:
          type: string
      required:
      - text
      - voice_id
    HeygenVideoCreate:
      type: object
      description: POST /v3/videos — discriminated union; only the SPA-used types.
      properties:
        type:
          $ref: '#/components/schemas/HeygenVideoCreateTypeEnum'
        avatar_id:
          type: string
        image:
          type: object
          additionalProperties: {}
        script:
          type: string
        voice_id:
          type: string
        audio_url:
          type: string
        audio_asset_id:
          type: string
        title:
          type: string
          nullable: true
      required:
      - type
    HeygenVideoCreateTypeEnum:
      enum:
      - avatar
      - image
      type: string
      description: |-
        * `avatar` - avatar
        * `image` - image
    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
    HeygenVoiceClone:
      type: object
      description: Declared fields are validated; undeclared ones pass through verbatim.
      properties:
        voice_name:
          type: string
        audio:
          type: object
          additionalProperties: {}
        language:
          type: string
        remove_background_noise:
          type: boolean
      required:
      - audio
      - voice_name
    HostingProject:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: Sanitized project name segment supplied by the user
          maxLength: 100
        vercel_project_name:
          type: string
          description: 'Full platform-username-project name. NOT necessarily the *.vercel.app
            subdomain: Vercel right-truncates long names when minting the auto-alias
            — see vercel_alias.'
          maxLength: 100
        url:
          type: string
          readOnly: true
        vercel_alias:
          type: string
          description: Vercel-confirmed production host (e.g. truncated-name.vercel.app),
            learned from create/deployment/project alias responses; empty until a
            deploy response carries it
          maxLength: 255
        vercel_project_id:
          type: string
          maxLength: 64
        last_deployment_id:
          type: string
          maxLength: 64
        last_deployment_url:
          type: string
          maxLength: 255
        last_ready_state:
          type: string
          maxLength: 16
        push_state:
          type: string
          readOnly: true
        push_error:
          type: string
          readOnly: true
        username:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - created_at
      - id
      - name
      - push_error
      - push_state
      - updated_at
      - url
      - username
      - vercel_project_name
    HumanSupportRecipientModeEnum:
      enum:
      - platform_admins_and_mentor_owner
      - platform_admins_only
      - mentor_owner_only
      - custom
      type: string
      description: |-
        * `platform_admins_and_mentor_owner` - platform_admins_and_mentor_owner
        * `platform_admins_only` - platform_admins_only
        * `mentor_owner_only` - mentor_owner_only
        * `custom` - custom
    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
          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
          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
      description: |-
        Used for POST / PATCH responses on the integration-credential endpoint.

        ``to_representation`` substitutes ``IntegrationCredential.masked_value``
        for the raw ``value`` field, so sensitive fields (as flagged by the
        linked v2 ``IntegrationCredentialSchema``) come out masked
        (e.g. ``"sk-****"``). Admin-only — GET responses go through
        ``AdminIntegrationCredentialSerializer`` or
        ``StudentIntegrationCredentialSerializer`` instead, depending on caller
        role.
      properties:
        name:
          type: string
          maxLength: 255
        value:
          type: object
          additionalProperties: {}
          description: |-
            Returns non-sensitive fields only.
            Safe to return to students.
          readOnly: true
        platform:
          type: string
          description: The platform key
        service_info:
          allOf:
          - $ref: '#/components/schemas/ExternalServiceInfo'
          readOnly: true
      required:
      - name
      - platform
      - service_info
      - value
    IntegrationCredentialSchema:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        schema: {}
        service_info:
          allOf:
          - $ref: '#/components/schemas/ExternalServiceInfo'
          readOnly: true
      required:
      - name
      - service_info
    IntegrationCredentialSchemaV2:
      type: object
      description: |-
        Returns raw v2 schema with is_sensitive metadata.
        Admin-only endpoint - students don't need schema access.
      properties:
        name:
          type: string
          maxLength: 255
        schema: {}
        service_info:
          allOf:
          - $ref: '#/components/schemas/ExternalServiceInfo'
          readOnly: true
      required:
      - name
      - service_info
    InterfaceEnum:
      enum:
      - chat
      - api
      type: string
      description: |-
        * `chat` - Chat
        * `api` - Api
    IntervalEnum:
      enum:
      - month
      - year
      - one_time
      type: string
      description: |-
        * `month` - Monthly
        * `year` - Yearly
        * `one_time` - One Time
    IntervalTypeEnum:
      enum:
      - day
      - week
      - month
      - year
      type: string
      description: |-
        * `day` - Day
        * `week` - Week
        * `month` - Month
        * `year` - Year
    IntialQuestionAnswer:
      type: object
      properties:
        text:
          type: string
          maxLength: 500
      required:
      - text
    InvalidQueryParameters:
      type: object
      properties:
        error:
          type: string
          default: Invalid query parameters.
    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
    ItemAccessCheckResponse:
      type: object
      description: |-
        Response for the generic item access check endpoint.

        Mirrors :class:`PaymentCheckResult` but only exposes the fields
        relevant to API consumers.
      properties:
        has_access:
          type: boolean
          description: True if the user can access the item.
        item_type:
          type: string
          description: Item type that was checked (e.g. 'mentor', 'workshop').
          pattern: ^(?:custom:)?[a-z][a-z0-9_-]*$
          maxLength: 50
        item_id:
          type: string
          description: ID of the item that was checked.
        reason:
          type: string
          description: Machine-readable reason for the access decision (e.g. 'active',
            'no_paywall', 'no_subscription').
        requires_payment:
          type: boolean
          description: True if the user must pay to gain access.
        pricing_available:
          type: boolean
          description: True if pricing tiers are available for purchase.
        pricing:
          nullable: true
          description: Pricing details when access is denied (item name, tiers, amounts).
        subscription:
          allOf:
          - $ref: '#/components/schemas/ItemSubscription'
          nullable: true
          description: Active subscription details when the user has access via subscription.
      required:
      - has_access
      - item_id
      - item_type
      - pricing_available
      - reason
      - requires_payment
    ItemPaywallConfig:
      type: object
      properties:
        unique_id:
          type: string
          format: uuid
          readOnly: true
        item_type:
          type: string
          description: Type of item being paywalled (e.g. mentor, course, program,
            or custom types)
          maxLength: 50
        item_id:
          type: string
          description: Identifier for the item (UUID for mentors, slug/key for others)
          maxLength: 255
        item_name:
          type: string
          readOnly: true
        item_metadata:
          nullable: true
          description: Arbitrary metadata for the item (custom types only).
        platform:
          type: object
          additionalProperties: {}
          readOnly: true
        is_enabled:
          type: boolean
          description: Whether the paywall is enabled for this item
        description:
          type: string
          description: Marketing description shown to customers at checkout. If blank,
            a default is generated from the item name.
        allow_free_tier:
          type: boolean
          description: Whether to allow a free tier (bypasses checkout)
        stripe_product_id:
          type: string
          readOnly: true
          nullable: true
          description: Stripe Product ID for this item (on the connected account)
        trial_period_days:
          type: integer
          description: Number of days for free trial (0 = no trial)
        grandfathering_strategy:
          allOf:
          - $ref: '#/components/schemas/GrandfatheringStrategyEnum'
          description: |-
            How to handle existing users when enabling the paywall

            * `free_forever` - Free Forever - Existing users get unlimited free access
            * `require_subscription` - Require Subscription - All users must subscribe (no grandfathering)
        on_successful_payment:
          type: string
          format: uri
          description: URL to redirect users to after successful payment. If blank,
            default confirmation page(or mentor/product url) or the caller-supplied
            URL is used.
          maxLength: 500
        paywall_enabled_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: When the paywall was first enabled (for grandfathering cutoff)
        prices:
          type: array
          items:
            $ref: '#/components/schemas/ItemPrice'
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - created_at
      - item_id
      - item_name
      - item_type
      - paywall_enabled_at
      - platform
      - prices
      - stripe_product_id
      - unique_id
      - updated_at
    ItemPaywallConfigCreate:
      type: object
      properties:
        item_name:
          type: string
          maxLength: 255
        item_metadata: {}
        is_enabled:
          type: boolean
        description:
          type: string
        allow_free_tier:
          type: boolean
        trial_period_days:
          type: integer
          minimum: 0
        on_successful_payment:
          type: string
          format: uri
          maxLength: 500
        grandfathering_strategy:
          allOf:
          - $ref: '#/components/schemas/GrandfatheringStrategyEnum'
          default: require_subscription
    ItemPrice:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          description: Display name for this pricing tier (e.g., 'Basic', 'Premium')
          maxLength: 255
        description:
          type: string
          nullable: true
          description: Description of what's included in this tier
        amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          description: Price amount in USD (e.g., 9.99 for $9.99, 0 for free)
        currency:
          type: string
          description: Currency code (e.g., 'usd', 'eur')
          maxLength: 3
        interval:
          allOf:
          - $ref: '#/components/schemas/IntervalEnum'
          description: |-
            Billing interval

            * `month` - Monthly
            * `year` - Yearly
            * `one_time` - One Time
        stripe_price_id:
          type: string
          readOnly: true
          nullable: true
          description: Stripe Price ID (on the connected account)
        is_active:
          type: boolean
          description: Whether this price is currently available for purchase
        features:
          nullable: true
          description: List of features included in this tier
        remark:
          type: string
          description: Optional label for this price tier (e.g., 'Most Popular', 'Best
            Value')
          maxLength: 100
        sort_order:
          type: integer
          description: Display order for this price tier
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - amount
      - created_at
      - id
      - name
      - stripe_price_id
      - updated_at
    ItemPriceCreate:
      type: object
      properties:
        name:
          type: string
          description: Display name for this pricing tier (e.g., 'Basic', 'Premium')
          maxLength: 255
        description:
          type: string
          nullable: true
          description: Description of what's included in this tier
        amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
        currency:
          type: string
          description: Currency code (e.g., 'usd', 'eur')
          maxLength: 3
        interval:
          allOf:
          - $ref: '#/components/schemas/IntervalEnum'
          description: |-
            Billing interval

            * `month` - Monthly
            * `year` - Yearly
            * `one_time` - One Time
        is_active:
          type: boolean
          description: Whether this price is currently available for purchase
        features:
          nullable: true
          description: List of features included in this tier
        remark:
          type: string
          description: Optional label for this price tier (e.g., 'Most Popular', 'Best
            Value')
          maxLength: 100
        sort_order:
          type: integer
          description: Display order for this price tier
      required:
      - amount
      - name
    ItemSubscription:
      type: object
      properties:
        unique_id:
          type: string
          format: uuid
          readOnly: true
        user_id:
          type: integer
          readOnly: true
        username:
          type: string
          readOnly: true
        email:
          type: string
          format: email
          readOnly: true
        item_type:
          type: string
          description: Type of item being subscribed to
          maxLength: 50
        item_id:
          type: string
          description: Identifier for the item
          maxLength: 255
        item_name:
          type: string
          readOnly: true
        status:
          allOf:
          - $ref: '#/components/schemas/Status0e3Enum'
          description: |-
            Current subscription status

            * `active` - Active
            * `free` - Free Tier
            * `grandfathered` - Grandfathered
            * `trialing` - Trialing
            * `past_due` - Past Due
            * `canceled` - Canceled
            * `incomplete` - Incomplete
        price:
          allOf:
          - $ref: '#/components/schemas/ItemPrice'
          readOnly: true
        current_period_start:
          type: string
          format: date-time
          nullable: true
          description: Start of current billing period
        current_period_end:
          type: string
          format: date-time
          nullable: true
          description: End of current billing period
        trial_end:
          type: string
          format: date-time
          nullable: true
          description: When the trial ends (if applicable)
        cancel_at_period_end:
          type: boolean
          description: Whether subscription will cancel at period end
        canceled_at:
          type: string
          format: date-time
          nullable: true
          description: When the subscription was canceled
        is_grandfathered:
          type: boolean
          description: Whether this is a grandfathered pre-paywall user
        grandfathered_at:
          type: string
          format: date-time
          nullable: true
          description: When the user was grandfathered
        billing_portal_url:
          type: string
          nullable: true
          readOnly: true
        metadata:
          nullable: true
          description: Additional subscription metadata
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - billing_portal_url
      - created_at
      - email
      - item_id
      - item_name
      - item_type
      - price
      - unique_id
      - updated_at
      - user_id
      - username
    ItemSubscriptionList:
      type: object
      properties:
        unique_id:
          type: string
          format: uuid
          readOnly: true
        user_id:
          type: integer
          readOnly: true
        username:
          type: string
          readOnly: true
        email:
          type: string
          format: email
          readOnly: true
        item_type:
          type: string
          description: Type of item being subscribed to
          maxLength: 50
        item_id:
          type: string
          description: Identifier for the item
          maxLength: 255
        item_name:
          type: string
          readOnly: true
        status:
          allOf:
          - $ref: '#/components/schemas/Status0e3Enum'
          description: |-
            Current subscription status

            * `active` - Active
            * `free` - Free Tier
            * `grandfathered` - Grandfathered
            * `trialing` - Trialing
            * `past_due` - Past Due
            * `canceled` - Canceled
            * `incomplete` - Incomplete
        price:
          allOf:
          - $ref: '#/components/schemas/ItemPrice'
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - created_at
      - email
      - item_id
      - item_name
      - item_type
      - price
      - unique_id
      - updated_at
      - user_id
      - username
    ItemTypeCommission:
      type: object
      description: Commission percentages keyed by item type.
      properties:
        mentor:
          type: number
          format: double
          description: Commission percentage for mentor sales
        course:
          type: number
          format: double
          description: Commission percentage for course sales
        program:
          type: number
          format: double
          description: Commission percentage for program sales
      required:
      - course
      - mentor
      - program
    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
    JudgeRecord:
      type: object
      description: Read shape for a `EvaluationTaskRecord` of type ``llm_judge``.
      properties:
        id:
          type: integer
        dataset_name:
          type: string
        run_name:
          type: string
        score_name:
          type: string
        status:
          type: string
        task_id:
          type: string
        request_metadata:
          type: object
          additionalProperties: {}
        error_message:
          type: string
        username:
          type: string
          readOnly: true
        user_email:
          type: string
          readOnly: true
        created_at:
          type: string
        started_at:
          type: string
          nullable: true
        completed_at:
          type: string
          nullable: true
      required:
      - created_at
      - dataset_name
      - error_message
      - id
      - run_name
      - score_name
      - status
      - task_id
      - user_email
      - username
    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
    LLMJudge:
      type: object
      description: Validates LLM-as-Judge evaluation requests.
      properties:
        criteria:
          type: string
        score_name:
          type: string
          maxLength: 255
        llm_provider:
          type: string
          default: openai
        llm_name:
          type: string
          default: gpt-4o-mini
        max_concurrency:
          type: integer
          maximum: 20
          minimum: 1
          default: 4
      required:
      - criteria
      - score_name
    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
    LLMModelRegistryMinimal:
      type: object
      description: Minimal serializer for LLMModelRegistry in fallback configs.
      properties:
        id:
          type: integer
          readOnly: true
        llm_name:
          type: string
          readOnly: true
          description: Model identifier (e.g., 'gpt-4o', 'gemini-2.5-pro')
        display_name:
          type: string
          readOnly: true
          description: Human-readable model name
        provider_name:
          type: string
          readOnly: true
      required:
      - display_name
      - id
      - llm_name
      - provider_name
    LLMProviderMinimal:
      type: object
      description: Minimal serializer for LLMProvider in fallback configs.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          allOf:
          - $ref: '#/components/schemas/NameEnum'
          readOnly: true
          description: |-
            Provider identifier (e.g., 'openai', 'google')

            * `openai` - OpenAI
            * `google` - Google
            * `anthropic` - Anthropic
            * `azure_openai` - Azure OpenAI
            * `groq` - Groq
            * `bedrock` - AWS Bedrock
            * `perplexity` - Perplexity
            * `nvidia` - NVIDIA
            * `sagemaker` - AWS SageMaker
            * `xai` - xAI
            * `deepseek` - DeepSeek
            * `iblai` - ibl.ai
            * `fake` - Fake (Testing)
        display_name:
          type: string
          readOnly: true
          description: Human-readable provider name
      required:
      - display_name
      - id
      - name
    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
    LeadSource:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
          description: Server-assigned id. Stable across renames.
        platform:
          type: integer
          readOnly: true
          description: Platform the LeadSource belongs to. Set automatically from
            your credentials; you cannot pass another Platform's id.
        name:
          type: string
          description: Display name shown to sales reps when categorizing a Deal.
          maxLength: 128
        code:
          type: string
          description: Stable slug used in API payloads and reports. Unique per Platform;
            lowercase letters, digits, and hyphens.
          maxLength: 64
          pattern: ^[-a-zA-Z0-9_]+$
        metadata:
          description: Free-form JSON for Platform-defined attributes.
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Creation timestamp.
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Last-modified timestamp.
      required:
      - code
      - created_at
      - id
      - name
      - platform
      - updated_at
    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'
        conversations:
          type: object
          additionalProperties: {}
          description: 'Conversation analytics for the user. With conversation_metric=headline
            (default): average messages per conversation, average rating, and average
            cost, each with its previous value and percentage change. With conversation_metric=conversations:
            conversation counts over time as a list of {date, value} points.'
        messages:
          type: object
          additionalProperties: {}
          description: 'The user''s conversation list: `summary` totals, a paginated
            `results` array of conversations, and `pagination` metadata.'
        message_detail:
          type: object
          additionalProperties: {}
          description: 'A single conversation transcript: a `summary` block of conversation
            metadata and a `messages` array of ordered human/AI message pairs.'
    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
    LifecycleStageEnum:
      enum:
      - lead
      - qualified
      - opportunity
      - customer
      - churned
      type: string
      description: |-
        * `lead` - Lead
        * `qualified` - Qualified
        * `opportunity` - Opportunity
        * `customer` - Customer
        * `churned` - Churned
    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
      - azure_openai
      type: string
      description: |-
        * `openai` - Openai
        * `google` - Google
        * `azure_openai` - Azure Openai
    LlmUsageAnalyticsResponse:
      type: object
      description: Response envelope for the LLM usage analytics endpoint.
      properties:
        resource:
          type: string
        data: {}
        meta: {}
      required:
      - resource
    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
        status:
          type: string
          readOnly: true
          description: 'Creation status: pending, building, ready, or failed'
        status_updated_at:
          type: string
          format: date-time
          readOnly: true
          description: When the status last changed
        stalled:
          type: boolean
          readOnly: true
          description: True when an in-flight build exceeded the stall timeout
        mentor_config:
          $ref: '#/components/schemas/LtiMentorCourseXBlock'
        platform_key:
          type: string
          writeOnly: true
          description: Platform key the requesting user belongs to
        async_create:
          type: boolean
          default: false
          description: When True, triggers an async create and reponds with a 202
            instead of 201
      required:
      - course_key
      - id
      - mentor_config
      - name
      - org
      - platform_key
      - stalled
      - status
      - status_updated_at
    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
        target_link_uri:
          type: string
          format: uri
          readOnly: true
          description: The LTI target_link_uri for this mentor xblock
      required:
      - location
      - mentor
      - target_link_uri
    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
        mentor:
          type: string
          format: uuid
          nullable: true
        owner:
          type: string
          nullable: true
          description: edX username
        name:
          type: string
          maxLength: 255
        description:
          type: string
          description: A description of the MCP server.
        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/MCPServerTransportEnum'
        credentials:
          type: string
          description: 'Authorization credentials to authenticate to the MCP server.
            If provided, these take priority over any headers configured on the server.
            Token here must be the full authorization value. For example: `<scheme>
            <credentials>`'
        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.
        auth_type:
          allOf:
          - $ref: '#/components/schemas/AuthTypeEnum'
          description: |-
            The type of authentication to use for the MCP server.

            * `none` - None
            * `token` - Token
            * `oauth2` - Oauth2
        auth_scope:
          allOf:
          - $ref: '#/components/schemas/AuthScopeEnum'
          description: |-
            Determines the required authentication granularity. 'platform' uses shared platform credentials, 'mentor' requires mentor-level credentials, and 'user' requires each user to authenticate individually.

            * `platform` - Platform
            * `mentor` - Mentor
            * `user` - User
        oauth_service:
          type: integer
          writeOnly: true
          nullable: true
        oauth_service_data:
          allOf:
          - $ref: '#/components/schemas/OAuthService'
          readOnly: true
        mcp_server_connections:
          type: string
          readOnly: true
        is_enabled:
          type: boolean
          description: Whether the MCP server is enabled or not.
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - created_at
      - id
      - mcp_server_connections
      - name
      - oauth_service_data
      - platform
      - platform_key
      - updated_at
      - url
    MCPServerConnection:
      type: object
      description: |-
        Serializer for managing `MCPServerConnection` records via the API.

        The serializer enforces the business rules for combining scope, platform,
        and authentication configuration while exposing a masked view of any stored
        credentials.
      properties:
        id:
          type: integer
          readOnly: true
        server:
          type: integer
        server_name:
          type: string
          readOnly: true
        scope:
          allOf:
          - $ref: '#/components/schemas/MCPServerConnectionScopeEnum'
          description: |-
            Whether this connection is scoped to a user or shared across a platform.

            * `user` - User
            * `mentor` - Mentor
            * `platform` - Platform
        auth_type:
          $ref: '#/components/schemas/AuthTypeEnum'
        platform:
          type: integer
          nullable: true
        platform_key:
          type: string
          nullable: true
          readOnly: true
        user:
          type: string
          nullable: true
          description: edX username
        mentor:
          type: string
          format: uuid
          nullable: true
        connected_service:
          type: integer
          nullable: true
        connected_service_summary:
          type: object
          additionalProperties: {}
          nullable: true
          readOnly: true
        credentials:
          type: string
          description: Static credential/token value for token-based authentication.
        authorization_scheme:
          type: string
          description: Authorization scheme to prefix tokens with (e.g. 'Bearer').
          maxLength: 50
        extra_headers:
          description: Additional headers to include when connecting to the MCP server.
        is_active:
          type: boolean
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - connected_service_summary
      - created_at
      - id
      - platform_key
      - server
      - server_name
      - updated_at
    MCPServerConnectionScopeEnum:
      enum:
      - user
      - mentor
      - platform
      type: string
      description: |-
        * `user` - User
        * `mentor` - Mentor
        * `platform` - Platform
    MCPServerOauthFind:
      type: object
      properties:
        url:
          type: string
          format: uri
        callback_url:
          type: string
          format: uri
          default: ''
        name:
          type: string
          default: ''
      required:
      - url
    MCPServerTransportEnum:
      enum:
      - sse
      - websocket
      - streamable_http
      type: string
      description: |-
        * `sse` - Sse
        * `websocket` - Websocket
        * `streamable_http` - Streamable Http
    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
          description: Status message after marking notifications as read
        count:
          type: integer
          description: Number of notifications marked as read
      required:
      - count
      - message
    MaskedIntegrationCredential:
      type: object
      description: |-
        Used for POST / PATCH responses on the integration-credential endpoint.

        ``to_representation`` substitutes ``IntegrationCredential.masked_value``
        for the raw ``value`` field, so sensitive fields (as flagged by the
        linked v2 ``IntegrationCredentialSchema``) come out masked
        (e.g. ``"sk-****"``). Admin-only — GET responses go through
        ``AdminIntegrationCredentialSerializer`` or
        ``StudentIntegrationCredentialSerializer`` instead, depending on caller
        role.
      properties:
        name:
          type: string
          maxLength: 255
        value:
          type: object
          additionalProperties: {}
          description: |-
            Returns non-sensitive fields only.
            Safe to return to students.
          readOnly: true
        platform:
          type: string
          description: The platform key
        service_info:
          allOf:
          - $ref: '#/components/schemas/ExternalServiceInfo'
          readOnly: true
      required:
      - name
      - platform
      - service_info
      - value
    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
    McpServerConfig:
      type: object
      description: |-
        ``McpServerSchema`` from ``src/config/zod-schema.ts``.

        All fields are optional (``catchall(unknown)`` on the upstream side) so
        callers can submit subsets.  Extra fields are allowed.
      properties:
        command:
          type: string
        args:
          type: array
          items:
            type: string
        env:
          type: object
          additionalProperties: {}
        cwd:
          type: string
        workingDirectory:
          type: string
        url:
          type: string
          format: uri
        transport:
          $ref: '#/components/schemas/McpServerConfigTransportEnum'
        headers:
          type: object
          additionalProperties: {}
    McpServerConfigTransportEnum:
      enum:
      - sse
      - streamable-http
      type: string
      description: |-
        * `sse` - sse
        * `streamable-http` - streamable-http
    McpServerCreate:
      type: object
      description: Body for ``POST mcp-servers/``.
      properties:
        name:
          type: string
        config:
          $ref: '#/components/schemas/McpServerConfig'
      required:
      - config
      - name
    McpServerEntry:
      type: object
      description: One entry in the MCP servers listing.
      properties:
        name:
          type: string
        config:
          $ref: '#/components/schemas/McpServerConfig'
      required:
      - config
      - name
    McpServerListResponse:
      type: object
      properties:
        servers:
          type: array
          items:
            $ref: '#/components/schemas/McpServerEntry'
      required:
      - servers
    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
          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/MemoryComponentDataKindEnum'
        content:
          type: string
      required:
      - content
    MemoryComponentDataKindEnum:
      enum:
      - KnowledgeGap
      - LessonsLearned
      - HelpRequest
      type: string
      description: |-
        * `KnowledgeGap` - KnowledgeGap
        * `LessonsLearned` - LessonsLearned
        * `HelpRequest` - HelpRequest
    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
        enable_offline_mode:
          type: boolean
          description: Allow this mentor to be used offline with local LLMs
        metadata:
          nullable: true
        enable_moderation:
          type: boolean
        enable_multi_query_rag:
          type: boolean
        enable_prompt_caching:
          type: boolean
          description: Enable prompt caching for Anthropic models to reduce latency
            and cost. This disabled RAG and other dynamic parts of system prompt such
            as memory, current datetime, etc. Use with caution
        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.'
        save_flagged_prompts:
          type: boolean
        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
        iblai_voice:
          type: integer
          nullable: true
          description: Voice used when voice_provider is 'iblai'. Leave empty to use
            the tenant's configured default voice.
        voice_provider:
          allOf:
          - $ref: '#/components/schemas/VoiceProviderEefEnum'
          description: |-
            TTS provider used when synthesizing chat messages from this mentor. Selects which of the *_voice fields applies. `iblai` synthesizes through our own gateway with the model configured on the tenant's ibl.ai routing profile, and uses iblai_voice — except when that model is an OpenAI one, which takes openai_voice.

            * `browser` - Browser
            * `openai` - OpenAI
            * `google` - Google
            * `iblai` - ibl.ai
        voice_instructions:
          type: string
          description: 'Free-form instructions describing the desired voice and reading
            style (tone, pace, emotion, accent) for TTS synthesis. Passed to providers
            that support style prompts: OpenAI as the speech ``instructions`` and
            Google as the synthesis ``prompt``. Ignored by providers/voices that don''t
            support styling.'
        categories:
          type: array
          items:
            $ref: '#/components/schemas/MentorCategory'
        types:
          type: array
          items:
            $ref: '#/components/schemas/MentorType'
        is_featured:
          type: boolean
          description: Whether the mentor is featured or not.
        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
        study_mode_prompt:
          type: string
          description: Prompt to be used to guide the user through their studies when
            study mode tool is enabled.
        disclaimer:
          type: string
          description: Disclaimer to be shown to the user when the mentor is used.
        enable_disclaimer:
          type: boolean
        show_attachment:
          type: boolean
          description: Show attachments on mentor.
        show_voice_call:
          type: boolean
          description: Show voice call button on mentor.
        show_voice_record:
          type: boolean
          description: Show voice recording button on mentor.
        show_rag_images:
          type: boolean
          description: Show RAG images in mentor response.
        show_catalogue:
          type: boolean
          description: Show catalogue on mentor.
        show_reasoning:
          type: boolean
          description: Show reasoning on mentor.
        starter_prompts:
          allOf:
          - $ref: '#/components/schemas/StarterPromptsB04Enum'
          description: |-
            Type of starter prompts to show: guided_prompt or suggested_prompt.

            * `guided_prompt` - Guided Prompt
            * `suggested_prompt` - Suggested Prompt
        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.
        embed_show_canvas:
          type: boolean
          description: Show display canvas on embedded mentor.
        show_explore_mentors:
          type: boolean
          description: Show explore mentors option.
        embed_icon_selection_data:
          nullable: true
          description: Stores embedded icon selection data for the mentor widget.
        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
        enable_privacy_router:
          type: boolean
          description: 'Master switch: enable input filtering before messages reach
            the LLM. Which categories run is controlled by filter_pii / filter_phi.'
        filter_pii:
          type: boolean
          description: When the privacy router is enabled, apply PII detection/filtering
            (uses privacy_action / privacy_entities).
        privacy_action:
          allOf:
          - $ref: '#/components/schemas/PrivacyActionEnum'
          description: |-
            Action to take when PII is detected: redact replaces with labels, mask partially hides, block rejects the message, allow passes the message through unchanged while still logging the detection

            * `redact` - Redact
            * `mask` - Mask
            * `block` - Block
            * `allow` - Allow
        privacy_entities:
          description: List of PII entity types to detect. Empty list uses defaults
            (PERSON, EMAIL, PHONE, SSN, etc.)
        privacy_response:
          type: string
          description: Response shown to user when a message is blocked due to PII
            detection
        enable_privacy_output_filter:
          type: boolean
          description: 'Master switch: also filter LLM responses (output rail). Which
            categories run is controlled by filter_pii / filter_phi.'
        filter_phi:
          type: boolean
          description: When the privacy router is enabled, apply PHI detection/filtering
            (uses phi_action / phi_entities).
        phi_action:
          allOf:
          - $ref: '#/components/schemas/PhiActionEnum'
          description: |-
            Action to take when PHI is detected: redact replaces with labels, mask partially hides, block rejects the message, allow passes the message through unchanged while still logging the detection

            * `redact` - Redact
            * `mask` - Mask
            * `block` - Block
            * `allow` - Allow
        phi_entities:
          description: List of PHI entity types to detect. Empty list detects all
            supported clinical and identifier entities.
        phi_response:
          type: string
          description: Response shown to user when a message is blocked due to PHI
            detection
        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
          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
        enable_computational_runtime:
          type: boolean
          nullable: true
          description: 'Per-mentor toggle for the sandboxed quickjs code-interpreter
            middleware on the graph agent. Off by default: the middleware runs an
            in-process JS REPL that adds latency and system-resource overhead, so
            it is only enabled for mentors that specifically need computational tool
            use. Even when True, the middleware is only attached if the mentor''s
            chosen LLM supports function calling; it is never attached for the fake
            graph mentors used in tests/healthchecks. Nullable so the add-column migration
            is a no-op for existing rows during a rolling multi-server deploy; a NULL
            value is treated as False at read time.'
      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
    MentorAuditLogEntry:
      type: object
      description: |-
        Serializer for a single audit log entry.

        Transforms DMAuditLogEntry model instances into API response format.
      properties:
        id:
          type: integer
          description: Audit log entry ID
        timestamp:
          type: string
          format: date-time
          description: When the action occurred
        actor_username:
          type: string
          nullable: true
          description: Username of the user who performed the action
        actor_email:
          type: string
          nullable: true
          description: Email of the user who performed the action
        action:
          type: string
          description: 'Action type: create, update, or delete'
        resource_type:
          type: string
          description: Type of resource modified (e.g., mentor, mentorsettings)
        resource_id:
          type: string
          description: ID of the modified resource
        resource_repr:
          type: string
          description: Human-readable representation of the resource
        changes:
          type: object
          additionalProperties: {}
          description: Dictionary of field changes with old and new values
      required:
      - action
      - actor_email
      - actor_username
      - changes
      - id
      - resource_id
      - resource_repr
      - resource_type
      - timestamp
    MentorBreakdown:
      type: object
      description: Agent 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
        enable_offline_mode:
          type: boolean
          description: Allow this mentor to be used offline with local LLMs
        metadata:
          nullable: true
        enable_moderation:
          type: boolean
        enable_multi_query_rag:
          type: boolean
        enable_prompt_caching:
          type: boolean
          description: Enable prompt caching for Anthropic models to reduce latency
            and cost. This disabled RAG and other dynamic parts of system prompt such
            as memory, current datetime, etc. Use with caution
        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.'
        save_flagged_prompts:
          type: boolean
        google_voice:
          type: integer
          nullable: true
        openai_voice:
          type: integer
          nullable: true
        iblai_voice:
          type: integer
          nullable: true
          description: Voice used when voice_provider is 'iblai'. Leave empty to use
            the tenant's configured default voice.
        voice_provider:
          allOf:
          - $ref: '#/components/schemas/VoiceProviderEefEnum'
          description: |-
            TTS provider used when synthesizing chat messages from this mentor. Selects which of the *_voice fields applies. `iblai` synthesizes through our own gateway with the model configured on the tenant's ibl.ai routing profile, and uses iblai_voice — except when that model is an OpenAI one, which takes openai_voice.

            * `browser` - Browser
            * `openai` - OpenAI
            * `google` - Google
            * `iblai` - ibl.ai
        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
        study_mode_prompt:
          type: string
          description: Prompt to be used to guide the user through their studies when
            study mode tool is enabled.
        disclaimer:
          type: string
          description: Disclaimer to be shown to the user when the mentor is used.
        enable_disclaimer:
          type: boolean
        show_attachment:
          type: boolean
          description: Show attachments on mentor.
        show_voice_call:
          type: boolean
          description: Show voice call button on mentor.
        show_voice_record:
          type: boolean
          description: Show voice recording button on mentor.
        show_rag_images:
          type: boolean
          description: Show RAG images in mentor response.
        show_catalogue:
          type: boolean
          description: Show catalogue on mentor.
        show_reasoning:
          type: boolean
          description: Show reasoning on mentor.
        starter_prompts:
          allOf:
          - $ref: '#/components/schemas/StarterPromptsB04Enum'
          description: |-
            Type of starter prompts to show: guided_prompt or suggested_prompt.

            * `guided_prompt` - Guided Prompt
            * `suggested_prompt` - Suggested Prompt
        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.
        embed_show_canvas:
          type: boolean
          description: Show display canvas on embedded mentor.
        show_explore_mentors:
          type: boolean
          description: Show explore mentors option.
        embed_icon_selection_data:
          nullable: true
          description: Stores embedded icon selection data for the mentor widget.
        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
        strip_page_content_html:
          type: boolean
          nullable: true
          description: Per-mentor toggle for stripping HTML markup from `payload.page_content`
            before it is envelope-wrapped and cached for the LLM. Defaults to False
            (raw HTML reaches the prompt). Set to True to strip markup, e.g. when
            pages embed inline JSON/CSS in script/style tags that bloats the context
            window. Nullable so the add-column migration is a no-op for existing rows
            during a rolling multi-server deploy; a NULL value is treated as False
            at read time.
        enable_safety_system:
          type: boolean
        enable_privacy_router:
          type: boolean
          description: 'Master switch: enable input filtering before messages reach
            the LLM. Which categories run is controlled by filter_pii / filter_phi.'
        filter_pii:
          type: boolean
          description: When the privacy router is enabled, apply PII detection/filtering
            (uses privacy_action / privacy_entities).
        privacy_action:
          allOf:
          - $ref: '#/components/schemas/PrivacyActionEnum'
          description: |-
            Action to take when PII is detected: redact replaces with labels, mask partially hides, block rejects the message, allow passes the message through unchanged while still logging the detection

            * `redact` - Redact
            * `mask` - Mask
            * `block` - Block
            * `allow` - Allow
        privacy_entities:
          description: List of PII entity types to detect. Empty list uses defaults
            (PERSON, EMAIL, PHONE, SSN, etc.)
        privacy_response:
          type: string
          description: Response shown to user when a message is blocked due to PII
            detection
        enable_privacy_output_filter:
          type: boolean
          description: 'Master switch: also filter LLM responses (output rail). Which
            categories run is controlled by filter_pii / filter_phi.'
        filter_phi:
          type: boolean
          description: When the privacy router is enabled, apply PHI detection/filtering
            (uses phi_action / phi_entities).
        phi_action:
          allOf:
          - $ref: '#/components/schemas/PhiActionEnum'
          description: |-
            Action to take when PHI is detected: redact replaces with labels, mask partially hides, block rejects the message, allow passes the message through unchanged while still logging the detection

            * `redact` - Redact
            * `mask` - Mask
            * `block` - Block
            * `allow` - Allow
        phi_entities:
          description: List of PHI entity types to detect. Empty list detects all
            supported clinical and identifier entities.
        phi_response:
          type: string
          description: Response shown to user when a message is blocked due to PHI
            detection
        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
          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
        enable_computational_runtime:
          type: boolean
          nullable: true
          description: 'Per-mentor toggle for the sandboxed quickjs code-interpreter
            middleware on the graph agent. Off by default: the middleware runs an
            in-process JS REPL that adds latency and system-resource overhead, so
            it is only enabled for mentors that specifically need computational tool
            use. Even when True, the middleware is only attached if the mentor''s
            chosen LLM supports function calling; it is never attached for the fake
            graph mentors used in tests/healthchecks. Nullable so the add-column migration
            is a no-op for existing rows during a rolling multi-server deploy; a NULL
            value is treated as False at read time.'
      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
        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
    MentorFromTemplate:
      type: object
      properties:
        detail:
          type: string
      required:
      - detail
    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
        custom_javascript:
          type: string
        uploaded_profile_image:
          type: string
          format: uri
        embed_custom_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.0
          maximum: 1.0
        seo_tags: {}
        marketing_conversations: {}
        proactive_prompt:
          type: string
        study_mode_prompt:
          type: string
        disclaimer:
          type: string
        enable_disclaimer:
          type: boolean
          default: true
        show_attachment:
          type: boolean
          default: true
        show_voice_call:
          type: boolean
          default: true
        show_voice_record:
          type: boolean
          default: true
        show_rag_images:
          type: boolean
          default: false
        show_catalogue:
          type: boolean
          default: true
        show_reasoning:
          type: boolean
          default: true
        starter_prompts:
          allOf:
          - $ref: '#/components/schemas/StarterPrompts8c6Enum'
          default: guided_prompt
        embed_is_context_aware:
          type: boolean
          default: false
        embed_open_by_default:
          type: boolean
          default: false
        embed_show_attachment:
          type: boolean
          default: true
        embed_show_voice_call:
          type: boolean
          default: true
        embed_show_voice_record:
          type: boolean
          default: true
        embed_show_canvas:
          type: boolean
          default: true
        show_explore_mentors:
          type: boolean
          default: true
        embed_icon_selection_data:
          nullable: true
        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_prompt_caching:
          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
        iblai_voice:
          type: integer
        voice_provider:
          $ref: '#/components/schemas/MentorFromTemplateWithSettingRequestVoiceProviderEnum'
        voice_instructions:
          type: string
        enable_suggested_prompts:
          type: boolean
          nullable: true
        enable_guided_prompts:
          type: boolean
          nullable: true
        save_flagged_prompts:
          type: boolean
          nullable: true
          default: true
        mcp_servers:
          type: array
          items:
            type: integer
          nullable: true
        guided_prompt_instructions:
          type: string
          nullable: true
        is_featured:
          type: boolean
          default: false
      required:
      - new_mentor_name
      - template_name
    MentorFromTemplateWithSettingRequestVoiceProviderEnum:
      enum:
      - openai
      - google
      - iblai
      type: string
      description: |-
        * `openai` - openai
        * `google` - google
        * `iblai` - iblai
    MentorGraderConfig:
      type: object
      description: |-
        Config-only surface. Criteria are managed through the criteria
        endpoints — keeping the two responsibilities separate.
      properties:
        id:
          type: integer
          readOnly: true
        mentor:
          type: string
          format: uuid
          readOnly: true
        grading_mode:
          allOf:
          - $ref: '#/components/schemas/GradingModeEnum'
          description: |-
            Selects which grading tool the mentor exposes to the LLM. Only one tool is exposed per mode so the agent can't choose between them.

            * `submission` - Submission
            * `conversation` - Conversation
        grader_instructions:
          type: string
          description: Describe the problem that's being graded and any special instructions
            outside of the rubric. The grading LLM is already instructed to give a
            score of 0-1 for each rubric criterion which is multiplied by the criterion's
            points to give earned points; overall score is total earned points / total
            possible points.
        feedback_mode:
          $ref: '#/components/schemas/FeedbackModeEnum'
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - created_at
      - feedback_mode
      - grader_instructions
      - id
      - mentor
      - updated_at
    MentorInteractions:
      type: object
      properties:
        session_count:
          type: integer
          description: Total conversations the user has started with this agent, including
            empty ones.
        conversation_count:
          type: integer
          description: Conversations that had real back-and-forth (at least one user
            message and one agent reply). Always less than or equal to session_count.
        message_count_human:
          type: integer
          description: Total messages the user sent to this agent across all conversations.
        message_count_ai:
          type: integer
          description: Total replies this agent sent to the user across all conversations.
        total_messages:
          type: integer
          description: Sum of user and agent messages exchanged with this agent.
        avg_messages_per_session:
          type: number
          format: double
          description: Average messages per conversation (total_messages / session_count);
            0 with no conversations.
        first_interaction:
          type: string
          format: date-time
          nullable: true
          description: When the user first messaged this agent.
        latest_interaction:
          type: string
          format: date-time
          nullable: true
          description: When the user most recently interacted with this agent.
        active_days:
          type: integer
          description: Number of distinct calendar days the user exchanged messages
            with this agent.
        cost_usd:
          type: string
          format: decimal
          pattern: ^-?\d{0,10}(?:\.\d{0,4})?$
          nullable: true
          description: Total amount the user has spent on this agent, in USD.
        rating:
          type: number
          format: double
          nullable: true
          description: Rating the user gave this agent.
        is_starred:
          type: boolean
          default: false
          description: Whether the user has favorited (starred) this agent.
      required:
      - active_days
      - avg_messages_per_session
      - conversation_count
      - message_count_ai
      - message_count_human
      - session_count
      - 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:
          allOf:
          - $ref: '#/components/schemas/RoleEnum'
          description: |-
            Role for accessing this mentor

            * `viewer` - viewer
            * `editor` - editor
            * `chat` - chat
            * `analytics_viewer` - analytics_viewer
            * `dataset_curator` - dataset_curator
        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
        usernames_to_add:
          type: array
          items:
            type: string
          writeOnly: true
          description: List of usernames to grant access to this mentor
        emails_to_add:
          type: array
          items:
            type: string
            format: email
          writeOnly: true
          description: List of user emails 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
        custom_javascript:
          type: string
          nullable: true
        enable_custom_javascript:
          type: boolean
          readOnly: true
        allow_anonymous:
          type: boolean
          readOnly: true
        enable_offline_mode:
          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
        study_mode_prompt:
          type: string
          readOnly: true
        voice_instructions:
          type: string
          readOnly: true
        disclaimer:
          type: string
          readOnly: true
        enable_disclaimer:
          type: boolean
          readOnly: true
        show_attachment:
          type: boolean
          readOnly: true
        show_voice_call:
          type: boolean
          readOnly: true
        show_voice_record:
          type: boolean
          readOnly: true
        show_rag_images:
          type: boolean
          readOnly: true
        show_catalogue:
          type: boolean
          readOnly: true
        show_reasoning:
          type: boolean
          readOnly: true
        starter_prompts:
          type: string
          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
        embed_show_canvas:
          type: boolean
          readOnly: true
        show_explore_mentors:
          type: boolean
          readOnly: true
        embed_icon_selection_data:
          readOnly: true
        embed_custom_image:
          type: string
          format: uri
          nullable: 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
        is_featured:
          type: boolean
          readOnly: true
        enable_guided_prompts:
          type: boolean
          readOnly: true
        save_flagged_prompts:
          type: boolean
          readOnly: true
        enable_moderation:
          type: boolean
          readOnly: true
        enable_multi_query_rag:
          type: boolean
          readOnly: true
        enable_prompt_caching:
          type: boolean
          readOnly: true
        enable_post_processing_system:
          type: boolean
          readOnly: true
        enable_safety_system:
          type: boolean
          readOnly: true
        enable_privacy_router:
          type: boolean
          readOnly: true
        filter_pii:
          type: boolean
          readOnly: true
        filter_phi:
          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
        segment:
          allOf:
          - $ref: '#/components/schemas/Segment'
          nullable: true
          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
        llm_provider:
          type: string
          readOnly: true
        enable_voice_call:
          type: boolean
          readOnly: true
        system_prompt:
          type: string
          readOnly: true
        shared_system_prompt_source:
          type: object
          additionalProperties: {}
          nullable: true
          readOnly: true
        llm_temperature:
          type: number
          format: double
          readOnly: true
        safety_system_prompt:
          type: string
          readOnly: true
        safety_response:
          type: string
          readOnly: true
        privacy_action:
          type: string
          readOnly: true
        privacy_entities:
          type: array
          items: {}
          readOnly: true
        privacy_response:
          type: string
          readOnly: true
        enable_privacy_output_filter:
          type: boolean
          readOnly: true
        phi_action:
          type: string
          readOnly: true
        phi_entities:
          type: array
          items: {}
          readOnly: true
        phi_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
        strip_page_content_html:
          type: boolean
          readOnly: true
        chat_history_max_tokens:
          type: integer
          readOnly: true
        chat_history_max_messages:
          type: integer
          readOnly: true
        rag_retrieval_k:
          type: integer
          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
        iblai_voice:
          type: string
          readOnly: true
        voice_provider:
          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
        is_lti_accessible:
          type: boolean
          nullable: true
          description: Enables LTI access for this mentor. When True, LTI users can
            be granted access via RBAC policies.
        enable_claw:
          type: boolean
        enable_virtual_machine:
          type: boolean
          description: Gives the graph agent an `execute` shell tool backed by an
            isolated per-chat-run VM (iblai-sandbox). The VM is created lazily on
            the first executed command and destroyed when the chat run ends. Supersedes
            the quickjs computational runtime when both are enabled.
        virtual_machine_egress:
          allOf:
          - $ref: '#/components/schemas/VirtualMachineEgressEnum'
          description: |-
            Network policy for the mentor's virtual machine, passed to the sandbox control plane as the egress profile. Defaults to no network access: the VM runs untrusted code, so outbound access is opt-in. The tenant must be granted the matching profile on the control plane.

            * `none` - None
            * `registries` - Registries
            * `public` - Public
      required:
      - allow_anonymous
      - call_configuration
      - can_use_tools
      - categories
      - chat_history_max_messages
      - chat_history_max_tokens
      - created_at
      - created_by
      - department
      - disable_chathistory
      - disclaimer
      - embed_icon_selection_data
      - embed_is_context_aware
      - embed_open_by_default
      - embed_show_attachment
      - embed_show_canvas
      - embed_show_voice_call
      - embed_show_voice_record
      - enable_custom_javascript
      - enable_disclaimer
      - enable_email_chat
      - enable_guided_prompts
      - enable_instruction_mode
      - enable_memory_component
      - enable_moderation
      - enable_multi_query_rag
      - enable_offline_mode
      - enable_openai_assistant
      - enable_post_processing_system
      - enable_privacy_output_filter
      - enable_privacy_router
      - enable_prompt_caching
      - enable_safety_system
      - enable_socratic_mode
      - enable_spaced_repetition
      - enable_suggested_prompts
      - enable_total_grounding
      - enable_voice_call
      - filter_phi
      - filter_pii
      - forkable
      - forkable_with_training_data
      - google_voice
      - greeting_method
      - guided_prompt_instructions
      - iblai_voice
      - id
      - is_deleted
      - is_featured
      - 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
      - phi_action
      - phi_entities
      - phi_response
      - placeholder_prompt
      - platform_key
      - post_processing_prompt
      - privacy_action
      - privacy_entities
      - privacy_response
      - proactive_prompt
      - proactive_response
      - rag_retrieval_k
      - recently_accessed_at
      - safety_response
      - safety_system_prompt
      - save_flagged_prompts
      - segment
      - seo_tags
      - shared_system_prompt_source
      - show_attachment
      - show_catalogue
      - show_explore_mentors
      - show_rag_images
      - show_reasoning
      - show_voice_call
      - show_voice_record
      - starter_prompts
      - strip_page_content_html
      - study_mode_prompt
      - subjects
      - suggested_prompts
      - system_prompt
      - template_mentor
      - types
      - updated_at
      - voice_instructions
      - voice_provider
    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
        custom_javascript:
          type: string
          nullable: true
        enable_custom_javascript:
          type: boolean
          readOnly: true
        allow_anonymous:
          type: boolean
          readOnly: true
        enable_offline_mode:
          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
        study_mode_prompt:
          type: string
          readOnly: true
        voice_instructions:
          type: string
          readOnly: true
        disclaimer:
          type: string
          readOnly: true
        enable_disclaimer:
          type: boolean
          readOnly: true
        show_attachment:
          type: boolean
          readOnly: true
        show_voice_call:
          type: boolean
          readOnly: true
        show_voice_record:
          type: boolean
          readOnly: true
        show_rag_images:
          type: boolean
          readOnly: true
        show_catalogue:
          type: boolean
          readOnly: true
        show_reasoning:
          type: boolean
          readOnly: true
        starter_prompts:
          type: string
          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
        embed_show_canvas:
          type: boolean
          readOnly: true
        show_explore_mentors:
          type: boolean
          readOnly: true
        embed_icon_selection_data:
          readOnly: true
        embed_custom_image:
          type: string
          format: uri
          nullable: 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
        is_featured:
          type: boolean
          readOnly: true
        enable_guided_prompts:
          type: boolean
          readOnly: true
        save_flagged_prompts:
          type: boolean
          readOnly: true
        enable_moderation:
          type: boolean
          readOnly: true
        enable_multi_query_rag:
          type: boolean
          readOnly: true
        enable_prompt_caching:
          type: boolean
          readOnly: true
        enable_post_processing_system:
          type: boolean
          readOnly: true
        enable_safety_system:
          type: boolean
          readOnly: true
        enable_privacy_router:
          type: boolean
          readOnly: true
        filter_pii:
          type: boolean
          readOnly: true
        filter_phi:
          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
        segment:
          allOf:
          - $ref: '#/components/schemas/Segment'
          nullable: true
          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
        llm_provider:
          type: string
          readOnly: true
        enable_voice_call:
          type: boolean
          readOnly: true
      required:
      - allow_anonymous
      - can_use_tools
      - categories
      - created_at
      - created_by
      - disclaimer
      - embed_icon_selection_data
      - embed_is_context_aware
      - embed_open_by_default
      - embed_show_attachment
      - embed_show_canvas
      - embed_show_voice_call
      - embed_show_voice_record
      - enable_custom_javascript
      - enable_disclaimer
      - enable_email_chat
      - enable_guided_prompts
      - enable_instruction_mode
      - enable_memory_component
      - enable_moderation
      - enable_multi_query_rag
      - enable_offline_mode
      - enable_post_processing_system
      - enable_privacy_router
      - enable_prompt_caching
      - enable_safety_system
      - enable_socratic_mode
      - enable_spaced_repetition
      - enable_voice_call
      - filter_phi
      - filter_pii
      - forkable
      - forkable_with_training_data
      - greeting_method
      - id
      - is_featured
      - is_guided_mentor
      - llm_config
      - llm_name
      - llm_provider
      - 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
      - save_flagged_prompts
      - segment
      - show_attachment
      - show_catalogue
      - show_explore_mentors
      - show_rag_images
      - show_reasoning
      - show_voice_call
      - show_voice_record
      - starter_prompts
      - study_mode_prompt
      - subjects
      - suggested_prompts
      - types
      - updated_at
      - voice_instructions
    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
        strip_page_content_html:
          type: boolean
        enable_computational_runtime:
          type: boolean
        chat_history_max_tokens:
          type: integer
          minimum: 1
          nullable: true
        chat_history_max_messages:
          type: integer
          minimum: 1
          nullable: true
        rag_retrieval_k:
          type: integer
          minimum: 1
          nullable: true
        metadata:
          nullable: true
        custom_css:
          type: string
          nullable: true
        custom_javascript:
          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
        enable_claw:
          type: boolean
        enable_virtual_machine:
          type: boolean
        virtual_machine_egress:
          $ref: '#/components/schemas/VirtualMachineEgressEnum'
        is_lti_accessible:
          type: boolean
        allow_anonymous:
          type: boolean
        enable_offline_mode:
          type: boolean
        forkable:
          type: boolean
        forkable_with_training_data:
          type: boolean
        mentor_description:
          type: string
        uploaded_profile_image:
          type: string
          format: uri
        embed_custom_image:
          type: string
          format: uri
          nullable: true
        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.0
          maximum: 1.0
        proactive_prompt:
          type: string
        study_mode_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_prompt_caching:
          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
        save_flagged_prompts:
          type: boolean
          nullable: true
          default: true
        mcp_servers:
          type: array
          items:
            type: integer
          nullable: true
        show_attachment:
          type: boolean
        show_voice_call:
          type: boolean
        show_voice_record:
          type: boolean
        show_rag_images:
          type: boolean
        show_catalogue:
          type: boolean
        show_reasoning:
          type: boolean
        starter_prompts:
          $ref: '#/components/schemas/StarterPrompts8c6Enum'
        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
        embed_show_canvas:
          type: boolean
        show_explore_mentors:
          type: boolean
        embed_icon_selection_data:
          nullable: true
        google_voice:
          type: integer
        openai_voice:
          type: integer
        iblai_voice:
          type: integer
        voice_provider:
          $ref: '#/components/schemas/MentorSettingsRequestVoiceProviderEnum'
        voice_instructions:
          type: string
        guided_prompt_instructions:
          type: string
          nullable: true
        safety_system_prompt:
          type: string
        safety_response:
          type: string
        enable_safety_system:
          type: boolean
        enable_privacy_router:
          type: boolean
        enable_privacy_output_filter:
          type: boolean
        filter_pii:
          type: boolean
        privacy_action:
          $ref: '#/components/schemas/PrivacyActionEnum'
        privacy_entities:
          type: array
          items:
            type: string
        privacy_response:
          type: string
        filter_phi:
          type: boolean
        phi_action:
          $ref: '#/components/schemas/PhiActionEnum'
        phi_entities:
          type: array
          items:
            type: string
        phi_response:
          type: string
        enable_memory_component:
          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
        is_featured:
          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
        segment:
          type: integer
          nullable: true
          description: ID of the segment, or null to clear it
    MentorSettingsRequestVoiceProviderEnum:
      enum:
      - browser
      - openai
      - google
      - iblai
      type: string
      description: |-
        * `browser` - browser
        * `openai` - openai
        * `google` - google
        * `iblai` - iblai
    MentorSkillAssignment:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        mentor:
          type: string
          format: uuid
          readOnly: true
        mentor_name:
          type: string
          readOnly: true
        mentor_slug:
          type: string
          readOnly: true
        skill:
          type: string
          format: uuid
        skill_name:
          type: string
          readOnly: true
        skill_slug:
          type: string
          readOnly: true
        enabled:
          type: boolean
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - created_at
      - id
      - mentor
      - mentor_name
      - mentor_slug
      - skill
      - skill_name
      - skill_slug
      - updated_at
    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
        is_shared:
          type: boolean
        proactive_prompt:
          type: string
        mentor_unique_id:
          type: string
        platform_key:
          type: string
        previous:
          type: string
        next:
          type: string
        results:
          type: array
          items: {}
        client_context:
          nullable: true
      required:
      - count
      - is_shared
      - 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
        is_shared:
          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
    ModalityEnum:
      enum:
      - text
      - multimodal
      - voice
      type: string
      description: |-
        * `text` - Text
        * `multimodal` - Multimodal
        * `voice` - Voice
    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
        email:
          type: string
          readOnly: true
        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
      - email
      - id
      - mentor
      - platform_key
      - prompt
      - reason
    NameEnum:
      enum:
      - openai
      - google
      - anthropic
      - azure_openai
      - groq
      - bedrock
      - perplexity
      - nvidia
      - sagemaker
      - xai
      - deepseek
      - iblai
      - fake
      type: string
    NestedArtifact:
      type: object
      description: |-
        Artifact embedded in another response (version rows, session open).

        The bytes live once and are fetched from the artifact detail endpoint (or
        carried by the current version's own `binary_content`); repeating them on
        every embedding would put a copy — and a storage read — on each row.
      properties:
        id:
          type: integer
          readOnly: true
        title:
          type: string
          description: Title or identifier for the artifact
          maxLength: 255
        content:
          type: string
          description: Text content of the artifact; empty for binary artifacts
          readOnly: true
        binary_content:
          type: string
          readOnly: true
          description: Always null on an embedded artifact; fetch the artifact (or
            the current version) for the bytes.
        is_binary:
          type: boolean
          readOnly: true
          description: True when the artifact carries `binary_content` instead of
            `content`
        mime_type:
          type: string
          readOnly: true
          description: MIME type of a binary artifact, e.g. application/pdf.
        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
        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
          nullable: true
          readOnly: true
        current_version_number:
          type: integer
          description: Version number of the current version
          readOnly: true
        version_count:
          type: integer
          description: Total number of versions for this artifact
          readOnly: true
      required:
      - binary_content
      - content
      - current_version_number
      - date_created
      - date_updated
      - file_extension
      - id
      - is_binary
      - llm_name
      - llm_provider
      - mime_type
      - session_id
      - title
      - username
      - version_count
    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
          nullable: true
          readOnly: true
        title:
          type: string
          readOnly: true
        body:
          type: string
          readOnly: true
        status:
          title: Message status
          oneOf:
          - $ref: '#/components/schemas/Status3daEnum'
          - $ref: '#/components/schemas/BlankEnum'
        channel:
          type: string
          nullable: true
          readOnly: true
        context:
          nullable: true
        short_message:
          type: string
          readOnly: true
        tags:
          type: array
          items:
            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
      - tags
      - title
      - updated_at
      - username
    NotificationCount:
      type: object
      properties:
        status:
          allOf:
          - $ref: '#/components/schemas/Status3daEnum'
          description: |-
            Filter count by notification status

            * `READ` - Read
            * `UNREAD` - Unread
            * `CANCELLED` - Cancelled
        channel:
          type: string
          description: Filter count by delivery channel
    NotificationFrequencyEnum:
      enum:
      - daily
      - weekly
      - monthly
      - important_only
      type: string
      description: |-
        * `daily` - Daily
        * `weekly` - Weekly
        * `monthly` - Monthly
        * `important_only` - Important only
    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
      - usergroup
      type: string
      description: |-
        * `email` - email
        * `username` - username
        * `platform` - platform
        * `csv` - csv
        * `department` - department
        * `pathway` - pathway
        * `program` - program
        * `usergroup` - usergroup
    NotificationTemplateData:
      type: object
      properties:
        message_title:
          type: string
          nullable: true
          default: ''
          description: Title of the message
        message_body:
          type: string
          description: "\n    This would be the body of the message. Some context\
            \ are available to use in the system.\n\n    e.g\n\n    ```\n    This\
            \ is a sample message to {{username}}.\n\n    Available accessors are\
            \ \n    - site_name\n    - site_url\n    - site_logo_url\n    - username\n\
            \    and <anything passed into context dictionary>\n    ```\n\n    "
      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.

            * `ACTIVITY_COURSE_MILESTONE` - Activity Course Milestone
            * `ACTIVITY_NEW_CONTENT` - Activity New Content
            * `ADMIN_NOTIF_COURSE_ENROLLMENT` - Admin Notif Course Enrollment
            * `APP_REGISTRATION` - App Registration
            * `COURSE_INVITATION` - Course Invitation
            * `COURSE_LICENSE_ASSIGNMENT` - Course License Assignment
            * `COURSE_LICENSE_GROUP_ASSIGNMENT` - Course License Group Assignment
            * `COURSE_SCHEDULE_CHANGE` - Course Schedule Change
            * `CRM_DEAL_STAGE_CHANGED` - Crm Deal Stage Changed
            * `CRM_PERSON_CREATED` - Crm Person Created
            * `CRM_PERSON_LINKED_TO_USER` - Crm Person Linked To User
            * `CUSTOM_NOTIFICATION` - Custom Notification
            * `DEFAULT_TEMPLATE` - Default Template
            * `HUMAN_SUPPORT_NOTIFICATION` - Human Support Notification
            * `HUMAN_SUPPORT_TICKET_MESSAGE` - Human Support Ticket Message
            * `PATHWAY_ENROLLMENT_CONFIRMATION` - Pathway Enrollment Confirmation
            * `PLATFORM_APPLICATION_DECISION` - Platform Application Decision
            * `PLATFORM_INVITATION` - Platform Invitation
            * `POLICY_ASSIGNMENT` - Policy Assignment
            * `PROACTIVE_LEARNER_NOTIFICATION` - Proactive Learner Notification
            * `PROGRAM_ENROLLMENT_CONFIRMATION` - Program Enrollment Confirmation
            * `PROGRAM_INVITATION` - Program Invitation
            * `PROGRAM_LICENSE_ASSIGNMENT` - Program License Assignment
            * `PROGRAM_LICENSE_GROUP_ASSIGNMENT` - Program License Group Assignment
            * `REPORT_COMPLETED` - Report Completed
            * `ROLE_CHANGE` - Role Change
            * `SKILL_MASTERY_CHANGE` - Skill Mastery Change
            * `SPEND_CAP_ALERT` - Spend Cap Alert
            * `SUBSECTION_GRADE_UPDATE` - Subsection Grade Update
            * `USER_LICENSE_ASSIGNMENT` - User License Assignment
            * `USER_LICENSE_GROUP_ASSIGNMENT` - User License Group Assignment
            * `USER_NOTIF_COURSE_COMPLETION` - User Notif Course Completion
            * `USER_NOTIF_COURSE_ENROLLMENT` - User Notif Course Enrollment
            * `USER_NOTIF_CREDENTIALS` - User Notif Credentials
            * `USER_NOTIF_LEARNER_PROGRESS` - User Notif Learner Progress
            * `USER_NOTIF_USER_INACTIVITY` - User Notif User Inactivity
            * `USER_NOTIF_USER_REGISTRATION` - User Notif User Registration
            * `COURSES_PROGRESS_SUMMARY` - User Progress Summary
          oneOf:
          - $ref: '#/components/schemas/TypeF30Enum'
          - $ref: '#/components/schemas/NullEnum'
        name:
          type: string
          nullable: true
          description: Template display name
          maxLength: 255
        description:
          type: string
          description: Description of when this notification is sent
        message_title:
          type: string
          nullable: true
          description: Title for push/in-app notifications
          maxLength: 255
        message_body:
          type: string
          description: Body text (supports Django template syntax)
        short_message_body:
          type: string
          description: Short version for SMS or preview
        email_subject:
          type: string
          nullable: true
          description: Email subject line (supports {{ variables }})
          maxLength: 255
        email_from_address:
          type: string
          nullable: true
          description: Sender email address
          maxLength: 255
        email_html_template:
          type: string
          nullable: true
          description: HTML email body (supports Django template syntax)
        watcher_email_html_template:
          type: string
          nullable: true
          description: Watcher-variant email HTML template (e.g., 'Your child completed...').
            Falls back to email_html_template if null.
        watcher_email_subject:
          type: string
          nullable: true
          description: Watcher-variant email subject. Falls back to email_subject
            if null.
          maxLength: 255
        tags:
          description: Free-form tags for categorization (e.g. ['activity', 'learning'])
        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
          description: IDs of SPAs that can use this template
        channel_ids:
          type: array
          items:
            type: integer
            writeOnly: true
          writeOnly: true
          description: IDs of delivery channels (email, push, etc.)
        is_inherited:
          type: boolean
          readOnly: true
          description: True if using main platform template (no platform override)
        is_enabled:
          type: boolean
          readOnly: true
          description: True if notification is enabled for this platform
        source_platform:
          type: string
          readOnly: true
          description: Platform key of the template source
        can_customize:
          type: boolean
          readOnly: true
          description: True if platform admin can edit template content
        metadata:
          description: JSON config (periodic_config, policy_config, etc.)
        available_context:
          type: string
          readOnly: true
          description: Context variables available for template rendering
        watcher_available_context:
          type: string
          readOnly: true
          description: Context variables available in the watcher email variant (null
            for notification types without a watcher variant)
        proactive_prompt_message:
          type: string
          nullable: true
          description: Default prompt message for AI agent notifications
        periodic_config:
          type: string
          readOnly: true
          description: Periodic report configuration (PROACTIVE_LEARNER_NOTIFICATION
            only)
        periodic_learner_scope:
          allOf:
          - $ref: '#/components/schemas/CoursesProgressLearnerScopeEnum'
          writeOnly: true
          description: |-
            Which learners to include: ACTIVE_LEARNERS or ALL_LEARNERS

            * `ACTIVE_LEARNERS` - ACTIVE_LEARNERS
            * `ALL_LEARNERS` - ALL_LEARNERS
        periodic_lookback_days:
          type: integer
          maximum: 365
          minimum: 1
          writeOnly: true
          description: Number of days to include in the report period
        periodic_report_period_days:
          type: integer
          maximum: 365
          minimum: 1
          writeOnly: true
          description: 'Deprecated: use periodic_lookback_days instead'
        periodic_frequency:
          allOf:
          - $ref: '#/components/schemas/CoursesProgressFrequencyEnum'
          writeOnly: true
          description: |-
            How often to send: DAILY, WEEKLY, MONTHLY, or CUSTOM

            * `DAILY` - DAILY
            * `WEEKLY` - WEEKLY
            * `MONTHLY` - MONTHLY
            * `CUSTOM` - CUSTOM
        periodic_custom_interval_days:
          type: integer
          maximum: 365
          minimum: 1
          writeOnly: true
          description: Custom interval in days (when frequency is CUSTOM)
        periodic_execution_time:
          type: string
          writeOnly: true
          description: Time to run in HH:MM format (24-hour)
        periodic_timezone:
          type: string
          writeOnly: true
          description: Timezone for execution time (e.g. America/New_York)
        periodic_mentors:
          type: array
          items:
            type: object
            additionalProperties: {}
          writeOnly: true
          description: 'List of agent configurations: [{"unique_id": "uuid", "prompt":
            "...", "name": "..."}]'
        policy_config:
          type: string
          readOnly: true
          description: Policy assignment notification config (POLICY_ASSIGNMENT only)
        policy_enabled_policies:
          type: array
          items:
            type: object
            additionalProperties: {}
          writeOnly: true
          description: 'Per-role config: [{"role_name": "Analytics Viewer", "enabled":
            True, "subject": "Custom subject for {{role_name}}"}, ...]'
        policy_notify_on_assignment:
          type: boolean
          writeOnly: true
          description: Send notification when policy is assigned
        policy_notify_on_removal:
          type: boolean
          writeOnly: true
          description: Send notification when policy is removed
        human_support_config:
          type: string
          readOnly: true
          description: Human support notification config (HUMAN_SUPPORT_NOTIFICATION
            only)
        human_support_recipient_mode:
          allOf:
          - $ref: '#/components/schemas/HumanSupportRecipientModeEnum'
          writeOnly: true
          description: |-
            Who receives human support ticket notifications

            * `platform_admins_and_mentor_owner` - platform_admins_and_mentor_owner
            * `platform_admins_only` - platform_admins_only
            * `mentor_owner_only` - mentor_owner_only
            * `custom` - custom
        human_support_custom_recipients:
          type: array
          items:
            type: object
            additionalProperties: {}
          writeOnly: true
          description: 'Custom targets: user: {type, id}; user_group: {type, id};
            rbac_policy: {type, policy_name}'
        recipients_config:
          type: string
          readOnly: true
          description: Recipients config (recipient mode + optional custom targets)
            for notification types that opt into the generic recipients model (e.g.
            CRM_*). Null for types that do not.
        recipients_recipient_mode:
          allOf:
          - $ref: '#/components/schemas/RecipientsRecipientModeEnum'
          writeOnly: true
          description: |-
            Who receives this notification: 'platform_admins_only', 'object_owner_only' (falls back to admins), 'object_owner_only_strict' (no fallback), 'platform_admins_and_object_owner' (default), or 'custom'.

            * `platform_admins_only` - platform_admins_only
            * `object_owner_only` - object_owner_only
            * `object_owner_only_strict` - object_owner_only_strict
            * `platform_admins_and_object_owner` - platform_admins_and_object_owner
            * `custom` - custom
        recipients_custom_recipients:
          type: array
          items:
            type: object
            additionalProperties: {}
          writeOnly: true
          description: 'Custom recipient targets (used when recipient_mode=''custom''):
            user: {type, id}; user_group: {type, id}; rbac_policy: {type, policy_name}.'
        new_content_config:
          type: string
          readOnly: true
          description: New content notification config (ACTIVITY_NEW_CONTENT only)
        new_content_block_types:
          type: array
          items:
            type: string
          writeOnly: true
          description: Block types to notify on (e.g. ["sequential", "vertical", "chapter"])
        course_milestone_config:
          type: string
          readOnly: true
          description: Course milestone notification config (ACTIVITY_COURSE_MILESTONE
            only)
        course_milestone_milestones:
          type: array
          items:
            type: integer
            maximum: 100
            minimum: 0
          writeOnly: true
          description: Completion percentage thresholds (e.g. [25, 50, 75, 100])
        skill_mastery_config:
          type: string
          readOnly: true
          description: Skill mastery notification config (SKILL_MASTERY_CHANGE only)
        skill_mastery_thresholds:
          type: array
          items:
            type: object
            additionalProperties: {}
          writeOnly: true
          description: 'Mastery band thresholds (e.g. [{"name": "Beginner", "min_points":
            0}, {"name": "Intermediate", "min_points": 100}])'
        schedule_change_config:
          type: string
          readOnly: true
          description: Schedule change notification config (COURSE_SCHEDULE_CHANGE
            only)
        schedule_change_enabled_signals:
          type: array
          items:
            type: string
          writeOnly: true
          description: 'Signal types to trigger notifications: ["course_overview.start_date_changed",
            "course_overview.pacing_changed", "course_overview.cert_date_changed"]'
        user_progress_config:
          type: object
          additionalProperties: {}
          nullable: true
          readOnly: true
          description: User progress summary config (COURSES_PROGRESS_SUMMARY only).
            Includes available_data_points and available_learner_scopes — the permitted
            values for enabled_data_points and learner_scope.
        user_progress_learner_scope:
          allOf:
          - $ref: '#/components/schemas/CoursesProgressLearnerScopeEnum'
          writeOnly: true
          description: |-
            Who receives the report. ALL_LEARNERS (default) sends to every learner with an active enrollment, including those with no activity in the period; ACTIVE_LEARNERS sends only to learners whose progress moved during the period.

            * `ACTIVE_LEARNERS` - ACTIVE_LEARNERS
            * `ALL_LEARNERS` - ALL_LEARNERS
        user_progress_lookback_days:
          type: integer
          writeOnly: true
          description: Lookback window in days for the user progress summary
        user_progress_enabled_data_points:
          type: array
          items:
            type: string
          writeOnly: true
          description: 'Data points to include: course_breakdown (per-course rows
            with topics and grade), course_grades (current grade per active enrollment),
            courses_progressed, courses_completed, credentials_earned, time_spent,
            active_days, mentors_accessed (AI agent activity), learning_insights (AI
            narrative summary of the period as {summary, watcher_summary}, written
            from the report''s figures and the learner''s agent conversations; one
            LLM call per learner with either)'
        user_progress_frequency:
          allOf:
          - $ref: '#/components/schemas/CoursesProgressFrequencyEnum'
          writeOnly: true
          description: |-
            How often to send the user progress summary

            * `DAILY` - DAILY
            * `WEEKLY` - WEEKLY
            * `MONTHLY` - MONTHLY
            * `CUSTOM` - CUSTOM
        user_progress_custom_interval_days:
          type: integer
          maximum: 365
          minimum: 1
          writeOnly: true
          description: Custom interval in days (when frequency is CUSTOM)
        user_progress_execution_time:
          type: string
          writeOnly: true
          description: Time of day to send (HH:MM format)
          pattern: ^\d{2}:\d{2}$
        user_progress_timezone:
          type: string
          writeOnly: true
          description: Timezone for execution (e.g. America/New_York)
        courses_progress_config:
          type: object
          additionalProperties: {}
          nullable: true
          readOnly: true
          description: Deprecated alias of user_progress_config (COURSES_PROGRESS_SUMMARY
            only)
        courses_progress_learner_scope:
          allOf:
          - $ref: '#/components/schemas/CoursesProgressLearnerScopeEnum'
          writeOnly: true
          description: |-
            Deprecated alias of user_progress_learner_scope

            * `ACTIVE_LEARNERS` - ACTIVE_LEARNERS
            * `ALL_LEARNERS` - ALL_LEARNERS
        courses_progress_lookback_days:
          type: integer
          writeOnly: true
          description: Deprecated alias of user_progress_lookback_days
        courses_progress_enabled_data_points:
          type: array
          items:
            type: string
          writeOnly: true
          description: Deprecated alias of user_progress_enabled_data_points
        courses_progress_frequency:
          allOf:
          - $ref: '#/components/schemas/CoursesProgressFrequencyEnum'
          writeOnly: true
          description: |-
            Deprecated alias of user_progress_frequency

            * `DAILY` - DAILY
            * `WEEKLY` - WEEKLY
            * `MONTHLY` - MONTHLY
            * `CUSTOM` - CUSTOM
        courses_progress_custom_interval_days:
          type: integer
          maximum: 365
          minimum: 1
          writeOnly: true
          description: Deprecated alias of user_progress_custom_interval_days
        courses_progress_execution_time:
          type: string
          writeOnly: true
          description: Deprecated alias of user_progress_execution_time
          pattern: ^\d{2}:\d{2}$
        courses_progress_timezone:
          type: string
          writeOnly: true
          description: Deprecated alias of user_progress_timezone
        grade_posted_config:
          type: object
          additionalProperties: {}
          nullable: true
          readOnly: true
          description: Grade posted notification config (SUBSECTION_GRADE_UPDATE only)
        grade_posted_notify_mode:
          allOf:
          - $ref: '#/components/schemas/GradePostedNotifyModeEnum'
          writeOnly: true
          description: |-
            Notification mode: 'every' (with debounce) or 'first_only' (once per subsection)

            * `every` - every
            * `first_only` - first_only
        grade_posted_debounce_seconds:
          type: integer
          minimum: 0
          writeOnly: true
          description: Debounce window in seconds for 'every' mode (default 300)
        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
      - can_customize
      - course_milestone_config
      - courses_progress_config
      - created_at
      - grade_posted_config
      - human_support_config
      - id
      - is_enabled
      - is_inherited
      - new_content_config
      - periodic_config
      - policy_config
      - recipients_config
      - schedule_change_config
      - skill_mastery_config
      - source_platform
      - spas_detail
      - type
      - updated_at
      - user_progress_config
      - watcher_available_context
    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.

            * `ACTIVITY_COURSE_MILESTONE` - Activity Course Milestone
            * `ACTIVITY_NEW_CONTENT` - Activity New Content
            * `ADMIN_NOTIF_COURSE_ENROLLMENT` - Admin Notif Course Enrollment
            * `APP_REGISTRATION` - App Registration
            * `COURSE_INVITATION` - Course Invitation
            * `COURSE_LICENSE_ASSIGNMENT` - Course License Assignment
            * `COURSE_LICENSE_GROUP_ASSIGNMENT` - Course License Group Assignment
            * `COURSE_SCHEDULE_CHANGE` - Course Schedule Change
            * `CRM_DEAL_STAGE_CHANGED` - Crm Deal Stage Changed
            * `CRM_PERSON_CREATED` - Crm Person Created
            * `CRM_PERSON_LINKED_TO_USER` - Crm Person Linked To User
            * `CUSTOM_NOTIFICATION` - Custom Notification
            * `DEFAULT_TEMPLATE` - Default Template
            * `HUMAN_SUPPORT_NOTIFICATION` - Human Support Notification
            * `HUMAN_SUPPORT_TICKET_MESSAGE` - Human Support Ticket Message
            * `PATHWAY_ENROLLMENT_CONFIRMATION` - Pathway Enrollment Confirmation
            * `PLATFORM_APPLICATION_DECISION` - Platform Application Decision
            * `PLATFORM_INVITATION` - Platform Invitation
            * `POLICY_ASSIGNMENT` - Policy Assignment
            * `PROACTIVE_LEARNER_NOTIFICATION` - Proactive Learner Notification
            * `PROGRAM_ENROLLMENT_CONFIRMATION` - Program Enrollment Confirmation
            * `PROGRAM_INVITATION` - Program Invitation
            * `PROGRAM_LICENSE_ASSIGNMENT` - Program License Assignment
            * `PROGRAM_LICENSE_GROUP_ASSIGNMENT` - Program License Group Assignment
            * `REPORT_COMPLETED` - Report Completed
            * `ROLE_CHANGE` - Role Change
            * `SKILL_MASTERY_CHANGE` - Skill Mastery Change
            * `SPEND_CAP_ALERT` - Spend Cap Alert
            * `SUBSECTION_GRADE_UPDATE` - Subsection Grade Update
            * `USER_LICENSE_ASSIGNMENT` - User License Assignment
            * `USER_LICENSE_GROUP_ASSIGNMENT` - User License Group Assignment
            * `USER_NOTIF_COURSE_COMPLETION` - User Notif Course Completion
            * `USER_NOTIF_COURSE_ENROLLMENT` - User Notif Course Enrollment
            * `USER_NOTIF_CREDENTIALS` - User Notif Credentials
            * `USER_NOTIF_LEARNER_PROGRESS` - User Notif Learner Progress
            * `USER_NOTIF_USER_INACTIVITY` - User Notif User Inactivity
            * `USER_NOTIF_USER_REGISTRATION` - User Notif User Registration
            * `COURSES_PROGRESS_SUMMARY` - User Progress Summary
          oneOf:
          - $ref: '#/components/schemas/TypeF30Enum'
          - $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
          description: True if using main platform template (no platform override)
        source_platform:
          type: string
          readOnly: true
          description: Platform key of the template source (main or tenant)
        is_enabled:
          type: boolean
          readOnly: true
          description: True if notification is enabled for this platform
        can_customize:
          type: boolean
          readOnly: true
          description: True if platform admin can edit template content
        is_custom:
          type: boolean
          readOnly: true
          default: false
          description: True if this is a custom notification type
        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
        tags:
          description: Free-form tags for categorization (e.g. ['activity', 'learning'])
        spas:
          type: string
          readOnly: true
          description: SPAs (Single Page Apps) that can use this template
        allowed_channels:
          type: string
          readOnly: true
          description: Channels this template can be delivered via (email, push, etc.)
        available_context:
          type: string
          readOnly: true
          description: Context variables available for template rendering
      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:
        context:
          description: 'Optional context variables for template rendering (e.g., {''course_name'':
            ''Test Course''})'
        use_sample_context:
          type: boolean
          default: true
          description: Use realistic sample data for this notification type. Set False
            for minimal context.
    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
          description: True to enable, False to disable this notification type for
            the platform
      required:
      - allow_notification
    NotificationTypePreference:
      type: object
      description: Serializer for per-type notification preference updates.
      properties:
        enabled:
          type: boolean
          default: true
          description: Whether this notification type is enabled
    NotificationsUpdate:
      type: object
      properties:
        notification_id:
          type: string
          default: ''
          description: Comma-separated list of notification UUIDs to update
        status:
          allOf:
          - $ref: '#/components/schemas/Status3daEnum'
          description: |-
            New status to set (e.g. read, unread)

            * `READ` - Read
            * `UNREAD` - Unread
            * `CANCELLED` - Cancelled
      required:
      - status
    NullEnum:
      enum:
      - null
    OAuthProvider:
      type: object
      description: Read-only serializer for OAuth providers, including the services
        they expose.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          readOnly: true
        description:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        image:
          type: string
          format: uri
          readOnly: true
          nullable: true
        scope_map:
          readOnly: true
        auth_url:
          type: string
          format: uri
          readOnly: true
        token_url:
          type: string
          format: uri
          readOnly: true
        is_enabled:
          type: boolean
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        services:
          type: array
          items:
            $ref: '#/components/schemas/OAuthService'
          readOnly: true
        credentials:
          allOf:
          - $ref: '#/components/schemas/OauthCredentialsMasked'
          readOnly: true
        use_basic_auth:
          type: boolean
          readOnly: true
          description: Whether to use basic authentication for the OAuth provider.
            By default client id and client secret are sent to the Authorization server
            as post data.
      required:
      - auth_url
      - created_at
      - credentials
      - description
      - id
      - image
      - is_enabled
      - name
      - scope_map
      - services
      - token_url
      - updated_at
      - url
      - use_basic_auth
    OAuthService:
      type: object
      description: Read-only serializer exposing details about an OAuth service.
      properties:
        id:
          type: integer
          readOnly: true
        oauth_provider:
          type: string
          readOnly: true
        oauth_provider_id:
          type: integer
          nullable: true
        name:
          type: string
          readOnly: true
        display_name:
          type: string
          readOnly: true
          description: Human readable label for the OAuth service scope.
        description:
          type: string
          readOnly: true
        scope:
          type: string
          readOnly: true
        image:
          type: string
          format: uri
          readOnly: true
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - created_at
      - description
      - display_name
      - id
      - image
      - name
      - oauth_provider
      - scope
      - updated_at
    OAuthStartResponse:
      type: object
      properties:
        auth_url:
          type: string
          format: uri
      required:
      - auth_url
    OauthCredentialsMasked:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        is_global:
          type: boolean
        client_id:
          type: string
        client_secret:
          type: string
          nullable: true
        scopes:
          type: array
          items:
            type: string
          nullable: true
        redirect_uris:
          type: array
          items:
            type: string
            format: uri
          nullable: true
        url:
          type: string
          format: uri
          nullable: true
      required:
      - client_id
      - id
      - is_global
      - name
    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
    OfflineDocument:
      type: object
      description: |-
        Serializes documents for offline use.

        Returns documents with S3 URLs that can be downloaded for offline use.
      properties:
        id:
          type: integer
          readOnly: true
        document_name:
          type: string
          nullable: true
        document_type:
          type: string
          nullable: true
        url:
          type: string
          nullable: true
        tokens:
          type: integer
          nullable: true
        is_trained:
          type: boolean
        access:
          nullable: true
          oneOf:
          - $ref: '#/components/schemas/AccessEnum'
          - $ref: '#/components/schemas/BlankEnum'
          - $ref: '#/components/schemas/NullEnum'
        metadata:
          nullable: true
        last_trained_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
      required:
      - id
      - last_trained_at
    OnboardingStatusUpdate:
      type: object
      properties:
        onboarding_completed:
          type: boolean
        app:
          type: string
          description: The app url or name or id
      required:
      - app
      - onboarding_completed
    Organization:
      type: object
      description: |-
        Adds a read-only ``tags`` field to a host serializer.

        Emits ``[{id, name, color}]``. Cheap when the host queryset uses
        ``prefetch_related("tag_assignments__tag")`` — without that prefetch
        every record triggers two extra queries.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: Server-assigned UUID.
        platform:
          type: integer
          readOnly: true
          description: Platform the Organization belongs to. Set server-side from
            the auth token.
        name:
          type: string
          description: Display name. Unique per platform (case-sensitive).
          maxLength: 255
        address:
          description: Free-form JSON address (street, city, country, etc.).
        owner:
          type: integer
          description: Id of the Platform user who owns / manages this Organization.
            Must be an active member of your Platform.
          nullable: true
        tags:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
              color:
                type: string
                example: '#3F6BFF'
            required:
            - id
            - name
            - color
          readOnly: true
        metadata:
          description: Free-form JSON for Platform-defined attributes.
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Creation timestamp.
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Last-modified timestamp.
      required:
      - created_at
      - id
      - name
      - platform
      - tags
      - updated_at
    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
    OverrideStatusEnum:
      enum:
      - pending
      - published
      - failed
      type: string
      description: |-
        * `pending` - Pending
        * `published` - Published
        * `failed` - Failed
    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.0
          description: Change in last 7 days in percentage
        change_last_thirty_days_percent:
          type: number
          format: double
          default: 0.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'
    PaginatedAccessibleUserList:
      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/AccessibleUser'
    PaginatedActivityList:
      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/Activity'
    PaginatedAgentSkillList:
      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/AgentSkill'
    PaginatedAgentSkillResourceList:
      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/AgentSkillResource'
    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'
    PaginatedArtifactVersionList:
      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/ArtifactVersion'
    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
    PaginatedAuditLogEntryList:
      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/AuditLogEntry'
    PaginatedChatRunTrackerList:
      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/ChatRunTracker'
    PaginatedClawInstanceList:
      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/ClawInstance'
    PaginatedClawModelProviderList:
      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/ClawModelProvider'
    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
    PaginatedDatasetItemList:
      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/DatasetItem'
      required:
      - count
      - next
      - previous
      - results
    PaginatedDatasetList:
      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/Dataset'
      required:
      - count
      - next
      - previous
      - results
    PaginatedDealList:
      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/Deal'
    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'
    PaginatedGoogleAgentDetailList:
      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/GoogleAgentDetail'
    PaginatedGradeResultList:
      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/GradeResult'
    PaginatedGraderCriterionList:
      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/GraderCriterion'
    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'
    PaginatedItemPaywallConfigList:
      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/ItemPaywallConfig'
    PaginatedItemSubscriptionList:
      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/ItemSubscription'
    PaginatedItemSubscriptionListList:
      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/ItemSubscriptionList'
    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'
    PaginatedJudgeList:
      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/JudgeRecord'
      required:
      - count
      - next
      - previous
      - results
    PaginatedLeadSourceList:
      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/LeadSource'
    PaginatedMCPServerConnectionList:
      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/MCPServerConnection'
    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'
    PaginatedMentorAuditLogEntryList:
      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/MentorAuditLogEntry'
    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'
    PaginatedMentorSkillAssignmentList:
      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/MentorSkillAssignment'
    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'
    PaginatedOfflineDocumentList:
      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/OfflineDocument'
    PaginatedOrganizationList:
      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/Organization'
    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'
    PaginatedPersonList:
      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/Person'
    PaginatedPipelineList:
      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/Pipeline'
    PaginatedPipelineStageList:
      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/PipelineStage'
    PaginatedPlatformApiKeyList:
      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/PlatformApiKey'
    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'
    PaginatedResource:
      type: object
      description: |-
        OpenAPI schema wrapper for the paginated resources endpoint.

        Mirrors the StandardPageNumberPagination response envelope so
        drf-spectacular renders the correct schema. Not used at runtime
        for serialization — the view uses ResourceSerializer for the items
        and PaginationMixin builds the envelope.
      properties:
        count:
          type: integer
          readOnly: true
        next_page:
          type: integer
          readOnly: true
          nullable: true
        previous_page:
          type: integer
          readOnly: true
          nullable: true
        results:
          type: array
          items:
            $ref: '#/components/schemas/Resource'
          readOnly: true
      required:
      - count
      - next_page
      - previous_page
      - results
    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'
    PaginatedRunList:
      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/Run'
      required:
      - count
      - next
      - previous
      - results
    PaginatedScoreConfigList:
      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/ScoreConfig'
      required:
      - count
      - next
      - previous
      - results
    PaginatedScoreList:
      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/Score'
      required:
      - count
      - next
      - previous
      - results
    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
    PaginatedTagList:
      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/Tag'
    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'
    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'
    PaginatedUserGroupList:
      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/UserGroup'
    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
    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'
    PaginatedWatchedGroupListList:
      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/WatchedGroupList'
    PaginatedWatchedUserReadList:
      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/WatchedUserRead'
    PaginatedWatcherReadList:
      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/WatcherRead'
    PaginatedWorkflowList:
      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/Workflow'
    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
    PatchedActivity:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
          description: Server-assigned id.
        platform:
          type: integer
          readOnly: true
          description: Platform this Activity belongs to. Set automatically from your
            credentials; you cannot pass another Platform's id.
        title:
          type: string
          description: Short summary (e.g. 'Discovery call', 'Stage changed').
          maxLength: 255
        type:
          allOf:
          - $ref: '#/components/schemas/ActivityTypeEnum'
          description: |-
            Interaction kind. One of `call`, `meeting`, `email`, `note`, `task`, `lunch`, `deadline`.

            * `call` - Call
            * `meeting` - Meeting
            * `email` - Email
            * `note` - Note
            * `task` - Task
            * `lunch` - Lunch
            * `deadline` - Deadline
        location:
          type: string
          default: ''
          description: Meeting location / call dial-in / venue.
          maxLength: 255
        comment:
          type: string
          default: ''
          description: Free-text notes.
        schedule_from:
          type: string
          format: date-time
          nullable: true
          description: Scheduled start. Leave null for instant log entries.
        schedule_to:
          type: string
          format: date-time
          nullable: true
          description: Scheduled end.
        is_done:
          type: boolean
          default: false
          description: Mark the Activity complete. Use `POST /activities/{id}/done/`
            to flip this and automatically stamp `done_at`.
        done_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: Read-only. Set automatically the first time `is_done` flips
            True.
        deal:
          type: integer
          nullable: true
          description: Id of the Deal this Activity is logged against. Either `deal`
            or `person` is required.
        person:
          type: string
          format: uuid
          description: UUID of the Person this Activity is logged against. Either
            `deal` or `person` is required.
          nullable: true
        owner:
          type: integer
          description: Id of the user who scheduled / logged this Activity. Defaults
            to the calling user on create.
          nullable: true
        reminder_at:
          type: string
          format: date-time
          nullable: true
          description: When to remind the owner.
        reminder_sent:
          type: boolean
          readOnly: true
          description: Marks that a reminder has been sent for this Activity; prevents
            the same reminder from firing twice.
        metadata:
          description: Free-form JSON for Platform-defined attributes.
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Creation timestamp.
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Last-modified timestamp.
    PatchedAgentSkill:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        unique_id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 255
        slug:
          type: string
          maxLength: 255
          pattern: ^[-a-zA-Z0-9_]+$
        description:
          type: string
        version:
          type: string
          maxLength: 50
        skill_type:
          $ref: '#/components/schemas/SkillTypeEnum'
        category:
          type: string
          description: 'Grouping for the catalog UI: web, code, browser, data, etc.'
          maxLength: 50
        source:
          type: string
          description: Provenance for seeded/imported skills (e.g. iblai-claw-agents/higher-education/skills/canvas).
          maxLength: 255
        is_featured:
          type: boolean
          description: Featured skills on the 'main' platform are visible to all tenants.
        mentor:
          type: string
          format: uuid
          nullable: true
        instruction:
          type: string
          description: SKILL.md body — the agent runbook for this skill.
        metadata:
          description: SKILL.md frontmatter (requires, primaryEnv, emoji, etc.).
        enabled:
          type: boolean
        platform_key:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    PatchedAgentSkillResource:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        skill:
          type: integer
        file_type:
          $ref: '#/components/schemas/FileTypeEnum'
        filename:
          type: string
          maxLength: 255
        content:
          type: string
          description: Text content for script/reference resources.
        file:
          type: string
          format: uri
          nullable: true
          description: Binary file for asset resources.
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    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: Text content of the artifact; empty for binary artifacts
          readOnly: true
        binary_content:
          type: string
          readOnly: true
          description: Base64-encoded bytes of a binary artifact (pdf, xlsx, ...);
            null for text artifacts. The client chooses the rendering from `file_extension`/`mime_type`.
        is_binary:
          type: boolean
          readOnly: true
          description: True when the artifact carries `binary_content` instead of
            `content`
        mime_type:
          type: string
          readOnly: true
          description: MIME type of a binary artifact, e.g. application/pdf.
        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
        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
          nullable: true
          readOnly: true
        current_version_number:
          type: integer
          description: Version number of the current version
          readOnly: true
        version_count:
          type: integer
          description: Total number of versions for 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'
        language:
          type: string
          description: Language code for TTS, STT, and LLM (e.g., 'en', 'en-US', 'es',
            'fr'). Defaults to 'en' (English).
          maxLength: 10
        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)
        screensharing_system_prompt:
          type: string
          description: System prompt to use for screensharing guidance. Defaults to
            VIDEO_GUIDANCE_PROMPT from constants.
        screensharing_proactive_prompt:
          type: string
          description: Proactive prompt used during screensharing calls to guide the
            conversation.
        platform_key:
          type: string
          readOnly: true
    PatchedClawConfigPatchRequest:
      type: object
      description: |-
        Body for ``PATCH config/`` — wraps ``OpenClawClient.patch_config``.

        The ``patch`` dict is deep-merged into the current config; ``null`` values
        delete a key, arrays replace wholesale.  Echoing
        ``"__OPENCLAW_REDACTED__"`` back at a secret path is the documented way
        to leave a secret unchanged.
      properties:
        patch:
          type: object
          additionalProperties: {}
          description: Merge-patch object applied to the current openclaw.json. Nulls
            delete keys; arrays replace wholesale; objects merge recursively.
    PatchedClawInstance:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        claw_type:
          $ref: '#/components/schemas/ClawTypeEnum'
        provision_mode:
          allOf:
          - $ref: '#/components/schemas/ProvisionModeEnum'
          readOnly: true
          description: |-
            Managed = provisioned by us. Self-hosted = tenant provides the server.

            * `managed` - Managed
            * `self_hosted` - Self-hosted
        server_url:
          type: string
          format: uri
          description: HTTPS URL of the Claw worker instance.
          maxLength: 200
        gateway_token:
          type: string
          writeOnly: true
        deployment_backend:
          type: integer
          nullable: true
          description: Backend that deployed this server. Null = manually configured.
        auth_headers:
          writeOnly: true
          description: Per-server auth headers (overrides backend defaults).
        connection_params:
          writeOnly: true
          description: 'Variant-specific connection parameters (write-only in API).
            OpenClaw: device_identity.private_key_pem, timeouts. IronClaw: typically
            empty (bearer token covered by gateway_token).'
        status:
          allOf:
          - $ref: '#/components/schemas/ClawInstanceStatusEnum'
          readOnly: true
        deploy_state:
          allOf:
          - $ref: '#/components/schemas/DeployStateEnum'
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        last_health_check:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        last_health_status:
          type: string
          readOnly: true
          nullable: true
        claw_version:
          type: string
          readOnly: true
          nullable: true
        last_pairing:
          type: object
          additionalProperties: {}
          nullable: true
          description: |-
            The most recent device-pairing result (request id + fingerprint, or status), as written
            by ``request_claw_pairing_task``. Read-only; transient (pairing requests expire ~5 min).
          readOnly: true
        last_upgrade:
          type: object
          additionalProperties: {}
          nullable: true
          description: |-
            The most recent worker-upgrade outcome (by/target/before/after/reason/at), as written
            by ``upgrade_claw_to_target_task``. Read-only.
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    PatchedClawMentorConfig:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        mentor:
          type: string
          format: uuid
          readOnly: true
        mentor_name:
          type: string
          readOnly: true
        mentor_slug:
          type: string
          readOnly: true
        server:
          type: integer
        server_name:
          type: string
          readOnly: true
        server_status:
          type: string
          readOnly: true
        server_last_health_status:
          type: string
          readOnly: true
          nullable: true
        server_last_health_check:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        agent_config: {}
        agent_id:
          type: string
          readOnly: true
          description: Worker-side agent id. System-minted from the mentor's unique_id
            on creation, immutable and read-only. Legacy configs may carry a hand-entered
            value such as 'main'.
        enabled:
          type: boolean
        auto_push:
          type: boolean
          description: When True, saving the mentor's AgentConfig triggers an async
            config push to the worker.
        last_config_push:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        last_config_push_status:
          type: string
          readOnly: true
          nullable: true
        last_push_warnings:
          readOnly: true
          description: Warnings from the last config push (baseline verification and
            per-agent skill upload).
    PatchedClawModelProvider:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        server:
          type: integer
        server_name:
          type: string
          readOnly: true
        name:
          type: string
          description: Provider identifier in the Claw config (e.g. 'minimax')
          maxLength: 100
        base_url:
          type: string
          format: uri
          description: Provider API endpoint (e.g. https://api.minimax.io/anthropic)
          maxLength: 200
        api_type:
          type: string
          description: Claw provider API type (e.g. 'openai-completions', 'anthropic-messages').
          maxLength: 50
        credential_name:
          type: string
          description: Name of the LLMCredential to resolve the API key from
          maxLength: 255
        credential_key:
          type: string
          description: Key within the LLMCredential value JSON to extract the API
            key
          maxLength: 100
        model_catalog:
          description: 'List of {"id": "...", "name": "..."} entries for the provider
            model catalog'
        enabled:
          type: boolean
        models_mode:
          type: string
          description: '''merge'' adds to built-in models, ''replace'' uses only configured
            providers.'
          maxLength: 20
        last_provider_push:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        last_provider_push_status:
          type: string
          readOnly: true
          nullable: true
        credential_resolved:
          type: boolean
          description: Check if the referenced LLMCredential exists for this platform.
          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
        is_shared:
          type: boolean
        is_authenticated:
          type: boolean
          description: False if session was created by an anonymous user
        disable_chathistory:
          type: boolean
          description: Per-session override that skips writing ChatMessageHistory
            rows for this conversation. Honored only when the tenant has ALLOW_USER_CHAT_PRIVACY_CONTROL
            enabled. Mirrors Mentor.disable_chathistory but scoped to one session.
        llm_name:
          type: string
          nullable: true
          maxLength: 255
        llm_provider:
          type: string
          nullable: true
          maxLength: 255
        metadata:
          nullable: true
        title:
          type: string
          nullable: true
          description: AI-generated title summarizing the conversation
          maxLength: 255
        is_conversation:
          type: boolean
          description: True if the session has both user and AI messages
        message_count_human:
          type: integer
          description: Count of human messages in this session
        message_count_ai:
          type: integer
          description: Count of AI messages in this session
        first_user_message:
          type: string
          nullable: true
        last_message_at:
          type: string
          format: date-time
          nullable: true
        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
    PatchedCourseExportEligibility:
      type: object
      description: Full CRUD serializer for course export eligibility records.
      properties:
        id:
          type: integer
          readOnly: true
        course:
          type: integer
        course_id:
          type: string
          readOnly: true
        is_enabled:
          type: boolean
        target_environments:
          type: array
          items:
            type: integer
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          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
    PatchedCreditAccountAutoRechargeUpdate:
      type: object
      description: Partial update for CreditAccount auto-recharge fields.
      properties:
        auto_recharge_threshold_usd:
          type: string
          format: decimal
          pattern: ^-?\d{0,11}(?:\.\d{0,3})?$
          description: Set the balance threshold for auto-recharge (must be non-negative).
        auto_recharge_amount_usd:
          type: string
          format: decimal
          pattern: ^-?\d{0,11}(?:\.\d{0,3})?$
          description: Set the amount to recharge (min $0.50).
        auto_recharge_enabled:
          type: boolean
          description: Enable or disable auto-recharge.
        auto_recharge_spending_limit_usd:
          type: string
          format: decimal
          pattern: ^-?\d{0,11}(?:\.\d{0,3})?$
          description: Cap on auto-recharge + manual top-up per 30-day period (user
            USD). 0 = unlimited. When > 0, backend sets recharge amount to 20% of
            limit (min $0.50).
        platform_key:
          type: string
          readOnly: true
          description: The platform key to update settings for (read-only in update
            context).
    PatchedCronJobPatch:
      type: object
      description: |-
        Body for ``PATCH cron-jobs/<job_id>/`` — sent verbatim to
        ``cron.update`` as the ``patch`` parameter.  Every field is optional.

        Field names are camelCase here to match the wire schema (``CronJobPatch``)
        since the patch dict is forwarded directly without translation.
      properties:
        name:
          type: string
        description:
          type: string
        enabled:
          type: boolean
        deleteAfterRun:
          type: boolean
        agentId:
          type: string
        sessionKey:
          type: string
        sessionTarget:
          type: string
        wakeMode:
          $ref: '#/components/schemas/WakeModeEnum'
        schedule:
          $ref: '#/components/schemas/CronSchedule'
        payload:
          $ref: '#/components/schemas/CronPayload'
        delivery:
          $ref: '#/components/schemas/CronDelivery'
    PatchedDeal:
      type: object
      description: |-
        Adds a read-only ``tags`` field to a host serializer.

        Emits ``[{id, name, color}]``. Cheap when the host queryset uses
        ``prefetch_related("tag_assignments__tag")`` — without that prefetch
        every record triggers two extra queries.
      properties:
        id:
          type: integer
          readOnly: true
          description: Server-assigned id.
        platform:
          type: integer
          readOnly: true
          description: Platform this Deal belongs to. Set automatically from your
            credentials; you cannot pass another Platform's id.
        title:
          type: string
          description: Short display name (e.g. 'Acme renewal — 2026').
          maxLength: 255
        description:
          type: string
          default: ''
          description: Free-text notes about scope, requirements, etc.
        lead_value:
          type: string
          format: decimal
          pattern: ^-?\d{0,12}(?:\.\d{0,2})?$
          default: '0.00'
          description: Estimated deal value in `currency`.
        currency:
          type: string
          default: USD
          description: ISO 4217 currency code.
          maxLength: 3
        status:
          allOf:
          - $ref: '#/components/schemas/DealStatusEnum'
          readOnly: true
          description: |-
            Read-only. Set by the move-stage/won/lost actions and derived from the destination stage's `is_won`/`is_lost`. Direct writes are rejected with `400`; use `POST /deals/{id}/move-stage/` (or `won/` / `lost/`).

            * `open` - Open
            * `won` - Won
            * `lost` - Lost
        lost_reason:
          type: string
          default: ''
          description: Set on a `lost` transition (e.g. 'Chose competitor').
          maxLength: 255
        expected_close_date:
          type: string
          format: date
          nullable: true
          description: Forecasted close date — used by revenue projections.
        closed_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: Read-only. Set automatically when the Deal enters a won/lost
            stage and cleared when it re-opens.
        person:
          type: string
          format: uuid
          description: UUID of the primary contact for this Deal. The person must
            belong to your Platform.
        organization:
          type: string
          format: uuid
          description: UUID of an organization the Deal is with. Optional; must belong
            to your Platform.
          nullable: true
        pipeline:
          type: integer
          description: Pipeline this Deal flows through. Must belong to your Platform.
        stage:
          type: integer
          description: Current PipelineStage. On create, must belong to `pipeline`.
            Use `POST /deals/{id}/move-stage/` to change after creation.
        source:
          type: integer
          nullable: true
          description: Where the Deal originated. Optional; must belong to your Platform.
        owner:
          type: integer
          description: Id of the platform user responsible for this Deal (sales rep).
            Defaults to the calling user on create.
          nullable: true
        tags:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
              color:
                type: string
                example: '#3F6BFF'
            required:
            - id
            - name
            - color
          readOnly: true
        metadata:
          description: Free-form JSON for Platform-defined attributes.
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Creation timestamp.
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Last-modified timestamp.
    PatchedDemographicsFieldDefinitionWrite:
      type: object
      properties:
        name:
          type: string
          description: Human-readable field label displayed in forms.
          maxLength: 255
        slug:
          type: string
          description: URL-safe identifier used as the key in custom_fields payloads.
          maxLength: 255
          pattern: ^[-a-zA-Z0-9_]+$
        field_type:
          allOf:
          - $ref: '#/components/schemas/FieldTypeEnum'
          description: |-
            Data type for this field. One of: text, number, date, boolean, select, multi_select.

            * `text` - Text
            * `number` - Number
            * `date` - Date
            * `boolean` - Boolean
            * `select` - Select
            * `multi_select` - Multi-select
        required:
          type: boolean
          description: Whether this field must be filled in by the user.
        choices:
          description: List of valid options for select/multi_select fields. Must
            be empty for other types.
        display_order:
          type: integer
          description: Sort order for rendering fields in the UI. Lower values appear
            first.
        active:
          type: boolean
          description: Inactive fields are hidden from forms and excluded from responses.
        description:
          type: string
          description: Optional description or instructions shown alongside the field.
    PatchedDisclaimer:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        scope:
          $ref: '#/components/schemas/DisclaimerScopeEnum'
        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
          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
    PatchedExportTargetEnvironment:
      type: object
      description: |-
        Full CRUD serializer for target environments.

        The bearer ``token`` field is write-only so credentials never leak via
        GET responses. Model-level validation (oauth credentials OR token must
        be provided) is enforced by calling ``ExportTargetEnvironment.clean()``
        during ``validate()``.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 100
        studio_base_url:
          type: string
          format: uri
          description: Base URL for Studio (CMS) API
          maxLength: 200
        is_enabled:
          type: boolean
        oauth_credentials:
          type: integer
          nullable: true
          description: OAuth credentials for API authentication
        token:
          type: string
          writeOnly: true
          description: Manual bearer token (fallback if OAuth not configured)
    PatchedFallbackLLMUpdate:
      type: object
      description: Serializer for updating FallbackLLM configuration.
      properties:
        scope:
          allOf:
          - $ref: '#/components/schemas/ScopeC1dEnum'
          description: |-
            Whether this fallback applies to a specific model or entire provider

            * `model` - Model Specific
            * `provider` - Provider Wide
        source_provider:
          type: integer
          description: The provider whose models this fallback applies to
        source_model:
          type: integer
          nullable: true
          description: Specific model this fallback applies to (only for model scope)
        fallback_provider:
          type: integer
          description: The provider to use as fallback
        fallback_model:
          type: integer
          description: The model to use as fallback
        is_enabled:
          type: boolean
          description: Whether this fallback configuration is active
    PatchedGoogleAgentDetail:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        sub_agents:
          type: string
          readOnly: true
        platform:
          type: string
          readOnly: true
        unique_id:
          type: string
          format: uuid
        model:
          type: string
        name:
          type: string
        description:
          type: string
        instruction:
          type: string
        output_key:
          type: string
          nullable: true
        inserted_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        created_by:
          type: integer
          description: edX user ID
          nullable: true
    PatchedGradeResultOverride:
      type: object
      description: |-
        Human override request.

        Scores are stored normalized but rubrics are authored in raw points, so
        the wire format is points and normalization happens here. A grade with no
        usable rubric snapshot has no denominator, so it cannot be overridden at
        all rather than silently falling back to a different scale.
      properties:
        override_points:
          type: number
          format: double
          minimum: 0
          nullable: true
          description: Points awarded, between 0 and the rubric's total_points. Null
            clears the override and restores the AI score.
        override_feedback:
          type: string
    PatchedGraderCriterion:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: Name for the criteria (accuracy, clarity, etc.)
          maxLength: 200
        criteria:
          type: string
          description: The requirements to evaluate this criterion against.
        points:
          type: number
          format: double
          description: Raw point value for this criterion (e.g. 6 for a 6-point criterion).
            Normalized against the sum of all criteria points at grading time.
    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
          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
    PatchedLeadSource:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
          description: Server-assigned id. Stable across renames.
        platform:
          type: integer
          readOnly: true
          description: Platform the LeadSource belongs to. Set automatically from
            your credentials; you cannot pass another Platform's id.
        name:
          type: string
          description: Display name shown to sales reps when categorizing a Deal.
          maxLength: 128
        code:
          type: string
          description: Stable slug used in API payloads and reports. Unique per Platform;
            lowercase letters, digits, and hyphens.
          maxLength: 64
          pattern: ^[-a-zA-Z0-9_]+$
        metadata:
          description: Free-form JSON for Platform-defined attributes.
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Creation timestamp.
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Last-modified timestamp.
    PatchedMCPServer:
      type: object
      description: Serializer for the MCPServer model.
      properties:
        id:
          type: integer
          readOnly: true
        platform:
          type: integer
          readOnly: true
        mentor:
          type: string
          format: uuid
          nullable: true
        owner:
          type: string
          nullable: true
          description: edX username
        name:
          type: string
          maxLength: 255
        description:
          type: string
          description: A description of the MCP server.
        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/MCPServerTransportEnum'
        credentials:
          type: string
          description: 'Authorization credentials to authenticate to the MCP server.
            If provided, these take priority over any headers configured on the server.
            Token here must be the full authorization value. For example: `<scheme>
            <credentials>`'
        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.
        auth_type:
          allOf:
          - $ref: '#/components/schemas/AuthTypeEnum'
          description: |-
            The type of authentication to use for the MCP server.

            * `none` - None
            * `token` - Token
            * `oauth2` - Oauth2
        auth_scope:
          allOf:
          - $ref: '#/components/schemas/AuthScopeEnum'
          description: |-
            Determines the required authentication granularity. 'platform' uses shared platform credentials, 'mentor' requires mentor-level credentials, and 'user' requires each user to authenticate individually.

            * `platform` - Platform
            * `mentor` - Mentor
            * `user` - User
        oauth_service:
          type: integer
          writeOnly: true
          nullable: true
        oauth_service_data:
          allOf:
          - $ref: '#/components/schemas/OAuthService'
          readOnly: true
        mcp_server_connections:
          type: string
          readOnly: true
        is_enabled:
          type: boolean
          description: Whether the MCP server is enabled or not.
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    PatchedMCPServerConnection:
      type: object
      description: |-
        Serializer for managing `MCPServerConnection` records via the API.

        The serializer enforces the business rules for combining scope, platform,
        and authentication configuration while exposing a masked view of any stored
        credentials.
      properties:
        id:
          type: integer
          readOnly: true
        server:
          type: integer
        server_name:
          type: string
          readOnly: true
        scope:
          allOf:
          - $ref: '#/components/schemas/MCPServerConnectionScopeEnum'
          description: |-
            Whether this connection is scoped to a user or shared across a platform.

            * `user` - User
            * `mentor` - Mentor
            * `platform` - Platform
        auth_type:
          $ref: '#/components/schemas/AuthTypeEnum'
        platform:
          type: integer
          nullable: true
        platform_key:
          type: string
          nullable: true
          readOnly: true
        user:
          type: string
          nullable: true
          description: edX username
        mentor:
          type: string
          format: uuid
          nullable: true
        connected_service:
          type: integer
          nullable: true
        connected_service_summary:
          type: object
          additionalProperties: {}
          nullable: true
          readOnly: true
        credentials:
          type: string
          description: Static credential/token value for token-based authentication.
        authorization_scheme:
          type: string
          description: Authorization scheme to prefix tokens with (e.g. 'Bearer').
          maxLength: 50
        extra_headers:
          description: Additional headers to include when connecting to the MCP server.
        is_active:
          type: boolean
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    PatchedMcpServerUpdate:
      type: object
      description: Body for ``PATCH mcp-servers/<name>/``.
      properties:
        config:
          $ref: '#/components/schemas/McpServerConfig'
        replace:
          type: boolean
          default: false
    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
          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
        enable_offline_mode:
          type: boolean
          description: Allow this mentor to be used offline with local LLMs
        metadata:
          nullable: true
        enable_moderation:
          type: boolean
        enable_multi_query_rag:
          type: boolean
        enable_prompt_caching:
          type: boolean
          description: Enable prompt caching for Anthropic models to reduce latency
            and cost. This disabled RAG and other dynamic parts of system prompt such
            as memory, current datetime, etc. Use with caution
        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.'
        save_flagged_prompts:
          type: boolean
        google_voice:
          type: integer
          nullable: true
        openai_voice:
          type: integer
          nullable: true
        iblai_voice:
          type: integer
          nullable: true
          description: Voice used when voice_provider is 'iblai'. Leave empty to use
            the tenant's configured default voice.
        voice_provider:
          allOf:
          - $ref: '#/components/schemas/VoiceProviderEefEnum'
          description: |-
            TTS provider used when synthesizing chat messages from this mentor. Selects which of the *_voice fields applies. `iblai` synthesizes through our own gateway with the model configured on the tenant's ibl.ai routing profile, and uses iblai_voice — except when that model is an OpenAI one, which takes openai_voice.

            * `browser` - Browser
            * `openai` - OpenAI
            * `google` - Google
            * `iblai` - ibl.ai
        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
        study_mode_prompt:
          type: string
          description: Prompt to be used to guide the user through their studies when
            study mode tool is enabled.
        disclaimer:
          type: string
          description: Disclaimer to be shown to the user when the mentor is used.
        enable_disclaimer:
          type: boolean
        show_attachment:
          type: boolean
          description: Show attachments on mentor.
        show_voice_call:
          type: boolean
          description: Show voice call button on mentor.
        show_voice_record:
          type: boolean
          description: Show voice recording button on mentor.
        show_rag_images:
          type: boolean
          description: Show RAG images in mentor response.
        show_catalogue:
          type: boolean
          description: Show catalogue on mentor.
        show_reasoning:
          type: boolean
          description: Show reasoning on mentor.
        starter_prompts:
          allOf:
          - $ref: '#/components/schemas/StarterPromptsB04Enum'
          description: |-
            Type of starter prompts to show: guided_prompt or suggested_prompt.

            * `guided_prompt` - Guided Prompt
            * `suggested_prompt` - Suggested Prompt
        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.
        embed_show_canvas:
          type: boolean
          description: Show display canvas on embedded mentor.
        show_explore_mentors:
          type: boolean
          description: Show explore mentors option.
        embed_icon_selection_data:
          nullable: true
          description: Stores embedded icon selection data for the mentor widget.
        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
        strip_page_content_html:
          type: boolean
          nullable: true
          description: Per-mentor toggle for stripping HTML markup from `payload.page_content`
            before it is envelope-wrapped and cached for the LLM. Defaults to False
            (raw HTML reaches the prompt). Set to True to strip markup, e.g. when
            pages embed inline JSON/CSS in script/style tags that bloats the context
            window. Nullable so the add-column migration is a no-op for existing rows
            during a rolling multi-server deploy; a NULL value is treated as False
            at read time.
        enable_safety_system:
          type: boolean
        enable_privacy_router:
          type: boolean
          description: 'Master switch: enable input filtering before messages reach
            the LLM. Which categories run is controlled by filter_pii / filter_phi.'
        filter_pii:
          type: boolean
          description: When the privacy router is enabled, apply PII detection/filtering
            (uses privacy_action / privacy_entities).
        privacy_action:
          allOf:
          - $ref: '#/components/schemas/PrivacyActionEnum'
          description: |-
            Action to take when PII is detected: redact replaces with labels, mask partially hides, block rejects the message, allow passes the message through unchanged while still logging the detection

            * `redact` - Redact
            * `mask` - Mask
            * `block` - Block
            * `allow` - Allow
        privacy_entities:
          description: List of PII entity types to detect. Empty list uses defaults
            (PERSON, EMAIL, PHONE, SSN, etc.)
        privacy_response:
          type: string
          description: Response shown to user when a message is blocked due to PII
            detection
        enable_privacy_output_filter:
          type: boolean
          description: 'Master switch: also filter LLM responses (output rail). Which
            categories run is controlled by filter_pii / filter_phi.'
        filter_phi:
          type: boolean
          description: When the privacy router is enabled, apply PHI detection/filtering
            (uses phi_action / phi_entities).
        phi_action:
          allOf:
          - $ref: '#/components/schemas/PhiActionEnum'
          description: |-
            Action to take when PHI is detected: redact replaces with labels, mask partially hides, block rejects the message, allow passes the message through unchanged while still logging the detection

            * `redact` - Redact
            * `mask` - Mask
            * `block` - Block
            * `allow` - Allow
        phi_entities:
          description: List of PHI entity types to detect. Empty list detects all
            supported clinical and identifier entities.
        phi_response:
          type: string
          description: Response shown to user when a message is blocked due to PHI
            detection
        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
          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
        enable_computational_runtime:
          type: boolean
          nullable: true
          description: 'Per-mentor toggle for the sandboxed quickjs code-interpreter
            middleware on the graph agent. Off by default: the middleware runs an
            in-process JS REPL that adds latency and system-resource overhead, so
            it is only enabled for mentors that specifically need computational tool
            use. Even when True, the middleware is only attached if the mentor''s
            chosen LLM supports function calling; it is never attached for the fake
            graph mentors used in tests/healthchecks. Nullable so the add-column migration
            is a no-op for existing rows during a rolling multi-server deploy; a NULL
            value is treated as False at read time.'
    PatchedMentorFromTemplate:
      type: object
      properties:
        detail:
          type: string
    PatchedMentorGraderConfig:
      type: object
      description: |-
        Config-only surface. Criteria are managed through the criteria
        endpoints — keeping the two responsibilities separate.
      properties:
        id:
          type: integer
          readOnly: true
        mentor:
          type: string
          format: uuid
          readOnly: true
        grading_mode:
          allOf:
          - $ref: '#/components/schemas/GradingModeEnum'
          description: |-
            Selects which grading tool the mentor exposes to the LLM. Only one tool is exposed per mode so the agent can't choose between them.

            * `submission` - Submission
            * `conversation` - Conversation
        grader_instructions:
          type: string
          description: Describe the problem that's being graded and any special instructions
            outside of the rubric. The grading LLM is already instructed to give a
            score of 0-1 for each rubric criterion which is multiplied by the criterion's
            points to give earned points; overall score is total earned points / total
            possible points.
        feedback_mode:
          $ref: '#/components/schemas/FeedbackModeEnum'
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    PatchedMentorSettings:
      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
        custom_javascript:
          type: string
          nullable: true
        enable_custom_javascript:
          type: boolean
          readOnly: true
        allow_anonymous:
          type: boolean
          readOnly: true
        enable_offline_mode:
          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
        study_mode_prompt:
          type: string
          readOnly: true
        voice_instructions:
          type: string
          readOnly: true
        disclaimer:
          type: string
          readOnly: true
        enable_disclaimer:
          type: boolean
          readOnly: true
        show_attachment:
          type: boolean
          readOnly: true
        show_voice_call:
          type: boolean
          readOnly: true
        show_voice_record:
          type: boolean
          readOnly: true
        show_rag_images:
          type: boolean
          readOnly: true
        show_catalogue:
          type: boolean
          readOnly: true
        show_reasoning:
          type: boolean
          readOnly: true
        starter_prompts:
          type: string
          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
        embed_show_canvas:
          type: boolean
          readOnly: true
        show_explore_mentors:
          type: boolean
          readOnly: true
        embed_icon_selection_data:
          readOnly: true
        embed_custom_image:
          type: string
          format: uri
          nullable: 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
        is_featured:
          type: boolean
          readOnly: true
        enable_guided_prompts:
          type: boolean
          readOnly: true
        save_flagged_prompts:
          type: boolean
          readOnly: true
        enable_moderation:
          type: boolean
          readOnly: true
        enable_multi_query_rag:
          type: boolean
          readOnly: true
        enable_prompt_caching:
          type: boolean
          readOnly: true
        enable_post_processing_system:
          type: boolean
          readOnly: true
        enable_safety_system:
          type: boolean
          readOnly: true
        enable_privacy_router:
          type: boolean
          readOnly: true
        filter_pii:
          type: boolean
          readOnly: true
        filter_phi:
          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
        segment:
          allOf:
          - $ref: '#/components/schemas/Segment'
          nullable: true
          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
        llm_provider:
          type: string
          readOnly: true
        enable_voice_call:
          type: boolean
          readOnly: true
        system_prompt:
          type: string
          readOnly: true
        shared_system_prompt_source:
          type: object
          additionalProperties: {}
          nullable: true
          readOnly: true
        llm_temperature:
          type: number
          format: double
          readOnly: true
        safety_system_prompt:
          type: string
          readOnly: true
        safety_response:
          type: string
          readOnly: true
        privacy_action:
          type: string
          readOnly: true
        privacy_entities:
          type: array
          items: {}
          readOnly: true
        privacy_response:
          type: string
          readOnly: true
        enable_privacy_output_filter:
          type: boolean
          readOnly: true
        phi_action:
          type: string
          readOnly: true
        phi_entities:
          type: array
          items: {}
          readOnly: true
        phi_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
        strip_page_content_html:
          type: boolean
          readOnly: true
        chat_history_max_tokens:
          type: integer
          readOnly: true
        chat_history_max_messages:
          type: integer
          readOnly: true
        rag_retrieval_k:
          type: integer
          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
        iblai_voice:
          type: string
          readOnly: true
        voice_provider:
          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
        is_lti_accessible:
          type: boolean
          nullable: true
          description: Enables LTI access for this mentor. When True, LTI users can
            be granted access via RBAC policies.
        enable_claw:
          type: boolean
        enable_virtual_machine:
          type: boolean
          description: Gives the graph agent an `execute` shell tool backed by an
            isolated per-chat-run VM (iblai-sandbox). The VM is created lazily on
            the first executed command and destroyed when the chat run ends. Supersedes
            the quickjs computational runtime when both are enabled.
        virtual_machine_egress:
          allOf:
          - $ref: '#/components/schemas/VirtualMachineEgressEnum'
          description: |-
            Network policy for the mentor's virtual machine, passed to the sandbox control plane as the egress profile. Defaults to no network access: the VM runs untrusted code, so outbound access is opt-in. The tenant must be granted the matching profile on the control plane.

            * `none` - None
            * `registries` - Registries
            * `public` - Public
    PatchedMentorSkillAssignment:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        mentor:
          type: string
          format: uuid
          readOnly: true
        mentor_name:
          type: string
          readOnly: true
        mentor_slug:
          type: string
          readOnly: true
        skill:
          type: string
          format: uuid
        skill_name:
          type: string
          readOnly: true
        skill_slug:
          type: string
          readOnly: true
        enabled:
          type: boolean
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    PatchedMentorWizard:
      type: object
      properties:
        name:
          type: string
          maxLength: 100
        description:
          type: string
          maxLength: 1000
          minLength: 20
    PatchedNotification:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        username:
          type: string
          nullable: true
          readOnly: true
        title:
          type: string
          readOnly: true
        body:
          type: string
          readOnly: true
        status:
          title: Message status
          oneOf:
          - $ref: '#/components/schemas/Status3daEnum'
          - $ref: '#/components/schemas/BlankEnum'
        channel:
          type: string
          nullable: true
          readOnly: true
        context:
          nullable: true
        short_message:
          type: string
          readOnly: true
        tags:
          type: array
          items:
            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.

            * `ACTIVITY_COURSE_MILESTONE` - Activity Course Milestone
            * `ACTIVITY_NEW_CONTENT` - Activity New Content
            * `ADMIN_NOTIF_COURSE_ENROLLMENT` - Admin Notif Course Enrollment
            * `APP_REGISTRATION` - App Registration
            * `COURSE_INVITATION` - Course Invitation
            * `COURSE_LICENSE_ASSIGNMENT` - Course License Assignment
            * `COURSE_LICENSE_GROUP_ASSIGNMENT` - Course License Group Assignment
            * `COURSE_SCHEDULE_CHANGE` - Course Schedule Change
            * `CRM_DEAL_STAGE_CHANGED` - Crm Deal Stage Changed
            * `CRM_PERSON_CREATED` - Crm Person Created
            * `CRM_PERSON_LINKED_TO_USER` - Crm Person Linked To User
            * `CUSTOM_NOTIFICATION` - Custom Notification
            * `DEFAULT_TEMPLATE` - Default Template
            * `HUMAN_SUPPORT_NOTIFICATION` - Human Support Notification
            * `HUMAN_SUPPORT_TICKET_MESSAGE` - Human Support Ticket Message
            * `PATHWAY_ENROLLMENT_CONFIRMATION` - Pathway Enrollment Confirmation
            * `PLATFORM_APPLICATION_DECISION` - Platform Application Decision
            * `PLATFORM_INVITATION` - Platform Invitation
            * `POLICY_ASSIGNMENT` - Policy Assignment
            * `PROACTIVE_LEARNER_NOTIFICATION` - Proactive Learner Notification
            * `PROGRAM_ENROLLMENT_CONFIRMATION` - Program Enrollment Confirmation
            * `PROGRAM_INVITATION` - Program Invitation
            * `PROGRAM_LICENSE_ASSIGNMENT` - Program License Assignment
            * `PROGRAM_LICENSE_GROUP_ASSIGNMENT` - Program License Group Assignment
            * `REPORT_COMPLETED` - Report Completed
            * `ROLE_CHANGE` - Role Change
            * `SKILL_MASTERY_CHANGE` - Skill Mastery Change
            * `SPEND_CAP_ALERT` - Spend Cap Alert
            * `SUBSECTION_GRADE_UPDATE` - Subsection Grade Update
            * `USER_LICENSE_ASSIGNMENT` - User License Assignment
            * `USER_LICENSE_GROUP_ASSIGNMENT` - User License Group Assignment
            * `USER_NOTIF_COURSE_COMPLETION` - User Notif Course Completion
            * `USER_NOTIF_COURSE_ENROLLMENT` - User Notif Course Enrollment
            * `USER_NOTIF_CREDENTIALS` - User Notif Credentials
            * `USER_NOTIF_LEARNER_PROGRESS` - User Notif Learner Progress
            * `USER_NOTIF_USER_INACTIVITY` - User Notif User Inactivity
            * `USER_NOTIF_USER_REGISTRATION` - User Notif User Registration
            * `COURSES_PROGRESS_SUMMARY` - User Progress Summary
          oneOf:
          - $ref: '#/components/schemas/TypeF30Enum'
          - $ref: '#/components/schemas/NullEnum'
        name:
          type: string
          nullable: true
          description: Template display name
          maxLength: 255
        description:
          type: string
          description: Description of when this notification is sent
        message_title:
          type: string
          nullable: true
          description: Title for push/in-app notifications
          maxLength: 255
        message_body:
          type: string
          description: Body text (supports Django template syntax)
        short_message_body:
          type: string
          description: Short version for SMS or preview
        email_subject:
          type: string
          nullable: true
          description: Email subject line (supports {{ variables }})
          maxLength: 255
        email_from_address:
          type: string
          nullable: true
          description: Sender email address
          maxLength: 255
        email_html_template:
          type: string
          nullable: true
          description: HTML email body (supports Django template syntax)
        watcher_email_html_template:
          type: string
          nullable: true
          description: Watcher-variant email HTML template (e.g., 'Your child completed...').
            Falls back to email_html_template if null.
        watcher_email_subject:
          type: string
          nullable: true
          description: Watcher-variant email subject. Falls back to email_subject
            if null.
          maxLength: 255
        tags:
          description: Free-form tags for categorization (e.g. ['activity', 'learning'])
        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
          description: IDs of SPAs that can use this template
        channel_ids:
          type: array
          items:
            type: integer
            writeOnly: true
          writeOnly: true
          description: IDs of delivery channels (email, push, etc.)
        is_inherited:
          type: boolean
          readOnly: true
          description: True if using main platform template (no platform override)
        is_enabled:
          type: boolean
          readOnly: true
          description: True if notification is enabled for this platform
        source_platform:
          type: string
          readOnly: true
          description: Platform key of the template source
        can_customize:
          type: boolean
          readOnly: true
          description: True if platform admin can edit template content
        metadata:
          description: JSON config (periodic_config, policy_config, etc.)
        available_context:
          type: string
          readOnly: true
          description: Context variables available for template rendering
        watcher_available_context:
          type: string
          readOnly: true
          description: Context variables available in the watcher email variant (null
            for notification types without a watcher variant)
        proactive_prompt_message:
          type: string
          nullable: true
          description: Default prompt message for AI agent notifications
        periodic_config:
          type: string
          readOnly: true
          description: Periodic report configuration (PROACTIVE_LEARNER_NOTIFICATION
            only)
        periodic_learner_scope:
          allOf:
          - $ref: '#/components/schemas/CoursesProgressLearnerScopeEnum'
          writeOnly: true
          description: |-
            Which learners to include: ACTIVE_LEARNERS or ALL_LEARNERS

            * `ACTIVE_LEARNERS` - ACTIVE_LEARNERS
            * `ALL_LEARNERS` - ALL_LEARNERS
        periodic_lookback_days:
          type: integer
          maximum: 365
          minimum: 1
          writeOnly: true
          description: Number of days to include in the report period
        periodic_report_period_days:
          type: integer
          maximum: 365
          minimum: 1
          writeOnly: true
          description: 'Deprecated: use periodic_lookback_days instead'
        periodic_frequency:
          allOf:
          - $ref: '#/components/schemas/CoursesProgressFrequencyEnum'
          writeOnly: true
          description: |-
            How often to send: DAILY, WEEKLY, MONTHLY, or CUSTOM

            * `DAILY` - DAILY
            * `WEEKLY` - WEEKLY
            * `MONTHLY` - MONTHLY
            * `CUSTOM` - CUSTOM
        periodic_custom_interval_days:
          type: integer
          maximum: 365
          minimum: 1
          writeOnly: true
          description: Custom interval in days (when frequency is CUSTOM)
        periodic_execution_time:
          type: string
          writeOnly: true
          description: Time to run in HH:MM format (24-hour)
        periodic_timezone:
          type: string
          writeOnly: true
          description: Timezone for execution time (e.g. America/New_York)
        periodic_mentors:
          type: array
          items:
            type: object
            additionalProperties: {}
          writeOnly: true
          description: 'List of agent configurations: [{"unique_id": "uuid", "prompt":
            "...", "name": "..."}]'
        policy_config:
          type: string
          readOnly: true
          description: Policy assignment notification config (POLICY_ASSIGNMENT only)
        policy_enabled_policies:
          type: array
          items:
            type: object
            additionalProperties: {}
          writeOnly: true
          description: 'Per-role config: [{"role_name": "Analytics Viewer", "enabled":
            True, "subject": "Custom subject for {{role_name}}"}, ...]'
        policy_notify_on_assignment:
          type: boolean
          writeOnly: true
          description: Send notification when policy is assigned
        policy_notify_on_removal:
          type: boolean
          writeOnly: true
          description: Send notification when policy is removed
        human_support_config:
          type: string
          readOnly: true
          description: Human support notification config (HUMAN_SUPPORT_NOTIFICATION
            only)
        human_support_recipient_mode:
          allOf:
          - $ref: '#/components/schemas/HumanSupportRecipientModeEnum'
          writeOnly: true
          description: |-
            Who receives human support ticket notifications

            * `platform_admins_and_mentor_owner` - platform_admins_and_mentor_owner
            * `platform_admins_only` - platform_admins_only
            * `mentor_owner_only` - mentor_owner_only
            * `custom` - custom
        human_support_custom_recipients:
          type: array
          items:
            type: object
            additionalProperties: {}
          writeOnly: true
          description: 'Custom targets: user: {type, id}; user_group: {type, id};
            rbac_policy: {type, policy_name}'
        recipients_config:
          type: string
          readOnly: true
          description: Recipients config (recipient mode + optional custom targets)
            for notification types that opt into the generic recipients model (e.g.
            CRM_*). Null for types that do not.
        recipients_recipient_mode:
          allOf:
          - $ref: '#/components/schemas/RecipientsRecipientModeEnum'
          writeOnly: true
          description: |-
            Who receives this notification: 'platform_admins_only', 'object_owner_only' (falls back to admins), 'object_owner_only_strict' (no fallback), 'platform_admins_and_object_owner' (default), or 'custom'.

            * `platform_admins_only` - platform_admins_only
            * `object_owner_only` - object_owner_only
            * `object_owner_only_strict` - object_owner_only_strict
            * `platform_admins_and_object_owner` - platform_admins_and_object_owner
            * `custom` - custom
        recipients_custom_recipients:
          type: array
          items:
            type: object
            additionalProperties: {}
          writeOnly: true
          description: 'Custom recipient targets (used when recipient_mode=''custom''):
            user: {type, id}; user_group: {type, id}; rbac_policy: {type, policy_name}.'
        new_content_config:
          type: string
          readOnly: true
          description: New content notification config (ACTIVITY_NEW_CONTENT only)
        new_content_block_types:
          type: array
          items:
            type: string
          writeOnly: true
          description: Block types to notify on (e.g. ["sequential", "vertical", "chapter"])
        course_milestone_config:
          type: string
          readOnly: true
          description: Course milestone notification config (ACTIVITY_COURSE_MILESTONE
            only)
        course_milestone_milestones:
          type: array
          items:
            type: integer
            maximum: 100
            minimum: 0
          writeOnly: true
          description: Completion percentage thresholds (e.g. [25, 50, 75, 100])
        skill_mastery_config:
          type: string
          readOnly: true
          description: Skill mastery notification config (SKILL_MASTERY_CHANGE only)
        skill_mastery_thresholds:
          type: array
          items:
            type: object
            additionalProperties: {}
          writeOnly: true
          description: 'Mastery band thresholds (e.g. [{"name": "Beginner", "min_points":
            0}, {"name": "Intermediate", "min_points": 100}])'
        schedule_change_config:
          type: string
          readOnly: true
          description: Schedule change notification config (COURSE_SCHEDULE_CHANGE
            only)
        schedule_change_enabled_signals:
          type: array
          items:
            type: string
          writeOnly: true
          description: 'Signal types to trigger notifications: ["course_overview.start_date_changed",
            "course_overview.pacing_changed", "course_overview.cert_date_changed"]'
        user_progress_config:
          type: object
          additionalProperties: {}
          nullable: true
          readOnly: true
          description: User progress summary config (COURSES_PROGRESS_SUMMARY only).
            Includes available_data_points and available_learner_scopes — the permitted
            values for enabled_data_points and learner_scope.
        user_progress_learner_scope:
          allOf:
          - $ref: '#/components/schemas/CoursesProgressLearnerScopeEnum'
          writeOnly: true
          description: |-
            Who receives the report. ALL_LEARNERS (default) sends to every learner with an active enrollment, including those with no activity in the period; ACTIVE_LEARNERS sends only to learners whose progress moved during the period.

            * `ACTIVE_LEARNERS` - ACTIVE_LEARNERS
            * `ALL_LEARNERS` - ALL_LEARNERS
        user_progress_lookback_days:
          type: integer
          writeOnly: true
          description: Lookback window in days for the user progress summary
        user_progress_enabled_data_points:
          type: array
          items:
            type: string
          writeOnly: true
          description: 'Data points to include: course_breakdown (per-course rows
            with topics and grade), course_grades (current grade per active enrollment),
            courses_progressed, courses_completed, credentials_earned, time_spent,
            active_days, mentors_accessed (AI agent activity), learning_insights (AI
            narrative summary of the period as {summary, watcher_summary}, written
            from the report''s figures and the learner''s agent conversations; one
            LLM call per learner with either)'
        user_progress_frequency:
          allOf:
          - $ref: '#/components/schemas/CoursesProgressFrequencyEnum'
          writeOnly: true
          description: |-
            How often to send the user progress summary

            * `DAILY` - DAILY
            * `WEEKLY` - WEEKLY
            * `MONTHLY` - MONTHLY
            * `CUSTOM` - CUSTOM
        user_progress_custom_interval_days:
          type: integer
          maximum: 365
          minimum: 1
          writeOnly: true
          description: Custom interval in days (when frequency is CUSTOM)
        user_progress_execution_time:
          type: string
          writeOnly: true
          description: Time of day to send (HH:MM format)
          pattern: ^\d{2}:\d{2}$
        user_progress_timezone:
          type: string
          writeOnly: true
          description: Timezone for execution (e.g. America/New_York)
        courses_progress_config:
          type: object
          additionalProperties: {}
          nullable: true
          readOnly: true
          description: Deprecated alias of user_progress_config (COURSES_PROGRESS_SUMMARY
            only)
        courses_progress_learner_scope:
          allOf:
          - $ref: '#/components/schemas/CoursesProgressLearnerScopeEnum'
          writeOnly: true
          description: |-
            Deprecated alias of user_progress_learner_scope

            * `ACTIVE_LEARNERS` - ACTIVE_LEARNERS
            * `ALL_LEARNERS` - ALL_LEARNERS
        courses_progress_lookback_days:
          type: integer
          writeOnly: true
          description: Deprecated alias of user_progress_lookback_days
        courses_progress_enabled_data_points:
          type: array
          items:
            type: string
          writeOnly: true
          description: Deprecated alias of user_progress_enabled_data_points
        courses_progress_frequency:
          allOf:
          - $ref: '#/components/schemas/CoursesProgressFrequencyEnum'
          writeOnly: true
          description: |-
            Deprecated alias of user_progress_frequency

            * `DAILY` - DAILY
            * `WEEKLY` - WEEKLY
            * `MONTHLY` - MONTHLY
            * `CUSTOM` - CUSTOM
        courses_progress_custom_interval_days:
          type: integer
          maximum: 365
          minimum: 1
          writeOnly: true
          description: Deprecated alias of user_progress_custom_interval_days
        courses_progress_execution_time:
          type: string
          writeOnly: true
          description: Deprecated alias of user_progress_execution_time
          pattern: ^\d{2}:\d{2}$
        courses_progress_timezone:
          type: string
          writeOnly: true
          description: Deprecated alias of user_progress_timezone
        grade_posted_config:
          type: object
          additionalProperties: {}
          nullable: true
          readOnly: true
          description: Grade posted notification config (SUBSECTION_GRADE_UPDATE only)
        grade_posted_notify_mode:
          allOf:
          - $ref: '#/components/schemas/GradePostedNotifyModeEnum'
          writeOnly: true
          description: |-
            Notification mode: 'every' (with debounce) or 'first_only' (once per subsection)

            * `every` - every
            * `first_only` - first_only
        grade_posted_debounce_seconds:
          type: integer
          minimum: 0
          writeOnly: true
          description: Debounce window in seconds for 'every' mode (default 300)
        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
          description: True to enable, False to disable this notification type for
            the platform
    PatchedNotificationTypePreference:
      type: object
      description: Serializer for per-type notification preference updates.
      properties:
        enabled:
          type: boolean
          default: true
          description: Whether this notification type is enabled
    PatchedOrganization:
      type: object
      description: |-
        Adds a read-only ``tags`` field to a host serializer.

        Emits ``[{id, name, color}]``. Cheap when the host queryset uses
        ``prefetch_related("tag_assignments__tag")`` — without that prefetch
        every record triggers two extra queries.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: Server-assigned UUID.
        platform:
          type: integer
          readOnly: true
          description: Platform the Organization belongs to. Set server-side from
            the auth token.
        name:
          type: string
          description: Display name. Unique per platform (case-sensitive).
          maxLength: 255
        address:
          description: Free-form JSON address (street, city, country, etc.).
        owner:
          type: integer
          description: Id of the Platform user who owns / manages this Organization.
            Must be an active member of your Platform.
          nullable: true
        tags:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
              color:
                type: string
                example: '#3F6BFF'
            required:
            - id
            - name
            - color
          readOnly: true
        metadata:
          description: Free-form JSON for Platform-defined attributes.
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Creation timestamp.
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Last-modified timestamp.
    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
          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.
    PatchedPerson:
      type: object
      description: |-
        Adds a read-only ``tags`` field to a host serializer.

        Emits ``[{id, name, color}]``. Cheap when the host queryset uses
        ``prefetch_related("tag_assignments__tag")`` — without that prefetch
        every record triggers two extra queries.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: Server-assigned UUID. Stable across renames and merges.
        platform:
          type: integer
          readOnly: true
          description: Platform the person belongs to. Set automatically from your
            credentials; you cannot pass another Platform's id.
        name:
          type: string
          description: Display name (e.g. 'Alice Chen').
          maxLength: 255
        primary_email:
          type: string
          format: email
          description: Canonical email address. When a platform user is created with
            a matching email in your Platform, this person is automatically linked
            to them (case-insensitive).
          maxLength: 254
        emails:
          description: Additional email addresses associated with this person.
        contact_numbers:
          description: Phone/contact numbers in any free-form shape.
        job_title:
          type: string
          default: ''
          description: Role / job title — display only, not validated.
          maxLength: 255
        organization:
          type: string
          format: uuid
          description: UUID of an organization in your Platform. References to organizations
            in other Platforms are rejected.
          nullable: true
        owner:
          type: integer
          description: Id of the platform user who owns / manages this person (internal
            account manager). Optional.
          nullable: true
        platform_user:
          type: integer
          description: Read-only. Populated once this person is bound to a platform
            user — either automatically on user creation when emails match, or explicitly
            via `POST /persons/{id}/link-user/`.
          readOnly: true
          nullable: true
        lifecycle_stage:
          allOf:
          - $ref: '#/components/schemas/LifecycleStageEnum'
          default: lead
          description: |-
            Sales pipeline stage. One of: `lead`, `qualified`, `opportunity`, `customer`, `churned`.

            * `lead` - Lead
            * `qualified` - Qualified
            * `opportunity` - Opportunity
            * `customer` - Customer
            * `churned` - Churned
        unique_id:
          type: string
          default: ''
          description: Optional external system id (e.g. import key from another CRM).
            When non-blank, must be unique within your Platform.
          maxLength: 128
        active:
          type: boolean
          readOnly: true
          description: Read-only. Set to `false` when the person is linked to a platform
            user or merged into another person.
        tags:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
              color:
                type: string
                example: '#3F6BFF'
            required:
            - id
            - name
            - color
          readOnly: true
        metadata:
          description: Free-form JSON for Platform-defined attributes.
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Creation timestamp.
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Last-modified timestamp.
    PatchedPipeline:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
          description: Server-assigned id.
        platform:
          type: integer
          readOnly: true
          description: Platform this Pipeline belongs to. Set automatically from your
            credentials; you cannot pass another Platform's id.
        name:
          type: string
          description: Display name (e.g. 'B2B Sales', 'Renewals').
          maxLength: 255
        code:
          type: string
          description: Stable slug used in API payloads. Unique per Platform; lowercase
            letters, digits, and hyphens.
          maxLength: 64
          pattern: ^[-a-zA-Z0-9_]+$
        is_default:
          type: boolean
          default: false
          description: Mark this as the default Pipeline new Deals land in when none
            is specified. At most one default per Platform — promoting a new default
            requires un-flagging the old one in the same call set.
        rotten_days:
          type: integer
          default: 30
          description: Days a Deal can sit in a stage before it's surfaced as stale.
        stages:
          type: array
          items:
            $ref: '#/components/schemas/PipelineStage'
          readOnly: true
        metadata:
          description: Free-form JSON for Platform-defined attributes.
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    PatchedPipelineStage:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
          description: Server-assigned id.
        pipeline:
          type: integer
          readOnly: true
          description: Pipeline this stage belongs to. Set automatically from the
            URL path; you cannot move a stage between Pipelines.
        code:
          type: string
          description: Stable identifier referenced by `Deal.stage` payloads. Unique
            within the Pipeline.
          maxLength: 64
          pattern: ^[-a-zA-Z0-9_]+$
        name:
          type: string
          description: Display name shown on Kanban boards.
          maxLength: 255
        probability:
          type: integer
          default: 0
          description: Win likelihood at this stage (0–100). Used for revenue forecasting.
        sort_order:
          type: integer
          default: 0
          description: Left-to-right position on the Kanban board.
        is_won:
          type: boolean
          default: false
          description: Closed-won terminal stage. Moving a Deal here sets `Deal.status='won'`.
        is_lost:
          type: boolean
          default: false
          description: Closed-lost terminal stage. Moving a Deal here sets `Deal.status='lost'`.
        metadata:
          description: Free-form JSON for Platform-defined attributes.
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    PatchedPlacementAssessmentUpdate:
      type: object
      description: 'Update body: every field optional; at least one must be present.'
      properties:
        name:
          type: string
          maxLength: 255
        source:
          $ref: '#/components/schemas/SourceEnum'
        agent_unique_id:
          type: string
          maxLength: 255
        agent_label:
          type: string
          maxLength: 255
        subject:
          type: string
          maxLength: 255
        config: {}
        enabled:
          type: boolean
    PatchedPlatformApiKey:
      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
        mode:
          allOf:
          - $ref: '#/components/schemas/PlatformApiKeyModeEnum'
          default: owner
          description: |-
            How permissions resolve: 'owner' (default) uses the owner's RBAC permissions; 'token_policies' uses the policies/groups this token is associated with

            * `owner` - Owner permissions
            * `token_policies` - Token policies
        policies_to_add:
          type: array
          items:
            type: integer
          writeOnly: true
          description: RbacPolicy IDs to associate with this token (mode=token_policies)
        policies_to_remove:
          type: array
          items:
            type: integer
          writeOnly: true
          description: RbacPolicy IDs to disassociate from this token (mode=token_policies)
        groups_to_add:
          type: array
          items:
            type: integer
          writeOnly: true
          description: RbacGroup IDs to associate with this token (mode=token_policies)
        groups_to_remove:
          type: array
          items:
            type: integer
          writeOnly: true
          description: RbacGroup IDs to disassociate from this token (mode=token_policies)
    PatchedPlatformApplicationFormUpdate:
      type: object
      description: Body for updating a platform's application form.
      properties:
        platform_key:
          type: string
        platform_org:
          type: string
        name:
          type: string
        schema: {}
        config: {}
        enabled:
          type: boolean
        is_default:
          type: boolean
    PatchedPlatformApplicationNote:
      type: object
      description: Body for adding/updating an internal reviewer note.
      properties:
        body:
          type: string
        kind:
          $ref: '#/components/schemas/PlatformApplicationNoteKindEnum'
    PatchedPlatformApplicationPlacementUpdate:
      type: object
      description: |-
        Body for advancing a placement: status, the agent's result, an admin
        override, or a note. All optional; at least one must be present.
      properties:
        status:
          $ref: '#/components/schemas/PlatformApplicationPlacementUpdateStatusEnum'
        result: {}
        override: {}
        session_id:
          type: string
          maxLength: 64
        note:
          type: string
    PatchedPlatformApplicationUpdate:
      type: object
      description: Body for updating a draft's responses.
      properties:
        responses: {}
    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
          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
          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)
        platform_key:
          type: string
          description: Target platform key. Service-account callers must supply this.
            Non-SA callers' value is overwritten by the view with the platform from
            the auth token.
          writeOnly: true
        resources:
          type: array
          items:
            type: string
          description: List of resource paths this policy grants access to, relative
            to your platform (e.g., ['/mentors/', '/usergroups/5/']). The '/platforms/{pk}/'
            prefix is added server-side.
        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
        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 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
    PatchedSeedMentorsView:
      type: object
      properties:
        detail:
          type: string
    PatchedSkillThreshold:
      type: object
      properties:
        name:
          type: string
          description: The name of the threshold e.g Beginner.
          maxLength: 255
        threshold:
          type: integer
          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
          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
    PatchedTag:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
          description: Server-assigned id.
        platform:
          type: integer
          readOnly: true
          description: Platform this Tag belongs to. Set automatically from your credentials;
            you cannot pass another Platform's id.
        name:
          type: string
          description: Display label shown on tag chips. Must be unique within your
            Platform (case-sensitive). Up to 64 characters.
          maxLength: 64
        color:
          type: string
          default: '#888888'
          description: Hex color (e.g. `#3F6BFF`) used to render the chip. Six lowercase
            or uppercase hex digits with a leading `#`.
          maxLength: 7
        metadata:
          description: Free-form JSON for Platform-defined attributes.
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Creation timestamp.
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Last-modified timestamp.
    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
    PatchedTenantChatPrivacyConfig:
      type: object
      description: |-
        Serializer for the tenant-wide chat-privacy config payload.

        Shared by GET and PATCH on /orgs/{org}/chat-privacy-config/.
      properties:
        allow_user_chat_privacy_control:
          type: boolean
          description: Whether the tenant allows end users to control their chat history
            privacy (anonymize or disable). When False, user and session preferences
            are ignored and history is always logged.
    PatchedTicketMessage:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        ticket:
          type: integer
        sender:
          type: integer
          description: edX user ID
          nullable: true
        message:
          type: string
        timestamp:
          type: string
          format: date-time
          readOnly: true
    PatchedUserGroup:
      type: object
      description: Serializer for UserGroups.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          nullable: true
          description: Group display name
          maxLength: 255
        platform:
          allOf:
          - $ref: '#/components/schemas/RbacPlatform'
          readOnly: true
        platform_key:
          type: string
          description: The platform key
          writeOnly: true
        description:
          type: string
          nullable: true
          description: Group description
        owner:
          allOf:
          - $ref: '#/components/schemas/RbacUser'
          readOnly: true
        users_to_set:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of user IDs to set in this group (replaces all existing
            users)
    PatchedUserNotificationPreferences:
      type: object
      description: Serializer for user notification preferences.
      properties:
        email_enabled:
          type: boolean
        push_enabled:
          type: boolean
        notification_frequency:
          $ref: '#/components/schemas/NotificationFrequencyEnum'
        type_preferences:
          readOnly: true
          description: 'Per-type overrides: {"ACTIVITY_NEW_CONTENT": {"enabled": true,
            "frequency": "daily"}, ...}'
    PatchedUserPlatformMetadataUpdate:
      type: object
      description: |-
        Update serializer for user platform metadata supporting partial key updates.

        - To update keys: {"metadata": {"key1": "value1"}}
        - To delete keys: {"delete_keys": ["key1", "key2"]}
      properties:
        metadata: {}
        delete_keys:
          type: array
          items:
            type: string
    PatchedWatchedGroupUpdate:
      type: object
      description: |-
        Payload for PATCH /watched-groups/{pk}/ — name only.

        Watchers are managed via /watchers/; watched users via /watched-users/.
      properties:
        name:
          type: string
    PatchedWatcherUpdate:
      type: object
      description: Payload for PATCH /watched-groups/{wg_pk}/watchers/{pk}/ — events
        only.
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/EventsEnum'
    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
          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
    PatchedWorkflow:
      type: object
      description: |-
        Serializer for Workflow CRUD operations.

        Provides basic ReactFlow JSON validation (Phase 1) to ensure definitions
        are renderable, while allowing draft workflows that may not be executable.

        Comprehensive execution validation (Phase 2) is available via the
        validate action endpoint.

        Fields:
        - All model fields are exposed
        - Platform and creator are set automatically from URL context
        - Read-only fields: id, unique_id, created_at, updated_at
        - Chat settings (chat_name, chat_greeting, etc.) update the entry_mentor
      properties:
        id:
          type: integer
          readOnly: true
        unique_id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
        definition:
          description: Workflow definition in ReactFlow format
        is_active:
          type: boolean
        is_template:
          type: boolean
        parent_workflow:
          type: integer
          nullable: true
          description: Parent workflow if this is a template variant
        platform:
          type: integer
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        platform_name:
          type: string
          readOnly: true
        created_by:
          type: integer
          description: edX user ID
          readOnly: true
        created_by_username:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        node_count:
          type: integer
          description: Get the number of nodes in the workflow definition.
          readOnly: true
        edge_count:
          type: integer
          description: Get the number of edges in the workflow definition.
          readOnly: true
        entry_mentor_id:
          type: string
          format: uuid
          readOnly: true
        chat_name:
          type: string
          description: Display name for chat (updates entry_mentor.name)
        chat_proactive_response:
          type: string
          description: Proactive greeting message for chat (updates entry_mentor.proactive_response)
    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
          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
          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
    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
    Person:
      type: object
      description: |-
        Adds a read-only ``tags`` field to a host serializer.

        Emits ``[{id, name, color}]``. Cheap when the host queryset uses
        ``prefetch_related("tag_assignments__tag")`` — without that prefetch
        every record triggers two extra queries.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: Server-assigned UUID. Stable across renames and merges.
        platform:
          type: integer
          readOnly: true
          description: Platform the person belongs to. Set automatically from your
            credentials; you cannot pass another Platform's id.
        name:
          type: string
          description: Display name (e.g. 'Alice Chen').
          maxLength: 255
        primary_email:
          type: string
          format: email
          description: Canonical email address. When a platform user is created with
            a matching email in your Platform, this person is automatically linked
            to them (case-insensitive).
          maxLength: 254
        emails:
          description: Additional email addresses associated with this person.
        contact_numbers:
          description: Phone/contact numbers in any free-form shape.
        job_title:
          type: string
          default: ''
          description: Role / job title — display only, not validated.
          maxLength: 255
        organization:
          type: string
          format: uuid
          description: UUID of an organization in your Platform. References to organizations
            in other Platforms are rejected.
          nullable: true
        owner:
          type: integer
          description: Id of the platform user who owns / manages this person (internal
            account manager). Optional.
          nullable: true
        platform_user:
          type: integer
          description: Read-only. Populated once this person is bound to a platform
            user — either automatically on user creation when emails match, or explicitly
            via `POST /persons/{id}/link-user/`.
          readOnly: true
          nullable: true
        lifecycle_stage:
          allOf:
          - $ref: '#/components/schemas/LifecycleStageEnum'
          default: lead
          description: |-
            Sales pipeline stage. One of: `lead`, `qualified`, `opportunity`, `customer`, `churned`.

            * `lead` - Lead
            * `qualified` - Qualified
            * `opportunity` - Opportunity
            * `customer` - Customer
            * `churned` - Churned
        unique_id:
          type: string
          default: ''
          description: Optional external system id (e.g. import key from another CRM).
            When non-blank, must be unique within your Platform.
          maxLength: 128
        active:
          type: boolean
          readOnly: true
          description: Read-only. Set to `false` when the person is linked to a platform
            user or merged into another person.
        tags:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
              color:
                type: string
                example: '#3F6BFF'
            required:
            - id
            - name
            - color
          readOnly: true
        metadata:
          description: Free-form JSON for Platform-defined attributes.
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Creation timestamp.
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Last-modified timestamp.
      required:
      - active
      - created_at
      - id
      - name
      - platform
      - platform_user
      - tags
      - updated_at
    PersonInviteConflict:
      type: object
      description: Shape returned when an active invitation already exists for this
        email.
      properties:
        detail:
          type: string
        invitation_id:
          type: integer
          description: Id of the pre-existing active invitation.
        person_id:
          type: string
          format: uuid
        platform_key:
          type: string
      required:
      - detail
      - invitation_id
      - person_id
      - platform_key
    PersonInviteRequest:
      type: object
      properties:
        is_admin:
          type: boolean
          description: Grant Platform-admin privileges on acceptance. Defaults to
            `false`.
        is_staff:
          type: boolean
          description: Grant staff privileges on acceptance. Defaults to `false`.
        enrollment_config:
          type: object
          additionalProperties: {}
          description: Optional enrollment payload. Forwarded to the platform invitation
            to auto-enroll the invitee in the listed courses, programs, or pathways
            on acceptance.
        redirect_to:
          type: string
          description: URL to send the invitee to after they accept the invitation
            (e.g. a custom landing page, an enrollment screen). Passed straight through
            to the platform invitation row. Leave blank to use the platform default.
          maxLength: 255
    PersonInviteResponse:
      type: object
      description: Shape returned by `POST /persons/{id}/invite/`.
      properties:
        person_id:
          type: string
          format: uuid
          description: UUID of the person that was invited.
        invitation_id:
          type: integer
          description: Id of the newly created invitation.
        invitation_email:
          type: string
          format: email
          description: Email address the invitation was sent to.
        platform_key:
          type: string
          description: Key of the Platform the invitation targets.
        auto_accept:
          type: boolean
          description: Whether the invitation is auto-accepted when the invitee first
            signs in.
        active:
          type: boolean
          description: Whether the invitation is currently active.
        redirect_to:
          type: string
          nullable: true
          description: URL the invitee will be sent to after accepting. Null/blank
            means the platform default destination.
        created:
          type: string
          format: date-time
          nullable: true
          description: When the invitation was created.
      required:
      - active
      - auto_accept
      - created
      - invitation_email
      - invitation_id
      - person_id
      - platform_key
      - redirect_to
    PersonLinkUserRequest:
      type: object
      properties:
        user_id:
          type: integer
          description: Id of the platform user to bind to this person. The user must
            already be a member of your Platform — invite them first if they are not.
      required:
      - user_id
    PersonMergeRequest:
      type: object
      properties:
        primary_id:
          type: string
          format: uuid
          description: UUID of the person to keep (the surviving record). Must belong
            to your Platform.
        duplicate_ids:
          type: array
          items:
            type: string
            format: uuid
          description: UUIDs of the persons to merge into `primary_id`. Each must
            belong to your Platform. `primary_id` may not appear in this list. The
            duplicates are marked inactive; their related records (deals, activities,
            tags) are re-parented onto the primary.
      required:
      - duplicate_ids
      - primary_id
    PersonMergeResponse:
      type: object
      description: Shape returned by `POST /persons/merge/`.
      properties:
        primary_id:
          type: string
          format: uuid
          description: UUID of the surviving (primary) person.
        merged_ids:
          type: array
          items:
            type: string
            format: uuid
          description: UUIDs of the persons marked inactive by this merge.
        reparented:
          type: object
          additionalProperties: {}
          description: Per-relation counts of related records (deals, activities,
            tags) re-parented onto the primary.
      required:
      - merged_ids
      - primary_id
      - reparented
    PhiActionEnum:
      enum:
      - redact
      - mask
      - block
      - allow
      type: string
      description: |-
        * `redact` - Redact
        * `mask` - Mask
        * `block` - Block
        * `allow` - Allow
    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
    PinnedMessageRequest:
      type: object
      properties:
        session_id:
          type: string
          description: Session id of the message to pin
      required:
      - session_id
    Pipeline:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
          description: Server-assigned id.
        platform:
          type: integer
          readOnly: true
          description: Platform this Pipeline belongs to. Set automatically from your
            credentials; you cannot pass another Platform's id.
        name:
          type: string
          description: Display name (e.g. 'B2B Sales', 'Renewals').
          maxLength: 255
        code:
          type: string
          description: Stable slug used in API payloads. Unique per Platform; lowercase
            letters, digits, and hyphens.
          maxLength: 64
          pattern: ^[-a-zA-Z0-9_]+$
        is_default:
          type: boolean
          default: false
          description: Mark this as the default Pipeline new Deals land in when none
            is specified. At most one default per Platform — promoting a new default
            requires un-flagging the old one in the same call set.
        rotten_days:
          type: integer
          default: 30
          description: Days a Deal can sit in a stage before it's surfaced as stale.
        stages:
          type: array
          items:
            $ref: '#/components/schemas/PipelineStage'
          readOnly: true
        metadata:
          description: Free-form JSON for Platform-defined attributes.
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - code
      - created_at
      - id
      - name
      - platform
      - stages
      - updated_at
    PipelineStage:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
          description: Server-assigned id.
        pipeline:
          type: integer
          readOnly: true
          description: Pipeline this stage belongs to. Set automatically from the
            URL path; you cannot move a stage between Pipelines.
        code:
          type: string
          description: Stable identifier referenced by `Deal.stage` payloads. Unique
            within the Pipeline.
          maxLength: 64
          pattern: ^[-a-zA-Z0-9_]+$
        name:
          type: string
          description: Display name shown on Kanban boards.
          maxLength: 255
        probability:
          type: integer
          default: 0
          description: Win likelihood at this stage (0–100). Used for revenue forecasting.
        sort_order:
          type: integer
          default: 0
          description: Left-to-right position on the Kanban board.
        is_won:
          type: boolean
          default: false
          description: Closed-won terminal stage. Moving a Deal here sets `Deal.status='won'`.
        is_lost:
          type: boolean
          default: false
          description: Closed-lost terminal stage. Moving a Deal here sets `Deal.status='lost'`.
        metadata:
          description: Free-form JSON for Platform-defined attributes.
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - code
      - created_at
      - id
      - name
      - pipeline
      - updated_at
    PlacementAssessment:
      type: object
      description: Create body for a placement assessment (platform configuration).
      properties:
        name:
          type: string
          maxLength: 255
        source:
          $ref: '#/components/schemas/SourceEnum'
        agent_unique_id:
          type: string
          maxLength: 255
        agent_label:
          type: string
          maxLength: 255
        subject:
          type: string
          maxLength: 255
        config: {}
        enabled:
          type: boolean
      required:
      - name
    PlacementCourseAssignmentCreate:
      type: object
      description: Grant one course to a platform user, optionally linked to a placement.
      properties:
        user_id:
          type: integer
        course_id:
          type: string
        started:
          type: string
          format: date-time
        expired:
          type: string
          format: date-time
        placement_id:
          type: integer
      required:
      - course_id
      - user_id
    PlacementProgramAssignmentCreate:
      type: object
      description: Grant one program to a platform user, optionally linked to a placement.
      properties:
        user_id:
          type: integer
        program_key:
          type: string
        started:
          type: string
          format: date-time
        expired:
          type: string
          format: date-time
        placement_id:
          type: integer
      required:
      - program_key
      - user_id
    PlacementRecordCreate:
      type: object
      description: Assign a configured assessment to a platform user (no application).
      properties:
        user_id:
          type: integer
        assessment_id:
          type: integer
        session_id:
          type: string
          maxLength: 64
        note:
          type: string
      required:
      - assessment_id
      - user_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
        is_enterprise:
          type: string
          readOnly: true
        show_paywall:
          type: boolean
          readOnly: true
          description: If True, billing status/credit checks are enforced for this
            platform's users
        enable_monetization:
          type: boolean
          readOnly: true
          description: If True, this platform can resell via Stripe Connect (act as
            a merchant of record). Separate from show_paywall, which controls billing/credits
            enforcement.
        timezone:
          readOnly: true
          nullable: true
          description: |-
            IANA timezone name (e.g. 'America/New_York'). Drives analytics bucket boundaries and timestamp localization.

            * `Africa/Abidjan` - Africa/Abidjan
            * `Africa/Accra` - Africa/Accra
            * `Africa/Addis_Ababa` - Africa/Addis_Ababa
            * `Africa/Algiers` - Africa/Algiers
            * `Africa/Asmara` - Africa/Asmara
            * `Africa/Asmera` - Africa/Asmera
            * `Africa/Bamako` - Africa/Bamako
            * `Africa/Bangui` - Africa/Bangui
            * `Africa/Banjul` - Africa/Banjul
            * `Africa/Bissau` - Africa/Bissau
            * `Africa/Blantyre` - Africa/Blantyre
            * `Africa/Brazzaville` - Africa/Brazzaville
            * `Africa/Bujumbura` - Africa/Bujumbura
            * `Africa/Cairo` - Africa/Cairo
            * `Africa/Casablanca` - Africa/Casablanca
            * `Africa/Ceuta` - Africa/Ceuta
            * `Africa/Conakry` - Africa/Conakry
            * `Africa/Dakar` - Africa/Dakar
            * `Africa/Dar_es_Salaam` - Africa/Dar_es_Salaam
            * `Africa/Djibouti` - Africa/Djibouti
            * `Africa/Douala` - Africa/Douala
            * `Africa/El_Aaiun` - Africa/El_Aaiun
            * `Africa/Freetown` - Africa/Freetown
            * `Africa/Gaborone` - Africa/Gaborone
            * `Africa/Harare` - Africa/Harare
            * `Africa/Johannesburg` - Africa/Johannesburg
            * `Africa/Juba` - Africa/Juba
            * `Africa/Kampala` - Africa/Kampala
            * `Africa/Khartoum` - Africa/Khartoum
            * `Africa/Kigali` - Africa/Kigali
            * `Africa/Kinshasa` - Africa/Kinshasa
            * `Africa/Lagos` - Africa/Lagos
            * `Africa/Libreville` - Africa/Libreville
            * `Africa/Lome` - Africa/Lome
            * `Africa/Luanda` - Africa/Luanda
            * `Africa/Lubumbashi` - Africa/Lubumbashi
            * `Africa/Lusaka` - Africa/Lusaka
            * `Africa/Malabo` - Africa/Malabo
            * `Africa/Maputo` - Africa/Maputo
            * `Africa/Maseru` - Africa/Maseru
            * `Africa/Mbabane` - Africa/Mbabane
            * `Africa/Mogadishu` - Africa/Mogadishu
            * `Africa/Monrovia` - Africa/Monrovia
            * `Africa/Nairobi` - Africa/Nairobi
            * `Africa/Ndjamena` - Africa/Ndjamena
            * `Africa/Niamey` - Africa/Niamey
            * `Africa/Nouakchott` - Africa/Nouakchott
            * `Africa/Ouagadougou` - Africa/Ouagadougou
            * `Africa/Porto-Novo` - Africa/Porto-Novo
            * `Africa/Sao_Tome` - Africa/Sao_Tome
            * `Africa/Timbuktu` - Africa/Timbuktu
            * `Africa/Tripoli` - Africa/Tripoli
            * `Africa/Tunis` - Africa/Tunis
            * `Africa/Windhoek` - Africa/Windhoek
            * `America/Adak` - America/Adak
            * `America/Anchorage` - America/Anchorage
            * `America/Anguilla` - America/Anguilla
            * `America/Antigua` - America/Antigua
            * `America/Araguaina` - America/Araguaina
            * `America/Argentina/Buenos_Aires` - America/Argentina/Buenos_Aires
            * `America/Argentina/Catamarca` - America/Argentina/Catamarca
            * `America/Argentina/ComodRivadavia` - America/Argentina/ComodRivadavia
            * `America/Argentina/Cordoba` - America/Argentina/Cordoba
            * `America/Argentina/Jujuy` - America/Argentina/Jujuy
            * `America/Argentina/La_Rioja` - America/Argentina/La_Rioja
            * `America/Argentina/Mendoza` - America/Argentina/Mendoza
            * `America/Argentina/Rio_Gallegos` - America/Argentina/Rio_Gallegos
            * `America/Argentina/Salta` - America/Argentina/Salta
            * `America/Argentina/San_Juan` - America/Argentina/San_Juan
            * `America/Argentina/San_Luis` - America/Argentina/San_Luis
            * `America/Argentina/Tucuman` - America/Argentina/Tucuman
            * `America/Argentina/Ushuaia` - America/Argentina/Ushuaia
            * `America/Aruba` - America/Aruba
            * `America/Asuncion` - America/Asuncion
            * `America/Atikokan` - America/Atikokan
            * `America/Atka` - America/Atka
            * `America/Bahia` - America/Bahia
            * `America/Bahia_Banderas` - America/Bahia_Banderas
            * `America/Barbados` - America/Barbados
            * `America/Belem` - America/Belem
            * `America/Belize` - America/Belize
            * `America/Blanc-Sablon` - America/Blanc-Sablon
            * `America/Boa_Vista` - America/Boa_Vista
            * `America/Bogota` - America/Bogota
            * `America/Boise` - America/Boise
            * `America/Buenos_Aires` - America/Buenos_Aires
            * `America/Cambridge_Bay` - America/Cambridge_Bay
            * `America/Campo_Grande` - America/Campo_Grande
            * `America/Cancun` - America/Cancun
            * `America/Caracas` - America/Caracas
            * `America/Catamarca` - America/Catamarca
            * `America/Cayenne` - America/Cayenne
            * `America/Cayman` - America/Cayman
            * `America/Chicago` - America/Chicago
            * `America/Chihuahua` - America/Chihuahua
            * `America/Ciudad_Juarez` - America/Ciudad_Juarez
            * `America/Coral_Harbour` - America/Coral_Harbour
            * `America/Cordoba` - America/Cordoba
            * `America/Costa_Rica` - America/Costa_Rica
            * `America/Coyhaique` - America/Coyhaique
            * `America/Creston` - America/Creston
            * `America/Cuiaba` - America/Cuiaba
            * `America/Curacao` - America/Curacao
            * `America/Danmarkshavn` - America/Danmarkshavn
            * `America/Dawson` - America/Dawson
            * `America/Dawson_Creek` - America/Dawson_Creek
            * `America/Denver` - America/Denver
            * `America/Detroit` - America/Detroit
            * `America/Dominica` - America/Dominica
            * `America/Edmonton` - America/Edmonton
            * `America/Eirunepe` - America/Eirunepe
            * `America/El_Salvador` - America/El_Salvador
            * `America/Ensenada` - America/Ensenada
            * `America/Fort_Nelson` - America/Fort_Nelson
            * `America/Fort_Wayne` - America/Fort_Wayne
            * `America/Fortaleza` - America/Fortaleza
            * `America/Glace_Bay` - America/Glace_Bay
            * `America/Godthab` - America/Godthab
            * `America/Goose_Bay` - America/Goose_Bay
            * `America/Grand_Turk` - America/Grand_Turk
            * `America/Grenada` - America/Grenada
            * `America/Guadeloupe` - America/Guadeloupe
            * `America/Guatemala` - America/Guatemala
            * `America/Guayaquil` - America/Guayaquil
            * `America/Guyana` - America/Guyana
            * `America/Halifax` - America/Halifax
            * `America/Havana` - America/Havana
            * `America/Hermosillo` - America/Hermosillo
            * `America/Indiana/Indianapolis` - America/Indiana/Indianapolis
            * `America/Indiana/Knox` - America/Indiana/Knox
            * `America/Indiana/Marengo` - America/Indiana/Marengo
            * `America/Indiana/Petersburg` - America/Indiana/Petersburg
            * `America/Indiana/Tell_City` - America/Indiana/Tell_City
            * `America/Indiana/Vevay` - America/Indiana/Vevay
            * `America/Indiana/Vincennes` - America/Indiana/Vincennes
            * `America/Indiana/Winamac` - America/Indiana/Winamac
            * `America/Indianapolis` - America/Indianapolis
            * `America/Inuvik` - America/Inuvik
            * `America/Iqaluit` - America/Iqaluit
            * `America/Jamaica` - America/Jamaica
            * `America/Jujuy` - America/Jujuy
            * `America/Juneau` - America/Juneau
            * `America/Kentucky/Louisville` - America/Kentucky/Louisville
            * `America/Kentucky/Monticello` - America/Kentucky/Monticello
            * `America/Knox_IN` - America/Knox_IN
            * `America/Kralendijk` - America/Kralendijk
            * `America/La_Paz` - America/La_Paz
            * `America/Lima` - America/Lima
            * `America/Los_Angeles` - America/Los_Angeles
            * `America/Louisville` - America/Louisville
            * `America/Lower_Princes` - America/Lower_Princes
            * `America/Maceio` - America/Maceio
            * `America/Managua` - America/Managua
            * `America/Manaus` - America/Manaus
            * `America/Marigot` - America/Marigot
            * `America/Martinique` - America/Martinique
            * `America/Matamoros` - America/Matamoros
            * `America/Mazatlan` - America/Mazatlan
            * `America/Mendoza` - America/Mendoza
            * `America/Menominee` - America/Menominee
            * `America/Merida` - America/Merida
            * `America/Metlakatla` - America/Metlakatla
            * `America/Mexico_City` - America/Mexico_City
            * `America/Miquelon` - America/Miquelon
            * `America/Moncton` - America/Moncton
            * `America/Monterrey` - America/Monterrey
            * `America/Montevideo` - America/Montevideo
            * `America/Montreal` - America/Montreal
            * `America/Montserrat` - America/Montserrat
            * `America/Nassau` - America/Nassau
            * `America/New_York` - America/New_York
            * `America/Nipigon` - America/Nipigon
            * `America/Nome` - America/Nome
            * `America/Noronha` - America/Noronha
            * `America/North_Dakota/Beulah` - America/North_Dakota/Beulah
            * `America/North_Dakota/Center` - America/North_Dakota/Center
            * `America/North_Dakota/New_Salem` - America/North_Dakota/New_Salem
            * `America/Nuuk` - America/Nuuk
            * `America/Ojinaga` - America/Ojinaga
            * `America/Panama` - America/Panama
            * `America/Pangnirtung` - America/Pangnirtung
            * `America/Paramaribo` - America/Paramaribo
            * `America/Phoenix` - America/Phoenix
            * `America/Port-au-Prince` - America/Port-au-Prince
            * `America/Port_of_Spain` - America/Port_of_Spain
            * `America/Porto_Acre` - America/Porto_Acre
            * `America/Porto_Velho` - America/Porto_Velho
            * `America/Puerto_Rico` - America/Puerto_Rico
            * `America/Punta_Arenas` - America/Punta_Arenas
            * `America/Rainy_River` - America/Rainy_River
            * `America/Rankin_Inlet` - America/Rankin_Inlet
            * `America/Recife` - America/Recife
            * `America/Regina` - America/Regina
            * `America/Resolute` - America/Resolute
            * `America/Rio_Branco` - America/Rio_Branco
            * `America/Rosario` - America/Rosario
            * `America/Santa_Isabel` - America/Santa_Isabel
            * `America/Santarem` - America/Santarem
            * `America/Santiago` - America/Santiago
            * `America/Santo_Domingo` - America/Santo_Domingo
            * `America/Sao_Paulo` - America/Sao_Paulo
            * `America/Scoresbysund` - America/Scoresbysund
            * `America/Shiprock` - America/Shiprock
            * `America/Sitka` - America/Sitka
            * `America/St_Barthelemy` - America/St_Barthelemy
            * `America/St_Johns` - America/St_Johns
            * `America/St_Kitts` - America/St_Kitts
            * `America/St_Lucia` - America/St_Lucia
            * `America/St_Thomas` - America/St_Thomas
            * `America/St_Vincent` - America/St_Vincent
            * `America/Swift_Current` - America/Swift_Current
            * `America/Tegucigalpa` - America/Tegucigalpa
            * `America/Thule` - America/Thule
            * `America/Thunder_Bay` - America/Thunder_Bay
            * `America/Tijuana` - America/Tijuana
            * `America/Toronto` - America/Toronto
            * `America/Tortola` - America/Tortola
            * `America/Vancouver` - America/Vancouver
            * `America/Virgin` - America/Virgin
            * `America/Whitehorse` - America/Whitehorse
            * `America/Winnipeg` - America/Winnipeg
            * `America/Yakutat` - America/Yakutat
            * `America/Yellowknife` - America/Yellowknife
            * `Antarctica/Casey` - Antarctica/Casey
            * `Antarctica/Davis` - Antarctica/Davis
            * `Antarctica/DumontDUrville` - Antarctica/DumontDUrville
            * `Antarctica/Macquarie` - Antarctica/Macquarie
            * `Antarctica/Mawson` - Antarctica/Mawson
            * `Antarctica/McMurdo` - Antarctica/McMurdo
            * `Antarctica/Palmer` - Antarctica/Palmer
            * `Antarctica/Rothera` - Antarctica/Rothera
            * `Antarctica/South_Pole` - Antarctica/South_Pole
            * `Antarctica/Syowa` - Antarctica/Syowa
            * `Antarctica/Troll` - Antarctica/Troll
            * `Antarctica/Vostok` - Antarctica/Vostok
            * `Arctic/Longyearbyen` - Arctic/Longyearbyen
            * `Asia/Aden` - Asia/Aden
            * `Asia/Almaty` - Asia/Almaty
            * `Asia/Amman` - Asia/Amman
            * `Asia/Anadyr` - Asia/Anadyr
            * `Asia/Aqtau` - Asia/Aqtau
            * `Asia/Aqtobe` - Asia/Aqtobe
            * `Asia/Ashgabat` - Asia/Ashgabat
            * `Asia/Ashkhabad` - Asia/Ashkhabad
            * `Asia/Atyrau` - Asia/Atyrau
            * `Asia/Baghdad` - Asia/Baghdad
            * `Asia/Bahrain` - Asia/Bahrain
            * `Asia/Baku` - Asia/Baku
            * `Asia/Bangkok` - Asia/Bangkok
            * `Asia/Barnaul` - Asia/Barnaul
            * `Asia/Beirut` - Asia/Beirut
            * `Asia/Bishkek` - Asia/Bishkek
            * `Asia/Brunei` - Asia/Brunei
            * `Asia/Calcutta` - Asia/Calcutta
            * `Asia/Chita` - Asia/Chita
            * `Asia/Choibalsan` - Asia/Choibalsan
            * `Asia/Chongqing` - Asia/Chongqing
            * `Asia/Chungking` - Asia/Chungking
            * `Asia/Colombo` - Asia/Colombo
            * `Asia/Dacca` - Asia/Dacca
            * `Asia/Damascus` - Asia/Damascus
            * `Asia/Dhaka` - Asia/Dhaka
            * `Asia/Dili` - Asia/Dili
            * `Asia/Dubai` - Asia/Dubai
            * `Asia/Dushanbe` - Asia/Dushanbe
            * `Asia/Famagusta` - Asia/Famagusta
            * `Asia/Gaza` - Asia/Gaza
            * `Asia/Harbin` - Asia/Harbin
            * `Asia/Hebron` - Asia/Hebron
            * `Asia/Ho_Chi_Minh` - Asia/Ho_Chi_Minh
            * `Asia/Hong_Kong` - Asia/Hong_Kong
            * `Asia/Hovd` - Asia/Hovd
            * `Asia/Irkutsk` - Asia/Irkutsk
            * `Asia/Istanbul` - Asia/Istanbul
            * `Asia/Jakarta` - Asia/Jakarta
            * `Asia/Jayapura` - Asia/Jayapura
            * `Asia/Jerusalem` - Asia/Jerusalem
            * `Asia/Kabul` - Asia/Kabul
            * `Asia/Kamchatka` - Asia/Kamchatka
            * `Asia/Karachi` - Asia/Karachi
            * `Asia/Kashgar` - Asia/Kashgar
            * `Asia/Kathmandu` - Asia/Kathmandu
            * `Asia/Katmandu` - Asia/Katmandu
            * `Asia/Khandyga` - Asia/Khandyga
            * `Asia/Kolkata` - Asia/Kolkata
            * `Asia/Krasnoyarsk` - Asia/Krasnoyarsk
            * `Asia/Kuala_Lumpur` - Asia/Kuala_Lumpur
            * `Asia/Kuching` - Asia/Kuching
            * `Asia/Kuwait` - Asia/Kuwait
            * `Asia/Macao` - Asia/Macao
            * `Asia/Macau` - Asia/Macau
            * `Asia/Magadan` - Asia/Magadan
            * `Asia/Makassar` - Asia/Makassar
            * `Asia/Manila` - Asia/Manila
            * `Asia/Muscat` - Asia/Muscat
            * `Asia/Nicosia` - Asia/Nicosia
            * `Asia/Novokuznetsk` - Asia/Novokuznetsk
            * `Asia/Novosibirsk` - Asia/Novosibirsk
            * `Asia/Omsk` - Asia/Omsk
            * `Asia/Oral` - Asia/Oral
            * `Asia/Phnom_Penh` - Asia/Phnom_Penh
            * `Asia/Pontianak` - Asia/Pontianak
            * `Asia/Pyongyang` - Asia/Pyongyang
            * `Asia/Qatar` - Asia/Qatar
            * `Asia/Qostanay` - Asia/Qostanay
            * `Asia/Qyzylorda` - Asia/Qyzylorda
            * `Asia/Rangoon` - Asia/Rangoon
            * `Asia/Riyadh` - Asia/Riyadh
            * `Asia/Saigon` - Asia/Saigon
            * `Asia/Sakhalin` - Asia/Sakhalin
            * `Asia/Samarkand` - Asia/Samarkand
            * `Asia/Seoul` - Asia/Seoul
            * `Asia/Shanghai` - Asia/Shanghai
            * `Asia/Singapore` - Asia/Singapore
            * `Asia/Srednekolymsk` - Asia/Srednekolymsk
            * `Asia/Taipei` - Asia/Taipei
            * `Asia/Tashkent` - Asia/Tashkent
            * `Asia/Tbilisi` - Asia/Tbilisi
            * `Asia/Tehran` - Asia/Tehran
            * `Asia/Tel_Aviv` - Asia/Tel_Aviv
            * `Asia/Thimbu` - Asia/Thimbu
            * `Asia/Thimphu` - Asia/Thimphu
            * `Asia/Tokyo` - Asia/Tokyo
            * `Asia/Tomsk` - Asia/Tomsk
            * `Asia/Ujung_Pandang` - Asia/Ujung_Pandang
            * `Asia/Ulaanbaatar` - Asia/Ulaanbaatar
            * `Asia/Ulan_Bator` - Asia/Ulan_Bator
            * `Asia/Urumqi` - Asia/Urumqi
            * `Asia/Ust-Nera` - Asia/Ust-Nera
            * `Asia/Vientiane` - Asia/Vientiane
            * `Asia/Vladivostok` - Asia/Vladivostok
            * `Asia/Yakutsk` - Asia/Yakutsk
            * `Asia/Yangon` - Asia/Yangon
            * `Asia/Yekaterinburg` - Asia/Yekaterinburg
            * `Asia/Yerevan` - Asia/Yerevan
            * `Atlantic/Azores` - Atlantic/Azores
            * `Atlantic/Bermuda` - Atlantic/Bermuda
            * `Atlantic/Canary` - Atlantic/Canary
            * `Atlantic/Cape_Verde` - Atlantic/Cape_Verde
            * `Atlantic/Faeroe` - Atlantic/Faeroe
            * `Atlantic/Faroe` - Atlantic/Faroe
            * `Atlantic/Jan_Mayen` - Atlantic/Jan_Mayen
            * `Atlantic/Madeira` - Atlantic/Madeira
            * `Atlantic/Reykjavik` - Atlantic/Reykjavik
            * `Atlantic/South_Georgia` - Atlantic/South_Georgia
            * `Atlantic/St_Helena` - Atlantic/St_Helena
            * `Atlantic/Stanley` - Atlantic/Stanley
            * `Australia/ACT` - Australia/ACT
            * `Australia/Adelaide` - Australia/Adelaide
            * `Australia/Brisbane` - Australia/Brisbane
            * `Australia/Broken_Hill` - Australia/Broken_Hill
            * `Australia/Canberra` - Australia/Canberra
            * `Australia/Currie` - Australia/Currie
            * `Australia/Darwin` - Australia/Darwin
            * `Australia/Eucla` - Australia/Eucla
            * `Australia/Hobart` - Australia/Hobart
            * `Australia/LHI` - Australia/LHI
            * `Australia/Lindeman` - Australia/Lindeman
            * `Australia/Lord_Howe` - Australia/Lord_Howe
            * `Australia/Melbourne` - Australia/Melbourne
            * `Australia/NSW` - Australia/NSW
            * `Australia/North` - Australia/North
            * `Australia/Perth` - Australia/Perth
            * `Australia/Queensland` - Australia/Queensland
            * `Australia/South` - Australia/South
            * `Australia/Sydney` - Australia/Sydney
            * `Australia/Tasmania` - Australia/Tasmania
            * `Australia/Victoria` - Australia/Victoria
            * `Australia/West` - Australia/West
            * `Australia/Yancowinna` - Australia/Yancowinna
            * `Brazil/Acre` - Brazil/Acre
            * `Brazil/DeNoronha` - Brazil/DeNoronha
            * `Brazil/East` - Brazil/East
            * `Brazil/West` - Brazil/West
            * `CET` - CET
            * `CST6CDT` - CST6CDT
            * `Canada/Atlantic` - Canada/Atlantic
            * `Canada/Central` - Canada/Central
            * `Canada/Eastern` - Canada/Eastern
            * `Canada/Mountain` - Canada/Mountain
            * `Canada/Newfoundland` - Canada/Newfoundland
            * `Canada/Pacific` - Canada/Pacific
            * `Canada/Saskatchewan` - Canada/Saskatchewan
            * `Canada/Yukon` - Canada/Yukon
            * `Chile/Continental` - Chile/Continental
            * `Chile/EasterIsland` - Chile/EasterIsland
            * `Cuba` - Cuba
            * `EET` - EET
            * `EST` - EST
            * `EST5EDT` - EST5EDT
            * `Egypt` - Egypt
            * `Eire` - Eire
            * `Etc/GMT` - Etc/GMT
            * `Etc/GMT+0` - Etc/GMT+0
            * `Etc/GMT+1` - Etc/GMT+1
            * `Etc/GMT+10` - Etc/GMT+10
            * `Etc/GMT+11` - Etc/GMT+11
            * `Etc/GMT+12` - Etc/GMT+12
            * `Etc/GMT+2` - Etc/GMT+2
            * `Etc/GMT+3` - Etc/GMT+3
            * `Etc/GMT+4` - Etc/GMT+4
            * `Etc/GMT+5` - Etc/GMT+5
            * `Etc/GMT+6` - Etc/GMT+6
            * `Etc/GMT+7` - Etc/GMT+7
            * `Etc/GMT+8` - Etc/GMT+8
            * `Etc/GMT+9` - Etc/GMT+9
            * `Etc/GMT-0` - Etc/GMT-0
            * `Etc/GMT-1` - Etc/GMT-1
            * `Etc/GMT-10` - Etc/GMT-10
            * `Etc/GMT-11` - Etc/GMT-11
            * `Etc/GMT-12` - Etc/GMT-12
            * `Etc/GMT-13` - Etc/GMT-13
            * `Etc/GMT-14` - Etc/GMT-14
            * `Etc/GMT-2` - Etc/GMT-2
            * `Etc/GMT-3` - Etc/GMT-3
            * `Etc/GMT-4` - Etc/GMT-4
            * `Etc/GMT-5` - Etc/GMT-5
            * `Etc/GMT-6` - Etc/GMT-6
            * `Etc/GMT-7` - Etc/GMT-7
            * `Etc/GMT-8` - Etc/GMT-8
            * `Etc/GMT-9` - Etc/GMT-9
            * `Etc/GMT0` - Etc/GMT0
            * `Etc/Greenwich` - Etc/Greenwich
            * `Etc/UCT` - Etc/UCT
            * `Etc/UTC` - Etc/UTC
            * `Etc/Universal` - Etc/Universal
            * `Etc/Zulu` - Etc/Zulu
            * `Europe/Amsterdam` - Europe/Amsterdam
            * `Europe/Andorra` - Europe/Andorra
            * `Europe/Astrakhan` - Europe/Astrakhan
            * `Europe/Athens` - Europe/Athens
            * `Europe/Belfast` - Europe/Belfast
            * `Europe/Belgrade` - Europe/Belgrade
            * `Europe/Berlin` - Europe/Berlin
            * `Europe/Bratislava` - Europe/Bratislava
            * `Europe/Brussels` - Europe/Brussels
            * `Europe/Bucharest` - Europe/Bucharest
            * `Europe/Budapest` - Europe/Budapest
            * `Europe/Busingen` - Europe/Busingen
            * `Europe/Chisinau` - Europe/Chisinau
            * `Europe/Copenhagen` - Europe/Copenhagen
            * `Europe/Dublin` - Europe/Dublin
            * `Europe/Gibraltar` - Europe/Gibraltar
            * `Europe/Guernsey` - Europe/Guernsey
            * `Europe/Helsinki` - Europe/Helsinki
            * `Europe/Isle_of_Man` - Europe/Isle_of_Man
            * `Europe/Istanbul` - Europe/Istanbul
            * `Europe/Jersey` - Europe/Jersey
            * `Europe/Kaliningrad` - Europe/Kaliningrad
            * `Europe/Kiev` - Europe/Kiev
            * `Europe/Kirov` - Europe/Kirov
            * `Europe/Kyiv` - Europe/Kyiv
            * `Europe/Lisbon` - Europe/Lisbon
            * `Europe/Ljubljana` - Europe/Ljubljana
            * `Europe/London` - Europe/London
            * `Europe/Luxembourg` - Europe/Luxembourg
            * `Europe/Madrid` - Europe/Madrid
            * `Europe/Malta` - Europe/Malta
            * `Europe/Mariehamn` - Europe/Mariehamn
            * `Europe/Minsk` - Europe/Minsk
            * `Europe/Monaco` - Europe/Monaco
            * `Europe/Moscow` - Europe/Moscow
            * `Europe/Nicosia` - Europe/Nicosia
            * `Europe/Oslo` - Europe/Oslo
            * `Europe/Paris` - Europe/Paris
            * `Europe/Podgorica` - Europe/Podgorica
            * `Europe/Prague` - Europe/Prague
            * `Europe/Riga` - Europe/Riga
            * `Europe/Rome` - Europe/Rome
            * `Europe/Samara` - Europe/Samara
            * `Europe/San_Marino` - Europe/San_Marino
            * `Europe/Sarajevo` - Europe/Sarajevo
            * `Europe/Saratov` - Europe/Saratov
            * `Europe/Simferopol` - Europe/Simferopol
            * `Europe/Skopje` - Europe/Skopje
            * `Europe/Sofia` - Europe/Sofia
            * `Europe/Stockholm` - Europe/Stockholm
            * `Europe/Tallinn` - Europe/Tallinn
            * `Europe/Tirane` - Europe/Tirane
            * `Europe/Tiraspol` - Europe/Tiraspol
            * `Europe/Ulyanovsk` - Europe/Ulyanovsk
            * `Europe/Uzhgorod` - Europe/Uzhgorod
            * `Europe/Vaduz` - Europe/Vaduz
            * `Europe/Vatican` - Europe/Vatican
            * `Europe/Vienna` - Europe/Vienna
            * `Europe/Vilnius` - Europe/Vilnius
            * `Europe/Volgograd` - Europe/Volgograd
            * `Europe/Warsaw` - Europe/Warsaw
            * `Europe/Zagreb` - Europe/Zagreb
            * `Europe/Zaporozhye` - Europe/Zaporozhye
            * `Europe/Zurich` - Europe/Zurich
            * `Factory` - Factory
            * `GB` - GB
            * `GB-Eire` - GB-Eire
            * `GMT` - GMT
            * `GMT+0` - GMT+0
            * `GMT-0` - GMT-0
            * `GMT0` - GMT0
            * `Greenwich` - Greenwich
            * `HST` - HST
            * `Hongkong` - Hongkong
            * `Iceland` - Iceland
            * `Indian/Antananarivo` - Indian/Antananarivo
            * `Indian/Chagos` - Indian/Chagos
            * `Indian/Christmas` - Indian/Christmas
            * `Indian/Cocos` - Indian/Cocos
            * `Indian/Comoro` - Indian/Comoro
            * `Indian/Kerguelen` - Indian/Kerguelen
            * `Indian/Mahe` - Indian/Mahe
            * `Indian/Maldives` - Indian/Maldives
            * `Indian/Mauritius` - Indian/Mauritius
            * `Indian/Mayotte` - Indian/Mayotte
            * `Indian/Reunion` - Indian/Reunion
            * `Iran` - Iran
            * `Israel` - Israel
            * `Jamaica` - Jamaica
            * `Japan` - Japan
            * `Kwajalein` - Kwajalein
            * `Libya` - Libya
            * `MET` - MET
            * `MST` - MST
            * `MST7MDT` - MST7MDT
            * `Mexico/BajaNorte` - Mexico/BajaNorte
            * `Mexico/BajaSur` - Mexico/BajaSur
            * `Mexico/General` - Mexico/General
            * `NZ` - NZ
            * `NZ-CHAT` - NZ-CHAT
            * `Navajo` - Navajo
            * `PRC` - PRC
            * `PST8PDT` - PST8PDT
            * `Pacific/Apia` - Pacific/Apia
            * `Pacific/Auckland` - Pacific/Auckland
            * `Pacific/Bougainville` - Pacific/Bougainville
            * `Pacific/Chatham` - Pacific/Chatham
            * `Pacific/Chuuk` - Pacific/Chuuk
            * `Pacific/Easter` - Pacific/Easter
            * `Pacific/Efate` - Pacific/Efate
            * `Pacific/Enderbury` - Pacific/Enderbury
            * `Pacific/Fakaofo` - Pacific/Fakaofo
            * `Pacific/Fiji` - Pacific/Fiji
            * `Pacific/Funafuti` - Pacific/Funafuti
            * `Pacific/Galapagos` - Pacific/Galapagos
            * `Pacific/Gambier` - Pacific/Gambier
            * `Pacific/Guadalcanal` - Pacific/Guadalcanal
            * `Pacific/Guam` - Pacific/Guam
            * `Pacific/Honolulu` - Pacific/Honolulu
            * `Pacific/Johnston` - Pacific/Johnston
            * `Pacific/Kanton` - Pacific/Kanton
            * `Pacific/Kiritimati` - Pacific/Kiritimati
            * `Pacific/Kosrae` - Pacific/Kosrae
            * `Pacific/Kwajalein` - Pacific/Kwajalein
            * `Pacific/Majuro` - Pacific/Majuro
            * `Pacific/Marquesas` - Pacific/Marquesas
            * `Pacific/Midway` - Pacific/Midway
            * `Pacific/Nauru` - Pacific/Nauru
            * `Pacific/Niue` - Pacific/Niue
            * `Pacific/Norfolk` - Pacific/Norfolk
            * `Pacific/Noumea` - Pacific/Noumea
            * `Pacific/Pago_Pago` - Pacific/Pago_Pago
            * `Pacific/Palau` - Pacific/Palau
            * `Pacific/Pitcairn` - Pacific/Pitcairn
            * `Pacific/Pohnpei` - Pacific/Pohnpei
            * `Pacific/Ponape` - Pacific/Ponape
            * `Pacific/Port_Moresby` - Pacific/Port_Moresby
            * `Pacific/Rarotonga` - Pacific/Rarotonga
            * `Pacific/Saipan` - Pacific/Saipan
            * `Pacific/Samoa` - Pacific/Samoa
            * `Pacific/Tahiti` - Pacific/Tahiti
            * `Pacific/Tarawa` - Pacific/Tarawa
            * `Pacific/Tongatapu` - Pacific/Tongatapu
            * `Pacific/Truk` - Pacific/Truk
            * `Pacific/Wake` - Pacific/Wake
            * `Pacific/Wallis` - Pacific/Wallis
            * `Pacific/Yap` - Pacific/Yap
            * `Poland` - Poland
            * `Portugal` - Portugal
            * `ROC` - ROC
            * `ROK` - ROK
            * `Singapore` - Singapore
            * `Turkey` - Turkey
            * `UCT` - UCT
            * `US/Alaska` - US/Alaska
            * `US/Aleutian` - US/Aleutian
            * `US/Arizona` - US/Arizona
            * `US/Central` - US/Central
            * `US/East-Indiana` - US/East-Indiana
            * `US/Eastern` - US/Eastern
            * `US/Hawaii` - US/Hawaii
            * `US/Indiana-Starke` - US/Indiana-Starke
            * `US/Michigan` - US/Michigan
            * `US/Mountain` - US/Mountain
            * `US/Pacific` - US/Pacific
            * `US/Samoa` - US/Samoa
            * `UTC` - UTC
            * `Universal` - Universal
            * `W-SU` - W-SU
            * `WET` - WET
            * `Zulu` - Zulu
          oneOf:
          - $ref: '#/components/schemas/TimezoneEnum'
          - $ref: '#/components/schemas/NullEnum'
      required:
      - enable_monetization
      - is_enterprise
      - key
      - show_paywall
      - timezone
    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
        mode:
          allOf:
          - $ref: '#/components/schemas/PlatformApiKeyModeEnum'
          default: owner
          description: |-
            How permissions resolve: 'owner' (default) uses the owner's RBAC permissions; 'token_policies' uses the policies/groups this token is associated with

            * `owner` - Owner permissions
            * `token_policies` - Token policies
        policies_to_add:
          type: array
          items:
            type: integer
          writeOnly: true
          description: RbacPolicy IDs to associate with this token (mode=token_policies)
        policies_to_remove:
          type: array
          items:
            type: integer
          writeOnly: true
          description: RbacPolicy IDs to disassociate from this token (mode=token_policies)
        groups_to_add:
          type: array
          items:
            type: integer
          writeOnly: true
          description: RbacGroup IDs to associate with this token (mode=token_policies)
        groups_to_remove:
          type: array
          items:
            type: integer
          writeOnly: true
          description: RbacGroup IDs to disassociate from this token (mode=token_policies)
      required:
      - created
      - expires
      - key
      - name
      - username
    PlatformApiKeyModeEnum:
      enum:
      - owner
      - token_policies
      type: string
      description: |-
        * `owner` - Owner permissions
        * `token_policies` - Token policies
    PlatformApiTokenFieldPermissions:
      type: object
      properties:
        mode:
          $ref: '#/components/schemas/PlatformApiToken_mode_Permission'
        policies_to_add:
          $ref: '#/components/schemas/PlatformApiToken_policies_to_add_Permission'
        policies_to_remove:
          $ref: '#/components/schemas/PlatformApiToken_policies_to_remove_Permission'
        groups_to_add:
          $ref: '#/components/schemas/PlatformApiToken_groups_to_add_Permission'
        groups_to_remove:
          $ref: '#/components/schemas/PlatformApiToken_groups_to_remove_Permission'
      required:
      - groups_to_add
      - groups_to_remove
      - mode
      - policies_to_add
      - policies_to_remove
    PlatformApiToken_groups_to_add_Permission:
      type: object
      properties:
        write:
          type: boolean
      required:
      - write
    PlatformApiToken_groups_to_remove_Permission:
      type: object
      properties:
        write:
          type: boolean
      required:
      - write
    PlatformApiToken_mode_Permission:
      type: object
      properties:
        write:
          type: boolean
      required:
      - write
    PlatformApiToken_policies_to_add_Permission:
      type: object
      properties:
        write:
          type: boolean
      required:
      - write
    PlatformApiToken_policies_to_remove_Permission:
      type: object
      properties:
        write:
          type: boolean
      required:
      - write
    PlatformApplicationAdminSubmit:
      type: object
      description: Body for the admin submit-with-exceptions action.
      properties:
        note:
          type: string
    PlatformApplicationAttachmentUpload:
      type: object
      description: Multipart body for uploading an attachment against a file field.
      properties:
        field:
          type: string
        item_id:
          type: string
        file:
          type: string
          format: uri
      required:
      - field
      - file
    PlatformApplicationCandidateLink:
      type: object
      description: |-
        Manually link an accepted candidate to an existing account; provide
        one of user_id or email.
      properties:
        user_id:
          type: integer
        email:
          type: string
          format: email
    PlatformApplicationCourseAssignment:
      type: object
      description: 'Body for assigning courses (#2134): one or many items in a single
        call.'
      properties:
        assignments:
          type: array
          items:
            $ref: '#/components/schemas/PlatformApplicationCourseAssignmentItem'
      required:
      - assignments
    PlatformApplicationCourseAssignmentItem:
      type: object
      description: 'One course assignment: which candidate, which course, and the
        dates.'
      properties:
        candidate_id:
          type: integer
        course_id:
          type: string
        started:
          type: string
          format: date-time
        expired:
          type: string
          format: date-time
        placement_id:
          type: integer
      required:
      - candidate_id
      - course_id
    PlatformApplicationCreate:
      type: object
      description: Body for creating an application draft.
      properties:
        platform_key:
          type: string
        responses: {}
        form_id:
          type: integer
      required:
      - platform_key
    PlatformApplicationDetail:
      type: object
      description: Minimal schema for a submission response object.
      properties:
        id:
          type: integer
        status:
          type: string
      required:
      - id
      - status
    PlatformApplicationFeeAction:
      type: object
      description: Admin action on a submission's application fee.
      properties:
        action:
          $ref: '#/components/schemas/PlatformApplicationFeeActionActionEnum'
        amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
        method:
          type: string
        funding_source:
          type: string
        note:
          type: string
      required:
      - action
    PlatformApplicationFeeActionActionEnum:
      enum:
      - record_payment
      - waive
      - refund
      - credit
      type: string
      description: |-
        * `record_payment` - record_payment
        * `waive` - waive
        * `refund` - refund
        * `credit` - credit
    PlatformApplicationFormCreate:
      type: object
      description: Body for creating a platform's application form.
      properties:
        platform_key:
          type: string
        platform_org:
          type: string
        name:
          type: string
        schema: {}
        config: {}
        enabled:
          type: boolean
          default: false
        is_default:
          type: boolean
      required:
      - platform_key
      - schema
    PlatformApplicationFormDetail:
      type: object
      description: Minimal schema for a form response object.
      properties:
        id:
          type: integer
        name:
          type: string
        version:
          type: integer
        enabled:
          type: boolean
      required:
      - enabled
      - id
      - name
      - version
    PlatformApplicationNote:
      type: object
      description: Body for adding/updating an internal reviewer note.
      properties:
        body:
          type: string
        kind:
          $ref: '#/components/schemas/PlatformApplicationNoteKindEnum'
      required:
      - body
    PlatformApplicationNoteKindEnum:
      enum:
      - general
      - interview
      type: string
      description: |-
        * `general` - general
        * `interview` - interview
    PlatformApplicationPlacementCreate:
      type: object
      description: |-
        Body for assigning placements (#2133): one or many in a single call
        ("individually or in bulk", PDF §9.1).
      properties:
        placements:
          type: array
          items:
            $ref: '#/components/schemas/PlatformApplicationPlacementItem'
      required:
      - placements
    PlatformApplicationPlacementItem:
      type: object
      description: |-
        One placement assignment: which candidate, which configured assessment.
        The agent and subject come from the assessment, snapshotted onto the record.
      properties:
        candidate_id:
          type: integer
        assessment_id:
          type: integer
        session_id:
          type: string
          maxLength: 64
        note:
          type: string
      required:
      - assessment_id
      - candidate_id
    PlatformApplicationPlacementUpdateStatusEnum:
      enum:
      - not_assigned
      - assigned
      - started
      - completed
      - reviewed
      - confirmed
      type: string
      description: |-
        * `not_assigned` - not_assigned
        * `assigned` - assigned
        * `started` - started
        * `completed` - completed
        * `reviewed` - reviewed
        * `confirmed` - confirmed
    PlatformApplicationSubmit:
      type: object
      description: Body for submitting an application.
      properties:
        responses: {}
    PlatformApplicationTransition:
      type: object
      description: Body for a reviewer status transition (per-candidate or application-wide).
      properties:
        action:
          $ref: '#/components/schemas/PlatformApplicationTransitionActionEnum'
        candidate_id:
          type: integer
        message:
          type: string
        note:
          type: string
        block:
          type: boolean
          default: false
      required:
      - action
    PlatformApplicationTransitionActionEnum:
      enum:
      - start_review
      - request_info
      - require_interview
      - waitlist
      - accept
      - decline
      type: string
      description: |-
        * `start_review` - start_review
        * `request_info` - request_info
        * `require_interview` - require_interview
        * `waitlist` - waitlist
        * `accept` - accept
        * `decline` - decline
    PlatformApplicationWaiver:
      type: object
      description: |-
        Waive (POST) or reinstate (DELETE) one required field on an application
        (§2.1 required items "complete or administratively waived").
      properties:
        section:
          type: string
        field:
          type: string
        reason:
          type: string
      required:
      - field
      - section
    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

        Supports new CSV format fields:
        - company_name (optional): Company name for the invited user
        - first_name (new): First name of the invited user
        - last_name (new): Last name of the invited user
        - user_group (new): Name of the UserGroup to assign the user to
        - user_group_owner_email (optional): Email of user who should own the group
      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
        company_name:
          type: string
          description: Company name for the invited user
          maxLength: 255
        first_name:
          type: string
          description: First name of the invited user
          maxLength: 255
        last_name:
          type: string
          description: Last name of the invited user
          maxLength: 255
        user_group:
          type: string
          description: Name of the UserGroup to assign the user to
          maxLength: 255
        user_group_owner_email:
          type: string
          format: email
          description: Email of user who should own the group (falls back to uploader)
      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:
          $ref: '#/components/schemas/PlatformListStatusEnum'
        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
    PlatformMembershipConfigPublicResponse:
      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
    PlatformMigrationRun:
      type: object
      description: |-
        Read-only view of a platform migration run — the status/progress payload.

        ``run_id`` is the public task id callers poll on. ``report`` carries the
        per-phase summaries, component selection, id-map totals and warnings written
        by the runner. ``download_url`` is the link to pull the bundle as a ``.zip``
        once a completed export has one on disk (null otherwise).
      properties:
        run_id:
          type: string
          format: uuid
          readOnly: true
        direction:
          allOf:
          - $ref: '#/components/schemas/DirectionEnum'
          readOnly: true
        source_key:
          type: string
          readOnly: true
        target_key:
          type: string
          readOnly: true
        bundle_path:
          type: string
          readOnly: true
        bundle_storage_key:
          type: string
          readOnly: true
        status:
          allOf:
          - $ref: '#/components/schemas/Status147Enum'
          readOnly: true
        phase:
          type: string
          readOnly: true
        cursor:
          readOnly: true
        selected_components:
          readOnly: true
        admin_user:
          type: string
          readOnly: true
        email:
          type: string
          format: email
          readOnly: true
        report:
          readOnly: true
        error_message:
          type: string
          readOnly: true
        download_url:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        started_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        finished_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
      required:
      - admin_user
      - bundle_path
      - bundle_storage_key
      - created_at
      - cursor
      - direction
      - download_url
      - email
      - error_message
      - finished_at
      - phase
      - report
      - run_id
      - selected_components
      - source_key
      - started_at
      - status
      - target_key
      - updated_at
    PlatformMigrationRunCreate:
      type: object
      description: |-
        Start a migration run. Validates the request; the view kicks the task.

        ``selected_components`` is the OPTIONAL-set selection; mandatory
        sets always run regardless. An empty/omitted list = full fidelity.
      properties:
        run_id:
          type: string
          format: uuid
          readOnly: true
        direction:
          $ref: '#/components/schemas/DirectionEnum'
        source_key:
          type: string
          maxLength: 255
        target_key:
          type: string
          maxLength: 255
        bundle_path:
          type: string
        bundle_storage_key:
          type: string
        selected_components: {}
        admin_user:
          type: string
          maxLength: 255
        email:
          type: string
          format: email
          maxLength: 254
      required:
      - direction
      - run_id
    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
    PlatformRevenueSummary:
      type: object
      properties:
        sales_volume:
          type: string
          format: decimal
          pattern: ^-?\d{0,10}(?:\.\d{0,2})?$
        sales_count:
          type: integer
        currency:
          type: string
      required:
      - currency
      - sales_count
      - sales_volume
    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
          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
    PortalUrlResponse:
      type: object
      description: Response containing a Stripe customer portal URL for subscription
        management.
      properties:
        portal_url:
          type: string
          format: uri
          description: Stripe customer portal URL.
      required:
      - portal_url
    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
    PrivacyActionEnum:
      enum:
      - redact
      - mask
      - block
      - allow
      type: string
      description: |-
        * `redact` - Redact
        * `mask` - Mask
        * `block` - Block
        * `allow` - Allow
    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
          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
        program_metadata:
          type: object
          additionalProperties: {}
          nullable: true
          description: Return program's public metadata
          readOnly: true
      required:
      - ended
      - program_metadata
    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.

        Supports CSV date fields for enrollment_config:
        - program_access_start_date: Maps to enrollment_config['started']
        - program_access_expiration_date: Maps to enrollment_config['expired']
      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.)
        program_access_start_date:
          type: string
          format: date-time
          nullable: true
          description: Program access start date (maps to enrollment_config['started'])
        program_access_expiration_date:
          type: string
          format: date-time
          nullable: true
          description: Program access expiration date (maps to enrollment_config['expired'])
      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
          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
    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
    ProvisionModeEnum:
      enum:
      - managed
      - self_hosted
      type: string
      description: |-
        * `managed` - Managed
        * `self_hosted` - Self-hosted
    PublicItemPricing:
      type: object
      properties:
        item_type:
          type: string
          pattern: ^(?:custom:)?[a-z][a-z0-9_-]*$
          maxLength: 50
        item_id:
          type: string
        item_name:
          type: string
        is_paywalled:
          type: boolean
        allow_free_tier:
          type: boolean
        trial_period_days:
          type: integer
        prices:
          type: array
          items:
            $ref: '#/components/schemas/ItemPrice'
      required:
      - allow_free_tier
      - is_paywalled
      - item_id
      - item_name
      - item_type
      - prices
      - trial_period_days
    QuestionCardTag:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
        difficulty:
          type: integer
        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)
        platform_key:
          type: string
          description: Target platform key. Service-account callers must supply this.
            Non-SA callers' value is overwritten by the view with the platform from
            the auth token.
          writeOnly: true
        resources:
          type: array
          items:
            type: string
          description: List of resource paths this policy grants access to, relative
            to your platform (e.g., ['/mentors/', '/usergroups/5/']). The '/platforms/{pk}/'
            prefix is added server-side.
        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
        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 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
        created_by:
          type: string
          nullable: true
          readOnly: true
      required:
      - created_by
      - 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
    RecipientsRecipientModeEnum:
      enum:
      - platform_admins_only
      - object_owner_only
      - object_owner_only_strict
      - platform_admins_and_object_owner
      - custom
      type: string
      description: |-
        * `platform_admins_only` - platform_admins_only
        * `object_owner_only` - object_owner_only
        * `object_owner_only_strict` - object_owner_only_strict
        * `platform_admins_and_object_owner` - platform_admins_and_object_owner
        * `custom` - custom
    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
        mentor_unique_id:
          type: string
          description: Optional mentor unique ID for RBAC ownership check
      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
    ReorderChildren:
      type: object
      description: Validate input for reordering children of an xblock.
      properties:
        xblock_id:
          type: string
          description: The parent xblock whose children to reorder.
        children:
          type: array
          items:
            type: string
          description: Ordered list of child xblock IDs. All existing children must
            be included.
          minItems: 1
      required:
      - children
      - xblock_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
        start_date:
          type: string
          format: date
          description: Start date for the report
        end_date:
          type: string
          format: date
          description: End date for the report
        mentor:
          type: string
          description: Mentor ID for the report (Only for mentor reports)
        course_id:
          type: string
          description: Course ID for the report (Only for course reports)
        usergroup_ids:
          type: array
          items:
            type: integer
          nullable: true
          description: Optional list of usergroup IDs to filter results
        source:
          type: string
          description: Domain/host the report is being requested from (e.g. analytics.example.com)
        query:
          type: string
          description: "\nAdvanced Query to run the report, supports SQL Like queries.\
            \ This runs against the final result after all filters are applied.\n\n\
            e.g For date type filtering\ndate_joined > '2021-01-01'\n\nSee https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.query.html#pandas.DataFrame.query\n\
            \        "
    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
        created_at:
          type: string
          description: When the report was requested (ISO 8601)
        poll_timeout:
          type: integer
          description: Seconds the client should poll before relying on notifications
    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
          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
          nullable: true
        crawler_max_pages_limit:
          type: integer
          nullable: true
        crawler_max_concurrency:
          type: integer
          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'
        crawler_extra_headers:
          nullable: true
          description: Extra HTTP headers the crawler sends on every request, as a
            flat object of string header names to string values (e.g. auth tokens
            for gated sites).
        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
        crawler_extra_headers:
          type: object
          additionalProperties:
            type: string
          description: Extra HTTP headers the crawler sends on every request, as a
            flat object of string header names to string values.
        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
    RoleEnum:
      enum:
      - viewer
      - editor
      - chat
      - analytics_viewer
      - dataset_curator
      type: string
      description: |-
        * `viewer` - viewer
        * `editor` - editor
        * `chat` - chat
        * `analytics_viewer` - analytics_viewer
        * `dataset_curator` - dataset_curator
    Run:
      type: object
      description: |-
        Read shape for an experiment run (Langfuse run + local pending entries).

        Pending entries (``status="pending"`` or ``"in_progress"``) carry
        ``id=null`` and an additional ``task_id`` / ``task_record_id`` pair —
        Langfuse mints the real run id only when the Celery task inserts the
        first dataset_run_items row. Completed entries carry the Langfuse run
        id and ``status="completed"``.
      properties:
        id:
          type: string
          nullable: true
        name:
          type: string
        metadata:
          type: object
          additionalProperties: {}
        created_at:
          type: string
        updated_at:
          type: string
        status:
          type: string
        username:
          type: string
          readOnly: true
        user_email:
          type: string
          readOnly: true
        task_id:
          type: string
        task_record_id:
          type: integer
          nullable: true
      required:
      - created_at
      - id
      - name
      - status
      - updated_at
      - user_email
      - username
    RunDetailResponse:
      type: object
      description: 'Run-detail response: run header + expanded items + pending judges.'
      properties:
        id:
          type: string
          nullable: true
        name:
          type: string
        metadata:
          type: object
          additionalProperties: {}
        created_at:
          type: string
        updated_at:
          type: string
        status:
          type: string
        username:
          type: string
          readOnly: true
        user_email:
          type: string
          readOnly: true
        task_id:
          type: string
        task_record_id:
          type: integer
          nullable: true
        dataset_run_items:
          type: array
          items:
            $ref: '#/components/schemas/DatasetRunItem'
        pending_judges:
          type: array
          items:
            $ref: '#/components/schemas/JudgeRecord'
      required:
      - created_at
      - dataset_run_items
      - id
      - name
      - pending_judges
      - status
      - updated_at
      - user_email
      - username
    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.
        Fields allow_blank=True so response validation succeeds for users with no name set.
      properties:
        formatted:
          type: string
          description: Full formatted name
        familyName:
          type: string
          description: Family/last name
        givenName:
          type: string
          description: Given/first name
    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
    ScopeC1dEnum:
      enum:
      - model
      - provider
      type: string
      description: |-
        * `model` - Model Specific
        * `provider` - Provider Wide
    Score:
      type: object
      description: Read shape for a score (human annotation or LLM-judge result).
      properties:
        id:
          type: string
        name:
          type: string
        value:
          type: number
          format: double
          nullable: true
        string_value:
          type: string
          nullable: true
        data_type:
          type: string
          nullable: true
        comment:
          type: string
          nullable: true
        trace_id:
          type: string
          nullable: true
        observation_id:
          type: string
          nullable: true
        dataset_run_id:
          type: string
          nullable: true
        created_at:
          type: string
        username:
          type: string
          readOnly: true
        user_email:
          type: string
          readOnly: true
      required:
      - created_at
      - id
      - name
      - user_email
      - username
      - value
    ScoreConfig:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        data_type:
          type: string
          nullable: true
        min_value:
          type: number
          format: double
          nullable: true
        max_value:
          type: number
          format: double
          nullable: true
        categories:
          type: array
          items:
            $ref: '#/components/schemas/ScoreConfigCategory'
          nullable: true
        description:
          type: string
          nullable: true
        is_archived:
          type: boolean
          default: false
        created_at:
          type: string
      required:
      - created_at
      - data_type
      - id
      - name
    ScoreConfigCategory:
      type: object
      description: Category definition for categorical score configs.
      properties:
        value:
          type: number
          format: double
        label:
          type: string
      required:
      - label
      - value
    ScoreConfigCreate:
      type: object
      description: Validates score config creation.
      properties:
        name:
          type: string
          maxLength: 255
        data_type:
          $ref: '#/components/schemas/DataTypeEnum'
        categories:
          type: array
          items:
            $ref: '#/components/schemas/ScoreConfigCategory'
        min_value:
          type: number
          format: double
          nullable: true
        max_value:
          type: number
          format: double
          nullable: true
        description:
          type: string
          nullable: true
      required:
      - data_type
      - name
    ScoreCreate:
      type: object
      description: Validates score creation for human annotations.
      properties:
        trace_id:
          type: string
        name:
          type: string
          maxLength: 255
        value:
          type: number
          format: double
        data_type:
          allOf:
          - $ref: '#/components/schemas/DataTypeEnum'
          default: NUMERIC
        comment:
          type: string
          nullable: true
        observation_id:
          type: string
          nullable: true
        config_id:
          type: string
          nullable: true
        dataset_run_id:
          type: string
          nullable: true
      required:
      - name
      - trace_id
      - value
    ScoreCreateResponse:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
        name:
          type: string
        value:
          type: number
          format: double
        username:
          type: string
        user_email:
          type: string
      required:
      - id
      - name
      - status
      - user_email
      - username
      - value
    SeedMentorsView:
      type: object
      properties:
        detail:
          type: string
      required:
      - detail
    Segment:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
          nullable: true
      required:
      - id
      - name
    SellableItem:
      type: object
      description: Response serializer for a single sellable item.
      properties:
        item_type:
          type: string
        item_id:
          type: string
        name:
          type: string
        description:
          type: string
          default: ''
        image:
          type: string
          nullable: true
        platform_key:
          type: string
        created_at:
          type: string
          format: date-time
          nullable: true
        paywall:
          allOf:
          - $ref: '#/components/schemas/SellableItemPaywall'
          nullable: true
      required:
      - item_id
      - item_type
      - name
      - paywall
      - platform_key
    SellableItemPaywall:
      type: object
      description: Nested serializer for paywall status on a sellable item.
      properties:
        is_enabled:
          type: boolean
        has_prices:
          type: boolean
        lowest_price:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          nullable: true
        stripe_product_id:
          type: string
          nullable: true
      required:
      - has_prices
      - is_enabled
      - lowest_price
      - stripe_product_id
    SellableItemsResponse:
      type: object
      description: Top-level response serializer for the sellable items endpoint.
      properties:
        count:
          type: integer
        next:
          type: string
          nullable: true
        previous:
          type: string
          nullable: true
        current_page:
          type: integer
        total_pages:
          type: integer
        results:
          type: array
          items:
            $ref: '#/components/schemas/SellableItem'
        facets:
          type: object
          additionalProperties: {}
      required:
      - count
      - current_page
      - next
      - previous
      - results
      - total_pages
    SendNotification:
      type: object
      description: Request serializer for sending notification
      properties:
        build_id:
          type: string
      required:
      - build_id
    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
    ServiceTypeEnum:
      enum:
      - http
      - streaming
      - async
      type: string
      description: |-
        * `http` - HTTP
        * `streaming` - Streaming
        * `async` - Async
    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
    SessionDisableChathistoryRequest:
      type: object
      description: Request body for toggling Session.disable_chathistory mid-conversation.
      properties:
        disable_chathistory:
          type: boolean
          description: 'When true, subsequent messages on this session are not written
            to ChatMessageHistory and the session is unlinked from the user. When
            false, the session reverts to honoring the user''s normal privacy preferences.
            Future-only: already-recorded messages are not retroactively deleted.'
      required:
      - disable_chathistory
    SessionDisableChathistoryResponse:
      type: object
      description: Response body for the disable-chathistory toggle endpoint.
      properties:
        session_id:
          type: string
          format: uuid
        disable_chathistory:
          type: boolean
      required:
      - disable_chathistory
      - session_id
    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
    SessionSummary:
      type: object
      description: Lightweight serializer for session list endpoints (pinned/recent
        messages).
      properties:
        session_id:
          type: string
          format: uuid
        mentor_unique_id:
          type: string
          format: uuid
        mentor:
          $ref: '#/components/schemas/SessionSummaryMentor'
        title:
          type: string
          nullable: true
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ChatHistory'
      required:
      - mentor
      - mentor_unique_id
      - messages
      - session_id
      - title
    SessionSummaryMentor:
      type: object
      description: Lightweight mentor serializer for backward compatibility.
      properties:
        unique_id:
          type: string
          format: uuid
      required:
      - unique_id
    SessionsChart:
      type: object
      properties:
        metric:
          type: string
        points:
          type: array
          items:
            $ref: '#/components/schemas/SessionChartPoint'
      required:
      - metric
      - points
    SetCurrentVersionRequest:
      type: object
      properties:
        version_id:
          type: integer
      required:
      - version_id
    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
    SharedSessionUpdateRequest:
      type: object
      properties:
        is_shared:
          type: boolean
      required:
      - is_shared
    SharedSessionUpdateResponse:
      type: object
      properties:
        detail:
          type: string
      required:
      - detail
    SharedSystemPromptConsumer:
      type: object
      description: A mentor currently consuming the source's prompt.
      properties:
        unique_id:
          type: string
          format: uuid
        name:
          type: string
        slug:
          type: string
        platform_key:
          type: string
          nullable: true
      required:
      - name
      - platform_key
      - slug
      - unique_id
    SharedSystemPromptRequest:
      type: object
      description: |-
        Targets for a share operation.

        POST and PUT require at least one target: a share needs two or more agents.
        DELETE may omit `targets` entirely, which removes every current consumer.
      properties:
        targets:
          type: array
          items:
            $ref: '#/components/schemas/SharedSystemPromptTarget'
      required:
      - targets
    SharedSystemPromptResponse:
      type: object
      properties:
        source:
          $ref: '#/components/schemas/SharedSystemPromptConsumer'
        system_prompt:
          type: string
          nullable: true
        consumers:
          type: array
          items:
            $ref: '#/components/schemas/SharedSystemPromptConsumer'
      required:
      - consumers
      - source
      - system_prompt
    SharedSystemPromptTarget:
      type: object
      description: One mentor that should consume the source mentor's system prompt.
      properties:
        platform_key:
          type: string
        mentor:
          type: string
          description: Target mentor's unique_id, slug or name, within platform_key.
      required:
      - mentor
      - platform_key
    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
          description: The threshold for the skill.
        platform:
          type: string
          description: The platform key
      required:
      - name
      - platform
      - threshold
    SkillTypeEnum:
      enum:
      - custom
      - native
      type: string
      description: |-
        * `custom` - Custom
        * `native` - Native
    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
          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
    SourceEnum:
      enum:
      - agent
      - manual
      - external
      type: string
      description: |-
        * `agent` - agent
        * `manual` - manual
        * `external` - external
    Spa:
      type: object
      description: Serializer for SPA (Single Page Application)
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: SPA identifier (e.g. skills, mentor, admin)
          maxLength: 100
        description:
          type: string
          description: Human-friendly description of the 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
    SpendCap:
      type: object
      description: |-
        Spend cap across any scope (tenant, agent, user-per-agent).

        Admins write ``max_cost_usd``, ``interval_type``, ``enforcement``,
        ``alert_thresholds`` and ``enabled``. The spend counters
        (``current_spend_usd``/``remaining_usd``/``is_exceeded``) are reconciled
        from ClickHouse and surfaced read-only so a UI can render a progress bar.
        ``scope``/``platform``/``mentor``/``user`` are set by the view, never the
        request body; ``mentor_unique_id``/``username`` are echoed read-only so the
        caller can tell which agent/user a cap belongs to.
      properties:
        id:
          type: integer
          readOnly: true
        scope:
          allOf:
          - $ref: '#/components/schemas/SpendCapScopeEnum'
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        mentor_unique_id:
          type: string
          nullable: true
          readOnly: true
        mentor_name:
          type: string
          nullable: true
          readOnly: true
        username:
          type: string
          nullable: true
          readOnly: true
        email:
          type: string
          nullable: true
          readOnly: true
        interval_type:
          $ref: '#/components/schemas/IntervalTypeEnum'
        max_cost_usd:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,4})?$
        enforcement:
          $ref: '#/components/schemas/EnforcementEnum'
        alert_thresholds: {}
        period_started_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        current_spend_usd:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,6})?$
          readOnly: true
        remaining_usd:
          type: string
          format: decimal
          pattern: ^-?\d{0,8}(?:\.\d{0,6})?$
          readOnly: true
        is_exceeded:
          type: boolean
          readOnly: true
        last_reconciled_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        enabled:
          type: boolean
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - created_at
      - current_spend_usd
      - email
      - id
      - interval_type
      - is_exceeded
      - last_reconciled_at
      - max_cost_usd
      - mentor_name
      - mentor_unique_id
      - period_started_at
      - platform_key
      - remaining_usd
      - scope
      - updated_at
      - username
    SpendCapScopeEnum:
      enum:
      - tenant
      - agent
      - user_agent
      type: string
      description: |-
        * `tenant` - Tenant
        * `agent` - Agent
        * `user_agent` - User per agent
    SpendCapStatusItem:
      type: object
      properties:
        scope:
          type: string
        interval_type:
          type: string
        enforcement:
          type: string
        status:
          type: string
          description: 'Zone for this cap: ok/warning/exceeded'
        percent_used:
          type: number
          format: double
        warning_threshold:
          type: number
          format: double
          nullable: true
        mentor_unique_id:
          type: string
          nullable: true
        username:
          type: string
          nullable: true
      required:
      - enforcement
      - interval_type
      - mentor_unique_id
      - percent_used
      - scope
      - status
      - username
      - warning_threshold
    SpendCapStatusSummary:
      type: object
      properties:
        status:
          allOf:
          - $ref: '#/components/schemas/SpendCapStatusSummaryStatusEnum'
          description: |-
            Worst zone across the applicable caps

            * `ok` - ok
            * `warning` - warning
            * `exceeded` - exceeded
        blocked:
          type: boolean
          description: True when a hard-block cap is already exceeded
        caps:
          type: array
          items:
            $ref: '#/components/schemas/SpendCapStatusItem'
      required:
      - blocked
      - caps
      - status
    SpendCapStatusSummaryStatusEnum:
      enum:
      - ok
      - warning
      - exceeded
      type: string
      description: |-
        * `ok` - ok
        * `warning` - warning
        * `exceeded` - exceeded
    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
        id:
          type: integer
          readOnly: true
        unique_id:
          type: string
          format: uuid
          readOnly: true
      required:
      - id
      - mentor
      - recently_accessed_at
      - student
      - unique_id
      - updated_at
    StarterPrompts8c6Enum:
      enum:
      - guided_prompt
      - suggested_prompt
      type: string
      description: |-
        * `guided_prompt` - guided_prompt
        * `suggested_prompt` - suggested_prompt
    StarterPromptsB04Enum:
      enum:
      - guided_prompt
      - suggested_prompt
      type: string
      description: |-
        * `guided_prompt` - Guided Prompt
        * `suggested_prompt` - Suggested Prompt
    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
    Status0e3Enum:
      enum:
      - active
      - free
      - grandfathered
      - trialing
      - past_due
      - canceled
      - incomplete
      type: string
      description: |-
        * `active` - Active
        * `free` - Free Tier
        * `grandfathered` - Grandfathered
        * `trialing` - Trialing
        * `past_due` - Past Due
        * `canceled` - Canceled
        * `incomplete` - Incomplete
    Status147Enum:
      enum:
      - pending
      - in_progress
      - completed
      - failed
      - canceled
      type: string
      description: |-
        * `pending` - Pending
        * `in_progress` - In Progress
        * `completed` - Completed
        * `failed` - Failed
        * `canceled` - Canceled
    Status3daEnum:
      enum:
      - READ
      - UNREAD
      - CANCELLED
      type: string
      description: |-
        * `READ` - Read
        * `UNREAD` - Unread
        * `CANCELLED` - Cancelled
    Status869Enum:
      enum:
      - pending
      - published
      - failed
      type: string
      description: |-
        * `pending` - Pending
        * `published` - Published
        * `failed` - Failed
    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
        job:
          type: integer
      required:
      - id
      - job
      - position
      - title
    StepStatusEnum:
      enum:
      - completed
      - failed
      - pending
      type: string
      description: |-
        * `completed` - Completed
        * `failed` - Failed
        * `pending` - Pending
    StopGenerationRequest:
      type: object
      description: Serializer for stop generation request.
      properties:
        generation_id:
          type: string
          description: The unique identifier of the generation to stop
      required:
      - generation_id
    StripeCheckoutSessionCreate:
      type: object
      description: POST /v1/checkout/sessions — Stripe requires no field; typed hints
        only.
      properties:
        mode:
          $ref: '#/components/schemas/StripeCheckoutSessionCreateModeEnum'
        line_items:
          type: array
          items:
            type: object
            additionalProperties: {}
        success_url:
          type: string
        customer:
          type: string
    StripeCheckoutSessionCreateModeEnum:
      enum:
      - payment
      - setup
      - subscription
      type: string
      description: |-
        * `payment` - payment
        * `setup` - setup
        * `subscription` - subscription
    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
    StripeConnectDashboardLink:
      type: object
      description: Serializer for Express Dashboard link response.
      properties:
        dashboard_url:
          type: string
          format: uri
      required:
      - dashboard_url
    StripeConnectOnboard:
      type: object
      description: Serializer for Connect onboarding request.
      properties:
        return_url:
          type: string
          format: uri
          description: URL to redirect after onboarding completes
        refresh_url:
          type: string
          format: uri
          description: URL to redirect if onboarding link expires
        business_type:
          allOf:
          - $ref: '#/components/schemas/BusinessTypeEnum'
          default: individual
          description: |-
            Type of business

            * `individual` - individual
            * `company` - company
      required:
      - refresh_url
      - return_url
    StripeConnectOnboardResponse:
      type: object
      description: Serializer for Connect onboarding response.
      properties:
        account_id:
          type: string
        onboarding_url:
          type: string
          format: uri
      required:
      - account_id
      - onboarding_url
    StripeConnectStatus:
      type: object
      description: Serializer for Connect account status.
      properties:
        has_account:
          type: boolean
        account_id:
          type: string
        onboarding_complete:
          type: boolean
        charges_enabled:
          type: boolean
        payouts_enabled:
          type: boolean
        details_submitted:
          type: boolean
        commission_percent:
          $ref: '#/components/schemas/ItemTypeCommission'
        is_ready_for_payments:
          type: boolean
      required:
      - has_account
      - onboarding_complete
    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
    StripeCustomerCreate:
      type: object
      description: POST /v1/customers — Stripe requires no field; typed hints only.
      properties:
        email:
          type: string
          format: email
        name:
          type: string
        metadata:
          type: object
          additionalProperties: {}
    StripeCustomerPortalRequest:
      type: object
      properties:
        return_url:
          type: string
          format: uri
          description: URL to redirect to when the customer exits the portal (back
            button)
        subscription_id:
          type: string
          description: Subscription ID required for subscription_update or subscription_cancel
            flows
        flow_type:
          nullable: true
          description: |-
            Type of flow to present: 'payment_method_update' for adding/updating payment method, 'subscription_update' for updating subscription, 'subscription_cancel' for cancellation. If not provided, shows the default portal homepage.

            * `payment_method_update` - Payment Method Update
            * `subscription_update` - Subscription Update
            * `subscription_cancel` - Subscription Cancel
          oneOf:
          - $ref: '#/components/schemas/FlowTypeEnum'
          - $ref: '#/components/schemas/NullEnum'
        after_completion_url:
          type: string
          format: uri
          nullable: true
          description: URL to redirect after the flow is completed successfully. Only
            used when flow_type is set. Defaults to return_url if not provided.
      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
    StripePaymentLinkCreate:
      type: object
      description: Declared fields are validated; undeclared ones pass through verbatim.
      properties:
        line_items:
          type: array
          items:
            type: object
            additionalProperties: {}
      required:
      - line_items
    StripePaywallAccessResponse:
      type: object
      properties:
        has_access:
          type: boolean
        mode:
          type: string
          nullable: true
        checked_at:
          type: string
          format: date-time
        stale:
          type: boolean
          description: Present and true only when Stripe was unreachable and the answer
            was served from the platform's recorded payments.
      required:
      - checked_at
      - has_access
      - mode
    StripePaywallCheckout:
      type: object
      properties:
        price_id:
          type: string
          maxLength: 255
        app:
          type: string
          maxLength: 64
          pattern: ^[-a-zA-Z0-9_]+$
        success_url:
          type: string
          maxLength: 2000
        cancel_url:
          type: string
          maxLength: 2000
      required:
      - app
      - cancel_url
      - price_id
      - success_url
    StripePaywallCheckoutResponse:
      type: object
      properties:
        checkout_url:
          type: string
        session_id:
          type: string
      required:
      - checkout_url
      - session_id
    StripePriceCreate:
      type: object
      description: Declared fields are validated; undeclared ones pass through verbatim.
      properties:
        currency:
          type: string
        product:
          type: string
        product_data:
          type: object
          additionalProperties: {}
        unit_amount:
          type: integer
        recurring:
          type: object
          additionalProperties: {}
      required:
      - currency
    StripePricingPageSessionResponse:
      type: object
      description: Response for the unified pricing page identifier endpoint (auth
        + guest).
      properties:
        publishable_key:
          type: string
        pricing_table_id:
          type: string
        pricing_table_js: {}
        payment_link_id:
          type: string
        payment_link_url:
          type: string
        client_reference_id:
          type: string
          format: uuid
        customer_email:
          type: string
          format: email
          nullable: true
      required:
      - client_reference_id
      - payment_link_id
      - payment_link_url
      - pricing_table_id
      - pricing_table_js
      - publishable_key
    StripeProductCreate:
      type: object
      description: Declared fields are validated; undeclared ones pass through verbatim.
      properties:
        name:
          type: string
        description:
          type: string
        metadata:
          type: object
          additionalProperties: {}
        default_price_data:
          type: object
          additionalProperties: {}
      required:
      - name
    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
      - azure_openai
      type: string
      description: |-
        * `openai` - Openai
        * `google` - Google
        * `deepgram` - Deepgram
        * `cartesia` - Cartesia
        * `azure_openai` - Azure Openai
    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
    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
    Tag:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
          description: Server-assigned id.
        platform:
          type: integer
          readOnly: true
          description: Platform this Tag belongs to. Set automatically from your credentials;
            you cannot pass another Platform's id.
        name:
          type: string
          description: Display label shown on tag chips. Must be unique within your
            Platform (case-sensitive). Up to 64 characters.
          maxLength: 64
        color:
          type: string
          default: '#888888'
          description: Hex color (e.g. `#3F6BFF`) used to render the chip. Six lowercase
            or uppercase hex digits with a leading `#`.
          maxLength: 7
        metadata:
          description: Free-form JSON for Platform-defined attributes.
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Creation timestamp.
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Last-modified timestamp.
      required:
      - created_at
      - id
      - name
      - platform
      - updated_at
    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
      - Privacy System
      - PHI System
      type: string
      description: |-
        * `Safety System` - Safety System
        * `Moderation System` - Moderation System
        * `Privacy System` - Privacy System
        * `PHI System` - Phi System
    TaskModeEnum:
      enum:
      - sync
      - async
      type: string
      description: |-
        * `sync` - sync
        * `async` - async
    TaskTypeEnum:
      enum:
      - talk
      - repeat
      type: string
      description: |-
        * `talk` - talk
        * `repeat` - repeat
    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
    TenantChatPrivacyConfig:
      type: object
      description: |-
        Serializer for the tenant-wide chat-privacy config payload.

        Shared by GET and PATCH on /orgs/{org}/chat-privacy-config/.
      properties:
        allow_user_chat_privacy_control:
          type: boolean
          description: Whether the tenant allows end users to control their chat history
            privacy (anonymize or disable). When False, user and session preferences
            are ignored and history is always logged.
      required:
      - allow_user_chat_privacy_control
    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
    TenantSetting:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        tenant_platform:
          type: string
          readOnly: true
        teams_bot_mentor:
          type: string
          readOnly: true
      required:
      - id
      - teams_bot_mentor
      - tenant_platform
    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
          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
    TimezoneEnum:
      enum:
      - Africa/Abidjan
      - Africa/Accra
      - Africa/Addis_Ababa
      - Africa/Algiers
      - Africa/Asmara
      - Africa/Asmera
      - Africa/Bamako
      - Africa/Bangui
      - Africa/Banjul
      - Africa/Bissau
      - Africa/Blantyre
      - Africa/Brazzaville
      - Africa/Bujumbura
      - Africa/Cairo
      - Africa/Casablanca
      - Africa/Ceuta
      - Africa/Conakry
      - Africa/Dakar
      - Africa/Dar_es_Salaam
      - Africa/Djibouti
      - Africa/Douala
      - Africa/El_Aaiun
      - Africa/Freetown
      - Africa/Gaborone
      - Africa/Harare
      - Africa/Johannesburg
      - Africa/Juba
      - Africa/Kampala
      - Africa/Khartoum
      - Africa/Kigali
      - Africa/Kinshasa
      - Africa/Lagos
      - Africa/Libreville
      - Africa/Lome
      - Africa/Luanda
      - Africa/Lubumbashi
      - Africa/Lusaka
      - Africa/Malabo
      - Africa/Maputo
      - Africa/Maseru
      - Africa/Mbabane
      - Africa/Mogadishu
      - Africa/Monrovia
      - Africa/Nairobi
      - Africa/Ndjamena
      - Africa/Niamey
      - Africa/Nouakchott
      - Africa/Ouagadougou
      - Africa/Porto-Novo
      - Africa/Sao_Tome
      - Africa/Timbuktu
      - Africa/Tripoli
      - Africa/Tunis
      - Africa/Windhoek
      - America/Adak
      - America/Anchorage
      - America/Anguilla
      - America/Antigua
      - America/Araguaina
      - America/Argentina/Buenos_Aires
      - America/Argentina/Catamarca
      - America/Argentina/ComodRivadavia
      - America/Argentina/Cordoba
      - America/Argentina/Jujuy
      - America/Argentina/La_Rioja
      - America/Argentina/Mendoza
      - America/Argentina/Rio_Gallegos
      - America/Argentina/Salta
      - America/Argentina/San_Juan
      - America/Argentina/San_Luis
      - America/Argentina/Tucuman
      - America/Argentina/Ushuaia
      - America/Aruba
      - America/Asuncion
      - America/Atikokan
      - America/Atka
      - America/Bahia
      - America/Bahia_Banderas
      - America/Barbados
      - America/Belem
      - America/Belize
      - America/Blanc-Sablon
      - America/Boa_Vista
      - America/Bogota
      - America/Boise
      - America/Buenos_Aires
      - America/Cambridge_Bay
      - America/Campo_Grande
      - America/Cancun
      - America/Caracas
      - America/Catamarca
      - America/Cayenne
      - America/Cayman
      - America/Chicago
      - America/Chihuahua
      - America/Ciudad_Juarez
      - America/Coral_Harbour
      - America/Cordoba
      - America/Costa_Rica
      - America/Coyhaique
      - America/Creston
      - America/Cuiaba
      - America/Curacao
      - America/Danmarkshavn
      - America/Dawson
      - America/Dawson_Creek
      - America/Denver
      - America/Detroit
      - America/Dominica
      - America/Edmonton
      - America/Eirunepe
      - America/El_Salvador
      - America/Ensenada
      - America/Fort_Nelson
      - America/Fort_Wayne
      - America/Fortaleza
      - America/Glace_Bay
      - America/Godthab
      - America/Goose_Bay
      - America/Grand_Turk
      - America/Grenada
      - America/Guadeloupe
      - America/Guatemala
      - America/Guayaquil
      - America/Guyana
      - America/Halifax
      - America/Havana
      - America/Hermosillo
      - America/Indiana/Indianapolis
      - America/Indiana/Knox
      - America/Indiana/Marengo
      - America/Indiana/Petersburg
      - America/Indiana/Tell_City
      - America/Indiana/Vevay
      - America/Indiana/Vincennes
      - America/Indiana/Winamac
      - America/Indianapolis
      - America/Inuvik
      - America/Iqaluit
      - America/Jamaica
      - America/Jujuy
      - America/Juneau
      - America/Kentucky/Louisville
      - America/Kentucky/Monticello
      - America/Knox_IN
      - America/Kralendijk
      - America/La_Paz
      - America/Lima
      - America/Los_Angeles
      - America/Louisville
      - America/Lower_Princes
      - America/Maceio
      - America/Managua
      - America/Manaus
      - America/Marigot
      - America/Martinique
      - America/Matamoros
      - America/Mazatlan
      - America/Mendoza
      - America/Menominee
      - America/Merida
      - America/Metlakatla
      - America/Mexico_City
      - America/Miquelon
      - America/Moncton
      - America/Monterrey
      - America/Montevideo
      - America/Montreal
      - America/Montserrat
      - America/Nassau
      - America/New_York
      - America/Nipigon
      - America/Nome
      - America/Noronha
      - America/North_Dakota/Beulah
      - America/North_Dakota/Center
      - America/North_Dakota/New_Salem
      - America/Nuuk
      - America/Ojinaga
      - America/Panama
      - America/Pangnirtung
      - America/Paramaribo
      - America/Phoenix
      - America/Port-au-Prince
      - America/Port_of_Spain
      - America/Porto_Acre
      - America/Porto_Velho
      - America/Puerto_Rico
      - America/Punta_Arenas
      - America/Rainy_River
      - America/Rankin_Inlet
      - America/Recife
      - America/Regina
      - America/Resolute
      - America/Rio_Branco
      - America/Rosario
      - America/Santa_Isabel
      - America/Santarem
      - America/Santiago
      - America/Santo_Domingo
      - America/Sao_Paulo
      - America/Scoresbysund
      - America/Shiprock
      - America/Sitka
      - America/St_Barthelemy
      - America/St_Johns
      - America/St_Kitts
      - America/St_Lucia
      - America/St_Thomas
      - America/St_Vincent
      - America/Swift_Current
      - America/Tegucigalpa
      - America/Thule
      - America/Thunder_Bay
      - America/Tijuana
      - America/Toronto
      - America/Tortola
      - America/Vancouver
      - America/Virgin
      - America/Whitehorse
      - America/Winnipeg
      - America/Yakutat
      - America/Yellowknife
      - Antarctica/Casey
      - Antarctica/Davis
      - Antarctica/DumontDUrville
      - Antarctica/Macquarie
      - Antarctica/Mawson
      - Antarctica/McMurdo
      - Antarctica/Palmer
      - Antarctica/Rothera
      - Antarctica/South_Pole
      - Antarctica/Syowa
      - Antarctica/Troll
      - Antarctica/Vostok
      - Arctic/Longyearbyen
      - Asia/Aden
      - Asia/Almaty
      - Asia/Amman
      - Asia/Anadyr
      - Asia/Aqtau
      - Asia/Aqtobe
      - Asia/Ashgabat
      - Asia/Ashkhabad
      - Asia/Atyrau
      - Asia/Baghdad
      - Asia/Bahrain
      - Asia/Baku
      - Asia/Bangkok
      - Asia/Barnaul
      - Asia/Beirut
      - Asia/Bishkek
      - Asia/Brunei
      - Asia/Calcutta
      - Asia/Chita
      - Asia/Choibalsan
      - Asia/Chongqing
      - Asia/Chungking
      - Asia/Colombo
      - Asia/Dacca
      - Asia/Damascus
      - Asia/Dhaka
      - Asia/Dili
      - Asia/Dubai
      - Asia/Dushanbe
      - Asia/Famagusta
      - Asia/Gaza
      - Asia/Harbin
      - Asia/Hebron
      - Asia/Ho_Chi_Minh
      - Asia/Hong_Kong
      - Asia/Hovd
      - Asia/Irkutsk
      - Asia/Istanbul
      - Asia/Jakarta
      - Asia/Jayapura
      - Asia/Jerusalem
      - Asia/Kabul
      - Asia/Kamchatka
      - Asia/Karachi
      - Asia/Kashgar
      - Asia/Kathmandu
      - Asia/Katmandu
      - Asia/Khandyga
      - Asia/Kolkata
      - Asia/Krasnoyarsk
      - Asia/Kuala_Lumpur
      - Asia/Kuching
      - Asia/Kuwait
      - Asia/Macao
      - Asia/Macau
      - Asia/Magadan
      - Asia/Makassar
      - Asia/Manila
      - Asia/Muscat
      - Asia/Nicosia
      - Asia/Novokuznetsk
      - Asia/Novosibirsk
      - Asia/Omsk
      - Asia/Oral
      - Asia/Phnom_Penh
      - Asia/Pontianak
      - Asia/Pyongyang
      - Asia/Qatar
      - Asia/Qostanay
      - Asia/Qyzylorda
      - Asia/Rangoon
      - Asia/Riyadh
      - Asia/Saigon
      - Asia/Sakhalin
      - Asia/Samarkand
      - Asia/Seoul
      - Asia/Shanghai
      - Asia/Singapore
      - Asia/Srednekolymsk
      - Asia/Taipei
      - Asia/Tashkent
      - Asia/Tbilisi
      - Asia/Tehran
      - Asia/Tel_Aviv
      - Asia/Thimbu
      - Asia/Thimphu
      - Asia/Tokyo
      - Asia/Tomsk
      - Asia/Ujung_Pandang
      - Asia/Ulaanbaatar
      - Asia/Ulan_Bator
      - Asia/Urumqi
      - Asia/Ust-Nera
      - Asia/Vientiane
      - Asia/Vladivostok
      - Asia/Yakutsk
      - Asia/Yangon
      - Asia/Yekaterinburg
      - Asia/Yerevan
      - Atlantic/Azores
      - Atlantic/Bermuda
      - Atlantic/Canary
      - Atlantic/Cape_Verde
      - Atlantic/Faeroe
      - Atlantic/Faroe
      - Atlantic/Jan_Mayen
      - Atlantic/Madeira
      - Atlantic/Reykjavik
      - Atlantic/South_Georgia
      - Atlantic/St_Helena
      - Atlantic/Stanley
      - Australia/ACT
      - Australia/Adelaide
      - Australia/Brisbane
      - Australia/Broken_Hill
      - Australia/Canberra
      - Australia/Currie
      - Australia/Darwin
      - Australia/Eucla
      - Australia/Hobart
      - Australia/LHI
      - Australia/Lindeman
      - Australia/Lord_Howe
      - Australia/Melbourne
      - Australia/NSW
      - Australia/North
      - Australia/Perth
      - Australia/Queensland
      - Australia/South
      - Australia/Sydney
      - Australia/Tasmania
      - Australia/Victoria
      - Australia/West
      - Australia/Yancowinna
      - Brazil/Acre
      - Brazil/DeNoronha
      - Brazil/East
      - Brazil/West
      - CET
      - CST6CDT
      - Canada/Atlantic
      - Canada/Central
      - Canada/Eastern
      - Canada/Mountain
      - Canada/Newfoundland
      - Canada/Pacific
      - Canada/Saskatchewan
      - Canada/Yukon
      - Chile/Continental
      - Chile/EasterIsland
      - Cuba
      - EET
      - EST
      - EST5EDT
      - Egypt
      - Eire
      - Etc/GMT
      - Etc/GMT+0
      - Etc/GMT+1
      - Etc/GMT+10
      - Etc/GMT+11
      - Etc/GMT+12
      - Etc/GMT+2
      - Etc/GMT+3
      - Etc/GMT+4
      - Etc/GMT+5
      - Etc/GMT+6
      - Etc/GMT+7
      - Etc/GMT+8
      - Etc/GMT+9
      - Etc/GMT-0
      - Etc/GMT-1
      - Etc/GMT-10
      - Etc/GMT-11
      - Etc/GMT-12
      - Etc/GMT-13
      - Etc/GMT-14
      - Etc/GMT-2
      - Etc/GMT-3
      - Etc/GMT-4
      - Etc/GMT-5
      - Etc/GMT-6
      - Etc/GMT-7
      - Etc/GMT-8
      - Etc/GMT-9
      - Etc/GMT0
      - Etc/Greenwich
      - Etc/UCT
      - Etc/UTC
      - Etc/Universal
      - Etc/Zulu
      - Europe/Amsterdam
      - Europe/Andorra
      - Europe/Astrakhan
      - Europe/Athens
      - Europe/Belfast
      - Europe/Belgrade
      - Europe/Berlin
      - Europe/Bratislava
      - Europe/Brussels
      - Europe/Bucharest
      - Europe/Budapest
      - Europe/Busingen
      - Europe/Chisinau
      - Europe/Copenhagen
      - Europe/Dublin
      - Europe/Gibraltar
      - Europe/Guernsey
      - Europe/Helsinki
      - Europe/Isle_of_Man
      - Europe/Istanbul
      - Europe/Jersey
      - Europe/Kaliningrad
      - Europe/Kiev
      - Europe/Kirov
      - Europe/Kyiv
      - Europe/Lisbon
      - Europe/Ljubljana
      - Europe/London
      - Europe/Luxembourg
      - Europe/Madrid
      - Europe/Malta
      - Europe/Mariehamn
      - Europe/Minsk
      - Europe/Monaco
      - Europe/Moscow
      - Europe/Nicosia
      - Europe/Oslo
      - Europe/Paris
      - Europe/Podgorica
      - Europe/Prague
      - Europe/Riga
      - Europe/Rome
      - Europe/Samara
      - Europe/San_Marino
      - Europe/Sarajevo
      - Europe/Saratov
      - Europe/Simferopol
      - Europe/Skopje
      - Europe/Sofia
      - Europe/Stockholm
      - Europe/Tallinn
      - Europe/Tirane
      - Europe/Tiraspol
      - Europe/Ulyanovsk
      - Europe/Uzhgorod
      - Europe/Vaduz
      - Europe/Vatican
      - Europe/Vienna
      - Europe/Vilnius
      - Europe/Volgograd
      - Europe/Warsaw
      - Europe/Zagreb
      - Europe/Zaporozhye
      - Europe/Zurich
      - Factory
      - GB
      - GB-Eire
      - GMT
      - GMT+0
      - GMT-0
      - GMT0
      - Greenwich
      - HST
      - Hongkong
      - Iceland
      - Indian/Antananarivo
      - Indian/Chagos
      - Indian/Christmas
      - Indian/Cocos
      - Indian/Comoro
      - Indian/Kerguelen
      - Indian/Mahe
      - Indian/Maldives
      - Indian/Mauritius
      - Indian/Mayotte
      - Indian/Reunion
      - Iran
      - Israel
      - Jamaica
      - Japan
      - Kwajalein
      - Libya
      - MET
      - MST
      - MST7MDT
      - Mexico/BajaNorte
      - Mexico/BajaSur
      - Mexico/General
      - NZ
      - NZ-CHAT
      - Navajo
      - PRC
      - PST8PDT
      - Pacific/Apia
      - Pacific/Auckland
      - Pacific/Bougainville
      - Pacific/Chatham
      - Pacific/Chuuk
      - Pacific/Easter
      - Pacific/Efate
      - Pacific/Enderbury
      - Pacific/Fakaofo
      - Pacific/Fiji
      - Pacific/Funafuti
      - Pacific/Galapagos
      - Pacific/Gambier
      - Pacific/Guadalcanal
      - Pacific/Guam
      - Pacific/Honolulu
      - Pacific/Johnston
      - Pacific/Kanton
      - Pacific/Kiritimati
      - Pacific/Kosrae
      - Pacific/Kwajalein
      - Pacific/Majuro
      - Pacific/Marquesas
      - Pacific/Midway
      - Pacific/Nauru
      - Pacific/Niue
      - Pacific/Norfolk
      - Pacific/Noumea
      - Pacific/Pago_Pago
      - Pacific/Palau
      - Pacific/Pitcairn
      - Pacific/Pohnpei
      - Pacific/Ponape
      - Pacific/Port_Moresby
      - Pacific/Rarotonga
      - Pacific/Saipan
      - Pacific/Samoa
      - Pacific/Tahiti
      - Pacific/Tarawa
      - Pacific/Tongatapu
      - Pacific/Truk
      - Pacific/Wake
      - Pacific/Wallis
      - Pacific/Yap
      - Poland
      - Portugal
      - ROC
      - ROK
      - Singapore
      - Turkey
      - UCT
      - US/Alaska
      - US/Aleutian
      - US/Arizona
      - US/Central
      - US/East-Indiana
      - US/Eastern
      - US/Hawaii
      - US/Indiana-Starke
      - US/Michigan
      - US/Mountain
      - US/Pacific
      - US/Samoa
      - UTC
      - Universal
      - W-SU
      - WET
      - Zulu
      type: string
      description: |-
        * `Africa/Abidjan` - Africa/Abidjan
        * `Africa/Accra` - Africa/Accra
        * `Africa/Addis_Ababa` - Africa/Addis_Ababa
        * `Africa/Algiers` - Africa/Algiers
        * `Africa/Asmara` - Africa/Asmara
        * `Africa/Asmera` - Africa/Asmera
        * `Africa/Bamako` - Africa/Bamako
        * `Africa/Bangui` - Africa/Bangui
        * `Africa/Banjul` - Africa/Banjul
        * `Africa/Bissau` - Africa/Bissau
        * `Africa/Blantyre` - Africa/Blantyre
        * `Africa/Brazzaville` - Africa/Brazzaville
        * `Africa/Bujumbura` - Africa/Bujumbura
        * `Africa/Cairo` - Africa/Cairo
        * `Africa/Casablanca` - Africa/Casablanca
        * `Africa/Ceuta` - Africa/Ceuta
        * `Africa/Conakry` - Africa/Conakry
        * `Africa/Dakar` - Africa/Dakar
        * `Africa/Dar_es_Salaam` - Africa/Dar_es_Salaam
        * `Africa/Djibouti` - Africa/Djibouti
        * `Africa/Douala` - Africa/Douala
        * `Africa/El_Aaiun` - Africa/El_Aaiun
        * `Africa/Freetown` - Africa/Freetown
        * `Africa/Gaborone` - Africa/Gaborone
        * `Africa/Harare` - Africa/Harare
        * `Africa/Johannesburg` - Africa/Johannesburg
        * `Africa/Juba` - Africa/Juba
        * `Africa/Kampala` - Africa/Kampala
        * `Africa/Khartoum` - Africa/Khartoum
        * `Africa/Kigali` - Africa/Kigali
        * `Africa/Kinshasa` - Africa/Kinshasa
        * `Africa/Lagos` - Africa/Lagos
        * `Africa/Libreville` - Africa/Libreville
        * `Africa/Lome` - Africa/Lome
        * `Africa/Luanda` - Africa/Luanda
        * `Africa/Lubumbashi` - Africa/Lubumbashi
        * `Africa/Lusaka` - Africa/Lusaka
        * `Africa/Malabo` - Africa/Malabo
        * `Africa/Maputo` - Africa/Maputo
        * `Africa/Maseru` - Africa/Maseru
        * `Africa/Mbabane` - Africa/Mbabane
        * `Africa/Mogadishu` - Africa/Mogadishu
        * `Africa/Monrovia` - Africa/Monrovia
        * `Africa/Nairobi` - Africa/Nairobi
        * `Africa/Ndjamena` - Africa/Ndjamena
        * `Africa/Niamey` - Africa/Niamey
        * `Africa/Nouakchott` - Africa/Nouakchott
        * `Africa/Ouagadougou` - Africa/Ouagadougou
        * `Africa/Porto-Novo` - Africa/Porto-Novo
        * `Africa/Sao_Tome` - Africa/Sao_Tome
        * `Africa/Timbuktu` - Africa/Timbuktu
        * `Africa/Tripoli` - Africa/Tripoli
        * `Africa/Tunis` - Africa/Tunis
        * `Africa/Windhoek` - Africa/Windhoek
        * `America/Adak` - America/Adak
        * `America/Anchorage` - America/Anchorage
        * `America/Anguilla` - America/Anguilla
        * `America/Antigua` - America/Antigua
        * `America/Araguaina` - America/Araguaina
        * `America/Argentina/Buenos_Aires` - America/Argentina/Buenos_Aires
        * `America/Argentina/Catamarca` - America/Argentina/Catamarca
        * `America/Argentina/ComodRivadavia` - America/Argentina/ComodRivadavia
        * `America/Argentina/Cordoba` - America/Argentina/Cordoba
        * `America/Argentina/Jujuy` - America/Argentina/Jujuy
        * `America/Argentina/La_Rioja` - America/Argentina/La_Rioja
        * `America/Argentina/Mendoza` - America/Argentina/Mendoza
        * `America/Argentina/Rio_Gallegos` - America/Argentina/Rio_Gallegos
        * `America/Argentina/Salta` - America/Argentina/Salta
        * `America/Argentina/San_Juan` - America/Argentina/San_Juan
        * `America/Argentina/San_Luis` - America/Argentina/San_Luis
        * `America/Argentina/Tucuman` - America/Argentina/Tucuman
        * `America/Argentina/Ushuaia` - America/Argentina/Ushuaia
        * `America/Aruba` - America/Aruba
        * `America/Asuncion` - America/Asuncion
        * `America/Atikokan` - America/Atikokan
        * `America/Atka` - America/Atka
        * `America/Bahia` - America/Bahia
        * `America/Bahia_Banderas` - America/Bahia_Banderas
        * `America/Barbados` - America/Barbados
        * `America/Belem` - America/Belem
        * `America/Belize` - America/Belize
        * `America/Blanc-Sablon` - America/Blanc-Sablon
        * `America/Boa_Vista` - America/Boa_Vista
        * `America/Bogota` - America/Bogota
        * `America/Boise` - America/Boise
        * `America/Buenos_Aires` - America/Buenos_Aires
        * `America/Cambridge_Bay` - America/Cambridge_Bay
        * `America/Campo_Grande` - America/Campo_Grande
        * `America/Cancun` - America/Cancun
        * `America/Caracas` - America/Caracas
        * `America/Catamarca` - America/Catamarca
        * `America/Cayenne` - America/Cayenne
        * `America/Cayman` - America/Cayman
        * `America/Chicago` - America/Chicago
        * `America/Chihuahua` - America/Chihuahua
        * `America/Ciudad_Juarez` - America/Ciudad_Juarez
        * `America/Coral_Harbour` - America/Coral_Harbour
        * `America/Cordoba` - America/Cordoba
        * `America/Costa_Rica` - America/Costa_Rica
        * `America/Coyhaique` - America/Coyhaique
        * `America/Creston` - America/Creston
        * `America/Cuiaba` - America/Cuiaba
        * `America/Curacao` - America/Curacao
        * `America/Danmarkshavn` - America/Danmarkshavn
        * `America/Dawson` - America/Dawson
        * `America/Dawson_Creek` - America/Dawson_Creek
        * `America/Denver` - America/Denver
        * `America/Detroit` - America/Detroit
        * `America/Dominica` - America/Dominica
        * `America/Edmonton` - America/Edmonton
        * `America/Eirunepe` - America/Eirunepe
        * `America/El_Salvador` - America/El_Salvador
        * `America/Ensenada` - America/Ensenada
        * `America/Fort_Nelson` - America/Fort_Nelson
        * `America/Fort_Wayne` - America/Fort_Wayne
        * `America/Fortaleza` - America/Fortaleza
        * `America/Glace_Bay` - America/Glace_Bay
        * `America/Godthab` - America/Godthab
        * `America/Goose_Bay` - America/Goose_Bay
        * `America/Grand_Turk` - America/Grand_Turk
        * `America/Grenada` - America/Grenada
        * `America/Guadeloupe` - America/Guadeloupe
        * `America/Guatemala` - America/Guatemala
        * `America/Guayaquil` - America/Guayaquil
        * `America/Guyana` - America/Guyana
        * `America/Halifax` - America/Halifax
        * `America/Havana` - America/Havana
        * `America/Hermosillo` - America/Hermosillo
        * `America/Indiana/Indianapolis` - America/Indiana/Indianapolis
        * `America/Indiana/Knox` - America/Indiana/Knox
        * `America/Indiana/Marengo` - America/Indiana/Marengo
        * `America/Indiana/Petersburg` - America/Indiana/Petersburg
        * `America/Indiana/Tell_City` - America/Indiana/Tell_City
        * `America/Indiana/Vevay` - America/Indiana/Vevay
        * `America/Indiana/Vincennes` - America/Indiana/Vincennes
        * `America/Indiana/Winamac` - America/Indiana/Winamac
        * `America/Indianapolis` - America/Indianapolis
        * `America/Inuvik` - America/Inuvik
        * `America/Iqaluit` - America/Iqaluit
        * `America/Jamaica` - America/Jamaica
        * `America/Jujuy` - America/Jujuy
        * `America/Juneau` - America/Juneau
        * `America/Kentucky/Louisville` - America/Kentucky/Louisville
        * `America/Kentucky/Monticello` - America/Kentucky/Monticello
        * `America/Knox_IN` - America/Knox_IN
        * `America/Kralendijk` - America/Kralendijk
        * `America/La_Paz` - America/La_Paz
        * `America/Lima` - America/Lima
        * `America/Los_Angeles` - America/Los_Angeles
        * `America/Louisville` - America/Louisville
        * `America/Lower_Princes` - America/Lower_Princes
        * `America/Maceio` - America/Maceio
        * `America/Managua` - America/Managua
        * `America/Manaus` - America/Manaus
        * `America/Marigot` - America/Marigot
        * `America/Martinique` - America/Martinique
        * `America/Matamoros` - America/Matamoros
        * `America/Mazatlan` - America/Mazatlan
        * `America/Mendoza` - America/Mendoza
        * `America/Menominee` - America/Menominee
        * `America/Merida` - America/Merida
        * `America/Metlakatla` - America/Metlakatla
        * `America/Mexico_City` - America/Mexico_City
        * `America/Miquelon` - America/Miquelon
        * `America/Moncton` - America/Moncton
        * `America/Monterrey` - America/Monterrey
        * `America/Montevideo` - America/Montevideo
        * `America/Montreal` - America/Montreal
        * `America/Montserrat` - America/Montserrat
        * `America/Nassau` - America/Nassau
        * `America/New_York` - America/New_York
        * `America/Nipigon` - America/Nipigon
        * `America/Nome` - America/Nome
        * `America/Noronha` - America/Noronha
        * `America/North_Dakota/Beulah` - America/North_Dakota/Beulah
        * `America/North_Dakota/Center` - America/North_Dakota/Center
        * `America/North_Dakota/New_Salem` - America/North_Dakota/New_Salem
        * `America/Nuuk` - America/Nuuk
        * `America/Ojinaga` - America/Ojinaga
        * `America/Panama` - America/Panama
        * `America/Pangnirtung` - America/Pangnirtung
        * `America/Paramaribo` - America/Paramaribo
        * `America/Phoenix` - America/Phoenix
        * `America/Port-au-Prince` - America/Port-au-Prince
        * `America/Port_of_Spain` - America/Port_of_Spain
        * `America/Porto_Acre` - America/Porto_Acre
        * `America/Porto_Velho` - America/Porto_Velho
        * `America/Puerto_Rico` - America/Puerto_Rico
        * `America/Punta_Arenas` - America/Punta_Arenas
        * `America/Rainy_River` - America/Rainy_River
        * `America/Rankin_Inlet` - America/Rankin_Inlet
        * `America/Recife` - America/Recife
        * `America/Regina` - America/Regina
        * `America/Resolute` - America/Resolute
        * `America/Rio_Branco` - America/Rio_Branco
        * `America/Rosario` - America/Rosario
        * `America/Santa_Isabel` - America/Santa_Isabel
        * `America/Santarem` - America/Santarem
        * `America/Santiago` - America/Santiago
        * `America/Santo_Domingo` - America/Santo_Domingo
        * `America/Sao_Paulo` - America/Sao_Paulo
        * `America/Scoresbysund` - America/Scoresbysund
        * `America/Shiprock` - America/Shiprock
        * `America/Sitka` - America/Sitka
        * `America/St_Barthelemy` - America/St_Barthelemy
        * `America/St_Johns` - America/St_Johns
        * `America/St_Kitts` - America/St_Kitts
        * `America/St_Lucia` - America/St_Lucia
        * `America/St_Thomas` - America/St_Thomas
        * `America/St_Vincent` - America/St_Vincent
        * `America/Swift_Current` - America/Swift_Current
        * `America/Tegucigalpa` - America/Tegucigalpa
        * `America/Thule` - America/Thule
        * `America/Thunder_Bay` - America/Thunder_Bay
        * `America/Tijuana` - America/Tijuana
        * `America/Toronto` - America/Toronto
        * `America/Tortola` - America/Tortola
        * `America/Vancouver` - America/Vancouver
        * `America/Virgin` - America/Virgin
        * `America/Whitehorse` - America/Whitehorse
        * `America/Winnipeg` - America/Winnipeg
        * `America/Yakutat` - America/Yakutat
        * `America/Yellowknife` - America/Yellowknife
        * `Antarctica/Casey` - Antarctica/Casey
        * `Antarctica/Davis` - Antarctica/Davis
        * `Antarctica/DumontDUrville` - Antarctica/DumontDUrville
        * `Antarctica/Macquarie` - Antarctica/Macquarie
        * `Antarctica/Mawson` - Antarctica/Mawson
        * `Antarctica/McMurdo` - Antarctica/McMurdo
        * `Antarctica/Palmer` - Antarctica/Palmer
        * `Antarctica/Rothera` - Antarctica/Rothera
        * `Antarctica/South_Pole` - Antarctica/South_Pole
        * `Antarctica/Syowa` - Antarctica/Syowa
        * `Antarctica/Troll` - Antarctica/Troll
        * `Antarctica/Vostok` - Antarctica/Vostok
        * `Arctic/Longyearbyen` - Arctic/Longyearbyen
        * `Asia/Aden` - Asia/Aden
        * `Asia/Almaty` - Asia/Almaty
        * `Asia/Amman` - Asia/Amman
        * `Asia/Anadyr` - Asia/Anadyr
        * `Asia/Aqtau` - Asia/Aqtau
        * `Asia/Aqtobe` - Asia/Aqtobe
        * `Asia/Ashgabat` - Asia/Ashgabat
        * `Asia/Ashkhabad` - Asia/Ashkhabad
        * `Asia/Atyrau` - Asia/Atyrau
        * `Asia/Baghdad` - Asia/Baghdad
        * `Asia/Bahrain` - Asia/Bahrain
        * `Asia/Baku` - Asia/Baku
        * `Asia/Bangkok` - Asia/Bangkok
        * `Asia/Barnaul` - Asia/Barnaul
        * `Asia/Beirut` - Asia/Beirut
        * `Asia/Bishkek` - Asia/Bishkek
        * `Asia/Brunei` - Asia/Brunei
        * `Asia/Calcutta` - Asia/Calcutta
        * `Asia/Chita` - Asia/Chita
        * `Asia/Choibalsan` - Asia/Choibalsan
        * `Asia/Chongqing` - Asia/Chongqing
        * `Asia/Chungking` - Asia/Chungking
        * `Asia/Colombo` - Asia/Colombo
        * `Asia/Dacca` - Asia/Dacca
        * `Asia/Damascus` - Asia/Damascus
        * `Asia/Dhaka` - Asia/Dhaka
        * `Asia/Dili` - Asia/Dili
        * `Asia/Dubai` - Asia/Dubai
        * `Asia/Dushanbe` - Asia/Dushanbe
        * `Asia/Famagusta` - Asia/Famagusta
        * `Asia/Gaza` - Asia/Gaza
        * `Asia/Harbin` - Asia/Harbin
        * `Asia/Hebron` - Asia/Hebron
        * `Asia/Ho_Chi_Minh` - Asia/Ho_Chi_Minh
        * `Asia/Hong_Kong` - Asia/Hong_Kong
        * `Asia/Hovd` - Asia/Hovd
        * `Asia/Irkutsk` - Asia/Irkutsk
        * `Asia/Istanbul` - Asia/Istanbul
        * `Asia/Jakarta` - Asia/Jakarta
        * `Asia/Jayapura` - Asia/Jayapura
        * `Asia/Jerusalem` - Asia/Jerusalem
        * `Asia/Kabul` - Asia/Kabul
        * `Asia/Kamchatka` - Asia/Kamchatka
        * `Asia/Karachi` - Asia/Karachi
        * `Asia/Kashgar` - Asia/Kashgar
        * `Asia/Kathmandu` - Asia/Kathmandu
        * `Asia/Katmandu` - Asia/Katmandu
        * `Asia/Khandyga` - Asia/Khandyga
        * `Asia/Kolkata` - Asia/Kolkata
        * `Asia/Krasnoyarsk` - Asia/Krasnoyarsk
        * `Asia/Kuala_Lumpur` - Asia/Kuala_Lumpur
        * `Asia/Kuching` - Asia/Kuching
        * `Asia/Kuwait` - Asia/Kuwait
        * `Asia/Macao` - Asia/Macao
        * `Asia/Macau` - Asia/Macau
        * `Asia/Magadan` - Asia/Magadan
        * `Asia/Makassar` - Asia/Makassar
        * `Asia/Manila` - Asia/Manila
        * `Asia/Muscat` - Asia/Muscat
        * `Asia/Nicosia` - Asia/Nicosia
        * `Asia/Novokuznetsk` - Asia/Novokuznetsk
        * `Asia/Novosibirsk` - Asia/Novosibirsk
        * `Asia/Omsk` - Asia/Omsk
        * `Asia/Oral` - Asia/Oral
        * `Asia/Phnom_Penh` - Asia/Phnom_Penh
        * `Asia/Pontianak` - Asia/Pontianak
        * `Asia/Pyongyang` - Asia/Pyongyang
        * `Asia/Qatar` - Asia/Qatar
        * `Asia/Qostanay` - Asia/Qostanay
        * `Asia/Qyzylorda` - Asia/Qyzylorda
        * `Asia/Rangoon` - Asia/Rangoon
        * `Asia/Riyadh` - Asia/Riyadh
        * `Asia/Saigon` - Asia/Saigon
        * `Asia/Sakhalin` - Asia/Sakhalin
        * `Asia/Samarkand` - Asia/Samarkand
        * `Asia/Seoul` - Asia/Seoul
        * `Asia/Shanghai` - Asia/Shanghai
        * `Asia/Singapore` - Asia/Singapore
        * `Asia/Srednekolymsk` - Asia/Srednekolymsk
        * `Asia/Taipei` - Asia/Taipei
        * `Asia/Tashkent` - Asia/Tashkent
        * `Asia/Tbilisi` - Asia/Tbilisi
        * `Asia/Tehran` - Asia/Tehran
        * `Asia/Tel_Aviv` - Asia/Tel_Aviv
        * `Asia/Thimbu` - Asia/Thimbu
        * `Asia/Thimphu` - Asia/Thimphu
        * `Asia/Tokyo` - Asia/Tokyo
        * `Asia/Tomsk` - Asia/Tomsk
        * `Asia/Ujung_Pandang` - Asia/Ujung_Pandang
        * `Asia/Ulaanbaatar` - Asia/Ulaanbaatar
        * `Asia/Ulan_Bator` - Asia/Ulan_Bator
        * `Asia/Urumqi` - Asia/Urumqi
        * `Asia/Ust-Nera` - Asia/Ust-Nera
        * `Asia/Vientiane` - Asia/Vientiane
        * `Asia/Vladivostok` - Asia/Vladivostok
        * `Asia/Yakutsk` - Asia/Yakutsk
        * `Asia/Yangon` - Asia/Yangon
        * `Asia/Yekaterinburg` - Asia/Yekaterinburg
        * `Asia/Yerevan` - Asia/Yerevan
        * `Atlantic/Azores` - Atlantic/Azores
        * `Atlantic/Bermuda` - Atlantic/Bermuda
        * `Atlantic/Canary` - Atlantic/Canary
        * `Atlantic/Cape_Verde` - Atlantic/Cape_Verde
        * `Atlantic/Faeroe` - Atlantic/Faeroe
        * `Atlantic/Faroe` - Atlantic/Faroe
        * `Atlantic/Jan_Mayen` - Atlantic/Jan_Mayen
        * `Atlantic/Madeira` - Atlantic/Madeira
        * `Atlantic/Reykjavik` - Atlantic/Reykjavik
        * `Atlantic/South_Georgia` - Atlantic/South_Georgia
        * `Atlantic/St_Helena` - Atlantic/St_Helena
        * `Atlantic/Stanley` - Atlantic/Stanley
        * `Australia/ACT` - Australia/ACT
        * `Australia/Adelaide` - Australia/Adelaide
        * `Australia/Brisbane` - Australia/Brisbane
        * `Australia/Broken_Hill` - Australia/Broken_Hill
        * `Australia/Canberra` - Australia/Canberra
        * `Australia/Currie` - Australia/Currie
        * `Australia/Darwin` - Australia/Darwin
        * `Australia/Eucla` - Australia/Eucla
        * `Australia/Hobart` - Australia/Hobart
        * `Australia/LHI` - Australia/LHI
        * `Australia/Lindeman` - Australia/Lindeman
        * `Australia/Lord_Howe` - Australia/Lord_Howe
        * `Australia/Melbourne` - Australia/Melbourne
        * `Australia/NSW` - Australia/NSW
        * `Australia/North` - Australia/North
        * `Australia/Perth` - Australia/Perth
        * `Australia/Queensland` - Australia/Queensland
        * `Australia/South` - Australia/South
        * `Australia/Sydney` - Australia/Sydney
        * `Australia/Tasmania` - Australia/Tasmania
        * `Australia/Victoria` - Australia/Victoria
        * `Australia/West` - Australia/West
        * `Australia/Yancowinna` - Australia/Yancowinna
        * `Brazil/Acre` - Brazil/Acre
        * `Brazil/DeNoronha` - Brazil/DeNoronha
        * `Brazil/East` - Brazil/East
        * `Brazil/West` - Brazil/West
        * `CET` - CET
        * `CST6CDT` - CST6CDT
        * `Canada/Atlantic` - Canada/Atlantic
        * `Canada/Central` - Canada/Central
        * `Canada/Eastern` - Canada/Eastern
        * `Canada/Mountain` - Canada/Mountain
        * `Canada/Newfoundland` - Canada/Newfoundland
        * `Canada/Pacific` - Canada/Pacific
        * `Canada/Saskatchewan` - Canada/Saskatchewan
        * `Canada/Yukon` - Canada/Yukon
        * `Chile/Continental` - Chile/Continental
        * `Chile/EasterIsland` - Chile/EasterIsland
        * `Cuba` - Cuba
        * `EET` - EET
        * `EST` - EST
        * `EST5EDT` - EST5EDT
        * `Egypt` - Egypt
        * `Eire` - Eire
        * `Etc/GMT` - Etc/GMT
        * `Etc/GMT+0` - Etc/GMT+0
        * `Etc/GMT+1` - Etc/GMT+1
        * `Etc/GMT+10` - Etc/GMT+10
        * `Etc/GMT+11` - Etc/GMT+11
        * `Etc/GMT+12` - Etc/GMT+12
        * `Etc/GMT+2` - Etc/GMT+2
        * `Etc/GMT+3` - Etc/GMT+3
        * `Etc/GMT+4` - Etc/GMT+4
        * `Etc/GMT+5` - Etc/GMT+5
        * `Etc/GMT+6` - Etc/GMT+6
        * `Etc/GMT+7` - Etc/GMT+7
        * `Etc/GMT+8` - Etc/GMT+8
        * `Etc/GMT+9` - Etc/GMT+9
        * `Etc/GMT-0` - Etc/GMT-0
        * `Etc/GMT-1` - Etc/GMT-1
        * `Etc/GMT-10` - Etc/GMT-10
        * `Etc/GMT-11` - Etc/GMT-11
        * `Etc/GMT-12` - Etc/GMT-12
        * `Etc/GMT-13` - Etc/GMT-13
        * `Etc/GMT-14` - Etc/GMT-14
        * `Etc/GMT-2` - Etc/GMT-2
        * `Etc/GMT-3` - Etc/GMT-3
        * `Etc/GMT-4` - Etc/GMT-4
        * `Etc/GMT-5` - Etc/GMT-5
        * `Etc/GMT-6` - Etc/GMT-6
        * `Etc/GMT-7` - Etc/GMT-7
        * `Etc/GMT-8` - Etc/GMT-8
        * `Etc/GMT-9` - Etc/GMT-9
        * `Etc/GMT0` - Etc/GMT0
        * `Etc/Greenwich` - Etc/Greenwich
        * `Etc/UCT` - Etc/UCT
        * `Etc/UTC` - Etc/UTC
        * `Etc/Universal` - Etc/Universal
        * `Etc/Zulu` - Etc/Zulu
        * `Europe/Amsterdam` - Europe/Amsterdam
        * `Europe/Andorra` - Europe/Andorra
        * `Europe/Astrakhan` - Europe/Astrakhan
        * `Europe/Athens` - Europe/Athens
        * `Europe/Belfast` - Europe/Belfast
        * `Europe/Belgrade` - Europe/Belgrade
        * `Europe/Berlin` - Europe/Berlin
        * `Europe/Bratislava` - Europe/Bratislava
        * `Europe/Brussels` - Europe/Brussels
        * `Europe/Bucharest` - Europe/Bucharest
        * `Europe/Budapest` - Europe/Budapest
        * `Europe/Busingen` - Europe/Busingen
        * `Europe/Chisinau` - Europe/Chisinau
        * `Europe/Copenhagen` - Europe/Copenhagen
        * `Europe/Dublin` - Europe/Dublin
        * `Europe/Gibraltar` - Europe/Gibraltar
        * `Europe/Guernsey` - Europe/Guernsey
        * `Europe/Helsinki` - Europe/Helsinki
        * `Europe/Isle_of_Man` - Europe/Isle_of_Man
        * `Europe/Istanbul` - Europe/Istanbul
        * `Europe/Jersey` - Europe/Jersey
        * `Europe/Kaliningrad` - Europe/Kaliningrad
        * `Europe/Kiev` - Europe/Kiev
        * `Europe/Kirov` - Europe/Kirov
        * `Europe/Kyiv` - Europe/Kyiv
        * `Europe/Lisbon` - Europe/Lisbon
        * `Europe/Ljubljana` - Europe/Ljubljana
        * `Europe/London` - Europe/London
        * `Europe/Luxembourg` - Europe/Luxembourg
        * `Europe/Madrid` - Europe/Madrid
        * `Europe/Malta` - Europe/Malta
        * `Europe/Mariehamn` - Europe/Mariehamn
        * `Europe/Minsk` - Europe/Minsk
        * `Europe/Monaco` - Europe/Monaco
        * `Europe/Moscow` - Europe/Moscow
        * `Europe/Nicosia` - Europe/Nicosia
        * `Europe/Oslo` - Europe/Oslo
        * `Europe/Paris` - Europe/Paris
        * `Europe/Podgorica` - Europe/Podgorica
        * `Europe/Prague` - Europe/Prague
        * `Europe/Riga` - Europe/Riga
        * `Europe/Rome` - Europe/Rome
        * `Europe/Samara` - Europe/Samara
        * `Europe/San_Marino` - Europe/San_Marino
        * `Europe/Sarajevo` - Europe/Sarajevo
        * `Europe/Saratov` - Europe/Saratov
        * `Europe/Simferopol` - Europe/Simferopol
        * `Europe/Skopje` - Europe/Skopje
        * `Europe/Sofia` - Europe/Sofia
        * `Europe/Stockholm` - Europe/Stockholm
        * `Europe/Tallinn` - Europe/Tallinn
        * `Europe/Tirane` - Europe/Tirane
        * `Europe/Tiraspol` - Europe/Tiraspol
        * `Europe/Ulyanovsk` - Europe/Ulyanovsk
        * `Europe/Uzhgorod` - Europe/Uzhgorod
        * `Europe/Vaduz` - Europe/Vaduz
        * `Europe/Vatican` - Europe/Vatican
        * `Europe/Vienna` - Europe/Vienna
        * `Europe/Vilnius` - Europe/Vilnius
        * `Europe/Volgograd` - Europe/Volgograd
        * `Europe/Warsaw` - Europe/Warsaw
        * `Europe/Zagreb` - Europe/Zagreb
        * `Europe/Zaporozhye` - Europe/Zaporozhye
        * `Europe/Zurich` - Europe/Zurich
        * `Factory` - Factory
        * `GB` - GB
        * `GB-Eire` - GB-Eire
        * `GMT` - GMT
        * `GMT+0` - GMT+0
        * `GMT-0` - GMT-0
        * `GMT0` - GMT0
        * `Greenwich` - Greenwich
        * `HST` - HST
        * `Hongkong` - Hongkong
        * `Iceland` - Iceland
        * `Indian/Antananarivo` - Indian/Antananarivo
        * `Indian/Chagos` - Indian/Chagos
        * `Indian/Christmas` - Indian/Christmas
        * `Indian/Cocos` - Indian/Cocos
        * `Indian/Comoro` - Indian/Comoro
        * `Indian/Kerguelen` - Indian/Kerguelen
        * `Indian/Mahe` - Indian/Mahe
        * `Indian/Maldives` - Indian/Maldives
        * `Indian/Mauritius` - Indian/Mauritius
        * `Indian/Mayotte` - Indian/Mayotte
        * `Indian/Reunion` - Indian/Reunion
        * `Iran` - Iran
        * `Israel` - Israel
        * `Jamaica` - Jamaica
        * `Japan` - Japan
        * `Kwajalein` - Kwajalein
        * `Libya` - Libya
        * `MET` - MET
        * `MST` - MST
        * `MST7MDT` - MST7MDT
        * `Mexico/BajaNorte` - Mexico/BajaNorte
        * `Mexico/BajaSur` - Mexico/BajaSur
        * `Mexico/General` - Mexico/General
        * `NZ` - NZ
        * `NZ-CHAT` - NZ-CHAT
        * `Navajo` - Navajo
        * `PRC` - PRC
        * `PST8PDT` - PST8PDT
        * `Pacific/Apia` - Pacific/Apia
        * `Pacific/Auckland` - Pacific/Auckland
        * `Pacific/Bougainville` - Pacific/Bougainville
        * `Pacific/Chatham` - Pacific/Chatham
        * `Pacific/Chuuk` - Pacific/Chuuk
        * `Pacific/Easter` - Pacific/Easter
        * `Pacific/Efate` - Pacific/Efate
        * `Pacific/Enderbury` - Pacific/Enderbury
        * `Pacific/Fakaofo` - Pacific/Fakaofo
        * `Pacific/Fiji` - Pacific/Fiji
        * `Pacific/Funafuti` - Pacific/Funafuti
        * `Pacific/Galapagos` - Pacific/Galapagos
        * `Pacific/Gambier` - Pacific/Gambier
        * `Pacific/Guadalcanal` - Pacific/Guadalcanal
        * `Pacific/Guam` - Pacific/Guam
        * `Pacific/Honolulu` - Pacific/Honolulu
        * `Pacific/Johnston` - Pacific/Johnston
        * `Pacific/Kanton` - Pacific/Kanton
        * `Pacific/Kiritimati` - Pacific/Kiritimati
        * `Pacific/Kosrae` - Pacific/Kosrae
        * `Pacific/Kwajalein` - Pacific/Kwajalein
        * `Pacific/Majuro` - Pacific/Majuro
        * `Pacific/Marquesas` - Pacific/Marquesas
        * `Pacific/Midway` - Pacific/Midway
        * `Pacific/Nauru` - Pacific/Nauru
        * `Pacific/Niue` - Pacific/Niue
        * `Pacific/Norfolk` - Pacific/Norfolk
        * `Pacific/Noumea` - Pacific/Noumea
        * `Pacific/Pago_Pago` - Pacific/Pago_Pago
        * `Pacific/Palau` - Pacific/Palau
        * `Pacific/Pitcairn` - Pacific/Pitcairn
        * `Pacific/Pohnpei` - Pacific/Pohnpei
        * `Pacific/Ponape` - Pacific/Ponape
        * `Pacific/Port_Moresby` - Pacific/Port_Moresby
        * `Pacific/Rarotonga` - Pacific/Rarotonga
        * `Pacific/Saipan` - Pacific/Saipan
        * `Pacific/Samoa` - Pacific/Samoa
        * `Pacific/Tahiti` - Pacific/Tahiti
        * `Pacific/Tarawa` - Pacific/Tarawa
        * `Pacific/Tongatapu` - Pacific/Tongatapu
        * `Pacific/Truk` - Pacific/Truk
        * `Pacific/Wake` - Pacific/Wake
        * `Pacific/Wallis` - Pacific/Wallis
        * `Pacific/Yap` - Pacific/Yap
        * `Poland` - Poland
        * `Portugal` - Portugal
        * `ROC` - ROC
        * `ROK` - ROK
        * `Singapore` - Singapore
        * `Turkey` - Turkey
        * `UCT` - UCT
        * `US/Alaska` - US/Alaska
        * `US/Aleutian` - US/Aleutian
        * `US/Arizona` - US/Arizona
        * `US/Central` - US/Central
        * `US/East-Indiana` - US/East-Indiana
        * `US/Eastern` - US/Eastern
        * `US/Hawaii` - US/Hawaii
        * `US/Indiana-Starke` - US/Indiana-Starke
        * `US/Michigan` - US/Michigan
        * `US/Mountain` - US/Mountain
        * `US/Pacific` - US/Pacific
        * `US/Samoa` - US/Samoa
        * `UTC` - UTC
        * `Universal` - Universal
        * `W-SU` - W-SU
        * `WET` - WET
        * `Zulu` - Zulu
    TokenProvisionInput:
      type: object
      description: |-
        Serializer for ConsolidatedTokenProvisionView POST input data.

        Unlike TokenProxyInputSerializer (which resolves an existing user by exactly
        one of user_id/username/email), provisioning needs a full identity to create
        the user on edX, so both username and email are required.
      properties:
        username:
          type: string
          description: Edx Username
        email:
          type: string
          format: email
          description: Edx Email
        name:
          type: string
          description: Optional full name for the new user
        platform_key:
          type: string
          description: Platform key the token should belong to
      required:
      - email
      - platform_key
      - username
    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
        edx_jwt_token:
          allOf:
          - $ref: '#/components/schemas/EdxJwtToken'
          description: edX JWT 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
        is_allowed:
          type: string
          readOnly: true
      required:
      - category
      - id
      - is_allowed
      - 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
    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
        crawler_extra_headers:
          type: object
          additionalProperties:
            type: string
          description: Extra HTTP headers the crawler sends on every request, as a
            flat object of string header names to string values.
        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.
        user_image_description:
          type: string
          description: Description of an image submitted by the user for RAG.
        github_access_token:
          type: string
          description: GitHub access token with repo scope. Required for private repositories.
      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
    TrainingStatusEnum:
      enum:
      - trained
      - failed
      - pending
      - untrained
      type: string
      description: |-
        * `trained` - Trained
        * `failed` - Failed
        * `pending` - Pending
        * `untrained` - Untrained
    TransactionTypeEnum:
      enum:
      - add
      - subtract
      - reserve
      - release
      - rollover
      - refund
      type: string
      description: |-
        * `add` - Add Credits
        * `subtract` - Subtract Credits
        * `reserve` - Reserve Credits
        * `release` - Release Reserved Credits
        * `rollover` - Rollover Credits
        * `refund` - Refund Credits
    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
      - azure_openai
      type: string
      description: |-
        * `openai` - Openai
        * `google` - Google
        * `elevenlabs` - Elevenlabs
        * `azure_openai` - Azure Openai
    TypeF30Enum:
      enum:
      - ACTIVITY_COURSE_MILESTONE
      - ACTIVITY_NEW_CONTENT
      - ADMIN_NOTIF_COURSE_ENROLLMENT
      - APP_REGISTRATION
      - COURSE_INVITATION
      - COURSE_LICENSE_ASSIGNMENT
      - COURSE_LICENSE_GROUP_ASSIGNMENT
      - COURSE_SCHEDULE_CHANGE
      - CRM_DEAL_STAGE_CHANGED
      - CRM_PERSON_CREATED
      - CRM_PERSON_LINKED_TO_USER
      - CUSTOM_NOTIFICATION
      - DEFAULT_TEMPLATE
      - HUMAN_SUPPORT_NOTIFICATION
      - HUMAN_SUPPORT_TICKET_MESSAGE
      - PATHWAY_ENROLLMENT_CONFIRMATION
      - PLATFORM_APPLICATION_DECISION
      - PLATFORM_INVITATION
      - POLICY_ASSIGNMENT
      - PROACTIVE_LEARNER_NOTIFICATION
      - PROGRAM_ENROLLMENT_CONFIRMATION
      - PROGRAM_INVITATION
      - PROGRAM_LICENSE_ASSIGNMENT
      - PROGRAM_LICENSE_GROUP_ASSIGNMENT
      - REPORT_COMPLETED
      - ROLE_CHANGE
      - SKILL_MASTERY_CHANGE
      - SPEND_CAP_ALERT
      - SUBSECTION_GRADE_UPDATE
      - USER_LICENSE_ASSIGNMENT
      - USER_LICENSE_GROUP_ASSIGNMENT
      - USER_NOTIF_COURSE_COMPLETION
      - USER_NOTIF_COURSE_ENROLLMENT
      - USER_NOTIF_CREDENTIALS
      - USER_NOTIF_LEARNER_PROGRESS
      - USER_NOTIF_USER_INACTIVITY
      - USER_NOTIF_USER_REGISTRATION
      - COURSES_PROGRESS_SUMMARY
      type: string
      description: |-
        * `ACTIVITY_COURSE_MILESTONE` - Activity Course Milestone
        * `ACTIVITY_NEW_CONTENT` - Activity New Content
        * `ADMIN_NOTIF_COURSE_ENROLLMENT` - Admin Notif Course Enrollment
        * `APP_REGISTRATION` - App Registration
        * `COURSE_INVITATION` - Course Invitation
        * `COURSE_LICENSE_ASSIGNMENT` - Course License Assignment
        * `COURSE_LICENSE_GROUP_ASSIGNMENT` - Course License Group Assignment
        * `COURSE_SCHEDULE_CHANGE` - Course Schedule Change
        * `CRM_DEAL_STAGE_CHANGED` - Crm Deal Stage Changed
        * `CRM_PERSON_CREATED` - Crm Person Created
        * `CRM_PERSON_LINKED_TO_USER` - Crm Person Linked To User
        * `CUSTOM_NOTIFICATION` - Custom Notification
        * `DEFAULT_TEMPLATE` - Default Template
        * `HUMAN_SUPPORT_NOTIFICATION` - Human Support Notification
        * `HUMAN_SUPPORT_TICKET_MESSAGE` - Human Support Ticket Message
        * `PATHWAY_ENROLLMENT_CONFIRMATION` - Pathway Enrollment Confirmation
        * `PLATFORM_APPLICATION_DECISION` - Platform Application Decision
        * `PLATFORM_INVITATION` - Platform Invitation
        * `POLICY_ASSIGNMENT` - Policy Assignment
        * `PROACTIVE_LEARNER_NOTIFICATION` - Proactive Learner Notification
        * `PROGRAM_ENROLLMENT_CONFIRMATION` - Program Enrollment Confirmation
        * `PROGRAM_INVITATION` - Program Invitation
        * `PROGRAM_LICENSE_ASSIGNMENT` - Program License Assignment
        * `PROGRAM_LICENSE_GROUP_ASSIGNMENT` - Program License Group Assignment
        * `REPORT_COMPLETED` - Report Completed
        * `ROLE_CHANGE` - Role Change
        * `SKILL_MASTERY_CHANGE` - Skill Mastery Change
        * `SPEND_CAP_ALERT` - Spend Cap Alert
        * `SUBSECTION_GRADE_UPDATE` - Subsection Grade Update
        * `USER_LICENSE_ASSIGNMENT` - User License Assignment
        * `USER_LICENSE_GROUP_ASSIGNMENT` - User License Group Assignment
        * `USER_NOTIF_COURSE_COMPLETION` - User Notif Course Completion
        * `USER_NOTIF_COURSE_ENROLLMENT` - User Notif Course Enrollment
        * `USER_NOTIF_CREDENTIALS` - User Notif Credentials
        * `USER_NOTIF_LEARNER_PROGRESS` - User Notif Learner Progress
        * `USER_NOTIF_USER_INACTIVITY` - User Notif User Inactivity
        * `USER_NOTIF_USER_REGISTRATION` - User Notif User Registration
        * `COURSES_PROGRESS_SUMMARY` - User Progress Summary
    UpdateXblock:
      type: object
      description: Validate input for updating an xblock.
      properties:
        xblock_id:
          type: string
          description: The xblock locator to update.
        display_name:
          type: string
          description: New display name.
        content:
          type: string
          description: New HTML content. Only applicable to component blocks (html,
            problem).
      required:
      - xblock_id
    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
    UserChatHistoryFilterData:
      type: object
      description: Filter options for user-scoped chat history (no users field - always
        self).
      properties:
        topics:
          type: array
          items:
            $ref: '#/components/schemas/TopicModel'
        date_ranges:
          type: array
          items:
            $ref: '#/components/schemas/DateRange'
        sentiment:
          type: array
          items:
            type: string
      required:
      - topics
    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
    UserChatPrivacySettings:
      type: object
      description: Serializer for user chat privacy settings.
      properties:
        chat_privacy_mode:
          allOf:
          - $ref: '#/components/schemas/ChatPrivacyModeEnum'
          description: |-
            User's global chat privacy preference

            * `normal` - Normal
            * `anonymized` - Anonymized
            * `disabled` - Disabled
        chat_privacy_enabled:
          type: boolean
          readOnly: true
          description: Whether chat privacy control is enabled for this platform
      required:
      - chat_privacy_enabled
    UserCountRecord:
      type: object
      properties:
        date:
          type: string
          format: date
        user_count:
          type: integer
      required:
      - date
      - user_count
    UserDefaultMentor:
      type: object
      description: |-
        Serializes a user's default mentor as the underlying mentor's fields.

        Shaped like ``RecentlyAccessedMentorModelSerializer`` so the frontend can
        render the default mentor the same way as starred/recent entries.
      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
        platform_key:
          type: string
          nullable: true
          readOnly: true
        created_by:
          type: string
          nullable: true
          readOnly: true
        student:
          type: string
          readOnly: true
        updated_at:
          type: string
          readOnly: true
      required:
      - created_by
      - description
      - id
      - name
      - platform_key
      - slug
      - student
      - unique_id
      - updated_at
    UserDefaultPlatformGetResponse:
      type: object
      properties:
        platform_key:
          type: string
          nullable: true
        platform_org:
          type: string
          nullable: true
      required:
      - platform_key
      - platform_org
    UserDefaultPlatformPostRequest:
      type: object
      properties:
        platform_key:
          type: string
      required:
      - platform_key
    UserDefaultPlatformPostResponse:
      type: object
      properties:
        message:
          type: string
      required:
      - message
    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
    UserDemographicsResponse:
      type: object
      properties:
        username:
          type: string
          readOnly: true
        gender:
          description: |-
            Gender identity. One of: male, female, non_binary, prefer_not_to_say, other.

            * `male` - Male
            * `female` - Female
            * `non_binary` - Non-binary
            * `prefer_not_to_say` - Prefer not to say
            * `other` - Other
          oneOf:
          - $ref: '#/components/schemas/GenderEnum'
          - $ref: '#/components/schemas/BlankEnum'
        ethnicity:
          description: |-
            Ethnic background. See Ethnicity enum for valid values.

            * `american_indian_alaska_native` - American Indian or Alaska Native
            * `asian` - Asian
            * `black_african_american` - Black or African American
            * `hispanic_latino` - Hispanic or Latino
            * `native_hawaiian_pacific_islander` - Native Hawaiian or Other Pacific Islander
            * `white` - White
            * `two_or_more` - Two or more races
            * `prefer_not_to_say` - Prefer not to say
            * `other` - Other
          oneOf:
          - $ref: '#/components/schemas/EthnicityEnum'
          - $ref: '#/components/schemas/BlankEnum'
        date_of_birth:
          type: string
          format: date
          nullable: true
          description: Date of birth in YYYY-MM-DD format.
        primary_language:
          type: string
          description: Primary language as ISO 639-1 code, e.g. 'en', 'es'.
          maxLength: 10
        country_of_birth:
          type: string
          description: Country of birth as ISO 3166-1 alpha-3 code, e.g. 'USA', 'MEX'.
          maxLength: 3
        nationality:
          type: string
          description: Nationality as ISO 3166-1 alpha-3 code, e.g. 'USA', 'MEX'.
          maxLength: 3
        disability_status:
          description: |-
            Disability status. One of: yes, no, prefer_not_to_say.

            * `yes` - Yes
            * `no` - No
            * `prefer_not_to_say` - Prefer not to say
          oneOf:
          - $ref: '#/components/schemas/DisabilityStatusEnum'
          - $ref: '#/components/schemas/BlankEnum'
        custom_fields:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - created_at
      - custom_fields
      - updated_at
      - username
    UserDemographicsWrite:
      type: object
      properties:
        gender:
          default: ''
          description: |-
            Gender identity. One of: male, female, non_binary, prefer_not_to_say, other.

            * `male` - Male
            * `female` - Female
            * `non_binary` - Non-binary
            * `prefer_not_to_say` - Prefer not to say
            * `other` - Other
          oneOf:
          - $ref: '#/components/schemas/GenderEnum'
          - $ref: '#/components/schemas/BlankEnum'
        ethnicity:
          default: ''
          description: |-
            Ethnic background. See Ethnicity enum for valid values.

            * `american_indian_alaska_native` - American Indian or Alaska Native
            * `asian` - Asian
            * `black_african_american` - Black or African American
            * `hispanic_latino` - Hispanic or Latino
            * `native_hawaiian_pacific_islander` - Native Hawaiian or Other Pacific Islander
            * `white` - White
            * `two_or_more` - Two or more races
            * `prefer_not_to_say` - Prefer not to say
            * `other` - Other
          oneOf:
          - $ref: '#/components/schemas/EthnicityEnum'
          - $ref: '#/components/schemas/BlankEnum'
        date_of_birth:
          type: string
          format: date
          nullable: true
          description: Date of birth in YYYY-MM-DD format.
        primary_language:
          type: string
          default: ''
          description: Primary language as ISO 639-1 code, e.g. 'en', 'es'.
          maxLength: 10
        country_of_birth:
          type: string
          default: ''
          description: Country of birth as ISO 3166-1 alpha-3 code, e.g. 'USA', 'MEX'.
          maxLength: 3
        nationality:
          type: string
          default: ''
          description: Nationality as ISO 3166-1 alpha-3 code, e.g. 'USA', 'MEX'.
          maxLength: 3
        disability_status:
          default: ''
          description: |-
            Disability status. One of: yes, no, prefer_not_to_say.

            * `yes` - Yes
            * `no` - No
            * `prefer_not_to_say` - Prefer not to say
          oneOf:
          - $ref: '#/components/schemas/DisabilityStatusEnum'
          - $ref: '#/components/schemas/BlankEnum'
        custom_fields:
          type: object
          additionalProperties: {}
          description: 'Custom field values as {slug: value} pairs. Slugs must match
            active field definitions.'
    UserDetail:
      type: object
      properties:
        username:
          type: string
          nullable: true
        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
      - username
    UserEdxMemory:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        username:
          type: string
          readOnly: true
        student:
          type: integer
          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
    UserGroup:
      type: object
      description: Serializer for UserGroups.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          nullable: true
          description: Group display name
          maxLength: 255
        platform:
          allOf:
          - $ref: '#/components/schemas/RbacPlatform'
          readOnly: true
        platform_key:
          type: string
          description: The platform key
          writeOnly: true
        description:
          type: string
          nullable: true
          description: Group description
        owner:
          allOf:
          - $ref: '#/components/schemas/RbacUser'
          readOnly: true
        users_to_set:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of user IDs to set in this group (replaces all existing
            users)
      required:
      - id
      - name
      - owner
      - platform
      - platform_key
    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
          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
    UserGroupPolicy:
      type: object
      description: |-
        Serializer for usergroup-specific RBAC policies using ModelSerializer pattern.
        Accepts usergroup_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 usergroup belongs
          writeOnly: true
        usergroup_id:
          type: integer
          writeOnly: true
          description: ID of the usergroup to manage access for
        role:
          type: string
          description: Role for accessing this usergroup (read, edit, view analytics,
            send notifications)
        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 RbacGroup IDs to grant access to this usergroup
        groups_to_remove:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of RbacGroup IDs to revoke access from this usergroup
        users_to_add:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of user IDs to grant access to this usergroup
        users_to_remove:
          type: array
          items:
            type: integer
          writeOnly: true
          description: List of user IDs to revoke access from this usergroup
      required:
      - groups
      - id
      - name
      - platform_key
      - resources
      - role
      - usergroup_id
      - users
    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
        total_agent_cost_usd:
          type: string
          format: decimal
          pattern: ^-?\d{0,10}(?:\.\d{0,4})?$
          nullable: true
          description: Total amount the user has spent across all agents, in USD.
            May be slightly higher than the sum of the per-agent cost_usd values.
      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
    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
    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
    UserNotificationPreferences:
      type: object
      description: Serializer for user notification preferences.
      properties:
        email_enabled:
          type: boolean
        push_enabled:
          type: boolean
        notification_frequency:
          $ref: '#/components/schemas/NotificationFrequencyEnum'
        type_preferences:
          readOnly: true
          description: 'Per-type overrides: {"ACTIVITY_NEW_CONTENT": {"enabled": true,
            "frequency": "daily"}, ...}'
      required:
      - type_preferences
    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
        is_enterprise:
          type: string
          readOnly: true
        is_default:
          type: string
          readOnly: true
        show_paywall:
          type: boolean
          readOnly: true
        enable_monetization:
          type: boolean
          readOnly: true
      required:
      - cms_url
      - email
      - enable_monetization
      - is_default
      - is_enterprise
      - key
      - lms_url
      - org
      - platform_name
      - portal_url
      - public
      - show_paywall
      - 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
    UserPlatformMetadata:
      type: object
      description: Read serializer for user platform metadata.
      properties:
        username:
          type: string
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        metadata: {}
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
      - created_at
      - metadata
      - platform_key
      - updated_at
      - username
    UserPlatformMetadataReplace:
      type: object
      properties:
        metadata: {}
      required:
      - metadata
    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
    UserReportListResponse:
      type: object
      properties:
        reports:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: List of user's reports with their status
      required:
      - reports
    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
    VersionNestedArtifact:
      type: object
      description: |-
        Artifact embedded in a version row, where the row carries the text.

        ``ArtifactVersion.content`` is the same string ``Artifact.get_content()``
        returns for the current version, so repeating it here would double every
        text payload. Session open uses ``NestedArtifactSerializer``, which keeps
        ``content``, because no version row accompanies the artifact there.
      properties:
        id:
          type: integer
          readOnly: true
        title:
          type: string
          description: Title or identifier for the artifact
          maxLength: 255
        content:
          type: string
          description: Always empty on a version's artifact; read the row's `content`.
          readOnly: true
        binary_content:
          type: string
          readOnly: true
          description: Always null on an embedded artifact; fetch the artifact (or
            the current version) for the bytes.
        is_binary:
          type: boolean
          readOnly: true
          description: True when the artifact carries `binary_content` instead of
            `content`
        mime_type:
          type: string
          readOnly: true
          description: MIME type of a binary artifact, e.g. application/pdf.
        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
        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
          nullable: true
          readOnly: true
        current_version_number:
          type: integer
          description: Version number of the current version
          readOnly: true
        version_count:
          type: integer
          description: Total number of versions for this artifact
          readOnly: true
      required:
      - binary_content
      - content
      - current_version_number
      - date_created
      - date_updated
      - file_extension
      - id
      - is_binary
      - llm_name
      - llm_provider
      - mime_type
      - session_id
      - title
      - username
      - version_count
    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
    VirtualMachineEgressEnum:
      enum:
      - none
      - registries
      - public
      type: string
      description: |-
        * `none` - None
        * `registries` - Registries
        * `public` - Public
    Voice:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        provider:
          $ref: '#/components/schemas/VoiceProviderEnum'
        language:
          type: string
          maxLength: 255
        description:
          type: string
        audio_url:
          type: string
          readOnly: true
      required:
      - audio_url
      - id
      - name
      - provider
    VoiceProviderEefEnum:
      enum:
      - browser
      - openai
      - google
      - iblai
      type: string
      description: |-
        * `browser` - Browser
        * `openai` - OpenAI
        * `google` - Google
        * `iblai` - ibl.ai
    VoiceProviderEnum:
      enum:
      - browser
      - openai
      - google
      - iblai
      - elevenlabs
      type: string
      description: |-
        * `browser` - Browser
        * `openai` - Openai
        * `google` - Google
        * `iblai` - ibl.ai
        * `elevenlabs` - Elevenlabs
    WakeModeEnum:
      enum:
      - now
      - next-heartbeat
      type: string
      description: |-
        * `now` - now
        * `next-heartbeat` - next-heartbeat
    WakeRequest:
      type: object
      description: Body for ``POST wake/`` — sent to the ``wake`` RPC.
      properties:
        text:
          type: string
        mode:
          allOf:
          - $ref: '#/components/schemas/WakeModeEnum'
          default: now
      required:
      - text
    WakeResponse:
      type: object
      description: |-
        Documents the ``wake`` RPC response.

        The upstream ``context.cron.wake(...)`` shape isn't pinned in the
        published docs; fields here are the ones consistently observed in
        practice.  Treat as best-effort — additional fields may be present.
      properties:
        ok:
          type: boolean
        scheduled:
          type: boolean
        sessionKey:
          type: string
        runId:
          type: string
        nextRunAtMs:
          type: integer
    WatchedGroupCreate:
      type: object
      description: |-
        Payload for POST /watched-groups/.

        Platform is resolved by the view (auth token for normal callers, query
        param or body `platform_key` for service accounts) and passed via
        `context["platform"]`. The body `platform_key` field is consumed by the
        view, not the serializer.

        `owner_id` is reserved for service-account callers. Platform users are
        implicitly the owner; specifying `owner_id` from a platform user yields 400.
      properties:
        watched_users:
          type: array
          items:
            type: integer
            description: edX user ID
        name:
          type: string
        watchers:
          type: array
          items:
            $ref: '#/components/schemas/WatcherEntry'
        owner_id:
          type: integer
          description: edX user ID
          writeOnly: true
          nullable: true
      required:
      - name
    WatchedGroupDetail:
      type: object
      description: |-
        Detail shape — counts plus opt-in inline collections.

        `watchers` honors `watcher_limit` from context (default 0).
        `watched_users` honors `watched_user_limit` from context (default 0).
        Use the dedicated sub-resources for paginated walks.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        watcher_count:
          type: integer
          readOnly: true
        watchers:
          type: array
          items: {}
          readOnly: true
        watched_user_count:
          type: integer
          readOnly: true
        watched_users:
          type: array
          items: {}
          readOnly: true
      required:
      - id
      - name
      - platform_key
      - watched_user_count
      - watched_users
      - watcher_count
      - watchers
    WatchedGroupList:
      type: object
      description: Lean shape for list responses — no watchers, no watched_users,
        no counts.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          readOnly: true
        platform_key:
          type: string
          readOnly: true
      required:
      - id
      - name
      - platform_key
    WatchedGroupUpdate:
      type: object
      description: |-
        Payload for PATCH /watched-groups/{pk}/ — name only.

        Watchers are managed via /watchers/; watched users via /watched-users/.
      properties:
        name:
          type: string
    WatchedUserRead:
      type: object
      description: |-
        Output for a single user inside a WatchedGroup.

        The entity is the user — `id` is the user's id (matching the URL pk). The
        underlying `UserGroupLink.id` is a routing artifact and isn't surfaced.
      properties:
        id:
          type: integer
          readOnly: true
        username:
          type: string
          readOnly: true
        email:
          type: string
          format: email
          readOnly: true
      required:
      - email
      - id
      - username
    WatchedUserWrite:
      type: object
      description: Payload for POST /watched-groups/{wg_pk}/watched-users/.
      properties:
        user_id:
          type: integer
          description: edX user ID
      required:
      - user_id
    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
    WatcherEntry:
      type: object
      description: 'A single watcher entry in the create payload: who watches and
        which events.'
      properties:
        watcher_id:
          type: integer
        events:
          type: array
          items:
            $ref: '#/components/schemas/EventsEnum'
      required:
      - watcher_id
    WatcherRead:
      type: object
      description: |-
        Output for a watcher (a user watching a WatchedGroup).

        The entity is the user — `id` is the watcher's user id (matching the URL
        pk). The underlying `WatcherToWatchedGroup.id` is a routing artifact and
        isn't surfaced.
      properties:
        id:
          type: integer
          readOnly: true
        username:
          type: string
          readOnly: true
        email:
          type: string
          format: email
          readOnly: true
        events:
          description: List of events the watcher is subscribed to for this group
      required:
      - email
      - id
      - username
    WatcherUpdate:
      type: object
      description: Payload for PATCH /watched-groups/{wg_pk}/watchers/{pk}/ — events
        only.
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/EventsEnum'
      required:
      - events
    WatcherWrite:
      type: object
      description: Payload for POST /watched-groups/{wg_pk}/watchers/.
      properties:
        watcher_id:
          type: integer
          description: edX user ID
        events:
          type: array
          items:
            $ref: '#/components/schemas/EventsEnum'
      required:
      - watcher_id
    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
          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
    Workflow:
      type: object
      description: |-
        Serializer for Workflow CRUD operations.

        Provides basic ReactFlow JSON validation (Phase 1) to ensure definitions
        are renderable, while allowing draft workflows that may not be executable.

        Comprehensive execution validation (Phase 2) is available via the
        validate action endpoint.

        Fields:
        - All model fields are exposed
        - Platform and creator are set automatically from URL context
        - Read-only fields: id, unique_id, created_at, updated_at
        - Chat settings (chat_name, chat_greeting, etc.) update the entry_mentor
      properties:
        id:
          type: integer
          readOnly: true
        unique_id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
        definition:
          description: Workflow definition in ReactFlow format
        is_active:
          type: boolean
        is_template:
          type: boolean
        parent_workflow:
          type: integer
          nullable: true
          description: Parent workflow if this is a template variant
        platform:
          type: integer
          readOnly: true
        platform_key:
          type: string
          readOnly: true
        platform_name:
          type: string
          readOnly: true
        created_by:
          type: integer
          description: edX user ID
          readOnly: true
        created_by_username:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        node_count:
          type: integer
          description: Get the number of nodes in the workflow definition.
          readOnly: true
        edge_count:
          type: integer
          description: Get the number of edges in the workflow definition.
          readOnly: true
        entry_mentor_id:
          type: string
          format: uuid
          readOnly: true
        chat_name:
          type: string
          description: Display name for chat (updates entry_mentor.name)
        chat_proactive_response:
          type: string
          description: Proactive greeting message for chat (updates entry_mentor.proactive_response)
      required:
      - created_at
      - created_by
      - created_by_username
      - definition
      - edge_count
      - entry_mentor_id
      - id
      - name
      - node_count
      - platform
      - platform_key
      - platform_name
      - unique_id
      - updated_at
    XblockResult:
      type: object
      description: Standard response for xblock operations.
      properties:
        success:
          type: boolean
        detail:
          type: string
        xblock_id:
          type: string
        extra: {}
      required:
      - detail
      - success
    XblockTypeEnum:
      enum:
      - section
      - subsection
      - unit
      - html
      - problem
      - video
      type: string
      description: |-
        * `section` - section
        * `subsection` - subsection
        * `unit` - unit
        * `html` - html
        * `problem` - problem
        * `video` - video
    _TagAttachRequest:
      type: object
      properties:
        tag_id:
          type: integer
          minimum: 1
          description: Id of the Tag to attach. Must belong to your Platform.
      required:
      - tag_id
  securitySchemes:
    PlatformApiKeyAuthentication:
      type: apiKey
      in: header
      name: Authorization
      description: 'Example: Api-Token <your-token>'
servers:
- url: https://base.manager.iblai.app
