> ## Documentation Index
> Fetch the complete documentation index at: https://intervyo.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Mock interviews, step by step

> Give people a realistic practice interview they can repeat as often as they like — perfect for embedding in your own app.

A mock interview is a **practice round**. It should feel real, but the person
can retry as many times as they want and always gets feedback on how to improve.

This is the most common setup for self-serve products (think "practice with AI"
buttons in a learning app).

<Note>
  You need an API key (`iv_live_...`) from **Developer → API Keys**. Use it in
  the `x-api-key` header and replace `<slug>` with your team slug.
</Note>

## Step 1 — Create a realistic interviewer

Real-feeling and challenging, but with improvement feedback turned on.

```bash theme={null}
curl -X POST "https://www.intervyo.ai/api/v1/interviewers?accountSlug=<slug>" \
  -H "x-api-key: iv_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "FAANG Mock Interviewer",
    "persona": "Jordan, a big-tech interviewer running a practice round.",
    "useCase": "training",
    "evaluationDimensions": [
      { "name": "Problem Solving", "description": "Approach and edge cases", "weight": 60 },
      { "name": "Communication",   "description": "Thinks out loud",         "weight": 40 }
    ],
    "interaction": { "tone": "challenging", "difficulty": "hard", "probingDepth": "high" },
    "output": { "includeImprovementFeedback": true }
  }'
```

👉 Save the `id` as `AGENT_ID`.

## Step 2 — Make a practice template

```bash theme={null}
curl -X POST "https://www.intervyo.ai/api/v1/roles?accountSlug=<slug>" \
  -H "x-api-key: iv_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "template_name": "DSA Mock Interview",
    "use_case": "training",
    "description": "A practice coding interview for new grads.",
    "objective": "Help the candidate feel ready for a real interview.",
    "success_outcome": "pass_fail",
    "default_session_mode": "practice_session"
  }'
```

👉 Save the `id` as `TEMPLATE_ID`.

## Step 3 — Add one repeatable round

One stage, `practice_session` type, retakes on.

```bash theme={null}
curl -X POST "https://www.intervyo.ai/api/v1/rounds?accountSlug=<slug>" \
  -H "x-api-key: iv_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "role_id": "TEMPLATE_ID",
    "type": "practice",
    "stage_name": "Mock Round",
    "stage_type": "practice_session",
    "stage_order": 0,
    "allow_retake": true,
    "duration_minutes": 45,
    "interviewer_id": "AGENT_ID"
  }'
```

## Step 4 — Add the practicing user

Use your app's user ID as `external_id` so you can match results back.

```bash theme={null}
curl -X POST "https://www.intervyo.ai/api/v1/participants?accountSlug=<slug>" \
  -H "x-api-key: iv_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Priya Patel",
    "email": "priya@student.edu",
    "external_id": "user_98213",
    "role_id": "TEMPLATE_ID",
    "profile": { "title": "New Grad", "experienceLevel": "entry" }
  }'
```

👉 Save the `id` as `USER_ID`.

## Step 5 — Start the mock (again and again)

Each time the user clicks "Practice", schedule a new session.

```bash theme={null}
curl -X POST "https://www.intervyo.ai/api/v1/sessions?accountSlug=<slug>" \
  -H "x-api-key: iv_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "candidate_id": "USER_ID",
    "role_id": "TEMPLATE_ID",
    "stage": "practice"
  }'
```

Because retakes are on, you can do this as many times as the user wants.

## Step 6 — Show their improvement

List the user's sessions to draw a "your scores over time" chart in your app.

<Card title="List a user's attempts" icon="list" href="/api-reference/participants/get-participants-id-sessions">
  `GET /api/v1/participants/{id}/sessions` returns every practice attempt.
</Card>

## Want it inside your own app?

Mock interviews shine when they live right in your product. Embed the live
interview with a token-authed widget — no redirect to us.

<Card title="Embed the widget" icon="code" href="/en/guides/embed-widget">
  Drop the AI interviewer into your app, white-labeled.
</Card>

<Tip>
  For coding mocks, the [code execution](/api-reference/code-execution/post-code-execute)
  endpoint runs the candidate's code against test cases and returns pass/fail
  per case.
</Tip>
