Skip to main content
Version: Beta

Generate Context

Return the set of events for the specified session formatted for input into a Generative AI. The format and contents of the response are controlled by the Context specified to optimize the information included for the intended use case.

Path Parameters
    session_id string required

    The UTF-8 encoded ID of the session for which to generate context data. To retrieve the Session ID you may use the appropriate Get Session Details API for Web, iOS, or Android. As Session IDs include : separators the ID must be URL encoded using the %3A substitution.

Request Body required
    slice object optional
    mode remove earliest or latest events as defined optional

    Possible values: [UNSPECIFIED, FIRST, LAST, TIMESTAMP]

    Default value: FIRST

    event_limit int32 optional
    duration_limit_ms int64 optional
    start_timestamp date-time optional

    If specified, the event limit and duration limit will be applied to the time beginning at this timestamp.

    context object optional
    include string[] optional

    Controls the session context elements to include, takes precedence over individual inclusion fields. Can be 'user', 'org', 'location', 'device'. If not specified and not excluded, all context elements are included.

    exclude string[] optional

    Controls the session context elements to exclude, takes precedence over individual exclusion fields. Can be 'user', 'org', 'location', 'device'. If not specified and not excluded, all context elements are included.

    exclude_org_context boolean optional
    exclude_user_context boolean optional
    exclude_location boolean optional
    exclude_device boolean optional
    exclude_descriptions boolean optional
    events object optional
    exclude_types string[] optional
    include_types string[] optional
    exclude_defined_events boolean optional
    exclude_api_events boolean optional
    exclude_event_timestamps boolean optional
    exclude_selectors boolean optional
    include_selector_tags boolean optional
    trim_to_last_n_selectors int32 optional
    media object optional
    include_screenshots boolean optional
    screenshot_event_types string[] optional
    crop_screenshots_to_selector boolean optional
    full_page_screenshots boolean optional
    cache object optional
    enable_event_cache boolean optional
Responses
200

Context response containing the session information and events as JSON.


{
"context_data": {
"context": {
"org_context": {},
"user_context": {
"properties": {}
},
"location_context": {},
"device_context": {
"screen_size": {},
"viewport_size": {}
}
},
"pages": [
{
"events": [
{
"properties": {}
}
]
}
]
}
}
Loading...