Research Automation: How to Build Real-Time Research Pipelines with Webhooks
Koji webhooks push interview and report data to your systems the instant something happens — enabling Slack alerts, CRM sync, automated tagging, and fully automated research pipelines that operate without manual intervention.
Research Automation: How to Build Real-Time Research Pipelines with Webhooks
A research pipeline is the infrastructure that moves data from your participants to the people who need to act on it — automatically. Traditional research workflows are manual: collect interviews, wait for analysis, write a report, share findings, repeat. This cycle takes days or weeks and produces insights that are stale by the time they reach decision-makers.
Koji's webhook system enables a fundamentally different model: automated, real-time data flows that trigger actions the moment a participant completes an interview. Insights reach your team within seconds of being generated — not in the next sprint planning meeting.
How Webhooks Work
A webhook is an HTTP POST request that Koji sends to a URL you specify when a specific event occurs. Unlike API polling — where you repeatedly check "are there new interviews?" — webhooks push data to you the instant something happens.
The basic flow:
- A participant completes a Koji interview
- Koji sends a POST request to your configured webhook URL with the event data
- Your system receives the data and triggers whatever action you have configured
- Everything happens automatically, typically within 2–5 seconds of completion
You configure webhooks in your workspace under Settings → Webhooks. Add your endpoint URL, select the events you want to subscribe to, and save.
Available Webhook Events
Koji currently supports the following webhook events:
interview.completed
Fired when a participant finishes an interview and it passes the quality gate. Payload includes: interview ID, study ID, participant attributes (from personalized links), quality score, completion timestamp, and a direct link to view the transcript.
interview.failed_quality_gate
Fired when an interview is completed but does not meet the minimum quality threshold. Useful for triggering follow-up outreach asking participants to try again, or for logging in your tracking system.
study.published
Fired when you publish a study and make it live for participants. Useful for triggering team notifications or updating a research calendar in your project management tool.
report.generated
Fired when a new report is generated or refreshed for a study. Payload includes key summary metrics and a link to the full report.
Each event payload includes a type field, a data object with event-specific details, and a timestamp in ISO 8601 format.
Integration Patterns
Pattern 1: Real-Time Slack Notifications
The simplest webhook use case: notify your team when a new interview is completed.
Using a no-code tool like Zapier or Make, connect Koji's interview.completed event to a Slack channel. Your research team sees a notification like: "New interview completed — Sarah (VP Engineering, Acme Corp, Enterprise plan). View transcript →"
For time-sensitive studies — before a product launch, during a competitive analysis sprint, or when investigating a support escalation — real-time notifications mean you can act on an insight the same day it surfaces, not in the next planning cycle.
Set up different Slack channels for different studies. Incoming signals from a churn research study route to your CS team's channel; signals from a feature validation study route to the product team.
Pattern 2: CRM Updates on Interview Completion
For sales, success, and marketing teams, interview completion can automatically update contact records.
Example: Post-trial interviews synced to Salesforce
When a trial user completes a Koji interview, a webhook triggers a Salesforce workflow that:
- Marks the contact record as "Research completed — date"
- Adds a note with the AI-generated interview summary
- Assigns a follow-up task to the AE or CSM
- Updates a custom satisfaction score field with the structured scale answer from the interview
This closes the loop between research and revenue-facing teams. The AE who calls a prospect to discuss renewal has context from a genuine qualitative conversation — not just CRM deal notes.
Example: Win/loss research synced to HubSpot
After a deal closes (won or lost), trigger a Koji interview via personalized link. When completed, the webhook updates the HubSpot deal record with competitive intelligence, pricing feedback, and decision factors extracted from the interview.
Pattern 3: Automated Research Tagging and Segmentation
For teams running ongoing research programs across multiple studies, webhooks automate participant tracking and segmentation.
When an interview is completed:
- Tag the participant in your CRM with the study topic and completion date
- Update a custom attribute in your product analytics tool (Mixpanel, Amplitude, Heap) to mark users who have participated in research
- Add the participant to a follow-up nurture sequence for future studies in the same theme area
- Create a record in your research repository (Notion, Confluence, Airtable) with the interview metadata
This creates a complete research participation history for every user — automatically, without manual spreadsheet tracking.
Pattern 4: Automated Report Delivery
When your Koji report is generated (report.generated event), automatically deliver it to stakeholders without any manual send:
- Slack: Post a summary to a product or leadership channel with a link to the full report
- Email: Trigger a personalized email via SendGrid or Mailchimp to each stakeholder with report highlights and the full link
- Notion or Confluence: Create a new page in your research repository with the report content and metadata
- Linear or Jira: Create action item tickets from the key recommendations surfaced in the report summary
This removes the "send the report email" step from your research workflow entirely — findings distribute themselves.
Pattern 5: End-to-End Automated Research Pipelines
For engineering teams, webhooks work in combination with Koji's Headless API to create fully automated research pipelines with no human intervention required:
- Trigger event in your product: User completes onboarding, trial expires, feature threshold reached, or NPS survey response received
- Your backend calls Koji API: Create a new interview session for that user, passing their context attributes (name, plan, feature usage)
- User receives in-app or email prompt: "Take a 5-minute interview to help us improve — your feedback directly shapes the product"
- User completes interview: Koji conducts the AI-moderated conversation
interview.completedwebhook fires: Your systems receive the structured data in real time- Downstream automation runs: CRM updated, Slack notification sent, report refreshed, tickets created
This is research-as-infrastructure: qualitative insights flowing through your systems with the same reliability as any other data pipeline, 24 hours a day, without a researcher manually scheduling anything.
Setting Up Your First Webhook
Step 1: Create a Webhook Endpoint
Using a no-code tool:
- Zapier: Create a "Webhooks by Zapier" trigger and copy the generated URL
- Make: Create an HTTP webhook module and copy the URL
- n8n: Create an HTTP webhook trigger and copy the URL
Building a custom endpoint:
// Example: Express.js webhook handler
app.post('/koji-webhook', express.raw({ type: 'application/json' }), (req, res) => {
const signature = req.headers['x-koji-signature'];
if (!verifySignature(req.body, signature, process.env.KOJI_WEBHOOK_SECRET)) {
return res.status(401).send('Unauthorized');
}
const event = JSON.parse(req.body);
if (event.type === 'interview.completed') {
// Handle completed interview
console.log('Interview completed:', event.data.interview_id);
}
res.status(200).send('OK');
});
Make sure your endpoint returns a 200 status code within 10 seconds. Koji retries on timeout.
Step 2: Register the Webhook in Koji
- Navigate to Settings → Webhooks in your Koji workspace
- Click Add Webhook
- Enter your endpoint URL
- Select the events you want to subscribe to
- Save — Koji sends a test ping to verify the connection
Step 3: Understand the Payload Structure
The interview.completed payload:
{
"type": "interview.completed",
"timestamp": "2026-04-16T10:23:00Z",
"data": {
"interview_id": "abc123",
"study_id": "xyz789",
"study_title": "Post-Trial Feedback",
"participant": {
"name": "Sarah",
"company": "Acme Corp",
"email": "[email protected]",
"plan": "enterprise"
},
"quality_score": 4,
"interaction_mode": "voice",
"completed_at": "2026-04-16T10:22:55Z",
"transcript_url": "https://app.koji.so/studies/xyz789/interviews/abc123"
}
}
When your study includes structured questions, the payload also includes structured_answers — an array of question IDs, types, and extracted values. This means a satisfaction scale rating or a single-choice response is available in your webhook payload in real time, without waiting for a full report refresh.
Step 4: Verify Webhook Signatures
Koji signs all webhook payloads using HMAC-SHA256. The signature appears in the X-Koji-Signature header. Always verify this in your handler:
const crypto = require('crypto');
function verifySignature(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from('sha256=' + expected),
Buffer.from(signature)
);
}
Your webhook secret is available in Settings → Webhooks after registering your endpoint.
Step 5: Handle Retries and Deduplication
Koji retries failed webhook deliveries up to 3 times with exponential backoff (approximately 30 seconds, 5 minutes, and 30 minutes after the initial failure). To prevent duplicate processing:
- Store processed
interview_idvalues in your database - Before processing any webhook, check whether that ID has already been handled
- Return 200 immediately even if you are processing asynchronously — this prevents Koji from treating slow processing as a failure
Structured Questions + Webhooks: Real-Time Quantitative Signals
Studies using structured questions produce richer webhook payloads. Koji supports six question types: open_ended, scale, single_choice, multiple_choice, ranking, and yes_no. Structured question values are included in the interview.completed payload as structured_answers.
This enables powerful routing logic:
- Low satisfaction score (scale question, score 1–5): create a CS follow-up task immediately
- Negative expansion intent (yes_no question, answer "no"): flag the account in Salesforce for at-risk review
- Specific churn reason selected (single_choice question, option "pricing"): route to a pricing-focused win-back sequence
Quantitative structured data flowing through webhooks in real time is one of the most powerful features of Koji's platform — transforming qualitative research into an operational data source your entire revenue stack can act on.
Monitoring and Debugging
In Settings → Webhooks, you can view delivery history for each registered endpoint:
- Status of each delivery attempt (success or failure)
- HTTP response code returned by your endpoint
- Payload content for debugging
- Option to manually retry failed deliveries
If you are developing locally, use a tool like ngrok to expose a local endpoint for testing before deploying to production.
Related Resources
- Structured Questions Guide — Add quantitative data to webhook payloads for real-time routing logic
- Webhook Setup — Quick-start configuration guide
- Headless API Overview — Full API access for building automated research pipelines
- API Authentication — Secure your API and webhook integrations
- Personalized Interview Links — Embed participant context that appears in webhook payloads
- Rate Limits and CORS — API constraints to plan around when building integrations
Related Articles
Exporting Research Data from Koji: CSV, JSON, and Transcript Access
A complete guide to every way you can get your interview data out of Koji — from one-click CSV downloads to real-time webhook pipelines.
API Authentication
Learn how to authenticate with the Koji API using API keys and Bearer tokens.
Webhook Setup
Receive real-time notifications when interviews complete and analysis finishes using webhooks.
Rate Limits and CORS
Understand how Koji's API rate limiting works and how to configure CORS origins for your integration.
Headless API Overview
Manage interviews programmatically with the Koji REST API — start, message, and complete interviews from your own code.
Personalized Interview Links: Send Targeted Research Invitations to Every Participant
Embed participant-specific context into Koji interview URLs so the AI greets each person by name, references their company, and tailors the conversation — automatically. Covers CSV import, URL parameters, and CRM integration patterns.
Structured Questions in AI Interviews
Mix quantitative data collection — scales, ratings, multiple choice, ranking — with AI-powered conversational follow-up in a single interview.