How Sampling Works
Both/messages and /events endpoints support sampling via two fields:
| Field | Type | Description |
|---|---|---|
sampleRate | number (0-1) | The probability that this request will be ingested. 0.1 means 10% of requests are stored. Defaults to 1.0 (all requests). |
forceSample | boolean | When true, bypasses sampling and ensures the request is always ingested. |
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 useforceSample: 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 a204 No Content response. This indicates the request was valid but intentionally not processed.
Your integration should handle this gracefully:
Best Practices
- Start with 100% sampling during development and initial rollout to ensure your integration is working correctly.
- Reduce sampling gradually as volume increases. Monitor your analytics to ensure you’re still capturing representative data.
-
Never sample critical business events. Use
forceSample: truefor events that directly impact revenue or customer success metrics. -
Consider conversation importance when sampling messages. High-value customer conversations or error scenarios should use
forceSample: true. - Monitor the 204 response rate to verify your sampling is working as expected.

