{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cadencz-com/json-schema/cadencz-com-learn-voice-response-schema.json",
  "title": "LearnVoiceResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cadencz-com-strategy-api-openapi.yml#/components/schemas/LearnVoiceResponse",
  "properties": {
    "run_id": {
      "type": "string",
      "title": "Run Id"
    },
    "voice": {
      "additionalProperties": true,
      "type": "object",
      "title": "Voice"
    },
    "strategy": {
      "$ref": "#/$defs/StrategyRead"
    }
  },
  "type": "object",
  "required": [
    "run_id",
    "voice",
    "strategy"
  ],
  "$defs": {
    "AutomationSettings": {
      "properties": {
        "enabled": {
          "type": "boolean",
          "title": "Enabled",
          "description": "Off by default. Auto-planning spends credits, so it's opt-in.",
          "default": false
        },
        "suspended_by_plan": {
          "type": "boolean",
          "title": "Suspended By Plan",
          "description": "Cadencz turned automation off after plan access was lost. The saved schedule remains, but the customer must explicitly enable it again.",
          "default": false
        },
        "auto_write_week": {
          "type": "boolean",
          "title": "Auto Write Week",
          "description": "Write the week's posts on their own at the planning hour, so the stack always has a fresh week on it. Every plan; bounded by the tier's weekly number and the monthly pool. Distinct from `enabled`, which is the paid Automation feature (rules, auto-approve).",
          "default": true
        },
        "plan_weekday": {
          "type": "integer",
          "maximum": 6.0,
          "minimum": 0.0,
          "title": "Plan Weekday",
          "description": "0 = Monday.",
          "default": 0
        },
        "plan_hour": {
          "type": "integer",
          "maximum": 23.0,
          "minimum": 0.0,
          "title": "Plan Hour",
          "description": "Local hour, 24h.",
          "default": 6
        },
        "timezone": {
          "type": "string",
          "maxLength": 64,
          "title": "Timezone",
          "description": "IANA zone.",
          "default": "UTC"
        },
        "posting_weekdays": {
          "items": {
            "type": "integer"
          },
          "type": "array",
          "title": "Posting Weekdays",
          "description": "Days posts may be scheduled on. 0 = Monday."
        },
        "posting_times": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Posting Times",
          "description": "HH:MM slots, cycled through in order."
        },
        "day_platforms": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "title": "Day Platforms",
          "description": "Which channel each weekday posts to, keyed by weekday index as a string ('0' = Monday). A day with no entry falls back to the workspace's platform rotation."
        },
        "platform_quota": {
          "additionalProperties": {
            "type": "integer"
          },
          "type": "object",
          "title": "Platform Quota",
          "description": "How many posts each channel gets per batch, keyed by platform id. The batch is their sum. Zero (or absent) means the channel gets none; empty means the planner decides per post from cadence."
        },
        "brain_id": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 64
            },
            {
              "type": "null"
            }
          ],
          "title": "Brain Id",
          "description": "Ground posts in this Brain. None = the most recently updated."
        },
        "auto_approve": {
          "type": "boolean",
          "title": "Auto Approve",
          "description": "Schedule straight to the calendar instead of holding for review.",
          "default": false
        }
      },
      "type": "object",
      "title": "AutomationSettings",
      "description": "When the agents plan, and when the posts they produce go out."
    },
    "StrategyRead": {
      "properties": {
        "workspace_id": {
          "type": "string",
          "title": "Workspace Id"
        },
        "niche": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Niche"
        },
        "goals": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Goals"
        },
        "whats_new": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Whats New"
        },
        "tags": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Tags"
        },
        "tone_profile": {
          "additionalProperties": true,
          "type": "object",
          "title": "Tone Profile"
        },
        "voice_profile": {
          "$ref": "#/$defs/VoiceProfile"
        },
        "voice_samples": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Voice Samples"
        },
        "voice_sample_platforms": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "title": "Voice Sample Platforms"
        },
        "voice_platforms_learned": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Voice Platforms Learned"
        },
        "cadence_per_week": {
          "type": "integer",
          "title": "Cadence Per Week"
        },
        "platforms": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Platforms"
        },
        "automation": {
          "$ref": "#/$defs/AutomationSettings"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        }
      },
      "type": "object",
      "required": [
        "workspace_id",
        "niche",
        "goals",
        "tags",
        "tone_profile",
        "voice_profile",
        "voice_samples",
        "cadence_per_week",
        "platforms",
        "automation",
        "updated_at"
      ],
      "title": "StrategyRead"
    },
    "ToneAxis": {
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 40,
          "title": "Id"
        },
        "low": {
          "type": "string",
          "maxLength": 40,
          "title": "Low"
        },
        "high": {
          "type": "string",
          "maxLength": 40,
          "title": "High"
        },
        "value": {
          "type": "integer",
          "maximum": 100.0,
          "minimum": 0.0,
          "title": "Value",
          "default": 50
        }
      },
      "type": "object",
      "required": [
        "id",
        "low",
        "high"
      ],
      "title": "ToneAxis",
      "description": "One bipolar slider: `value` 0 sits at `low`, 100 at `high`."
    },
    "VoicePersona": {
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 64,
          "title": "Id"
        },
        "name": {
          "type": "string",
          "maxLength": 80,
          "title": "Name",
          "default": ""
        },
        "audience": {
          "type": "string",
          "maxLength": 2000,
          "title": "Audience",
          "default": ""
        },
        "context": {
          "type": "string",
          "maxLength": 500,
          "title": "Context",
          "default": ""
        },
        "mission": {
          "type": "string",
          "maxLength": 2000,
          "title": "Mission",
          "default": ""
        },
        "traits": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Traits"
        },
        "goals": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Goals"
        },
        "tone": {
          "items": {
            "$ref": "#/$defs/ToneAxis"
          },
          "type": "array",
          "maxItems": 12,
          "title": "Tone"
        },
        "vocabulary": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Vocabulary"
        },
        "banned_words": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Banned Words"
        },
        "ctas": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Ctas"
        },
        "formatting": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Formatting"
        },
        "active": {
          "type": "boolean",
          "title": "Active",
          "default": false
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Created At"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Updated At"
        }
      },
      "type": "object",
      "required": [
        "id"
      ],
      "title": "VoicePersona",
      "description": "A named way of speaking. Exactly one persona is active at a time."
    },
    "VoiceProfile": {
      "properties": {
        "personas": {
          "items": {
            "$ref": "#/$defs/VoicePersona"
          },
          "type": "array",
          "maxItems": 10,
          "title": "Personas"
        },
        "versions": {
          "items": {
            "$ref": "#/$defs/VoiceVersion"
          },
          "type": "array",
          "maxItems": 20,
          "title": "Versions"
        }
      },
      "type": "object",
      "title": "VoiceProfile",
      "description": "The whole authored document. Empty is valid — it just means untouched."
    },
    "VoiceVersion": {
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 64,
          "title": "Id"
        },
        "persona_id": {
          "type": "string",
          "maxLength": 64,
          "title": "Persona Id"
        },
        "label": {
          "type": "string",
          "maxLength": 160,
          "title": "Label",
          "default": ""
        },
        "saved_at": {
          "type": "string",
          "format": "date-time",
          "title": "Saved At"
        },
        "snapshot": {
          "$ref": "#/$defs/VoicePersona"
        }
      },
      "type": "object",
      "required": [
        "id",
        "persona_id",
        "saved_at",
        "snapshot"
      ],
      "title": "VoiceVersion",
      "description": "A snapshot taken on save, so a regretted edit is one click from undone."
    }
  }
}