Back to docs
API Reference

User Research API: Embed AI Interviews into Any Product or Workflow

How to use Koji's User Research API to run AI-moderated interviews from your own backend. Covers REST endpoints, the embed widget, how to get completion signals without webhooks, authentication, rate limits, and headless interview patterns.

The Bottom Line

A User Research API lets you trigger AI-moderated user interviews from your own backend code instead of a SaaS dashboard. Koji exposes a complete headless API: start an interview, exchange messages, complete it, and read the analyzed transcript back. There are no outbound webhooks yet, so your backend polls the read endpoint or listens for the embed widget's browser events. Either way you can embed conversational research anywhere a customer touchpoint exists: an in-product onboarding flow, a churn cancellation screen, a post-purchase email, a Discord bot, or an internal data pipeline.

The core primitives are four REST endpoints plus a JavaScript embed widget that posts completion events to the parent page. With these you can run a full customer research conversation programmatically: the AI interviewer adapts to each participant, asks follow-up questions, and your backend reads quality-scored transcripts and structured answers as soon as analysis finishes.

This guide is the entry point. If you're evaluating whether a research platform fits your stack — or you've outgrown survey APIs that only POST form responses — this article shows how Koji's API differs and where to go next.

Why a User Research API Exists

Most research tools assume a researcher logs into a dashboard, sends a link, and reads the results manually. That model breaks at three common moments:

  1. In-product moments matter more than scheduled studies. The best feedback comes from a user mid-task, not a user three weeks later trying to remember what frustrated them. A research API lets you trigger an interview the moment a user hits a meaningful trigger (clicks "Cancel subscription", finishes onboarding, downgrades, etc.).
  2. Product-led growth teams want every signup interviewed. When you're onboarding hundreds of users a week, sending them all the same Typeform isn't research — it's a survey. An API lets you queue an AI interview per qualified signup and feed the structured output into your CRM.
  3. AI-native teams want research data as a feed. You want themes, quotes, and structured answers landing in your data warehouse, Slack, or your own LLM agent — not a PDF.

A real user research API answers all three. Koji's does. Closed-dashboard tools like SurveyMonkey or Qualtrics cannot — their APIs let you POST survey responses, not run conversational interviews.

The Core API Primitives

1. Headless Interview Endpoints

The Koji REST API exposes four conversation endpoints under /api/v1:

  • POST /api/v1/interviews/start — Open an interview session. Accepts the projectSlug (or projectId), optional respondentMetadata (name, email, external ID), and returns a sessionToken plus the first AI message.
  • POST /api/v1/interviews/message — Send a participant message and receive the next AI response. The AI agent decides whether to ask a follow-up, move to the next question, or wrap up.
  • POST /api/v1/interviews/complete — Mark the interview complete and trigger analysis. The transcript is quality-scored and themes are extracted asynchronously.
  • GET /api/v1/interviews/{id} — Read the full transcript, quality score, structured answers, and themes after analysis runs.

Every endpoint is rate-limited at 60 requests per minute per API key, with permissive CORS for browser-based callers. Authentication is via Bearer tokens — keys are generated in the API tab of any Koji workspace.

2. The Embed Widget (JavaScript)

If you'd rather not implement the full conversation loop yourself, Koji ships a JavaScript embed widget that renders the interview UI inside your app. Drop the snippet into a modal, a sidebar, or a dedicated page; it handles voice, text, and the structured-question widgets (buttons, sliders, radio, checkbox, drag-to-rank) automatically. The widget is the same primitive that powers Koji's hosted interview page — your branding, your domain, with the AI moderation logic still running on Koji's backend.

3. Completion Signals for Near-Real-Time Pipelines

Koji has no outbound webhooks yet, so there is no URL to register and nothing signed arriving at your server. Two patterns give you the same outcome:

  • Poll the read endpoint. Store each interview_id when you start an interview, then have a scheduled job call GET /api/v1/interviews/{id} and act when status is completed and analysis is present, which is when the quality score, themes and structured answers are all populated.
  • Forward the embed event. If the interview runs in the embed widget, the respondent's browser posts koji:interview_completed to the parent page. Forward it to your backend as a fast path, and keep the poller as the source of truth: the event only fires while the tab is open.

This is how teams build "research-aware" automations: post every interview transcript to a Slack channel; sync structured NPS answers into HubSpot; trigger a Linear ticket when a churn-risk theme appears; feed insights directly into a Claude agent that drafts PRDs. The trigger is your own job, not a Koji callback. See Webhook Setup for working code.

4. CRM and CSV Import

The respondent import endpoint accepts CSV uploads or programmatic POSTs. Each respondent gets a personalized interview link (with a unique token) so you can target named accounts, send 1:1 invites, and tie interview results back to a contact record in your CRM. When you need people you do not have, the same study can also be filled from Koji's built-in panel: open Panel recruit in the dashboard, describe the audience, approve the price per completed interview in credits, and those interviews land in the same study, readable through the same GET /api/v1/interviews/{id} endpoint as everything else.

Authentication and Rate Limits

Koji uses standard Bearer-token authentication:

