Skip to main content
Version: v2

Introduction

As part of Anywhere: Activation, the Sessions API provides access to session event data and device context for real-time activation and artificial intelligence use cases. Designed for real-time inspection and online inferencing, this API will return data within seconds of events being captured.

Developers can access real-time session data in three different formats: raw event data, session context data, or AI-generated session summaries. See below for an overview of each approach.

This API is not intended for use for data export or transformation. For data export use cases, see Anywhere: Warehouse.

Version: 1.0beta

Authentication


The HTTP API requires an API key that you can generate from the Fullstory app. The API key must have Admin or Architect level permissions for requests which retrieve data. The header value takes the form "Basic {YOUR_API_KEY}".

Security Scheme Type:apiKey
Header parameter name:Authorization

Sessions API Overview

The Sessions API provides three ways for getting real-time session data out of Fullstory: raw event data, session context data, and AI-generated session summaries. The specific approach you take will depend on your use case.

ApproachPrimary API Endpoint(s)Use Case & API Strategy
Raw Event DataGet Session EventsUse Case: You need real-time access to raw event data exactly as it appears in Fullstory for your own custom processing.

API Strategy: Returns the full, untransformed set of captured events for a specified session.
Contextual Data for AIGenerate ContextUse Case: You need to provide structured session context to a generative AI or large language model (LLM) that you control.

API Strategy: Returns session events that are lightly transformed and structured for optimal consumption by an AI model.
AI-Generated Session SummariesCreate Profile*
Generate Summary
Use Case: You want to use Fullstory's AI to generate a text or JSON-based summary based on a set of prompt instructions you define.

API Strategy: First, create one or more Profiles with LLM prompting instructions, data configuration, and JSON response schema. Then, generate a summary based on the profile(s) you defined.

See below for guidance.

*NOTE: APIs for profile management include: Create, Get, Update, Delete, and List.

Generate Summary Overview

Fullstory's Session Summary API provides AI-generated summaries of user sessions. Generating a summary is a two-step process:

  1. Create a summary prompt profile that defines the kind of summary you want.
  2. Generate the session summary that uses the config profile id from the previous step.

You can configure the summary prompt profile to return the summary as plain text or as a structured JSON object that conforms to a specific JSON schema you define.

llm Prompt Defaults

Within the llm object, you can provide prompt instructions to guide the AI-generated results. These are the defaults:

  • prePrompt: “The following json encodes a user session as a sequence of page views and events, comprising the user's experience. Keep in mind the data is raw, and some values may not be relevant.”
  • postPrompt: “Please summarize the user's experience.”

Both properties can be customized to instruct the AI to format the session summary to your specific needs.

Example: Plain Text Summary

The following is a request body for a summary profile that's trimmed to the most recent ten minutes of the session, excludes the user's location and Fullstory account information, trims events to the last two selectors, and excludes API events. The pre_prompt is unchanged from the default while the post_prompt has been adapted to the context of a vehicle rental site and light text formatting has been specified.

{
"slice": {
"mode": "LAST",
"duration_limit_ms": 600000
},
"context": {
"exclude": [ "org", "location"]
},
"events": {
"trim_to_last_n_selectors": 2,
"exclude_api_events": true
},
"llm": {
"pre_prompt": "The following json encodes a user session as a sequence of page views and events, comprising the user's experience. Keep in mind the data is raw, and some values may not be relevant.",
"post_prompt": "Provide a bulleted list of the names of any rental vehicles the user viewed during their session. Below the list of vehicles, provide a summary of the user's experience. Use the following template:\n\n*Vehicles Viewed*\n\n<bulleted list of vehicles viewed>\n\n*Quick Summary*\n\n<one paragraph summary>\n\n*Frustration Signals*\n\n<bulleted list of frustration signals identified>"
}
}

Here's an example response of the above summary profile used with Generate Summary:

{
"summary": "*Vehicles Viewed*\n\n* Honda NT1100 2022\n* Honda TRX250 (FourTrax 250) 2021\n\n*Quick Summary*\n\nThe user began their session on a promotional landing page, likely from a Google ad campaign. They then attempted to book a car rental in Savannah, Georgia, but encountered an error indicating no cars were available. They then returned to the homepage and attempted to log in, but the login attempt failed. The user then successfully searched for a car rental in Tokyo, Japan. They viewed details for a Honda NT1100 2022 and a Honda TRX250 (FourTrax 250) 2021. The user selected the Honda NT1100 2022, proceeded through the booking process, applied a promo code, and successfully completed the checkout. The user then viewed the details of the Honda TRX250 (FourTrax 250) 2021, but found it unavailable for the selected dates.\n\n*Frustration Signals*\n\n* Encountered a 404 network error when searching for cars in Savannah, Georgia.\n* Failed login attempt.\n* The user had to re-enter the search criteria multiple times.\n* The user was shown an \"Unavailable\" tag for a vehicle.\n"
}

