{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/athenahq-ai/json-schema/athenahq-ai-pitch-report-schema.json",
  "title": "PitchReport",
  "description": "Full pitch report payload returned by `GET /api/v1/pitches/{pitch_id}`.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/athenahq-ai-pitch-workspace-api-openapi.yml#/components/schemas/PitchReport",
  "type": "object",
  "required": [
    "pitch",
    "competitors",
    "prompts",
    "attributes",
    "sources",
    "metrics"
  ],
  "properties": {
    "pitch": {
      "$ref": "#/$defs/PitchSummary"
    },
    "competitors": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PitchCompetitor"
      },
      "description": "Competitors tracked on the pitch, with mention counts and sentiment."
    },
    "prompts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PitchPrompt"
      },
      "description": "Prompts generated for the pitch."
    },
    "attributes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PitchAttribute"
      },
      "description": "Positive and negative attributes extracted from the pitch's responses, for both the target company and its competitors."
    },
    "sources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PitchSource"
      },
      "description": "Top 10 citing domains across the pitch's responses, ordered by mention count."
    },
    "metrics": {
      "$ref": "#/$defs/PitchMetrics"
    }
  },
  "$defs": {
    "PitchAttribute": {
      "type": "object",
      "description": "An attribute (positive or negative trait) extracted from pitch responses, applied to either the target company or its competitors.",
      "required": [
        "id",
        "attribute_name",
        "attribute_type",
        "applies_to",
        "count"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier for the pitch attribute."
        },
        "attribute_name": {
          "type": "string",
          "description": "The attribute label."
        },
        "attribute_type": {
          "type": "string",
          "enum": [
            "positive",
            "negative"
          ],
          "description": "Whether the attribute is a positive trait or a negative trait."
        },
        "applies_to": {
          "type": "string",
          "enum": [
            "target",
            "competitors"
          ],
          "description": "Whether the attribute describes the target company (`target`) or one of the tracked competitors (`competitors`)."
        },
        "count": {
          "type": "integer",
          "description": "How many pitch responses mentioned this attribute."
        }
      }
    },
    "PitchCompetitor": {
      "type": "object",
      "description": "A competitor tracked on a pitch, with aggregate mention and sentiment stats across the pitch's responses.",
      "required": [
        "id",
        "name",
        "url",
        "mentions",
        "sentiment"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier for the pitch competitor row."
        },
        "name": {
          "type": "string",
          "description": "Competitor display name."
        },
        "url": {
          "type": "string",
          "description": "Competitor website (without protocol)."
        },
        "mentions": {
          "type": "integer",
          "description": "Number of pitch responses where this competitor was mentioned."
        },
        "sentiment": {
          "type": "integer",
          "description": "Average sentiment across mentions, expressed as an integer percent from 0 to 100. `positive` mentions count as 1, `neutral` as 0.5, and `negative` as 0; the average is then scaled to a percent. `0` when the competitor has no mentions.",
          "minimum": 0,
          "maximum": 100
        }
      }
    },
    "PitchMetrics": {
      "type": "object",
      "description": "Aggregate metrics computed across the pitch's AI responses.",
      "required": [
        "total_responses",
        "brand_mentions",
        "sentiment_score",
        "response_rate"
      ],
      "properties": {
        "total_responses": {
          "type": "integer",
          "description": "Total number of AI responses collected for this pitch."
        },
        "brand_mentions": {
          "type": "integer",
          "description": "Number of responses in which the target company was mentioned."
        },
        "sentiment_score": {
          "type": "integer",
          "description": "Average sentiment across mentioning responses, expressed as an integer percent from 0 to 100. `positive` counts as 1, `neutral` as 0.5, and `negative` as 0; the average is then scaled to a percent. `0` when there are no brand mentions.",
          "minimum": 0,
          "maximum": 100
        },
        "response_rate": {
          "type": "integer",
          "description": "Share of responses that mentioned the target company, expressed as an integer percent from 0 to 100 (`brand_mentions / total_responses`).",
          "minimum": 0,
          "maximum": 100
        }
      }
    },
    "PitchPrompt": {
      "type": "object",
      "description": "A prompt generated for a pitch and used to query AI models.",
      "required": [
        "id",
        "prompt",
        "type"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier for the pitch prompt."
        },
        "prompt": {
          "type": "string",
          "description": "The prompt text used for generation."
        },
        "type": {
          "type": "string",
          "description": "Prompt category. Common values include `discovery` and `high_intent`; other values may be present depending on the pitch generator version."
        }
      }
    },
    "PitchSource": {
      "type": "object",
      "description": "A top citing source (root domain) referenced across the pitch's AI responses.",
      "required": [
        "domain",
        "mentions"
      ],
      "properties": {
        "domain": {
          "type": "string",
          "description": "Root domain of the citing source. Google Places citations are surfaced as `google.com (Google Places)` to distinguish them from regular `google.com` citations."
        },
        "mentions": {
          "type": "integer",
          "description": "Number of pitch source rows attributed to this domain."
        }
      }
    },
    "PitchSummary": {
      "type": "object",
      "description": "A pitch workspace report — org-scoped, returned in lists without the heavy report payload.",
      "required": [
        "id",
        "company_name",
        "company_url",
        "company_description",
        "status",
        "created_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier for the pitch."
        },
        "company_name": {
          "type": "string",
          "description": "Display name of the company the pitch was created for."
        },
        "company_url": {
          "type": "string",
          "description": "The company website domain (without protocol)."
        },
        "company_description": {
          "type": "string",
          "description": "Short description of the company captured at pitch creation time."
        },
        "status": {
          "type": "string",
          "enum": [
            "draft",
            "processing",
            "completed",
            "failed"
          ],
          "description": "Current state of the pitch run. `processing` means the workflow is still generating prompts and responses; `completed` means the report is ready; `failed` means the run errored."
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp (UTC) for when the pitch was created."
        },
        "country": {
          "type": [
            "string",
            "null"
          ],
          "description": "Target country for the pitch, or `null` if no country was set."
        },
        "language": {
          "type": [
            "string",
            "null"
          ],
          "description": "Target language for the pitch, or `null` if no language was set."
        },
        "type": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "pitch_workspace",
            "landing_page"
          ],
          "description": "Pitch variant. `pitch_workspace` is the standard pitch report; `landing_page` is generated from a landing page URL. `null` for legacy pitches predating the field."
        }
      }
    }
  }
}