Authorization: Bearer koji_live_<your-api-key>

API keys are scoped to a workspace. Each key has a creation date, last-used timestamp, and revocation control. There are no per-endpoint scopes today — every key has full read/write access to its workspace.

Rate limits:

  • 60 requests/minute per API key (sliding window).
  • No daily cap. You're bounded by credits, not requests.
  • CORS is permissive on /api/v1/* endpoints — direct browser calls work, useful for client-side embed scenarios.
  • No outbound webhooks yet. There is no signed callback to validate. Poll GET /api/v1/interviews/{id} or forward the embed widget's koji:interview_completed event instead.

If you exceed the rate limit, you'll get a 429 Too Many Requests with a Retry-After header.

Pricing and Credits via the API

The API and MCP connector are available on every plan, including a free account, and outbound webhooks are not available yet. Pricing is credit-based and identical to dashboard interviews:

  • Text interview: 1 credit
  • Voice interview: 3 credits
  • Report refresh: 5 credits
  • Quality gate: interviews scoring 1 or 2 (out of 5) don't consume credits

Interviews start as low as €1 per qualified interview, and €3 per qualified voice interview. The API and MCP connector are included for everyone, not sold as a tier, and there are no per-seat or per-call API surcharges. When you need more credits, top up with pay as you go. Nothing is ever charged automatically, and you pay only for the interviews your study actually uses.

For team-wide API deployments (multiple products embedding interviews, SSO/SAML, isolated infrastructure, and a signed DPA), the Enterprise plan adds the controls procurement asks for, with custom committed credit volume and invoicing.

Compared with survey APIs that charge per-response or per-question, Koji is unusually simple: a research-grade text interview costs as low as €1, and a conversation that scores below 3 out of 5 is free and never charged.

Architecture Patterns

Here's how typical implementations look.

Pattern A: In-Product Cancel Flow

A SaaS product wants to interview every user who clicks "Cancel my subscription." The cancel button posts the user to a modal that loads the Koji embed widget with a pre-filled respondentMetadata (user ID, plan, tenure). The AI runs a 3-minute interview asking why they're leaving, what almost stopped them, and what would bring them back. The transcript is analyzed; a poller on your side reads it back and, if the theme "missing feature" appears, posts the quote to the product team's Slack.

Pattern B: PLG Onboarding Research at Scale

A developer-tools company wants to interview every signup that completes the tutorial. A backend cron job runs daily, identifies qualified signups, hits POST /api/v1/interviews/start to generate personalized links, and sends them via email. A second scheduled job polls the read endpoint and routes finished transcripts into the company's warehouse (BigQuery) tagged with the user's plan and traffic source. The product manager queries the table for emerging themes by cohort.

Pattern C: Headless Research for an AI Agent

A founder builds an AI agent in Claude that supervises customer research. The agent calls Koji over MCP (Model Context Protocol) to read existing studies, draft new ones, generate reports, and import respondents. From the founder's perspective, customer research is a tool the AI uses — not a SaaS the founder logs into. Koji's MCP server (15 tools) is built on top of the same API; everything callable via REST is also callable via MCP.

Pattern D: Embedding Research in a Mobile App

A mobile team wants in-app feedback that goes deeper than NPS. They use the embed widget inside a sheet view, configured for voice interviews. Users speak into their phone; the AI converses, probes, and wraps up in 90 seconds. The team sees themes ranked by frequency, quality-scored, with verbatim quotes — all without anyone scheduling a call.

How Koji's User Research API Compares

CapabilitySurvey APIs (Typeform/SurveyMonkey)Recording APIs (UserTesting/Maze)Koji User Research API
Conversational AI interviewsNo (static form)Recording-basedYes (text + voice)
Adaptive follow-up probingNoManual moderator onlyYes (1–3 per question, autonomous)
Structured + qualitative outputForm fields onlyManual tagging6 structured types + free-form transcripts
Per-interview quality scoringNoManual review1–5 composite score auto
Completion signal on transcript analysisLimitedLimitedRead endpoint plus embed events (no outbound webhooks yet)
Voice mode programmaticallyNoRecording, not conversationalYes (3 credits/interview)
Embed widgetForm embedsIframe recordingsFull interview widget with branding
Available on free tierFree tier existsEnterprise only typically10 free credits to trial; API included on every plan

The TL;DR: survey APIs collect answers; recording APIs save videos; Koji's API runs conversations.

Getting Started

  1. Create a workspace. Sign up at koji.so. You get 10 free credits immediately.
  2. Generate an API key. Settings → API → Create Key. Copy it once — it's only displayed at creation time.
  3. Build your first study in the dashboard. Easier to validate the brief in the UI before going headless. Set interview mode (structured, exploratory, or hybrid) and add structured questions if you want chartable answers.
  4. Test POST /api/v1/interviews/start. Use cURL with your key and the study's projectSlug. You'll get a sessionToken and the first AI greeting.
  5. Loop messages. Send a participant reply via POST /api/v1/interviews/message and read the AI's next message. The agent may attach a widget field (for scale, single_choice, etc.) so your client can render the right input.
  6. Complete and read results. Call POST /api/v1/interviews/complete to finalize. Analysis runs asynchronously (typically under 30 seconds). Poll GET /api/v1/interviews/{id} for the quality score and structured answers, or forward the embed widget's completion event if the interview runs in the widget.

For production, run the poller on a schedule and put the embed widget on a dedicated subdomain. The full API specification, including request/response schemas, is in Headless API Overview.

Frequently Asked Questions

Can I use the API on the free plan? Yes. The API and MCP connector are available on every plan, including a free account, and outbound webhooks are not available yet. Voice and text interviews run on every way of paying, and new accounts get 10 free credits to try interviews in the dashboard.

How do I authenticate? Bearer tokens. Authorization: Bearer koji_live_<key>. Keys are workspace-scoped and revocable.

What's the rate limit? 60 requests/minute per key, sliding window. Returns 429 with Retry-After on overflow. Most production workloads stay well below this.

Are voice interviews supported via the API? Yes. Voice interviews cost 3 credits each. You can either use the embed widget (handles audio capture for you) or implement the full WebSocket-based voice protocol yourself.

How do I know when an interview has finished? There are no outbound webhooks yet, so there is nothing to register or verify. Poll GET /api/v1/interviews/{id} from a scheduled job and act when status is completed and analysis is present. If the interview runs in the embed widget, forward the browser's koji:interview_completed event to your backend as a fast path. See Webhook Setup.

Can I use Koji headlessly with no dashboard at all? Yes. Every dashboard action — create study, edit brief, publish, generate report, export data — is available via the REST API and the MCP server. Several customers operate fully headless via Claude + MCP.

Related Resources

Further reading on the blog

<!-- further-reading:blog -->

Related Articles

Amplitude + Koji: Trigger AI Interviews from Product Analytics and Pipe Insights Back as Events

How to close the loop between Amplitude product analytics and Koji AI interviews — fire interview links to users in specific Amplitude cohorts, and pipe interview themes, sentiment, and quality scores back into Amplitude as user properties and custom events.

API Authentication

How Koji Headless API authentication works: pk_live_ API keys, permissions, session tokens, and origin allowlists.

Build vs Buy: Customer Research Software (The 2026 Decision Framework)

A 2026 decision framework for whether to build your own customer research platform or buy one. Includes true-cost worksheet, the 6 questions that decide it, and where AI-native platforms like Koji change the math.

Completing Interviews via API

Finalize interviews with POST /interviews/{id}/complete, then poll the read endpoint for the asynchronous AI analysis.

Embed Widget Reference

Embed the Koji interview widget with an iframe: URL parameters, koji:* postMessage events, React integration, and prefilled respondents.

Headless API Overview

Manage interviews programmatically with the Koji REST API — start, message, and complete interviews from your own code.

Koji MCP Integration Overview

Connect Koji to Claude, Cursor, and other AI assistants using the Model Context Protocol (MCP). Manage your entire research workflow conversationally — create studies, run interviews, analyze data, and generate reports without leaving your AI assistant.

Connect Koji to n8n: Build Self-Hosted Customer Research Pipelines

Wire Koji into n8n with the REST API to build self-hosted pipelines that route every completed interview into Notion, Linear, Slack, your CRM, or any other system — without sending data through a third-party automation cloud.

Research Automation: How to Build Real-Time Research Pipelines with Webhooks

Build automated research pipelines on the Koji API today: event-triggered interviews, completion detection, and insight routing, no native webhooks required.

Customer Research in Your Data Warehouse: Modelling Interview Data for Snowflake, BigQuery, and BI

A practical schema and loading pattern for getting AI interview data into Snowflake, BigQuery, Redshift, or Postgres — and the four dashboards worth building in Looker, Tableau, Power BI, or Metabase once qualitative themes sit next to revenue and product events.

Sync Koji AI Interviews to Salesforce: Customer Insights on Every Account, Contact, and Opportunity

Push interview transcripts, AI themes, sentiment, and quality scores from Koji into Salesforce with a scheduled worker on the Koji read API and the Salesforce REST API — so account executives, customer success managers, and revenue ops teams act on customer evidence inside the CRM they already live in.

Finding What a Customer Said Across Your Interview Transcripts

Koji has no transcript search box. Here is how you get back to the moment a customer said the thing: every interview analysed as it lands, a report where every claim links to its quote, the responses grid, readable transcripts, CSV and JSON export, and the MCP connector for questions that span studies.

Starting Interviews via API

Create interview sessions programmatically with POST /interviews/start: request fields, the 201 response, CRM linking, and voice mode.

Structured Questions in AI Interviews

Mix quantitative data collection — scales, ratings, multiple choice, ranking — with AI-powered conversational follow-up in a single interview.

Webhook Setup

Koji has no native outbound webhooks yet. Three working alternatives: polling the read endpoint, embed completion events, and automation platforms.

Connect Koji to Zapier: Automate Customer Research Workflows in Minutes

Route every completed AI customer interview from Koji into 6,000+ Zapier apps — including Notion, Linear, Salesforce, Airtable, and Gmail. A step-by-step integration guide.