Skip to main content
What changed in v2.1. Case studies no longer carry a single knowledge_base_id; they hold a list of document_ids instead, and the same document can be attached to multiple case studies. New endpoints under /{case_study_id}/documents cover upload, list, attach, detach, and reingest. The legacy knowledge_base_id field has been removed from create/update bodies and from response payloads. knowledge_base_document_count was renamed to document_count.See the Knowledge Base reference for how documents and collections work.Case studies can now also be scoped to specific programmes via the new programme_codes field. An empty list (the default) means the case study is open to all programmes — existing case studies keep working without any tagging.

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://staging-be.mind.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://staging-be.mind.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,
    "document_ids": ["6650f6a7b8c9d0e1f2a3b4c5", "6651a7b8c9d0e1f2a3b4c5d6"],
    "programme_codes": ["MPH"],
    "is_active": true,
    "created_at": "2025-06-01T14:00:00Z",
    "updated_at": null,
    "document_count": 2
  },
  "message": null
}

Get Case Study Metrics

GET /v1/console/case-studies/{case_study_id}/metrics
Returns the summary metrics shown on the case study dashboard: how many students are assigned, how many have completed it, the average session duration in minutes, and the average score as a percentage. All four values are computed dynamically from the latest data — nothing is cached or precomputed.

Authentication

Requires CASE_STUDIES.can_view permission.

Path parameters

case_study_id
string
required
The case study’s ID.

Metric definitions

MetricDefinition
students_assignedDistinct students with an explicit attempt record for this case study. A student becomes “assigned” the moment they’re added to the case study (via the Add Student flows) and given their base attempts.
students_completedDistinct students with at least one graded session for this case study. A session is graded when the rubric grader has produced a Grade document.
average_session_minutesMean of elapsed_active_time across sessions for this case study, in minutes, rounded to 1 decimal. Sessions that never started talking (elapsed_active_time == 0) are excluded so abandoned-pre-conversation rows don’t drag the average down. 0.0 if no qualifying sessions exist.
average_score_percentMean of final_score across all graded sessions for this case study, rounded to 1 decimal. Scores are 0–100. 0.0 if no graded sessions exist.

Example request

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

Response

{
  "success": true,
  "data": {
    "case_study_id": "6650e5f6a7b8c9d0e1f2a3b4",
    "students_assigned": 42,
    "students_completed": 17,
    "average_session_minutes": 12.5,
    "average_score_percent": 73.4
  },
  "message": null
}

Errors

StatusCodeCondition
404NOT_FOUNDThe case_study_id does not exist (or belongs to another tenant).
403FORBIDDENCaller lacks CASE_STUDIES.can_view.

Add Student to Case Study

POST /v1/console/case-studies/{case_study_id}/students
Add a single student to a case study via a form submission. Creates the student record if they don’t already exist, ensures they have an attempt record for this case study (3 base attempts by default), and merges the programme code into their profile if missing. This endpoint is idempotent for existing students — re-adding a student who’s already assigned won’t fail or duplicate anything. The response flags (user_created, attempt_record_created) tell the frontend what actually happened.
Student users created here are intended for CAS-SSO instances. They’re created with no password, no invite email, and status=ACTIVE so they can sign in via CAS immediately. If your instance doesn’t use CAS, students won’t be able to log in until you add an invite/password flow on top.

Authentication

Requires CASE_STUDIES.can_edit permission.

Path parameters

case_study_id
string
required
The case study’s ID.

Request body

full_name
string
required
The student’s full name. Max 255 characters. Split into first/middle/last on save.
email
string
required
The student’s email. Validated as RFC-compliant email.
programme_code
string
required
Programme code (e.g. MPH). Must already exist for this tenant — see the Programmes endpoint to create one first.

Example request

curl -X POST https://staging-be.mind.miva.university/v1/console/case-studies/6650e5f6a7b8c9d0e1f2a3b4/students \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "full_name": "Sultana Akinremi",
    "email": "sultana@miva.university",
    "programme_code": "MPH"
  }'

Response

{
  "success": true,
  "data": {
    "user_id": "6650f7a8b9c0d1e2f3a4b5c6",
    "email": "sultana@miva.university",
    "student_name": "Sultana Akinremi",
    "programme_code": "MPH",
    "case_study_id": "6650e5f6a7b8c9d0e1f2a3b4",
    "user_created": true,
    "attempt_record_created": true,
    "base_attempts": 3
  },
  "message": "Student added to case study"
}

Response fields

user_created
boolean
true if a new student record was created. false if the email already existed and we just associated them with the case study.
attempt_record_created
boolean
true if this is the first time the student was assigned to this case study. false if they already had an attempt record (re-adds are no-ops).
base_attempts
integer
The student’s max_attempts for this case study. Defaults to 3 for new assignments. If the student was previously granted extras, this reflects the current ceiling.

Audit logging

Every successful call records an ATTEMPT_GRANTED audit event with target_type: "case_study", target_id: <case_study_id>, and metadata including the actor, the target student’s id and email, the programme code, and both creation flags. Re-adds are still audited so the trail is complete.

Errors

StatusCodeCondition
404NOT_FOUNDThe case_study_id does not exist (or belongs to another tenant).
422VALIDATION_ERRORThe programme_code does not exist for this tenant, or no Student role is configured.
403FORBIDDENCaller lacks CASE_STUDIES.can_edit.

Bulk Upload Students

POST /v1/console/case-studies/{case_study_id}/students/upload
Upload a CSV of students and add them all to a case study in one request. Reuses the same find-or-create-student + ensure-attempt flow as the single Add Student endpoint, but applied to every row in the file. The endpoint processes partial success — valid rows are saved even when other rows fail validation. The response returns row-numbered errors so you can show the user exactly which rows to fix.

Authentication

Requires CASE_STUDIES.can_edit permission.

Path parameters

case_study_id
string
required
The case study’s ID.

Request body

Content-Type: multipart/form-data
file
file
required
A .csv file with the columns described below. Max size: 5 MiB (~50,000 student rows).

CSV format

The file must include these three columns. Header names are case-insensitive and accept either spaces or underscores (Full Name, full_name, FULL NAME all work):
ColumnRequiredDescription
Full NameThe student’s full name. Split into first/middle/last on save.
EmailThe student’s email. Validated as RFC-compliant.
Programme CodeProgramme code (e.g. MPH). Must already exist for this tenant.
Example CSV:
Full Name,Email,Programme Code
Sultana Akinremi,sultana@miva.university,MPH
Tunde Ojo,tunde@miva.university,MPH
Bola Eze,bola@miva.university,MBA
UTF-8 with or without BOM is accepted (Excel exports usually include a BOM).

Example request

curl -X POST https://staging-be.mind.miva.university/v1/console/case-studies/6650e5f6a7b8c9d0e1f2a3b4/students/upload \
  -H "Authorization: Bearer <access_token>" \
  -F "file=@students.csv"

Response

{
  "success": true,
  "data": {
    "total_records_processed": 5,
    "success_count": 3,
    "failure_count": 2,
    "errors": [
      { "row": 3, "email": "not-an-email", "reason": "Invalid Email format" },
      { "row": 5, "email": "x@example.com", "reason": "Non-existent Programme: 'XYZ'" }
    ]
  },
  "message": "Upload processed"
}
When every row is valid, errors is an empty array.

Response fields

total_records_processed
integer
Total number of data rows in the CSV (excluding the header).
success_count
integer
Rows that successfully resulted in a student being assigned (whether newly created or already existing).
failure_count
integer
Rows that failed validation or processing. success_count + failure_count == total_records_processed.
errors
array
One entry per failed row. Each contains row (1-indexed, with row 2 being the first data row — matches what Excel shows), email (the value from that row, or null if missing), and reason (a short human-readable explanation).

Validation rules (per row)

The order below is the order checks fire. The first failure for a row wins:
  1. Missing Full Name — empty after strip.
  2. Missing Email — empty after strip.
  3. Invalid Email format — fails RFC email validation.
  4. Missing Programme Code — empty after strip.
  5. Non-existent Programme: ‘CODE’ — programme code not found for this tenant.
  6. Duplicate email within file (first seen at row N) — same email appeared on an earlier row.
  7. Processing error: … — caught at save time (rare; usually a DB or schema issue).
Existing students (already in the tenant) are not flagged as failures — they’re just associated with the programme and case study like a normal valid row.

Audit logging

One ATTEMPT_BULK_GRANT audit event is recorded per upload (not per row), with metadata including the actor, the case study id, and the total/success/failure counts. Per-row creates are visible in the user collection’s created_at timestamps if you need finer granularity.

Errors

StatusCodeCondition
400VALIDATION_ERRORFile is empty, missing required headers, malformed CSV, or no data rows.
404NOT_FOUNDThe case_study_id does not exist (or belongs to another tenant).
413VALIDATION_ERRORFile exceeds the 5 MiB cap.
422VALIDATION_ERRORFile extension isn’t .csv, or no Student role is configured for the tenant.
403FORBIDDENCaller lacks CASE_STUDIES.can_edit.
Row-level failures do not produce non-200 responses — they’re returned inside the errors array of a 200 (or 201) response. The endpoint only returns 4xx when the entire upload can’t be processed.

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.
programme_codes
array
Programme codes (e.g. ["MPH", "MBA"]) that may access this case study. Validated against the Programmes list. Empty list (default) means open to all programmes — students with any or no programme affiliation will see it.
is_active
boolean
default:"true"
Visible to students.
Documents are attached to a case study via the document endpoints below — not via this body. A newly created case study has document_ids: [] and no RAG until at least one document is attached.

Example request

curl -X POST https://staging-be.mind.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",
    "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,
    "document_ids": [],
    "programme_codes": [],
    "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.
programme_codes
array
Replace the programme codes that may access this case study. Pass an empty list to open it to all programmes.
is_active
boolean
Active status.

Example request

curl -X PATCH https://staging-be.mind.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://staging-be.mind.miva.university/v1/console/case-studies/6650e5f6a7b8c9d0e1f2a3b4 \
  -H "Authorization: Bearer <access_token>"

Response

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

Documents

Each case study holds a list of document_ids referencing items in a knowledge base collection. The agent receives that list at session start and uses it to scope retrieval — empty list means no RAG. The relationship is many-to-many:
  • Many documents per case study. A single case study can attach as many documents as it needs — there’s no upper limit beyond what makes sense for retrieval quality. All attached documents are eligible for the agent’s retrieval pool on every user turn.
  • Same document across many case studies. A document uploaded once can be attached to any number of case studies. Detaching it from one case study has no effect on the others; the underlying document is shared.
The endpoints below cover the case-study-side flows: upload-and-attach, list, attach-existing (from the library), detach, and reingest. The library itself lives at /v1/console/knowledge-base/....

Upload & Attach Document

POST /v1/console/case-studies/{case_study_id}/documents
Convenience for the case-study editor: uploads a file and appends the resulting document id to the case study’s document_ids in one shot. Requires CASE_STUDIES.can_edit. By default the file lands in the configured KB_COLLECTION_NAME collection (default case-studies). Pass ?collection=<name> to upload into a different existing collection — useful if you’ve created collections for specific subject areas and want the upload to land there directly.

Path parameters

case_study_id
string
required
The case study’s id.

Query parameters

collection
string
Optional. Target collection name. Must already exist (create it first via the knowledge base collections endpoint). Defaults to KB_COLLECTION_NAME.

Request body

