Skip to main content

List Case Studies

GET /v1/console/case-studies
List all case studies in the tenant, including inactive ones.

Authentication

Requires CASE_STUDIES.can_view permission.

Query parameters

skip
integer
default:"0"
Number of records to skip.
limit
integer
default:"20"
Max records to return (1-100).
include_inactive
boolean
default:"false"
Include inactive case studies.

Example request

curl "https://mind-be.staging.miva.university/v1/console/case-studies?include_inactive=true" \
  -H "Authorization: Bearer <access_token>"

Response

{
  "success": true,
  "data": [
    {
      "id": "6650e5f6a7b8c9d0e1f2a3b4",
      "title": "Diabetic Patient Consultation",
      "slug": "diabetic-patient-consultation",
      "description": "Practice a consultation with a Type 2 diabetic patient...",
      "avatar_id": "6650a1b2c3d4e5f6a7b8c9d0",
      "avatar": {
        "id": "6650a1b2c3d4e5f6a7b8c9d0",
        "name": "Maria Rodriguez",
        "image_url": "https://cdn.example.com/avatars/maria.png",
        "bio": "Maria is a 54-year-old teacher recently diagnosed with Type 2 diabetes.",
        "role": "Patient",
        "tags": ["diabetes", "chronic-care"],
        "is_active": true
      },
      "media_url": null,
      "document_url": null,
      "instructions": [],
      "time_limit_minutes": null,
      "is_active": true,
      "created_at": "2025-06-01T14:00:00Z"
    }
  ],
  "total": 1,
  "page": 1,
  "page_size": 20,
  "total_pages": 1,
  "message": null
}

Get Case Study

GET /v1/console/case-studies/{case_study_id}
Get the full case study detail including system prompt and AI overrides.

Authentication

Requires CASE_STUDIES.can_view permission.

Path parameters

case_study_id
string
required
The case study’s ID.

Example request

curl https://mind-be.staging.miva.university/v1/console/case-studies/6650e5f6a7b8c9d0e1f2a3b4 \
  -H "Authorization: Bearer <access_token>"

Response

{
  "success": true,
  "data": {
    "id": "6650e5f6a7b8c9d0e1f2a3b4",
    "title": "Diabetic Patient Consultation",
    "slug": "diabetic-patient-consultation",
    "description": "Practice a consultation with a Type 2 diabetic patient...",
    "avatar_id": "6650a1b2c3d4e5f6a7b8c9d0",
    "avatar": {
      "id": "6650a1b2c3d4e5f6a7b8c9d0",
      "name": "Maria Rodriguez",
      "image_url": "https://cdn.example.com/avatars/maria.png",
      "bio": "Maria is a 54-year-old teacher recently diagnosed with Type 2 diabetes.",
      "role": "Patient",
      "tags": ["diabetes", "chronic-care"],
      "is_active": true
    },
    "media_url": null,
    "document_url": null,
    "instructions": [],
    "time_limit_minutes": null,
    "system_prompt": null,
    "first_message": null,
    "llm_model": null,
    "tts_voice": null,
    "stt_language": null,
    "knowledge_base_id": "6650d4e5f6a7b8c9d0e1f2a3",
    "is_active": true,
    "created_at": "2025-06-01T14:00:00Z",
    "updated_at": null,
    "knowledge_base_document_count": 3
  },
  "message": null
}

Create Case Study

POST /v1/console/case-studies
Create a new case study. Link a reusable avatar by passing its ID in the avatar field.

Authentication

Requires CASE_STUDIES.can_create permission.

Request body

title
string
required
Case study title. Max 255 characters.
slug
string
URL-safe slug. Auto-generated from the title if omitted.
description
string
Description. Max 5000 characters.
avatar
string
ID of a reusable case study avatar. Create avatars via the Avatars endpoints.
media_url
string
Media URL (image/video). Max 1000 characters.
document_url
string
Document URL (PDF). Max 1000 characters.
instructions
array
List of instruction strings. Max 20 items.
time_limit_minutes
integer
Session time limit (1-180 minutes).
system_prompt
string
Custom system prompt for the AI agent.
first_message
string
AI’s opening message. Max 2000 characters.
llm_model
string
Override LLM model. Max 100 characters.
tts_voice
string
Override TTS voice. Max 100 characters.
stt_language
string
Override STT language. Max 10 characters.
knowledge_base_id
string
Knowledge base ID for RAG context.
is_active
boolean
default:"true"
Visible to students.

