Overview
Turret’s event tracking captures user interactions along with free-form text metadata. The API analyzes this metadata to automatically group similar events into semantic clusters and track how users flow through different topics within conversations.Request Body
Every event sent to Turret has the following structure:Field Reference
Response
Every successful request returns the IDs used for the event:Authentication
All requests must include your API key in theX-API-Key header:
Code Examples
Minimal Integration
The simplest integration - just send the message, Turret handles the rest:Recommended: Persist IDs for Journey Tracking
Store the returned IDs and include them in subsequent messages:Using Your Own IDs
If you already have conversation/user IDs, pass them directly:cURL
JavaScript
Using fetch in Node.js:Python
Using the requests library:Multiple Metadata Keys
You can include additional context in your metadata:Automatic Field Type Detection
Turret automatically analyzes your metadata fields and classifies them:Field types are detected automatically when you first send events with new metadata keys. You can override these classifications in Settings → Metadata if needed. See Segmentation for more details.
Event Naming Best Practices
Choose descriptive, consistent names for your events:Good Names
- “user_prompt”
- “search_query”
- “chat_message”
- “feedback_submitted”
Avoid
- “Event1”, “Event2”
- “user_action”
- “something_happened”
- Names that are too generic
How Clustering Works
When you send an event:- Embedding Generation: Turret generates a vector embedding for the metadata value (e.g., the prompt text) using an embedding model.
-
Semantic Clustering: Events are grouped into clusters based on embedding similarity. Similar prompts end up in the same cluster, even if they use different words:
- “How do I reset my password?” and “I forgot my login credentials” → Same cluster
- Cluster Labeling: Clusters are automatically labeled with human-readable descriptions using an LLM (e.g., “Password Reset Requests”).
How Journey Tracking Works
When events share the samesession_id, Turret tracks transitions between clusters:
- User asks about pricing (Cluster A)
- User asks about features (Cluster B)
- User asks about pricing again (Cluster A)
- Starting topics: What do users ask about first?
- Common follow-ups: After topic X, users often ask about Y
- Back-and-forth patterns: Users bounce between topics A and B
Rate Limits
Turret has generous rate limits to accommodate high-volume applications:- Free trial: 250k total events (within 14 days)
- Pro plan: 1,000,000 events per month
- Business plan: 10,000,000 events per month
- Enterprise: Custom limits
429 Too Many Requests response.