{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tiro-ooo/json-schema/tiro-ooo-paragraph-schema.json",
  "title": "Paragraph",
  "description": "A semantic unit of a Note's transcript (a speaker turn or topic chunk, not\na prose paragraph). Generated asynchronously as transcription progresses —\nfields like `transcript`, `translated`, and `summary` become non-null in\nstages. See [Data Model](/fundamentals/note-data-model).\n",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tiro-ooo-openapi.yml#/components/schemas/Paragraph",
  "type": "object",
  "required": [
    "uuid",
    "locked"
  ],
  "properties": {
    "uuid": {
      "type": "string",
      "description": "Unique identifier for the paragraph"
    },
    "transcribeLocale": {
      "type": [
        "string",
        "null"
      ],
      "description": "Locale used for transcription. Null for paragraphs from non-recording source notes.\n"
    },
    "transcript": {
      "nullable": true,
      "description": "Transcribed text content. Null when transcription has not yet completed or is unavailable.\n",
      "allOf": [
        {
          "$ref": "#/$defs/TextObject"
        },
        {}
      ]
    },
    "translateLocale": {
      "type": [
        "string",
        "null"
      ],
      "description": "Locale used for translation. Null when no translation was requested.\n"
    },
    "translated": {
      "nullable": true,
      "description": "Translated text content. Null when no translation was requested or translation has not yet completed.\n",
      "allOf": [
        {
          "$ref": "#/$defs/TextObject"
        },
        {}
      ]
    },
    "summaryLocale": {
      "type": [
        "string",
        "null"
      ],
      "description": "Locale used for summary. Resolved from summaryLocale, then translateLocale, then transcribeLocale. Null only when all three locale fields are null.\n"
    },
    "summary": {
      "nullable": true,
      "description": "AI-generated paragraph summary. Null when summary generation has not yet completed.\n",
      "allOf": [
        {
          "$ref": "#/$defs/TextObject"
        },
        {}
      ]
    },
    "diarizedSegments": {
      "type": [
        "array",
        "null"
      ],
      "description": "Speaker-attributed segments. Backend applies userDiarizedTranscript →\ndiarizedTranscript precedence and resolves user-mapped person names.\nNull when the paragraph has no diarization data — callers should fall\nback to `transcript`.\n",
      "items": {
        "$ref": "#/$defs/DiarizedSegment"
      }
    },
    "timeFrom": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Start time of the paragraph. Null when timing information is not available.\n"
    },
    "timeTo": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "End time of the paragraph. Null when timing information is not available.\n"
    },
    "locked": {
      "type": "boolean",
      "description": "Whether the paragraph is behind the paywall. `true` means the paragraph is past the note's free usage limit on a free or unpaid plan, and its text content (`transcript`, `translated`, `summary`) is returned masked — length and structure are preserved but the words are replaced with placeholder characters. Starting a paid plan unlocks the note and returns these paragraphs in full.\n"
    }
  },
  "$defs": {
    "DiarizedSegment": {
      "type": "object",
      "description": "A speaker-attributed slice of a paragraph.",
      "required": [
        "content",
        "speaker"
      ],
      "properties": {
        "content": {
          "type": "string",
          "description": "Plain-text content of the segment, attributed to one speaker."
        },
        "speaker": {
          "$ref": "#/$defs/SpeakerInfo"
        }
      }
    },
    "SpeakerInfo": {
      "type": "object",
      "description": "Identifies the speaker of a diarized segment.",
      "required": [
        "label"
      ],
      "properties": {
        "label": {
          "type": "string",
          "description": "Diarization-engine label for the speaker (stable within a single note, e.g. `SPEAKER_0`).\n"
        },
        "personName": {
          "type": [
            "string",
            "null"
          ],
          "description": "Resolved person name when the user has mapped this label to a person. Null when the speaker is unmapped.\n"
        }
      }
    },
    "TextObject": {
      "type": "object",
      "required": [
        "type",
        "content"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "text/plain",
            "text/markdown"
          ],
          "description": "MIME type of the text content"
        },
        "content": {
          "type": "string",
          "description": "The actual text content"
        }
      }
    }
  }
}