{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/2x/json-schema/2x-client-detail-response-schema.json",
  "title": "ClientDetailResponse",
  "description": "Detailed client response with additional data.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/2x-clients-api-openapi.yml#/components/schemas/ClientDetailResponse",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "customerId": {
      "type": "string",
      "title": "Customerid"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "score": {
      "type": "integer",
      "title": "Score"
    },
    "scoreSource": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Scoresource",
      "description": "Score data source: chr1 or chr2"
    },
    "scoreChanges": {
      "anyOf": [
        {
          "$ref": "#/$defs/ScoreChanges"
        },
        {
          "type": "null"
        }
      ],
      "description": "Score changes over time"
    },
    "lastContactDate": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Lastcontactdate"
    },
    "lastUpdatedAt": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Lastupdatedat"
    },
    "hasInsufficientData": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Hasinsufficientdata"
    },
    "metadata": {
      "anyOf": [
        {
          "$ref": "#/$defs/ClientMetadata"
        },
        {
          "type": "null"
        }
      ]
    },
    "extraColumns": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Extracolumns",
      "description": "Custom column values"
    },
    "historicalData": {
      "anyOf": [
        {
          "items": {
            "type": "integer"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Historicaldata"
    },
    "archived": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Archived"
    },
    "spotlightSummary": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Spotlightsummary",
      "description": "AI-generated markdown summary of client status for the current week"
    },
    "topics": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Topics",
      "description": "Topic and category scores organized by category"
    }
  },
  "type": "object",
  "required": [
    "id",
    "customerId",
    "name",
    "score"
  ],
  "$defs": {
    "ClientMetadata": {
      "properties": {
        "accountOwner": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Accountowner"
        },
        "annualRevenue": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Annualrevenue"
        },
        "industry": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Industry"
        },
        "location": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Location"
        },
        "active": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Active"
        },
        "accountStatus": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Accountstatus"
        },
        "domain": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Domain"
        },
        "clientType": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Clienttype"
        },
        "revenueTTM": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Revenuettm"
        },
        "revenueF12M": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Revenuef12M"
        }
      },
      "type": "object",
      "title": "ClientMetadata",
      "description": "Client metadata."
    },
    "ScoreChange": {
      "properties": {
        "change": {
          "type": "number",
          "title": "Change",
          "description": "Absolute change in score"
        },
        "percentage": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Percentage",
          "description": "Percentage change"
        },
        "previousScore": {
          "type": "number",
          "title": "Previousscore",
          "description": "Score at start of period"
        }
      },
      "type": "object",
      "required": [
        "change",
        "previousScore"
      ],
      "title": "ScoreChange",
      "description": "Score change over a time period."
    },
    "ScoreChanges": {
      "properties": {
        "7day": {
          "anyOf": [
            {
              "$ref": "#/$defs/ScoreChange"
            },
            {
              "type": "null"
            }
          ],
          "description": "7-day change"
        },
        "30day": {
          "anyOf": [
            {
              "$ref": "#/$defs/ScoreChange"
            },
            {
              "type": "null"
            }
          ],
          "description": "30-day change"
        }
      },
      "type": "object",
      "title": "ScoreChanges",
      "description": "Score changes over different time periods."
    }
  }
}