> ## 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.

# 模擬面接 ステップバイステップ

> 何度でも繰り返せるリアルな練習面接を提供します—自社アプリへの組み込みに最適です。

模擬面接は **練習ラウンド** です。リアルに感じられる一方で、参加者は好きなだけ何度でも再挑戦でき、改善方法に関するフィードバックを常に受け取れます。

これはセルフサービス型プロダクト（学習アプリ内の「AIで練習する」ボタンなどを想像してください）で最も一般的なセットアップです。

<Note>
  **Developer → API Keys** から取得したAPIキー（`iv_live_...`）が必要です。これを
  `x-api-key` ヘッダーに設定し、`<slug>` をご自身のチームスラッグに置き換えてください。
</Note>

## ステップ 1 — リアルな面接担当者を作成する

リアルで歯ごたえがありつつ、改善フィードバックをオンにします。

```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 }
  }'
```

👉 `id` を `AGENT_ID` として保存してください。

## ステップ 2 — 練習用テンプレートを作成する

```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",
    "default_duration_minutes": 45
  }'
```

👉 `id` を `TEMPLATE_ID` として保存してください。

## ステップ 3 — 繰り返し可能なラウンドを1つ追加する

ステージは1つ、タイプは `practice_session`、再受験はオンにします。

```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"
  }'
```

## ステップ 4 — 練習するユーザーを追加する

結果をあとで突き合わせられるよう、`external_id` には自社アプリのユーザーIDを使用してください。

```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" }
  }'
```

👉 `id` を `USER_ID` として保存してください。

## ステップ 5 — 模擬面接を開始する（何度でも）

ユーザーが「練習」をクリックするたびに、新しいセッションをスケジュールします。

```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"
  }'
```

再受験がオンになっているため、ユーザーが望むだけ何度でもこれを実行できます。

## ステップ 6 — 成長を可視化する

ユーザーのセッション一覧を取得し、自社アプリ内で「スコアの推移」グラフを描画しましょう。

<Card title="ユーザーの受験履歴を取得する" icon="list" href="/api-reference/participants/get-participants-id-sessions">
  `GET /api/v1/participants/{id}/sessions` で、すべての練習の受験記録が返されます。
</Card>

## 自社アプリ内に組み込みたいですか？

模擬面接は、自社プロダクトの中に直接組み込むことで真価を発揮します。トークン認証ウィジェットでライブ面接を埋め込めば、こちらへのリダイレクトは不要です。

<Card title="ウィジェットを埋め込む" icon="code" href="/jp/guides/embed-widget">
  ホワイトラベル化されたAI面接担当者を自社アプリに組み込みます。
</Card>

<Tip>
  コーディングの模擬面接では、[コード実行](/api-reference/code-execution/post-code-execute)
  エンドポイントが候補者のコードをテストケースに対して実行し、ケースごとに合否（pass/fail）を返します。
</Tip>