Content-Type: multipart/form-data
file
file
required
The document file to upload.
Supported types: PDF, DOCX, DOC, PPTX, PPT, TXT, Markdown. Max size: 25 MiB.

Example requests

Default collection:
curl -X POST https://staging-be.mind.miva.university/v1/console/case-studies/6650e5f6a7b8c9d0e1f2a3b4/documents \
  -H "Authorization: Bearer <access_token>" \
  -F "file=@diabetes-guidelines.pdf"
Targeting a specific collection:
curl -X POST "https://staging-be.mind.miva.university/v1/console/case-studies/6650e5f6a7b8c9d0e1f2a3b4/documents?collection=clinical-references" \
  -H "Authorization: Bearer <access_token>" \
  -F "file=@diabetes-guidelines.pdf"

Example response

{
  "success": true,
  "data": {
    "id": "6650f6a7b8c9d0e1f2a3b4c5",
    "filename": "diabetes-guidelines.pdf",
    "file_size": 2048576,
    "content_type": "application/pdf",
    "status": "pending",
    "error_message": null,
    "chunk_count": 0,
    "created_at": "2026-04-28T10:00:00Z"
  },
  "message": "Document attached and queued for ingestion"
}
The document is now in case_study.document_ids and will be picked up by the agent at session start once ingestion finishes.

List Attached Documents

GET /v1/console/case-studies/{case_study_id}/documents
Returns the documents attached to this case study, in attachment order. Requires CASE_STUDIES.can_view.

Example response

{
  "success": true,
  "data": [
    {
      "id": "6650f6a7b8c9d0e1f2a3b4c5",
      "filename": "diabetes-guidelines.pdf",
      "file_size": 2048576,
      "content_type": "application/pdf",
      "status": "completed",
      "error_message": null,
      "chunk_count": 42,
      "created_at": "2026-04-28T10:00:00Z"
    }
  ]
}

Attach Existing Documents

POST /v1/console/case-studies/{case_study_id}/documents/attach
Use this when the document already exists in the knowledge base library and you just want to add it to this case study. Documents that are already attached are silently skipped, so the call is idempotent. Requires CASE_STUDIES.can_edit.

Request body

document_ids
array
required
One or more KBDocument ids to attach. Every id must reference a non-deleted document in this tenant.

Example request

curl -X POST https://staging-be.mind.miva.university/v1/console/case-studies/6650e5f6a7b8c9d0e1f2a3b4/documents/attach \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{ "document_ids": ["6650f6a7b8c9d0e1f2a3b4c5", "6651a7b8c9d0e1f2a3b4c5d6"] }'

Example response

Returns the full case study detail (same shape as Get Case Study) so the frontend can refresh the editor in one call.

Errors

StatusCodeCondition
404NOT_FOUNDOne or more document_ids do not exist (or belong to another tenant). The error details list the missing ids.

Detach Document

DELETE /v1/console/case-studies/{case_study_id}/documents/{document_id}
Removes the document from document_ids. Detach only — the document is not deleted and remains attachable to other case studies. To hard-delete the document and remove its vectors entirely, use the knowledge base delete endpoint. Requires CASE_STUDIES.can_edit.

Example response

{
  "success": true,
  "message": "Document detached"
}

Re-ingest Document

POST /v1/console/case-studies/{case_study_id}/documents/{document_id}/reingest
Drops the existing vectors for this document, resets its status to pending, and re-queues ingestion. Useful after the source file has been replaced or you want to refresh the embeddings. The document stays attached to the case study throughout. Requires CASE_STUDIES.can_edit.

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://staging-be.mind.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://staging-be.mind.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://staging-be.mind.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://staging-be.mind.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://staging-be.mind.miva.university/v1/console/case-study-avatars/6650a1b2c3d4e5f6a7b8c9d0 \
  -H "Authorization: Bearer <access_token>"

Response

Returns the soft-deleted avatar object.