Skip to main content
GET
Get Conversation History

Overview

This endpoint returns the complete message history for a contact’s conversation with your bot — every message sent by both the user and the bot, in chronological order, along with delivery status details. Use this to capture lead data, sync conversations to your CRM, or trigger downstream automations (e.g. in n8n or Make) whenever a conversation completes.
Authentication: Requires a Bearer token. Pass your API key in the Authorization header as Bearer <your-api-key>.
Bot Integration ID: The botIntegrationId in the path identifies a specific channel of a bot (its WhatsApp or SMS integration) — it is not the bot ID. Find it in the bot’s Integrations settings under the WhatsApp or Twilio integration. See Send Message for details.

Platform-specific parameters

The query parameter you need depends on your bot’s platform:

Example request (WhatsApp)

Response

Each item in the data array is a single message:
  • senderType"user" or "bot"
  • content — the message text
  • createdAt — ISO 8601 timestamp
  • latestStatus — delivery status (e.g. sent, delivered, read, failed)
  • failureReason / errorCode / errorMessage — populated only when latestStatus is failed
The metadata.contextStartsAt field indicates when the bot’s active context window begins. Messages before this timestamp are still returned in full but fall outside the bot’s current context.

Getting Your API Key

API keys can be generated from your Setter AI dashboard under Settings > API Keys. Keep your API key secure and never expose it in client-side code.

Authorizations

Authorization
string
header
required

Bearer token authentication using your API key

Path Parameters

botIntegrationId
integer
required

The ID of your bot integration

Query Parameters

userNumber
string

The contact's phone number (WhatsApp or SMS integrations)

sessionId
integer

The session ID (Playground or Embed integrations)

Response

Conversation history retrieved successfully

data
object[]
metadata
object