{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://transcript.audio/schema/meeting-notes.v1.json",
  "title": "Transcript Audio meeting notes (version 1)",
  "description": "The optional JSON export (Meeting record.json) written next to Meeting record.docx when Settings > Export formats > JSON is on. Version 1 never changes shape: any change publishes a new file (meeting-notes.v2.json) with a new schemaVersion. Text is plain (no Markdown or HTML). Times are seconds from the start of the recording unless named otherwise.",
  "definitions": {
    "leadText": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "lead",
        "text"
      ],
      "properties": {
        "lead": {
          "type": "string",
          "description": "A short bold lead-in, or an empty string."
        },
        "text": {
          "type": "string"
        }
      }
    },
    "table": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "columns",
        "rows"
      ],
      "properties": {
        "columns": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "rows": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": "One array of cells per row, in column order."
        }
      }
    }
  },
  "type": "object",
  "additionalProperties": false,
  "required": [
    "$schema",
    "schemaVersion",
    "generator",
    "meeting",
    "attendees",
    "speakers",
    "hasNotes",
    "fallback",
    "summary",
    "decisions",
    "actionItems",
    "participants",
    "details",
    "sections",
    "transcript",
    "models"
  ],
  "properties": {
    "$schema": {
      "const": "https://transcript.audio/schema/meeting-notes.v1.json"
    },
    "schemaVersion": {
      "const": 1
    },
    "generator": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "exportedAt"
      ],
      "properties": {
        "name": {
          "const": "Transcript Audio"
        },
        "exportedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "meeting": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "title",
        "start",
        "end",
        "durationSeconds",
        "app",
        "languages",
        "calendarEvent",
        "template",
        "layout"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable meeting id (UUID), the same in meeting.json."
        },
        "title": {
          "type": "string"
        },
        "start": {
          "type": "string",
          "format": "date-time",
          "description": "When the recording started (ISO 8601)."
        },
        "end": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "durationSeconds": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "app": {
          "type": [
            "string",
            "null"
          ],
          "description": "The meeting app, e.g. Zoom, Microsoft Teams, Google Meet, In person."
        },
        "languages": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Languages heard, as display names (English)."
        },
        "calendarEvent": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title",
                "source",
                "eventId"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "source": {
                  "type": "string",
                  "description": "The calendar it came from (google, microsoft, macos, ...)."
                },
                "eventId": {
                  "type": "string"
                }
              }
            }
          ]
        },
        "template": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "name",
                "version"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "version": {
                  "type": [
                    "integer",
                    "null"
                  ]
                }
              }
            }
          ]
        },
        "layout": {
          "type": [
            "string",
            "null"
          ],
          "description": "The record layout used (standard, client, internal, ...)."
        }
      }
    },
    "attendees": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "self"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The invitee's name, or their email when the invite has no name (as Transcript.docx shows them)."
          },
          "self": {
            "type": "boolean"
          }
        }
      },
      "description": "Calendar invitees."
    },
    "speakers": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "label",
          "name",
          "talkSeconds"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "me for the microphone; S1, S2, ... for other speakers."
          },
          "label": {
            "type": "string",
            "description": "As shown in the documents."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name given to this speaker, if any."
          },
          "talkSeconds": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "description": "People heard in the recording."
    },
    "hasNotes": {
      "type": "boolean",
      "description": "False when only a transcript was made (no notes model)."
    },
    "fallback": {
      "type": "boolean",
      "description": "True when the notes are the minimal fallback record."
    },
    "summary": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/leadText"
      },
      "description": "The executive summary, paragraph by paragraph."
    },
    "decisions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Lines from the template's decisions sections (empty when the template has none)."
    },
    "actionItems": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "text",
          "owner",
          "due"
        ],
        "properties": {
          "text": {
            "type": "string"
          },
          "owner": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who is responsible, as stated."
          },
          "due": {
            "type": [
              "string",
              "null"
            ],
            "description": "When, as stated (free text such as 'by Friday', not a date)."
          }
        }
      }
    },
    "participants": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "role",
          "contribution"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "contribution": {
            "type": "string"
          }
        }
      },
      "description": "Participants as the notes describe them."
    },
    "details": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "label",
          "value",
          "status",
          "evidence"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The detail's id from the template (lower_snake_case)."
          },
          "label": {
            "type": "string"
          },
          "value": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "enum": [
              "stated",
              "inferred",
              "not-mentioned"
            ]
          },
          "evidence": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}:\\d{2}$"
            },
            "description": "Transcript times (HH:MM:SS) the value came from."
          }
        }
      },
      "description": "The template's details to capture, as key/value pairs with labels."
    },
    "sections": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "source",
          "paragraphs",
          "bullets",
          "table"
        ],
        "properties": {
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Template section or core block id; null for a section from the user's format instructions."
          },
          "title": {
            "type": "string"
          },
          "source": {
            "enum": [
              "core",
              "template",
              "custom"
            ]
          },
          "paragraphs": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/leadText"
            }
          },
          "bullets": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/leadText"
            }
          },
          "table": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/definitions/table"
              }
            ]
          }
        }
      },
      "description": "Every section of Meeting record.docx in document order."
    },
    "transcript": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "segments"
      ],
      "properties": {
        "segments": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "start",
              "end",
              "speaker",
              "speakerId",
              "text",
              "inaudible"
            ],
            "properties": {
              "start": {
                "type": "number",
                "minimum": 0
              },
              "end": {
                "type": "number",
                "minimum": 0
              },
              "speaker": {
                "type": "string"
              },
              "speakerId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "text": {
                "type": "string"
              },
              "inaudible": {
                "type": "boolean"
              }
            }
          }
        }
      }
    },
    "models": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "transcription": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "model",
            "provider"
          ],
          "properties": {
            "model": {
              "type": "string"
            },
            "provider": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "notes": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "model",
            "provider"
          ],
          "properties": {
            "model": {
              "type": "string"
            },
            "provider": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        }
      },
      "description": "The AI models used (optional information)."
    }
  }
}
