{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coderpad/json-schema/coderpad-question-write-request-schema.json",
  "title": "QuestionWriteRequest",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coderpad-questions-api-openapi.yml#/components/schemas/QuestionWriteRequest",
  "type": "object",
  "properties": {
    "title": {
      "type": "string"
    },
    "language": {
      "type": "string",
      "description": "A language key or a project template slug."
    },
    "description": {
      "type": "string",
      "description": "Description of the question, only shown to interviewers."
    },
    "candidate_instructions": {
      "type": "string",
      "description": "Instructions shown to the candidate, as a **JSON-encoded** array of objects with `instructions` (required, Markdown), `name` and `default_visible`.\n"
    },
    "contents": {
      "type": "string",
      "description": "Starter code, for single-file languages. Cannot be combined with `file_contents`."
    },
    "file_contents": {
      "type": "string",
      "description": "Starter files, for project templates, as a JSON-encoded array of objects with `path`, `contents`, and optionally `hidden: true` to hide a file from the candidate. On creation, `deleted: true` drops a template file (`.cpad` cannot be deleted). On update, `deleted` entries are ignored.\n"
    },
    "solution": {
      "type": "string",
      "description": "Reference solution, only shown to interviewers."
    },
    "shared": {
      "type": "boolean",
      "description": "Share the question with your organization. Only the question author can change it."
    },
    "custom_database_id": {
      "type": "integer",
      "description": "A custom database to attach to the question."
    },
    "ai_assist_custom_system_prompt": {
      "type": "string",
      "description": "Custom AI Assist system prompt. Enterprise plans only."
    }
  }
}