Skip to main content
For high-volume applications, you can control the percentage of data that is ingested using sampling. This helps manage costs while still capturing representative data and ensuring critical information always gets through.

How Sampling Works

Both /messages and /events endpoints support sampling via two fields:
Free plan customers are not affected by sampling. All data is ingested regardless of the sampleRate value.

Messages vs. Events

Sampling works differently for messages and events to optimize for their distinct use cases:

Messages: Conversation-Level Sampling

For /messages, sampling is deterministic per conversation. Either all messages in a conversation are ingested or none are. This ensures:
  • Complete conversation context is preserved
  • No fragmented conversations with missing messages
  • Consistent behavior across retries and multiple message batches

Events: Per-Event Sampling

For /events, sampling is non-deterministic per event. Each event has an independent probability of being ingested. This ensures:
  • Even distribution across all organizations and event types
  • No entire buckets (org, eventType) are permanently included or excluded
  • Representative sampling across your entire event stream

When to Use Sampling

High-Frequency Data

If you’re tracking high-volume data like general usage events or routine conversations, sample at 10-20% to capture trends without storing every occurrence.

Critical Data

Always use forceSample: true for high-value data that should never be dropped:
  • Events: purchase_completed, subscription_started, churn_detected
  • Messages: Support escalations, error conversations, VIP customer interactions

Response for Dropped Requests

When a request is dropped due to sampling, the API returns a 204 No Content response. This indicates the request was valid but intentionally not processed. Your integration should handle this gracefully:

Best Practices

  1. Start with 100% sampling during development and initial rollout to ensure your integration is working correctly.
  2. Reduce sampling gradually as volume increases. Monitor your analytics to ensure you’re still capturing representative data.
  3. Never sample critical business events. Use forceSample: true for events that directly impact revenue or customer success metrics.
  4. Consider conversation importance when sampling messages. High-value customer conversations or error scenarios should use forceSample: true.
  5. Monitor the 204 response rate to verify your sampling is working as expected.