{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scriptgrain-com/json-schema/scriptgrain-com-profile-detail-schema.json",
  "title": "ProfileDetail",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scriptgrain-com-openapi.json#/components/schemas/ProfileDetail",
  "type": "object",
  "required": [
    "id",
    "name",
    "status",
    "progress_percent",
    "confidence_score",
    "sample_count",
    "total_word_count",
    "english_variant",
    "company_id",
    "created_at",
    "narrative",
    "attributes"
  ],
  "properties": {
    "id": {
      "$ref": "#/$defs/Uuid"
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "processing",
        "complete",
        "failed"
      ]
    },
    "progress_percent": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 100,
      "description": "Extraction progress while `pending` or `processing` (0 with no job row, otherwise 5 to 95); 100 when `complete`; `null` when `failed`."
    },
    "confidence_score": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "maximum": 1
    },
    "sample_count": {
      "type": [
        "integer",
        "null"
      ]
    },
    "total_word_count": {
      "type": [
        "integer",
        "null"
      ]
    },
    "english_variant": {
      "oneOf": [
        {
          "$ref": "#/$defs/EnglishVariant"
        },
        {
          "type": "null"
        }
      ]
    },
    "company_id": {
      "description": "The voice's default company; drafts with no `company_id` are grounded in it. `null` when it has none.",
      "oneOf": [
        {
          "$ref": "#/$defs/Uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "narrative": {
      "type": [
        "string",
        "null"
      ],
      "description": "The voice narrative. Filled only when `status` is `complete`."
    },
    "attributes": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true,
      "description": "The 45 measured voice attributes in eight groups (sentence structure, vocabulary, punctuation, tone and register, rhetoric, perspective and pronouns, structure and formatting, signature phrases and banned terms). Filled only when `status` is `complete`."
    },
    "last_error": {
      "type": [
        "string",
        "null"
      ],
      "description": "Present only when `status` is `failed`."
    }
  },
  "$defs": {
    "EnglishVariant": {
      "type": "string",
      "description": "British or American English. Omitted, the profile's stored variant applies.",
      "enum": [
        "uk",
        "us"
      ]
    },
    "Uuid": {
      "type": "string",
      "format": "uuid",
      "description": "A UUID. Path ids that are not UUID-shaped never match a route (404 `not_found`)."
    }
  }
}