Create a chat history entry

POST /v1/replicas/{replicaUUID}/chat/history

Save chat history items of a Replica belonging to the logged in user.

Headers

Path parameters

application/json

Body

  • content string Required

    Content of the message

    Minimum length is 1.

  • source string

    The place where the conversation is happening, which informs where the message should be saved in the chat history.

    Values are discord, telegram, embed, web, or telegram_autopilot.

  • Discord information about the message

    Additional properties are NOT allowed.

    Hide discord_data attributes Show discord_data attributes object

Responses

  • 200 application/json

    Saves the chat history of the replica by the currently logged in user.

    Hide response attribute Show response attribute object
    • success boolean Required

      Indicates the status of the request

  • The replica specified could not be found or you do not have access to it

POST /v1/replicas/{replicaUUID}/chat/history
curl \
 --request POST 'https://api.sensay.io/v1/replicas/03db5651-cb61-4bdf-9ef0-89561f7c9c53/chat/history' \
 --header "X-ORGANIZATION-SECRET: $API_KEY" \
 --header "X-USER-ID: $API_KEY" \
 --header "Content-Type: application/json" \
 --header "X-API-Version: 2025-03-25" \
 --data '{"content":"How did you handle the immense pressure during the Civil War?","source":"discord","discord_data":{"channel_id":"string","channel_name":"string","author_id":"string","author_name":"string","message_id":"string","created_at":"string","server_id":"string","server_name":"string"}}'
Request examples
# Headers
X-API-Version: 2025-03-25

# Payload
{
  "content": "How did you handle the immense pressure during the Civil War?",
  "source": "discord",
  "discord_data": {
    "channel_id": "string",
    "channel_name": "string",
    "author_id": "string",
    "author_name": "string",
    "message_id": "string",
    "created_at": "string",
    "server_id": "string",
    "server_name": "string"
  }
}
Response examples (200)
{
  "success": true
}