All API requests require an API key to be included in the request header:
X-API-Key: your_api_keyRegister or update a user in the Growlycs system
This endpoint is called when a user signs up or updates their profile.
{
"user_id": "unique_user_id",
"email": "user@example.com",
"name": "John Doe",
"properties": {
"plan": "premium",
"company": "Acme Inc"
}
}{
"success": true,
"message": "User created successfully",
"user_id": "unique_user_id"
}Record meaningful user events for signed-up users
This endpoint focuses on four key user interactions: page views, button clicks, form submissions, and user inputs.
{
"user_id": "unique_user_id",
"event_name": "viewed_pricing_page",
"event_type": "page_view",
"session_id": "optional_session_id",
"properties": {
"url": "/pricing",
"title": "Pricing Plans"
}
}{
"success": true,
"message": "Event recorded successfully",
"session_id": "session_id_value"
}url and title propertieselement_text or element_type propertiesform_id or form_action propertiesinput_id, input_name, or input_type propertiesVerify script installation and configuration
This endpoint confirms that the tracking script is properly installed and configured.
{
"success": true,
"organization_id": "org_123",
"script_version": "1.0.0"
}Analyze user behavior patterns to predict churn risk
This endpoint uses machine learning to evaluate user engagement data and assign a churn risk score.
{
"success": true,
"stats": {
"totalUsers": 100,
"processedUsers": 100,
"successfulUsers": 98,
"failedUsers": 2,
"predictions": [...]
}
}Generate personalized messages for users at risk of churning
This endpoint generates personalized, contextual messages to re-engage users at risk of churning.
{
"user_id": "unique_user_id",
"template_id": "template_123",
"custom_context": {
"feature": "dashboard",
"last_action": "viewed_reports"
}
}{
"success": true,
"nudge_id": "nudge_456",
"content": "Hi John, we noticed you haven't explored the new dashboard features yet. Check out our latest reports for valuable insights!",
"user_id": "unique_user_id"
}Create actionable alerts for founders
This endpoint generates actionable alerts for founders about important user behavior patterns.
{
"success": true,
"alert_id": "alert_789",
"alert_type": "high_value_user_at_risk",
"user_id": "unique_user_id",
"priority": "high",
"message": "High-value customer at risk of churning. Last active 7 days ago.",
"recommended_actions": [
"Send personalized email",
"Offer extended trial of premium features"
]
}Verify API service status
This endpoint checks the health status of the API service and its dependencies.
{
"status": "healthy",
"version": "1.0.0",
"timestamp": "2025-07-20T22:35:00Z",
"services": {
"database": "connected",
"ml_server": "connected"
}
}Close inactive user sessions
This endpoint closes sessions that have been inactive for a specified period.
{
"success": true,
"sessions_closed": 42,
"inactivity_threshold_minutes": 30
}Growlycs uses a dedicated ML server for churn prediction and analytics. The ML server provides the following endpoints:
The ML server is configured via environment variables and requires an API key for authentication.