Mindview API
Fetches the conversation context used to build responses, either from a stored session or from the current character setup.
This API is available only on the Professional Plan and above.
Get Prompt For Mindview
POST https://api.convai.com/character/chatHistory/get_prompt
Fetches prompt data for MindView in one of two ways:
Session mode (
session_id): reads prompt data from stored interaction records.Character mode (
character_idonly): generates static prompt data from current character configuration.
Headers
CONVAI-API-KEY*
String
The unique api-key provided for every user. Found under the Key icon when logged into your Convai account.
Request Body
session_id
String
Session identifier. If provided, API runs in session mode.
character_id
String
Character identifier. Used when session_id is not provided.
offset
Integer
Optional. Used only with session_id. Default -1 returns latest prompt record.
At least one of
session_idorcharacter_idis required.
{
"prompt_id": "f2f8a75e-...",
"prompt": "[{\"role\":\"system\",\"content\":\"...\"}]",
"model": "gpt-4o-mini",
"temperature": 0.7,
"max_tokens": 512,
"top_p": 1.0,
"frequency_penalty": 0.0,
"presence_penalty": 0.0,
"stop": null,
"session_id": "sess_123",
"mindview": "{\"static_prompt\": {...}, \"dynamic_prompt\": {...}}"
}{
"mindview": "{\"static_prompt\": {...}, \"dynamic_prompt\": {...}}",
"model": "gpt-4o-mini"
}{
"ERROR": "Either session_id or character_id is required",
"Reference ID": "<transaction_id>"
}{
"ERROR": "offset must be a valid integer",
"Reference ID": "<transaction_id>"
}{
"ERROR": "Offset is greater than the number of records",
"Reference ID": "<transaction_id>"
}Here are some sample codes to demonstrate the request format for the endpoint -->
Session Mode (session_id)
Character Mode (character_id)
Last updated
Was this helpful?