Example request

curl -X POST https://mind-be.staging.miva.university/v1/console/case-studies \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Diabetic Patient Consultation",
    "description": "Practice a consultation with a Type 2 diabetic patient.",
    "avatar": "6650a1b2c3d4e5f6a7b8c9d0",
    "knowledge_base_id": "6650d4e5f6a7b8c9d0e1f2a3",
    "time_limit_minutes": 30
  }'

Response

{
  "success": true,
  "data": {
    "id": "6650e5f6a7b8c9d0e1f2a3b4",
    "title": "Diabetic Patient Consultation",
    "slug": "diabetic-patient-consultation",
    "description": "Practice a consultation with a Type 2 diabetic patient.",
    "avatar_id": "6650a1b2c3d4e5f6a7b8c9d0",
    "avatar": {
      "id": "6650a1b2c3d4e5f6a7b8c9d0",
      "name": "Maria Rodriguez",
      "image_url": "https://cdn.example.com/avatars/maria.png",
      "bio": "Maria is a 54-year-old teacher recently diagnosed with Type 2 diabetes.",
      "role": "Patient",
      "tags": ["diabetes", "chronic-care"],
      "is_active": true
    },
    "media_url": null,
    "document_url": null,
    "instructions": [],
    "time_limit_minutes": 30,
    "system_prompt": null,
    "first_message": null,
    "llm_model": null,
    "tts_voice": null,
    "stt_language": null,
    "knowledge_base_id": "6650d4e5f6a7b8c9d0e1f2a3",
    "is_active": true,
    "created_at": "2025-06-01T14:00:00Z",
    "updated_at": null
  },
  "message": "Case study created successfully"
}
When llm_model, tts_voice, or stt_language are null, the tenant’s AI config defaults are used at runtime.

Update Case Study

PATCH /v1/console/case-studies/{case_study_id}
Partial update — only send the fields you want to change.

Authentication

Requires CASE_STUDIES.can_edit permission.

Path parameters

case_study_id
string
required
The case study’s ID.

Request body

title
string
Updated title.
slug
string
Updated slug.
description
string
Updated description.
avatar
string
ID of a different reusable avatar.
media_url
string
Updated media URL.
document_url
string
Updated document URL.
instructions
array
Updated instructions list.
time_limit_minutes
integer
Updated time limit.
system_prompt
string
Updated system prompt.
first_message
string
Updated first message.
llm_model
string
Override LLM model.
tts_voice
string
Override TTS voice.
stt_language
string
Override STT language.
knowledge_base_id
string
Link a different knowledge base.
is_active
boolean
Active status.

Example request

curl -X PATCH https://mind-be.staging.miva.university/v1/console/case-studies/6650e5f6a7b8c9d0e1f2a3b4 \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "avatar": "6650b2c3d4e5f6a7b8c9d0e1",
    "system_prompt": "You are Maria Rodriguez, a 54-year-old patient. Be cooperative but anxious.",
    "llm_model": "gpt-4o"
  }'

Response

Returns the full updated case study object.

Delete Case Study

DELETE /v1/console/case-studies/{case_study_id}
Soft-delete a case study. Students will no longer see it, but existing session data is preserved.

Authentication

Requires CASE_STUDIES.can_delete permission.

Path parameters

case_study_id
string
required
The case study’s ID.

Example request

curl -X DELETE https://mind-be.staging.miva.university/v1/console/case-studies/6650e5f6a7b8c9d0e1f2a3b4 \
  -H "Authorization: Bearer <access_token>"

Response

Returns the soft-deleted case study object with is_active: false.

List Avatars

GET /v1/console/case-study-avatars
List all case study avatars in the tenant, including inactive ones.

Authentication

Requires CASE_STUDIES.can_view permission.

Query parameters

skip
integer
default:"0"
Number of records to skip.
limit
integer
default:"20"
Max records to return (1-100).

Example request

