{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/getmattered/json-schema/getmattered-derive-custom-tone-response-schema.json",
  "title": "DeriveCustomToneResponse",
  "description": "Successful API response",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getmattered-ai-persona-api-openapi.yml#/components/schemas/DeriveCustomToneResponse",
  "type": "object",
  "properties": {
    "data": {
      "$ref": "#/$defs/DeriveCustomToneData"
    },
    "meta": {
      "$ref": "#/$defs/ResponseMetadata"
    },
    "success": {
      "type": "boolean",
      "enum": [
        true
      ]
    }
  },
  "required": [
    "data",
    "success"
  ],
  "additionalProperties": false,
  "$defs": {
    "DeriveCustomToneData": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "custom-tone"
          ],
          "description": "Discriminator for the derive envelope."
        },
        "applied": {
          "type": "boolean",
          "description": "Whether a custom tone was derived and persisted."
        },
        "reason": {
          "type": [
            "string",
            "null"
          ],
          "description": "Why a tone could not be derived (e.g. no base resume). Null on success."
        },
        "personalDescription": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 500,
          "description": "Derived personal description (≤500 chars). Null when not applied."
        },
        "toneInstructions": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 1000,
          "description": "Derived tone instructions (≤1000 chars). Null when not applied."
        },
        "samplePhrases": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string",
            "maxLength": 200
          },
          "maxItems": 10,
          "description": "Derived sample phrases (≤10). Null when not applied."
        }
      },
      "required": [
        "kind",
        "applied",
        "reason",
        "personalDescription",
        "toneInstructions",
        "samplePhrases"
      ],
      "additionalProperties": false
    },
    "ResponseMetadata": {
      "type": "object",
      "properties": {
        "duration": {
          "type": "number",
          "minimum": 0,
          "description": "Request duration in milliseconds"
        },
        "performance": {
          "type": "object",
          "properties": {
            "dbQueries": {
              "type": "integer",
              "minimum": 0
            },
            "totalDbTime": {
              "type": "number",
              "minimum": 0
            }
          },
          "description": "Performance metrics (preview/local only)"
        },
        "requestId": {
          "type": "string",
          "description": "Unique request identifier"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp"
        },
        "version": {
          "type": "string",
          "description": "API version"
        }
      }
    }
  }
}