Mindview API

Learn how to use the Backstory API to create and manage character backstories, adding depth and personality to your NPCs.

triangle-exclamation

Get Prompt For Mindview

POST https://api.convai.com/character/chatHistory/get_prompt

Fetches prompt data for MindView in one of two ways:

  1. Session mode (session_id): reads prompt data from stored interaction records.

  2. Character mode (character_id only): generates static prompt data from current character configuration.

Headers

Name
Type
Description

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

Name
Type
Description

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_id or character_id is 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\": {...}}"
}

Here are some sample codes to demonstrate the request format for the endpoint -->

Session Mode (session_id)

Character Mode (character_id)

circle-info

Implementation notes:

  • If both session_id and character_id are provided, session mode is used.

  • In current implementation, mindview and prompt fields are serialized JSON strings.

Last updated

Was this helpful?