{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/peerbound/json-schema/peerbound-moment-schema.json",
  "title": "Moment",
  "description": "A customer moment (quote) extracted from a call recording.\n\nMoments are flattened from the internal moment/moment_quote structure\nto expose quotes directly at the top level.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/peerbound-moments-api-openapi.yml#/components/schemas/Moment",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id",
      "description": "Unique Peerbound identifier for the quote"
    },
    "text": {
      "type": "string",
      "title": "Text",
      "description": "The quote text"
    },
    "approval_state": {
      "type": "string",
      "enum": [
        "Not Approved",
        "Approved – Anonymous",
        "Approved – Public"
      ],
      "title": "Approval State",
      "description": "Approval status of the quote"
    },
    "moment_type": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "AI Hype",
            "Competitive Clue",
            "Expansion Potential",
            "Impact Insight",
            "Partner Love",
            "People Praise",
            "Sentiment Signal",
            "Use Case Finder"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Moment Type",
      "description": "Category/type of the moment"
    },
    "recording": {
      "anyOf": [
        {
          "$ref": "#/$defs/RecordingSource"
        },
        {
          "type": "null"
        }
      ],
      "description": "Source recording metadata (null for external moments)"
    },
    "account": {
      "anyOf": [
        {
          "$ref": "#/$defs/LinkedAccount"
        },
        {
          "type": "null"
        }
      ],
      "description": "Associated account (customer)"
    },
    "contact": {
      "anyOf": [
        {
          "$ref": "#/$defs/LinkedContact"
        },
        {
          "type": "null"
        }
      ],
      "description": "Associated contact (person)"
    },
    "occurred_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Occurred At",
      "description": "When the moment occurred (ISO 8601)"
    },
    "is_deleted": {
      "type": "boolean",
      "title": "Is Deleted",
      "description": "Whether the moment quote has been deleted"
    },
    "created_at": {
      "type": "string",
      "title": "Created At",
      "description": "Timestamp when the quote was created (ISO 8601)"
    },
    "updated_at": {
      "type": "string",
      "title": "Updated At",
      "description": "Timestamp when the quote or moment was last updated (ISO 8601)"
    }
  },
  "type": "object",
  "required": [
    "id",
    "text",
    "approval_state",
    "is_deleted",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "LinkedAccount": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Unique Peerbound identifier for the account"
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Name of the account"
        },
        "salesforce_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Salesforce Id",
          "description": "Salesforce Account ID if synced"
        },
        "hubspot_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Hubspot Id",
          "description": "HubSpot Company ID if synced"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "title": "LinkedAccount",
      "description": "Account (customer company) linked to a resource.\n\nUsed for stories, reviews, and moments to reference the associated account."
    },
    "LinkedContact": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Unique Peerbound identifier for the contact"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name",
          "description": "Full name of the contact"
        },
        "email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Email",
          "description": "Email address of the contact"
        },
        "salesforce_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Salesforce Id",
          "description": "Salesforce Contact ID if synced"
        },
        "hubspot_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Hubspot Id",
          "description": "HubSpot Contact ID if synced"
        }
      },
      "type": "object",
      "required": [
        "id"
      ],
      "title": "LinkedContact",
      "description": "Contact (person) linked to a resource.\n\nUsed for reviews and moments to reference the associated contact."
    },
    "RecordingSource": {
      "properties": {
        "type": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "attention",
                "avoma",
                "bluedot",
                "chorus",
                "clari",
                "fireflies",
                "gong",
                "goodmeetings",
                "granola",
                "momentum",
                "outreach",
                "salesloft"
              ]
            },
            {
              "type": "string",
              "const": "ai_interview"
            }
          ],
          "title": "Type",
          "description": "Recording platform identifier"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Id",
          "description": "Call ID on the source platform"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title",
          "description": "Title of the recording/call"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Url",
          "description": "Link to the recording on source platform"
        }
      },
      "type": "object",
      "required": [
        "type"
      ],
      "title": "RecordingSource",
      "description": "Source recording metadata for a moment."
    }
  }
}