---
title: "Create a micro-game"
method: POST
path: "/api/journey/template/micro-games"
tags: ["journey"]
---

# Create a micro-game

`POST /api/journey/template/micro-games`

## Request body

- CreateMicroGameRequest — Create a micro-game (used as game_type in a step's micro_game content).
  - `code` string, required — Unique game code
  - `title` string, required — Game title
  - `category` string, required — Motivation category
  - `appointment_group` AppointmentGroupConfig, required — Appointment range for a game.
    - `min` integer, required — Minimum completed appointments (inclusive)
    - `max` integer, required — Maximum completed appointments (inclusive)
  - `total_duration_seconds` integer, nullable — Estimated duration
  - `dedup_key` string, nullable — Dedup key; derived from category + group when omitted
  - `display_order` integer, nullable — Order within category; appended last when omitted
  - `enabled` boolean — Whether the game is active
  - `screens` union[] — Ordered screens
    - union
      - IntroScreen — Introductory screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'intro'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `visual` VisualConfig — Visual asset for intro screens.
          - `type` string, required — Asset type: image, lottie, icon
          - `asset` string, required — Asset filename or identifier
        - `transition` string — Transition type: tap, button, auto
        - `button_label` string, nullable — Button label when transition is 'button'
        - `blocks` union[], required — Composable blocks for client (text, image, etc.).
          - union
            - TextBlock — A text block inside a screen.
              - …
            - ImageBlock — An image block inside a screen.
              - …
            - SingleChoiceBlock — A single-choice block inside a screen.
              - …
            - ChoiceSectionsBlock — A multi-section choice block inside a screen.
              - …
            - TextInputBlock — A text-input block inside a screen.
              - …
            - ResultRowsBlock — A result-summary rows block inside a screen.
              - …
            - AudioBlock — An audio block inside a screen.
              - …
      - SingleChoiceScreen — Single-choice question screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'single_choice'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `microcopy` string, nullable — Helper text
        - `button_label` string, nullable — Submit button label
        - `blocks` union[], required — Composable blocks (text, single_choice).
          - union
            - TextBlock — A text block inside a screen.
              - …
            - ImageBlock — An image block inside a screen.
              - …
            - SingleChoiceBlock — A single-choice block inside a screen.
              - …
            - ChoiceSectionsBlock — A multi-section choice block inside a screen.
              - …
            - TextInputBlock — A text-input block inside a screen.
              - …
            - ResultRowsBlock — A result-summary rows block inside a screen.
              - …
            - AudioBlock — An audio block inside a screen.
              - …
      - TextInputScreen — Free text input screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'text_input'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `question` string, required — Question/prompt text
        - `placeholder` string, nullable — Placeholder text
        - `min_chars` integer — Minimum characters required
        - `max_chars` integer, nullable — Maximum characters allowed
        - `anti_block_hint` string, nullable — Hint to reduce writing block
        - `save_as` string, required — Variable name to store input
        - `button_label` string — Submit button label
        - `blocks` union[], nullable — Optional composable blocks (e.g. title text)
          - union
            - TextBlock — A text block inside a screen.
              - …
            - ImageBlock — An image block inside a screen.
              - …
            - SingleChoiceBlock — A single-choice block inside a screen.
              - …
            - ChoiceSectionsBlock — A multi-section choice block inside a screen.
              - …
            - TextInputBlock — A text-input block inside a screen.
              - …
            - ResultRowsBlock — A result-summary rows block inside a screen.
              - …
            - AudioBlock — An audio block inside a screen.
              - …
      - MultiSectionChoiceScreen — Multi-section choice screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'multi_section_choice'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `layout` string — Layout style: quadrant, list, grid
        - `microcopy` string, nullable — Helper text
        - `button_label` string — Submit button label
        - `blocks` union[], required — Composable blocks for client (text, choice_sections, etc.).
          - union
            - TextBlock — A text block inside a screen.
              - …
            - ImageBlock — An image block inside a screen.
              - …
            - SingleChoiceBlock — A single-choice block inside a screen.
              - …
            - ChoiceSectionsBlock — A multi-section choice block inside a screen.
              - …
            - TextInputBlock — A text-input block inside a screen.
              - …
            - ResultRowsBlock — A result-summary rows block inside a screen.
              - …
            - AudioBlock — An audio block inside a screen.
              - …
      - ResultScreen — Result/summary card screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'result'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `layout` string — Layout style: card, list
        - `dynamic_text_from` string, nullable — Source for dynamic text: 'scoring_rules'
        - `save_to_journey` boolean — Whether to save to 'Il mio percorso'
        - `cta` CtaConfig — Call-to-action configuration.
          - `type` string, required — CTA type: write_expert, call_conoscitiva, save_to_journey, copy_message, url, chat_expert
          - `label` string, required — CTA button label
          - `url` string, nullable — Optional URL for type 'url'
          - `message_template` string, nullable — Optional backend-side template for message_for_chat (e.g. 'Ciao... {{var}}')
          - `message_variables` object, nullable — Map template placeholders -> variable names from responses (e.g. {'fatica': 'dr_dove_sono_fatica'})
          - `profession` string, nullable — Target profession (psi/nutri) for profession-dependent CTAs; resolved per patient at render time
        - `blocks` union[], required — Composable blocks for client (text, result_rows, image, dynamic_text).
          - union
            - TextBlock — A text block inside a screen.
              - …
            - ImageBlock — An image block inside a screen.
              - …
            - SingleChoiceBlock — A single-choice block inside a screen.
              - …
            - ChoiceSectionsBlock — A multi-section choice block inside a screen.
              - …
            - TextInputBlock — A text-input block inside a screen.
              - …
            - ResultRowsBlock — A result-summary rows block inside a screen.
              - …
            - AudioBlock — An audio block inside a screen.
              - …
      - DynamicMessageScreen — Pre-compiled message for the expert.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'dynamic_message'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `title` string, nullable — Screen title
        - `template` string, required — Message template with {variable} placeholders
        - `editable` boolean — Whether the user can edit the message
        - `cta` CtaConfig — Call-to-action configuration.
          - `type` string, required — CTA type: write_expert, call_conoscitiva, save_to_journey, copy_message, url, chat_expert
          - `label` string, required — CTA button label
          - `url` string, nullable — Optional URL for type 'url'
          - `message_template` string, nullable — Optional backend-side template for message_for_chat (e.g. 'Ciao... {{var}}')
          - `message_variables` object, nullable — Map template placeholders -> variable names from responses (e.g. {'fatica': 'dr_dove_sono_fatica'})
          - `profession` string, nullable — Target profession (psi/nutri) for profession-dependent CTAs; resolved per patient at render time
      - VideoScreen — Video content screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'video'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `url` string, nullable — External video URL
        - `file_path` string, nullable — Internal file path
        - `transcript` string, nullable — Video transcript / script text
        - `button_label` string — Continue button label
      - AudioScreen — Audio content screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'audio'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `url` string, nullable — External audio URL
        - `file_path` string, nullable — Internal file path
        - `transcript` string, nullable — Audio transcript / script text
        - `button_label` string — Continue button label
      - PuzzleScreen — Image puzzle screen (grid-based).
        - `id` string, required — Unique screen identifier within the game
        - `type` 'puzzle'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `file_path` string, nullable — Internal image file path for the puzzle (e.g. journey/games/images/...).
        - `visual` PuzzleVisualConfig — Grid config for a puzzle screen.
          - `rows` integer, required — Number of rows
          - `cols` integer, required — Number of columns
        - `blocks` union[] — Optional blocks (e.g. title text) shown with the puzzle.
          - union
            - TextBlock — A text block inside a screen.
              - …
            - ImageBlock — An image block inside a screen.
              - …
            - SingleChoiceBlock — A single-choice block inside a screen.
              - …
            - ChoiceSectionsBlock — A multi-section choice block inside a screen.
              - …
            - TextInputBlock — A text-input block inside a screen.
              - …
            - ResultRowsBlock — A result-summary rows block inside a screen.
              - …
            - AudioBlock — An audio block inside a screen.
              - …
        - `button_label` string, nullable — Button label shown when the user finishes the puzzle.
      - CustomScreen — Custom content screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'custom'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `transition` string, nullable — Transition type: tap, button, auto
        - `blocks` union[], required — Composable blocks (e.g. text + video) for fully custom layouts.
          - union
            - TextBlock — A text block inside a screen.
              - …
            - ImageBlock — An image block inside a screen.
              - …
            - SingleChoiceBlock — A single-choice block inside a screen.
              - …
            - ChoiceSectionsBlock — A multi-section choice block inside a screen.
              - …
            - TextInputBlock — A text-input block inside a screen.
              - …
            - ResultRowsBlock — A result-summary rows block inside a screen.
              - …
            - AudioBlock — An audio block inside a screen.
              - …
        - `button_label` string, nullable — Continue button label
      - CardFlipScreen — Card flip interaction screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'card_flip'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `instruction` string, nullable — Instruction text
        - `microcopy` string, nullable — Helper text
        - `cards` CardConfig[], required — Cards to display
          - `id` string, required — Card identifier
          - `front_image` string, required — Image shown on front of card
          - `back_image` string, required — Image shown on back of card
        - `select_mode` string — Selection mode: single, multi, none
        - `save_as` string, nullable — Variable name to store selection
        - `button_label` string, nullable — Continue button label
      - ConditionalGroupScreenInput — Branching screen that shows different sub-screens based on a previous choice.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'conditional_group'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `switch_on` string, required — Variable name to branch on
        - `branches` object, required — Map of option_id -> branch with sub-screens
      - LetterScreen — Letter writing/reading screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'letter'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `mode` string — Mode: write, read
        - `prompt` string, nullable — Writing prompt
        - `placeholder` string, nullable — Placeholder text
        - `max_chars` integer, nullable — Maximum characters
        - `save_as` string, nullable — Variable name to store letter text
        - `button_label` string — Submit button label
  - `scoring_rules` ScoringRule[] — Dynamic text scoring rules
    - `id` string, required — Rule identifier
    - `conditions` ScoringCondition[], required — Conditions to check
      - `variable` string, required — Variable name to check
      - `operator` string, required — Operator: eq, neq, in, not_in, gt, lt
      - `value` string, nullable — Single value (for eq/neq/gt/lt)
      - `values` string[], nullable — Multiple values (for in/not_in)
      - `value_variable` string, nullable — Optional variable name to compare against instead of a constant value (for eq/neq/gt/lt between two variables, e.g. 'economico_score' vs 'emotivo_score').
    - `match` string — Match mode: 'all' (AND) or 'any' (OR)
    - `output_text` string, required — Text to display when conditions are met
    - `priority` integer — Priority (lower = higher priority)

## Response `201`

Successful Response

- MicroGameTemplateResponse — Response for GET /journey/micro-games/{game_type}.
  - `id` string, required — Game type identifier
  - `title` string, required — Game title
  - `subtitle` string, nullable — Subtitle / intro quote
  - `category` string, required — Motivation category
  - `appointment_group` AppointmentGroupConfig, required — Appointment range for a game.
    - `min` integer, required — Minimum completed appointments (inclusive)
    - `max` integer, required — Maximum completed appointments (inclusive)
  - `total_duration_seconds` integer, nullable — Estimated duration
  - `screens` union[], required — Ordered list of screens, typed by 'type'
    - union
      - IntroScreen — Introductory screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'intro'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `visual` VisualConfig — Visual asset for intro screens.
          - `type` string, required — Asset type: image, lottie, icon
          - `asset` string, required — Asset filename or identifier
        - `transition` string — Transition type: tap, button, auto
        - `button_label` string, nullable — Button label when transition is 'button'
        - `blocks` union[], required — Composable blocks for client (text, image, etc.).
          - union
            - TextBlock — A text block inside a screen.
              - …
            - ImageBlock — An image block inside a screen.
              - …
            - SingleChoiceBlock — A single-choice block inside a screen.
              - …
            - ChoiceSectionsBlock — A multi-section choice block inside a screen.
              - …
            - TextInputBlock — A text-input block inside a screen.
              - …
            - ResultRowsBlock — A result-summary rows block inside a screen.
              - …
            - AudioBlock — An audio block inside a screen.
              - …
      - SingleChoiceScreen — Single-choice question screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'single_choice'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `microcopy` string, nullable — Helper text
        - `button_label` string, nullable — Submit button label
        - `blocks` union[], required — Composable blocks (text, single_choice).
          - union
            - TextBlock — A text block inside a screen.
              - …
            - ImageBlock — An image block inside a screen.
              - …
            - SingleChoiceBlock — A single-choice block inside a screen.
              - …
            - ChoiceSectionsBlock — A multi-section choice block inside a screen.
              - …
            - TextInputBlock — A text-input block inside a screen.
              - …
            - ResultRowsBlock — A result-summary rows block inside a screen.
              - …
            - AudioBlock — An audio block inside a screen.
              - …
      - TextInputScreen — Free text input screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'text_input'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `question` string, required — Question/prompt text
        - `placeholder` string, nullable — Placeholder text
        - `min_chars` integer — Minimum characters required
        - `max_chars` integer, nullable — Maximum characters allowed
        - `anti_block_hint` string, nullable — Hint to reduce writing block
        - `save_as` string, required — Variable name to store input
        - `button_label` string — Submit button label
        - `blocks` union[], nullable — Optional composable blocks (e.g. title text)
          - union
            - TextBlock — A text block inside a screen.
              - …
            - ImageBlock — An image block inside a screen.
              - …
            - SingleChoiceBlock — A single-choice block inside a screen.
              - …
            - ChoiceSectionsBlock — A multi-section choice block inside a screen.
              - …
            - TextInputBlock — A text-input block inside a screen.
              - …
            - ResultRowsBlock — A result-summary rows block inside a screen.
              - …
            - AudioBlock — An audio block inside a screen.
              - …
      - MultiSectionChoiceScreen — Multi-section choice screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'multi_section_choice'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `layout` string — Layout style: quadrant, list, grid
        - `microcopy` string, nullable — Helper text
        - `button_label` string — Submit button label
        - `blocks` union[], required — Composable blocks for client (text, choice_sections, etc.).
          - union
            - TextBlock — A text block inside a screen.
              - …
            - ImageBlock — An image block inside a screen.
              - …
            - SingleChoiceBlock — A single-choice block inside a screen.
              - …
            - ChoiceSectionsBlock — A multi-section choice block inside a screen.
              - …
            - TextInputBlock — A text-input block inside a screen.
              - …
            - ResultRowsBlock — A result-summary rows block inside a screen.
              - …
            - AudioBlock — An audio block inside a screen.
              - …
      - ResultScreen — Result/summary card screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'result'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `layout` string — Layout style: card, list
        - `dynamic_text_from` string, nullable — Source for dynamic text: 'scoring_rules'
        - `save_to_journey` boolean — Whether to save to 'Il mio percorso'
        - `cta` CtaConfig — Call-to-action configuration.
          - `type` string, required — CTA type: write_expert, call_conoscitiva, save_to_journey, copy_message, url, chat_expert
          - `label` string, required — CTA button label
          - `url` string, nullable — Optional URL for type 'url'
          - `message_template` string, nullable — Optional backend-side template for message_for_chat (e.g. 'Ciao... {{var}}')
          - `message_variables` object, nullable — Map template placeholders -> variable names from responses (e.g. {'fatica': 'dr_dove_sono_fatica'})
          - `profession` string, nullable — Target profession (psi/nutri) for profession-dependent CTAs; resolved per patient at render time
        - `blocks` union[], required — Composable blocks for client (text, result_rows, image, dynamic_text).
          - union
            - TextBlock — A text block inside a screen.
              - …
            - ImageBlock — An image block inside a screen.
              - …
            - SingleChoiceBlock — A single-choice block inside a screen.
              - …
            - ChoiceSectionsBlock — A multi-section choice block inside a screen.
              - …
            - TextInputBlock — A text-input block inside a screen.
              - …
            - ResultRowsBlock — A result-summary rows block inside a screen.
              - …
            - AudioBlock — An audio block inside a screen.
              - …
      - DynamicMessageScreen — Pre-compiled message for the expert.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'dynamic_message'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `title` string, nullable — Screen title
        - `template` string, required — Message template with {variable} placeholders
        - `editable` boolean — Whether the user can edit the message
        - `cta` CtaConfig — Call-to-action configuration.
          - `type` string, required — CTA type: write_expert, call_conoscitiva, save_to_journey, copy_message, url, chat_expert
          - `label` string, required — CTA button label
          - `url` string, nullable — Optional URL for type 'url'
          - `message_template` string, nullable — Optional backend-side template for message_for_chat (e.g. 'Ciao... {{var}}')
          - `message_variables` object, nullable — Map template placeholders -> variable names from responses (e.g. {'fatica': 'dr_dove_sono_fatica'})
          - `profession` string, nullable — Target profession (psi/nutri) for profession-dependent CTAs; resolved per patient at render time
      - VideoScreen — Video content screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'video'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `url` string, nullable — External video URL
        - `file_path` string, nullable — Internal file path
        - `transcript` string, nullable — Video transcript / script text
        - `button_label` string — Continue button label
      - AudioScreen — Audio content screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'audio'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `url` string, nullable — External audio URL
        - `file_path` string, nullable — Internal file path
        - `transcript` string, nullable — Audio transcript / script text
        - `button_label` string — Continue button label
      - PuzzleScreen — Image puzzle screen (grid-based).
        - `id` string, required — Unique screen identifier within the game
        - `type` 'puzzle'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `file_path` string, nullable — Internal image file path for the puzzle (e.g. journey/games/images/...).
        - `visual` PuzzleVisualConfig — Grid config for a puzzle screen.
          - `rows` integer, required — Number of rows
          - `cols` integer, required — Number of columns
        - `blocks` union[] — Optional blocks (e.g. title text) shown with the puzzle.
          - union
            - TextBlock — A text block inside a screen.
              - …
            - ImageBlock — An image block inside a screen.
              - …
            - SingleChoiceBlock — A single-choice block inside a screen.
              - …
            - ChoiceSectionsBlock — A multi-section choice block inside a screen.
              - …
            - TextInputBlock — A text-input block inside a screen.
              - …
            - ResultRowsBlock — A result-summary rows block inside a screen.
              - …
            - AudioBlock — An audio block inside a screen.
              - …
        - `button_label` string, nullable — Button label shown when the user finishes the puzzle.
      - CustomScreen — Custom content screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'custom'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `transition` string, nullable — Transition type: tap, button, auto
        - `blocks` union[], required — Composable blocks (e.g. text + video) for fully custom layouts.
          - union
            - TextBlock — A text block inside a screen.
              - …
            - ImageBlock — An image block inside a screen.
              - …
            - SingleChoiceBlock — A single-choice block inside a screen.
              - …
            - ChoiceSectionsBlock — A multi-section choice block inside a screen.
              - …
            - TextInputBlock — A text-input block inside a screen.
              - …
            - ResultRowsBlock — A result-summary rows block inside a screen.
              - …
            - AudioBlock — An audio block inside a screen.
              - …
        - `button_label` string, nullable — Continue button label
      - CardFlipScreen — Card flip interaction screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'card_flip'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `instruction` string, nullable — Instruction text
        - `microcopy` string, nullable — Helper text
        - `cards` CardConfig[], required — Cards to display
          - `id` string, required — Card identifier
          - `front_image` string, required — Image shown on front of card
          - `back_image` string, required — Image shown on back of card
        - `select_mode` string — Selection mode: single, multi, none
        - `save_as` string, nullable — Variable name to store selection
        - `button_label` string, nullable — Continue button label
      - ConditionalGroupScreenOutput — Branching screen that shows different sub-screens based on a previous choice.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'conditional_group'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `switch_on` string, required — Variable name to branch on
        - `branches` object, required — Map of option_id -> branch with sub-screens
      - LetterScreen — Letter writing/reading screen.
        - `id` string, required — Unique screen identifier within the game
        - `type` 'letter'
        - `duration_seconds` integer, nullable — Suggested duration in seconds
        - `mode` string — Mode: write, read
        - `prompt` string, nullable — Writing prompt
        - `placeholder` string, nullable — Placeholder text
        - `max_chars` integer, nullable — Maximum characters
        - `save_as` string, nullable — Variable name to store letter text
        - `button_label` string — Submit button label
  - `scoring_rules` ScoringRule[] — Dynamic text scoring rules
    - `id` string, required — Rule identifier
    - `conditions` ScoringCondition[], required — Conditions to check
      - `variable` string, required — Variable name to check
      - `operator` string, required — Operator: eq, neq, in, not_in, gt, lt
      - `value` string, nullable — Single value (for eq/neq/gt/lt)
      - `values` string[], nullable — Multiple values (for in/not_in)
      - `value_variable` string, nullable — Optional variable name to compare against instead of a constant value (for eq/neq/gt/lt between two variables, e.g. 'economico_score' vs 'emotivo_score').
    - `match` string — Match mode: 'all' (AND) or 'any' (OR)
    - `output_text` string, required — Text to display when conditions are met
    - `priority` integer — Priority (lower = higher priority)

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/corabea/apis/corabea-api.md) · [All operations](https://skmtc.dev/corabea/apis/corabea-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/corabea/corabea-api/revisions/13c1bce1bdc4/schema)
