{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coderpad/json-schema/coderpad-pad-response-schema.json",
  "title": "PadResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coderpad-pads-api-openapi.yml#/components/schemas/PadResponse",
  "allOf": [
    {
      "$ref": "#/$defs/Ok"
    },
    {
      "$ref": "#/$defs/Pad"
    },
    {
      "type": "object",
      "properties": {
        "interview_highlights": {
          "type": "string",
          "description": "AI-generated summary of the interview. Insights & Analytics only."
        },
        "interview_outline": {
          "description": "AI-generated outline of the interview. Insights & Analytics only."
        },
        "transcript": {
          "type": "array",
          "description": "The interview transcript. Insights & Analytics only.",
          "items": {
            "$ref": "#/$defs/TranscriptEntry"
          }
        },
        "transcript_source_unavailable": {
          "type": "boolean",
          "description": "Present and `true` when the transcript could not be retrieved."
        },
        "review_reports": {
          "type": "array",
          "description": "AI review reports of the pad. Only returned to the pad owner.",
          "items": {
            "$ref": "#/$defs/ReviewReport"
          }
        }
      }
    }
  ],
  "$defs": {
    "Ok": {
      "type": "object",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "OK"
          ]
        }
      }
    },
    "Pad": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The pad ID, as shown in the pad URL."
        },
        "title": {
          "type": "string"
        },
        "state": {
          "type": "string",
          "description": "`pending`: not started yet. `started`: a participant has joined. `ended`: the interview has ended. `opened_take_home` and `submitted_take_home`: take-home progress. `deleted`: the pad was deleted.\n",
          "enum": [
            "pending",
            "started",
            "ended",
            "deleted",
            "opened_take_home",
            "submitted_take_home"
          ]
        },
        "owner_email": {
          "type": [
            "string",
            "null"
          ],
          "format": "email"
        },
        "language": {
          "type": [
            "string",
            "null"
          ],
          "description": "The pad language. `null` for pads with multiple environments; see `pad_environment_ids`."
        },
        "private": {
          "type": "boolean",
          "description": "Whether the waiting room is enabled, so that guests must be admitted before joining the pad."
        },
        "execution_enabled": {
          "type": "boolean"
        },
        "restrict_interviewer_access": {
          "type": "boolean",
          "description": "Whether only the owner and `allowed_interviewer_emails` can access the pad as interviewers."
        },
        "contents": {
          "type": [
            "string",
            "null"
          ],
          "description": "The code of single-environment pads. `null` for pads with environments; use `GET /pad_environments/{id}`."
        },
        "participants": {
          "type": "array",
          "description": "Names of the people who joined the pad.",
          "items": {
            "type": "string"
          }
        },
        "events": {
          "type": "string",
          "format": "uri",
          "description": "URL of the pad's events (`GET /pads/{id}/events`)."
        },
        "notes": {
          "type": [
            "string",
            "null"
          ],
          "description": "Private interviewer notes, in Markdown. Only returned to the pad owner."
        },
        "created_at": {
          "$ref": "#/$defs/Timestamp"
        },
        "updated_at": {
          "$ref": "#/$defs/Timestamp"
        },
        "ended_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "URL of the pad."
        },
        "playback": {
          "type": "string",
          "format": "uri",
          "description": "URL of the pad playback."
        },
        "history": {
          "type": "string",
          "format": "uri",
          "description": "URL of the raw edit history of single-environment pads."
        },
        "drawing": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Temporary URL (valid 5 minutes) of the drawing made in the pad, if any."
        },
        "type": {
          "type": "string",
          "enum": [
            "live",
            "take_home",
            "drawing",
            "no_code"
          ]
        },
        "question_ids": {
          "type": "array",
          "description": "IDs of the question bank questions added to the pad.",
          "items": {
            "type": "integer"
          }
        },
        "pad_environment_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "active_environment_id": {
          "type": [
            "integer",
            "null"
          ]
        },
        "allowed_interviewer_emails": {
          "type": "array",
          "description": "Interviewers allowed on the pad when `restrict_interviewer_access` is enabled.",
          "items": {
            "type": "string",
            "format": "email"
          }
        },
        "team": {
          "type": [
            "object",
            "null"
          ],
          "allOf": [
            {
              "$ref": "#/$defs/Team"
            }
          ]
        },
        "pad_interviewer_notifications": {
          "type": "array",
          "description": "Notifications shown to interviewers during the interview.",
          "items": {
            "$ref": "#/$defs/PadInterviewerNotification"
          }
        }
      }
    },
    "PadInterviewerNotification": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "title": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ]
        },
        "priority": {
          "type": [
            "string",
            "null"
          ]
        },
        "request_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "useful": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "The interviewer's feedback on the notification, if any."
        },
        "auto_dismissed": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "created_at": {
          "$ref": "#/$defs/Timestamp"
        },
        "updated_at": {
          "$ref": "#/$defs/Timestamp"
        },
        "dismissed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "ReviewReport": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "title": {
          "type": [
            "string",
            "null"
          ]
        },
        "prompt": {
          "type": [
            "string",
            "null"
          ]
        },
        "report": {
          "type": [
            "string",
            "null"
          ]
        },
        "summary": {
          "type": [
            "string",
            "null"
          ]
        },
        "icon": {
          "type": [
            "string",
            "null"
          ]
        },
        "error": {
          "type": [
            "string",
            "null"
          ]
        },
        "user_id": {
          "type": [
            "integer",
            "null"
          ]
        },
        "file_paths": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "created_at": {
          "$ref": "#/$defs/Timestamp"
        },
        "updated_at": {
          "$ref": "#/$defs/Timestamp"
        }
      }
    },
    "Team": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "Timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "TranscriptEntry": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "transcript",
            "system_message"
          ]
        },
        "speaker_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "speaker_role": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "interviewer",
            "candidate",
            null
          ]
        },
        "text": {
          "type": "string"
        },
        "timestamp": {
          "type": "integer",
          "description": "Unix timestamp in milliseconds."
        }
      }
    }
  }
}