Example: Response Schema

When creating a prompt profile, you can use the llm.response_schema object to specify a desired JSON structure for the summary. This allows you to receive a predictable, parsable JSON object in the response, which is ideal for programmatically handling the summary data.

The llm.response_schema defines the JSON schema for the model's output. The LLM response is highly reliable at conforming to this schema, ensuring a structured and predictable format.

This implementation adheres to the JSON Schema specification, with two exceptions:

  1. All type values must be capitalized (e.g., OBJECT, STRING, ARRAY, etc.).
  2. The $schema and $id properties are not supported and must be omitted from the schema definition.

The following is a request body for a summary profile that's trimmed to the most recent ten minutes of the session, excludes the user's location and Fullstory account information, trims events to the last two selectors, and excludes API events. The pre_prompt is unchanged from the default while the post_prompt has been modified to direct the LLM to the supplied response_schema.

{
"slice": {
"mode": "LAST",
"duration_limit_ms": 600000
},
"context": {
"exclude": [ "org", "location"]
},
"events": {
"trim_to_last_n_selectors": 2,
"exclude_api_events": true
},
"llm": {
"post_prompt": "Analyze the user's session and populate the JSON schema with a summary of their experience, including details for each vehicle they viewed, any frustration signals, and whether they completed a booking.",
"response_schema": {
"type": "OBJECT",
"properties": {
"vehiclesViewed": {
"type": "ARRAY",
"description": "A list of the rental vehicles the user viewed.",
"items": {
"type": "OBJECT",
"properties": {
"Make": {
"type": "STRING",
"description": "The manufacturer of the vehicle."
},
"Model": {
"type": "STRING",
"description": "The model of the vehicle."
},
"Year": {
"type": "STRING",
"description": "The model year of the vehicle."
}
},
"required": ["Make", "Model", "Year"]
}
},
"quickSummary": {
"type": "STRING",
"description": "A one-paragraph summary of the user's entire experience."
},
"frustrationSignals": {
"type": "ARRAY",
"description": "A list of any frustration signals the user encountered.",
"items": {
"type": "STRING",
"description": "A description of a single frustration signal, like an error or failed attempt."
}
},
"bookingCompleted": {
"type": "BOOLEAN",
"description": "Indicates whether the user successfully completed a booking during the session."
}
},
"required": ["vehiclesViewed", "quickSummary", "frustrationSignals", "bookingCompleted"]
}
}
}

Here's an example response of the above summary profile used with Generate Summary:

{
"response": {
"bookingCompleted": true,
"frustrationSignals": [
"Network error: No cars available in Savannah, Georgia",
"User changed dates multiple times"
],
"quickSummary": "The user started by searching for a car in Savannah, Georgia, but encountered an error indicating no cars were available. They then searched for a car in Tokyo, Japan, and viewed details for a Honda NT1100 2022 and a Honda TRX250 (FourTrax 250) 2021. The user proceeded to book the Honda NT1100 2022, completed the checkout process, and successfully submitted the order.",
"vehiclesViewed": [
{
"Make": "Honda",
"Model": "NT1100",
"Year": "2022"
},
{
"Make": "Honda",
"Model": "TRX250 (FourTrax 250)",
"Year": "2021"
}
]
},
"response_schema": {
"type": "OBJECT",
"properties": {
"bookingCompleted": {
"type": "BOOLEAN",
"description": "Indicates whether the user successfully completed a booking during the session."
},
"frustrationSignals": {
"type": "ARRAY",
"description": "A list of any frustration signals the user encountered.",
"items": {
"type": "STRING",
"description": "A description of a single frustration signal, like an error or failed attempt."
}
},
"quickSummary": {
"type": "STRING",
"description": "A one-paragraph summary of the user's entire experience."
},
"vehiclesViewed": {
"type": "ARRAY",
"description": "A list of the rental vehicles the user viewed.",
"items": {
"type": "OBJECT",
"properties": {
"Make": {
"type": "STRING",
"description": "The manufacturer of the vehicle."
},
"Model": {
"type": "STRING",
"description": "The model of the vehicle."
},
"Year": {
"type": "STRING",
"description": "The model year of the vehicle."
}
},
"required": [
"Make",
"Model",
"Year"
]
}
}
},
"required": [
"vehiclesViewed",
"quickSummary",
"frustrationSignals",
"bookingCompleted"
]
}
}

Additional Resources

For more detailed information on using the Session Summary API and creating effective prompt profiles, please refer to the following documentation: