Skip to main content
GET
/
api
/
v1
/
bot-integrations
/
{botIntegrationId}
/
conversations
Get Conversation History
curl --request GET \
  --url https://chat.trysetter.com/api/v1/bot-integrations/{botIntegrationId}/conversations \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "botIntegrationId": 123,
      "content": "Hi! I'd like to book an appointment.",
      "senderType": "user",
      "createdAt": "2024-01-15T14:30:00.000Z",
      "messageId": 789,
      "platformResourceId": "wamid.abc123",
      "latestStatus": "delivered",
      "failureReason": null,
      "errorCode": null,
      "errorTitle": null,
      "errorMessage": null,
      "errorDetails": null
    }
  ],
  "metadata": {
    "contextStartsAt": "2024-01-15T12:00:00.000Z"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.trysetter.com/llms.txt

Use this file to discover all available pages before exploring further.

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>.

Platform-specific parameters

The query parameter you need depends on your bot’s platform:
PlatformRequired parameter
WhatsAppuserNumber — the contact’s phone number
SMS (Twilio)userNumber — the contact’s phone number
Playground / EmbedsessionId — the session ID

Example request (WhatsApp)

curl -X GET \
  "https://chat.trysetter.com/api/v1/bot-integrations/123/conversations?userNumber=1234567890" \
  -H "Authorization: Bearer <your-api-key>"

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