Skip to main content
POST
/
api
/
v1
/
bot-integrations
/
{botIntegrationId}
/
messages
/
send
curl --request POST \
--url https://chat.trysetter.com/api/v1/bot-integrations/{botIntegrationId}/messages/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"phoneNumber": "1234567890",
"templateName": "appointment_booking",
"language": "en_US",
"bodyParameters": [
{
"type": "text",
"text": "John",
"parameter_name": "customer_name"
}
],
"email": "john@example.com",
"firstName": "John",
"lastName": "Doe",
"timeZone": "America/New_York"
}'
201

Overview

This endpoint allows you to send a message to initiate a conversation with a contact. It supports both WhatsApp and SMS platforms and automatically handles contact creation and conversation management.
Rate Limiting: You cannot send another bot-initiated message to the same phone number within 30 minutes.

Platform Support

WhatsApp

For WhatsApp integrations, you’ll need to specify:
  • templateName - The approved WhatsApp message template
  • language - Language code (e.g., “en_US”)
  • bodyParameters - Parameters to fill template placeholders

SMS (Twilio)

For SMS integrations, you’ll need to specify:
  • message - The text message to send

Important Notes

  • Authentication: All requests require a Bearer token in the Authorization header
  • Phone Format: Always use international format (e.g., 1234567890)
  • Contact Management: Contacts are automatically created or updated
  • Conversation Tracking: Conversations are automatically created and linked
  • Calendar Integration: Optionally link conversations to specific calendar integrations

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

Body

application/json
phoneNumber
string
required

Contact's phone number in international format

Example:

"1234567890"

templateName
string

Name of the WhatsApp message template (WhatsApp only)

Example:

"hello_world"

language
string

Language code for the template (WhatsApp only)

Example:

"en_US"

bodyParameters
object[]

Parameters to fill template placeholders (WhatsApp only)

message
string

The message text to send (SMS/Twilio only)

Example:

"Hello! I'm here to help you schedule an appointment."

email
string<email>

Contact's email address

Example:

"john@example.com"

firstName
string

Contact's first name

Example:

"John"

lastName
string

Contact's last name

Example:

"Doe"

fullName
string

Contact's full name

Example:

"John Doe"

timeZone
string

Contact's timezone

Example:

"America/New_York"

metadata
object

Custom key-value pairs to store with the contact

Example:
{
"source": "website",
"campaign": "summer2024"
}
calendarIntegrationId
integer

ID of calendar integration to use for this conversation

Example:

123

Response

Message sent successfully

The response is of type integer.

Example:

201

I