{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/audiomap-ai/json-schema/audiomap-ai-note-detail-schema.json",
  "title": "NoteDetail",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/audiomap-ai-openapi.json#/components/schemas/NoteDetail",
  "allOf": [
    {
      "$ref": "#/$defs/Note"
    },
    {
      "type": "object",
      "properties": {
        "transcript": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "fullText": {
              "type": "string"
            },
            "languagesDetected": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "speakerCount": {
              "type": [
                "integer",
                "null"
              ]
            }
          }
        },
        "aiNotes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Analysis"
          }
        },
        "outline": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Chapter"
          }
        }
      }
    }
  ],
  "$defs": {
    "Analysis": {
      "type": "object",
      "properties": {
        "template": {
          "type": "string",
          "enum": [
            "generic",
            "sales",
            "legal",
            "medical",
            "journalism",
            "education",
            "customer_success",
            "meeting_minutes",
            "consulting",
            "coaching",
            "therapy",
            "podcast",
            "university_class",
            "debate"
          ]
        },
        "summary": {
          "type": "string"
        },
        "keyPoints": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "actionItems": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "assignee": {
                "type": "string"
              },
              "deadline": {
                "type": "string"
              }
            }
          }
        },
        "decisions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "questions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "anchors": {
          "$ref": "#/$defs/Anchors"
        },
        "sections": {
          "type": [
            "object",
            "null"
          ],
          "description": "Template-specific sections, only for the \"debate\" template (podcasts, interviews, multi-person debates). Each item carries who says it (speaker name or diarization letter) and the exact start millisecond of the transcript segment where it is said. Null for other templates.",
          "properties": {
            "positions": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "speaker": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "t": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "required": [
                  "text"
                ]
              }
            },
            "arguments": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "speaker": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "t": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "required": [
                  "text"
                ]
              }
            },
            "quotes": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "speaker": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "t": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "required": [
                  "text"
                ]
              }
            },
            "agreements": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "speaker": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "t": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "required": [
                  "text"
                ]
              }
            },
            "disagreements": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "speaker": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "t": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "required": [
                  "text"
                ]
              }
            }
          }
        },
        "mindmap": {
          "type": [
            "string",
            "null"
          ],
          "description": "Mermaid source, when one was generated"
        },
        "model": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "Anchors": {
      "type": [
        "object",
        "null"
      ],
      "description": "Millisecond at which each element is said, aligned index by index with its list. Null per element when the model could not place it; null as a whole for analyses generated before Sep 2026.",
      "properties": {
        "keyPoints": {
          "type": "array",
          "items": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "actionItems": {
          "type": "array",
          "items": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "decisions": {
          "type": "array",
          "items": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "questions": {
          "type": "array",
          "items": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      }
    },
    "Chapter": {
      "type": "object",
      "properties": {
        "startMs": {
          "type": "integer"
        },
        "endMs": {
          "type": "integer"
        },
        "headline": {
          "type": "string"
        }
      }
    },
    "Note": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "processing",
            "ready",
            "failed"
          ]
        },
        "errorCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "Why it failed; null otherwise"
        },
        "sourceType": {
          "type": "string",
          "enum": [
            "upload",
            "recording",
            "url"
          ]
        },
        "origin": {
          "type": "string",
          "enum": [
            "youtube",
            "podcast",
            "link",
            "video",
            "audio",
            "recording"
          ]
        },
        "sourceUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "folderId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "durationSeconds": {
          "type": [
            "integer",
            "null"
          ]
        },
        "language": {
          "type": [
            "string",
            "null"
          ]
        },
        "recordedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}