SDKGet your keys

Get your interviewId & API keys

Every Ear3 integration needs exactly two values. This page is the canonical walkthrough for finding both — and for telling them apart from the values that look similar but won’t work.

ValueFormatWhere it lives
interviewIdcm… (cuid, ~25 chars)Dashboard → your interview → Deploy
publishableKeypk_test_… / pk_live_…Dashboard → Settings → API Keys

Step 1 — create and deploy an interview

  1. Open the dashboard: app.ear3.ai/v2/researcher (redirects into your workspace).
  2. Interviews → Create — author your questions (by hand, with ThirdAI generation, or by importing a template). Details: Creating an interview.
  3. Click Deploy and walk the wizard (choose voice / text / both).
  4. The wizard’s output is the Deployment ID — a cm… string. That is your interviewId.
Deployment id ≠ survey id

If the id you copied looks like a UUID (9453c463-74b6-4ff8-… — five dash-separated groups), you grabbed the survey id from an editor URL. The SDK will answer 404 interview_not_found. Go back to the interview’s Deploy tab and copy the deployment id — it starts with cm.

Also check the deployment is Active — expired or paused deployments answer 409 interview_inactive / 410 interview_expired.

Step 2 — mint API keys

Settings → API Keys → Create key (direct path: /v2/researcher/{workspace}/settings/api-keys). You’ll see three key types — they are not interchangeable:

PrefixTypeWhere it may liveUsed for
pk_test_ / pk_live_PublishableBrowser bundles — safe to expose<Ear3Interview>, <Ear3VoiceInterview>
sk_test_ / sk_live_SecretServer only — never ship to a browser@ear3/server (sessions.retrieve, …)
whsec_WebhookServer onlyVerifying interview_completed signatures

Use _test_ keys while integrating; switch to _live_ for real respondents. The key must belong to the same workspace as the deployment — a key from another workspace answers 403 workspace_mismatch.

Step 3 — put both in env

Never hardcode the values in source. Browser-read vars need your framework’s public prefix:

# .env.local (Next.js — use VITE_ for Vite, REACT_APP_ for CRA)
NEXT_PUBLIC_EAR3_INTERVIEW_ID=cm...       # deployment id from Step 1
NEXT_PUBLIC_EAR3_VOICE_INTERVIEWER_KEY=pk_test_...

The publishable key is browser-safe by design — env vars here aren’t about secrecy; they keep ids out of source control and let dev/staging/prod each point at their own interview.

For AI agents doing this integration

Create the env entries above with placeholder values, wire the component to read them, and tell the user to fill in the real values from the dashboard paths on this page. Do not invent values; do not put an sk_ key in browser code; and validate the id format — cm…, not a UUID.

Verify before writing code

One curl tells you whether the pair works:

curl -s -X POST \
  "https://app.ear3.ai/api/v1/interviews/$INTERVIEW_ID/sessions" \
  -H 'Content-Type: application/json' \
  -d "{\"publishableKey\":\"$PUBLISHABLE_KEY\",\"mode\":\"hosted\"}"

A working pair returns { "sessionId": …, "sessionUrl": … }. Errors map directly to the mistakes above:

ResponseMeaning
404 interview_not_foundWrong id — likely a survey UUID, not a deployment id
401 invalid_api_keyKey typo, or key from a different environment
403 workspace_mismatchKey and deployment belong to different workspaces
409 / 410Deployment inactive / expired — redeploy

Next


Built by Ear3 — voice interviews for any app.
⌘/