curl "https://mind-be.staging.miva.university/v1/console/case-study-avatars" \
  -H "Authorization: Bearer <access_token>"

Response

{
  "success": true,
  "data": [
    {
      "id": "6650a1b2c3d4e5f6a7b8c9d0",
      "name": "Maria Rodriguez",
      "image_url": "https://cdn.example.com/avatars/maria.png",
      "role": "Patient",
      "tags": ["diabetes", "chronic-care"],
      "is_active": true,
      "created_at": "2025-06-01T14:00:00Z"
    }
  ],
  "total": 1,
  "page": 1,
  "page_size": 20,
  "total_pages": 1,
  "message": null
}

Get Avatar

GET /v1/console/case-study-avatars/{avatar_id}
Get a specific avatar’s full details.

Authentication

Requires CASE_STUDIES.can_view permission.

Path parameters

avatar_id
string
required
The avatar’s ID.

Example request

curl https://mind-be.staging.miva.university/v1/console/case-study-avatars/6650a1b2c3d4e5f6a7b8c9d0 \
  -H "Authorization: Bearer <access_token>"

Response

{
  "success": true,
  "data": {
    "id": "6650a1b2c3d4e5f6a7b8c9d0",
    "name": "Maria Rodriguez",
    "image_url": "https://cdn.example.com/avatars/maria.png",
    "bio": "Maria is a 54-year-old teacher recently diagnosed with Type 2 diabetes.",
    "role": "Patient",
    "tags": ["diabetes", "chronic-care"],
    "is_active": true,
    "created_at": "2025-06-01T14:00:00Z",
    "updated_at": null
  },
  "message": null
}

Create Avatar

POST /v1/console/case-study-avatars
Create a reusable avatar that can be linked to case studies via the avatar field.

Authentication

Requires CASE_STUDIES.can_create permission.

Request body

name
string
required
Avatar name. Max 255 characters.
image_url
string
Avatar image URL. Max 1000 characters.
bio
string
Character background. Max 2000 characters.
role
string
Character role (e.g. “Patient”, “Client”). Max 255 characters.
tags
array
Tags for categorization. Max 20 items.
is_active
boolean
default:"true"
Active status.

Example request

curl -X POST https://mind-be.staging.miva.university/v1/console/case-study-avatars \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Maria Rodriguez",
    "role": "Patient",
    "bio": "Maria is a 54-year-old teacher recently diagnosed with Type 2 diabetes.",
    "tags": ["diabetes", "chronic-care"]
  }'

Response

{
  "success": true,
  "data": {
    "id": "6650a1b2c3d4e5f6a7b8c9d0",
    "name": "Maria Rodriguez",
    "image_url": null,
    "bio": "Maria is a 54-year-old teacher recently diagnosed with Type 2 diabetes.",
    "role": "Patient",
    "tags": ["diabetes", "chronic-care"],
    "is_active": true,
    "created_at": "2025-06-01T14:00:00Z",
    "updated_at": null
  },
  "message": "Case study avatar created successfully"
}

Update Avatar

PATCH /v1/console/case-study-avatars/{avatar_id}
Partial update — only send the fields you want to change.

Authentication

Requires CASE_STUDIES.can_edit permission.

Path parameters

avatar_id
string
required
The avatar’s ID.

Request body

name
string
Updated name.
image_url
string
Updated image URL.
bio
string
Updated bio.
role
string
Updated role.
tags
array
Updated tags.
is_active
boolean
Active status.

Example request

curl -X PATCH https://mind-be.staging.miva.university/v1/console/case-study-avatars/6650a1b2c3d4e5f6a7b8c9d0 \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{ "bio": "Updated background story." }'

Response

Returns the full updated avatar object.

Delete Avatar

DELETE /v1/console/case-study-avatars/{avatar_id}
Soft-delete an avatar.

Authentication

Requires CASE_STUDIES.can_delete permission.

Path parameters

avatar_id
string
required
The avatar’s ID.

Example request

curl -X DELETE https://mind-be.staging.miva.university/v1/console/case-study-avatars/6650a1b2c3d4e5f6a7b8c9d0 \
  -H "Authorization: Bearer <access_token>"

Response

Returns the soft-deleted avatar object.