Skip to main content
This page provides a complete reference for the webhook payload format sent to your integration and the expected response format.

Request Payload

When a user sends a message, your integration receives a POST request with this structure:

Complete Example

Payload Fields

messages

Array of conversation messages following the OpenAI/Anthropic format. Type: Array<Message> Message Object:
Roles:
  • user: Messages from the end user
  • assistant: Previous responses from your bot
  • system: System instructions (if configured)
Context Window: The number of messages included is controlled by your bot’s history_limit setting (default: 10). Order: Messages are ordered chronologically, oldest first.

conversation_id

Unique identifier for this conversation. Type: string Format: conv_ followed by alphanumeric characters Example: "conv_abc123def456" Usage:
  • Track conversations across messages
  • Store user context or state
  • Retrieve conversation history via API

user

Information about the user sending the message. Type: object Fields: Note: Not all fields are available on all platforms. For example, Slack may not provide username.

bot

Information about your bot. Type: object Fields: Usage:
  • Identify which bot received the message (if you manage multiple)
  • Include bot name in responses
  • Customize behavior per bot

channel

Information about the channel that received the message. Type: object Fields:

metadata

Platform-specific metadata and message context. Type: object Common Fields: Platform-Specific Metadata: Telegram:
Slack:
Discord (Coming Soon):

Response Format

Your webhook must return JSON with a content field.

Simple Response

The minimum required response:
Required:
  • content (string): The message to send to the user

Response with Metadata

Include optional metadata for logging and analytics:
Metadata fields are optional and can include:
  • model: AI model used
  • tokens: Token count
  • processing_time_ms: Processing duration
  • Any custom fields for your analytics
Note: Metadata is stored but not sent to the user.

Error Response

Return appropriate HTTP status codes for errors:
HTTP Status Codes:
Always return valid JSON. If your backend returns invalid JSON or HTML, the platform cannot process the response.

Special Response Types

Async Processing

For long-running operations, return an immediate acknowledgment:
Then send the final response using the Conversation Messages API (see Async Replies).

Empty Response

To acknowledge a message without responding:
Or return 204 No Content status with no body. Use cases:
  • Commands that don’t need a response
  • Silent processing
  • Reaction-only interactions (future feature)

Platform-Specific Considerations

Telegram

Character Limits:
  • Maximum message length: 4096 characters
  • Messages longer than this will be truncated
Markdown Support:
Media Support (Coming Soon):

Slack

Character Limits:
  • Maximum message length: 40,000 characters
Blocks and Attachments (Future):
Thread Awareness:
  • Responses automatically sent to the same thread
  • No special handling needed

Discord

Character Limits:
  • Maximum message length: 2000 characters
Embed Support (Coming Soon):

Example Integrations

OpenAI Proxy

Anthropic Proxy

Custom Backend

Security

Validating Requests

Verify requests come from Chatbot Platform: Option 1: API Key Header
Option 2: Webhook Signature (Future)

Best Practices

Use HTTPS

Always use HTTPS endpoints to encrypt data in transit

Validate Input

Sanitize and validate all incoming data

Rate Limiting

Implement rate limiting on your webhook endpoint

Timeout Handling

Return responses within configured timeout

Testing

Manual Testing with cURL

Expected Response

Troubleshooting

Invalid JSON Response

Problem: Bot sends error message to user Solution:
  • Ensure response is valid JSON
  • Check content field is present and is a string
  • Look for encoding issues (use UTF-8)
  • Test with JSON validator

Timeout Errors

Problem: Requests timeout before completion Solution:
  • Increase timeout in integration settings
  • Optimize backend for faster responses
  • Consider async processing for long operations
  • Check network latency

Missing Fields

Problem: Expected fields not in payload Solution:
  • Check platform support for field
  • Verify channel is properly configured
  • Review platform-specific limitations
  • Handle missing fields gracefully

Complete API Reference

View the full API specification with all endpoints, parameters, and response schemas.

Next Steps

Webhook Setup

Configure your webhook integration

Async Replies

Handle long-running operations

Custom Headers

Add authentication headers