Skip to main content

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

Setter AI sends webhook notifications to your server when important events occur, allowing you to build real-time integrations and automate workflows.

Setting Your Webhook URL

Configure your webhook URL in the Setter AI dashboard:
  1. Navigate to Settings > General
  2. Enter your webhook endpoint URL in the “Webhook URL” field
  3. Save your settings
Alternatively, you can configure it via API:
PUT /api/v1/organizations/current/settings
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "webhookUrl": "https://api.example.com/webhook"
}
Your webhook endpoint must accept POST requests with Content-Type: application/json.

Webhook Events

Appointment Booked

Triggered when a contact successfully books an appointment through any connected calendar integration. Event Type: appointment_booked

Payload Example

{
  "type": "appointment_booked",
  "timestamp": "2025-12-04T10:30:00.000Z",
  "startTime": "2025-12-05T14:00:00.000Z",
  "startTimeInTz": "2025-12-05T09:00:00-05:00",
  "endTime": "2025-12-05T15:00:00.000Z",
  "timeZone": "America/New_York",
  "contactEmail": "user@example.com",
  "contactWhatsappId": "1234567890",
  "contactPhoneNumber": "+1234567890",
  "contactFullName": "John Doe",
  "contactFirstName": "John",
  "contactLastName": "Doe",
  "contactMetadata": {},
  "concatenatedConversation": "Full conversation history...",
  "botId": 123,
  "botIntegrationId": 456
}

Conversation Inactive

Triggered 23 hours after the last user message in a conversation. Event Type: conversation_inactive

Payload Example

{
  "type": "conversation_inactive",
  "timestamp": "2025-12-04T10:30:00.000Z",
  "lastUserMessageSentAt": "2025-12-03T11:30:00.000Z",
  "inactiveForDuration": "PT23H",
  "conversationStatus": ["replied"],
  "contactEmail": "user@example.com",
  "contactWhatsappId": "1234567890",
  "contactPhoneNumber": "+1234567890",
  "contactFullName": "John Doe",
  "contactFirstName": "John",
  "contactLastName": "Doe",
  "contactMetadata": {},
  "concatenatedConversation": "Full conversation history...",
  "botId": 123,
  "botIntegrationId": 456
}

Message Delivery Failed

Triggered when a WhatsApp message fails to deliver. Use this to implement fallback workflows — for example, triggering an SMS via Zapier when a WhatsApp message can’t be delivered. Event Type: message_delivery_failed

Payload Example

{
  "type": "message_delivery_failed",
  "timestamp": "2025-12-04T10:30:00.000Z",
  "platformResourceId": "wamid.HBgLNDQ3...",
  "errorCode": 131026,
  "errorTitle": "Message undeliverable",
  "errorMessage": "Message failed to send because there were one or more errors related to your phone number.",
  "errorDetails": "The message could not be delivered.",
  "contactWhatsappId": "447911123456",
  "contactPhoneNumber": "+447911123456",
  "contactFullName": "John Doe",
  "contactFirstName": "John",
  "contactLastName": "Doe",
  "contactEmail": "john@example.com",
  "contactMetadata": {},
  "botIntegrationId": 456
}

Use case: SMS fallback via Zapier

If a WhatsApp message fails to deliver, you can use this webhook to trigger an SMS to the same contact:
  1. Create a Zap with Webhook by Zapier as the trigger (Catch Hook)
  2. Set your Zapier webhook URL as the Webhook URL in your Setter AI settings
  3. Filter on type === "message_delivery_failed"
  4. Use contactPhoneNumber to send an SMS via Twilio or another SMS provider

Payload Fields

Common Fields

FieldTypeDescription
typestringEvent type identifier (appointment_booked, conversation_inactive, or message_delivery_failed)
timestampISO 8601When the event occurred (UTC)
contactEmailstring | nullContact’s email address
contactWhatsappIdstring | nullWhatsApp user ID
contactPhoneNumberstring | nullContact’s phone number
contactFullNamestring | nullContact’s full name
contactFirstNamestring | nullContact’s first name
contactLastNamestring | nullContact’s last name
contactMetadataobject | nullCustom metadata associated with the contact
botIdnumber | nullBot identifier
botIntegrationIdnumberIntegration identifier

Appointment-Specific Fields

FieldTypeDescription
startTimeISO 8601Appointment start time (UTC)
startTimeInTzISO 8601Appointment start time in the invitee’s timezone
endTimeISO 8601Appointment end time (UTC)
timeZonestringIANA timezone identifier (e.g., “America/New_York”)

Conversation Inactive Fields

FieldTypeDescription
lastUserMessageSentAtISO 8601Timestamp of the last user message
inactiveForDurationISO 8601 DurationDuration of inactivity (e.g., “PT23H” = 23 hours)
conversationStatusstring[]Array of conversation status tags (e.g., [“appointment_booked”, “replied”])
concatenatedConversationstring | nullComplete conversation history

Message Delivery Failed Fields

FieldTypeDescription
platformResourceIdstringThe WhatsApp message ID (wamid) that failed to deliver
errorCodenumber | nullWhatsApp error code (see Meta error codes)
errorTitlestring | nullShort error title
errorMessagestring | nullDetailed error message
errorDetailsstring | nullAdditional error context

Best Practices

Implement Idempotency: Your webhook endpoint should handle duplicate events gracefully. Use the timestamp and event-specific fields to deduplicate requests.
  • Respond Quickly: Return a 2xx status code within 5 seconds to acknowledge receipt
  • Process Asynchronously: Queue webhook processing for longer operations
  • Secure Your Endpoint: Use HTTPS and validate webhook signatures (if implemented)
  • Handle Failures: Implement retry logic with exponential backoff on your side