Skip to content
StudyFetch API

Performance Insights

Generate performance insights embed

Creates an embeddable URL and token for the Performance Insights dashboard. Requires a TrueLearn userContextJwt to authenticate data access.

OpenAPI specification
POST/api/v1/performance-insights/embed

Authentication

x-api-key

Request

curl --globoff --request POST \
  --url 'https://api.example.com/api/v1/performance-insights/embed' \
  --header 'x-api-key: <API_KEY>' \
  --header 'Content-Type: application/json' \
  --data-raw '{}'

Replace credential and <field> placeholders with your own values. URL placeholders appear as %3Cfield%3E. Review the example values before sending your request.

Replace https://api.example.com with the API server URL.

Use the sample JSON body as your starting point, and enter values that match the endpoint's schema.

Request body schema or example

{
  "type": "object",
  "properties": {
    "userId": {
      "type": "string",
      "description": "User ID for tracking"
    },
    "studentName": {
      "type": "string",
      "description": "Student name for display and tracking"
    },
    "groupIds": {
      "description": "Group IDs for collaboration",
      "example": [
        "class-101",
        "class-102"
      ],
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "sessionId": {
      "type": "string",
      "description": "Session ID for continuity"
    },
    "theme": {
      "description": "Theme customization",
      "allOf": [
        {
          "type": "object",
          "properties": {
            "primaryColor": {
              "type": "string",
              "description": "Primary color (hex)"
            },
            "secondaryColor": {
              "type": "string",
              "description": "Secondary color (hex)"
            },
            "backgroundColor": {
              "type": "string",
              "description": "Background color (hex)"
            },
            "textColor": {
              "type": "string",
              "description": "Text color (hex)"
            },
            "fontFamily": {
              "type": "string",
              "description": "Font family"
            },
            "fontSize": {
              "type": "string",
              "description": "Font size"
            },
            "borderRadius": {
              "type": "string",
              "description": "Border radius"
            },
            "padding": {
              "type": "string",
              "description": "Padding"
            },
            "logoUrl": {
              "type": "string",
              "description": "Logo URL"
            },
            "hideBranding": {
              "type": "boolean",
              "description": "Hide branding"
            }
          }
        }
      ]
    },
    "features": {
      "description": "Feature toggles",
      "allOf": [
        {
          "type": "object",
          "properties": {
            "enableWebSearch": {
              "type": "boolean",
              "description": "Enable web search"
            },
            "enableHistory": {
              "type": "boolean",
              "description": "Enable history"
            },
            "enableVoice": {
              "type": "boolean",
              "description": "Enable voice input"
            },
            "enableFollowUps": {
              "type": "boolean",
              "description": "Enable follow-up questions"
            },
            "enableComponentCreation": {
              "type": "boolean",
              "description": "Enable component creation"
            },
            "placeholderText": {
              "type": "string",
              "description": "Placeholder text"
            },
            "enableWebSearchSources": {
              "type": "boolean",
              "description": "Enable web search sources"
            },
            "enableImageSources": {
              "type": "boolean",
              "description": "Enable image sources"
            },
            "enableTranscript": {
              "type": "boolean",
              "description": "Enable transcript"
            },
            "enableOutline": {
              "type": "boolean",
              "description": "Enable outline"
            },
            "enableBadWordsFilter": {
              "type": "boolean",
              "description": "Enable bad words filter"
            },
            "enableGuardrails": {
              "type": "boolean",
              "description": "Enable guardrails"
            },
            "enablePromptingScore": {
              "type": "boolean",
              "description": "Enable prompting quality score",
              "default": true
            },
            "enableResponsibilityScore": {
              "type": "boolean",
              "description": "Enable learning responsibility score",
              "default": true
            },
            "enableReferenceMode": {
              "type": "boolean",
              "description": "Enable reference mode - show references instead of source content"
            },
            "enableFeedback": {
              "type": "boolean",
              "description": "Enable thumbs up/down feedback with reason",
              "default": true
            },
            "hideTitle": {
              "type": "boolean",
              "description": "Hide the chat title and avatar in the embedded component"
            },
            "emptyStateHtml": {
              "type": "string",
              "description": "Custom HTML to show in empty state instead of default icon and text"
            },
            "hideEmptyState": {
              "type": "boolean",
              "description": "Hide the default empty state (icon and text)"
            }
          },
          "required": [
            "enableBadWordsFilter"
          ]
        }
      ]
    },
    "width": {
      "type": "string",
      "description": "Embed width (e.g., \"100%\", \"600px\")"
    },
    "height": {
      "type": "string",
      "description": "Embed height (e.g., \"400px\", \"100vh\")"
    },
    "expiryHours": {
      "type": "number",
      "description": "Token expiry time in hours",
      "default": 1
    }
  }
}

Responses

201Embed URL and token generated
{
  "type": "object",
  "properties": {
    "embedUrl": {
      "type": "string",
      "description": "Full embed URL for iframe integration"
    },
    "token": {
      "type": "string",
      "description": "JWT embed token"
    },
    "expiresAt": {
      "format": "date-time",
      "type": "string",
      "description": "Token expiration timestamp (1 hour from creation)"
    },
    "componentId": {
      "type": "string",
      "description": "Resolved component id backing this embed. Stable across calls sharing the same organization + label, so it can be passed back as componentId on a later call to target the same record explicitly."
    }
  },
  "required": [
    "embedUrl",
    "token",
    "expiresAt",
    "componentId"
  ]
}
400userContextJwt is required