{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nopaque-co-uk/json-schema/nopaque-co-uk-profile-schema.json",
  "title": "Profile",
  "description": "Workspace-scoped profile of named voice + data items, used to instantiate\nparameterised tests. Items reference audio rows and/or dataset items via id.\n",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nopaque-co-uk-profiles-api-openapi.yml#/components/schemas/Profile",
  "type": "object",
  "required": [
    "id",
    "workspaceId",
    "name",
    "items",
    "createdAt",
    "updatedAt",
    "createdBy"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Profile id (prefix `profile_` followed by a base-36 timestamp + random)."
    },
    "workspaceId": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ProfileItem"
      }
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "createdBy": {
      "type": "string"
    }
  },
  "$defs": {
    "ProfileDataItem": {
      "type": "object",
      "description": "Data item inside a profile — references a specific `DataItem` inside a `Dataset`\nby `datasetId` + `itemId`. The `label` is the parameter name used to match against\ntest scripts.\n",
      "required": [
        "type",
        "id",
        "datasetId",
        "itemId",
        "label"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "data"
          ]
        },
        "id": {
          "type": "string",
          "description": "Stable item id (server-generated)."
        },
        "datasetId": {
          "type": "string",
          "format": "uuid",
          "description": "Reference to `Dataset.id` in the same workspace."
        },
        "itemId": {
          "type": "string",
          "description": "Reference to `DataItem.id` inside the dataset."
        },
        "label": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "ProfileItem": {
      "description": "Union of voice items (`type: voice`) and data items (`type: data`). The `type`\ndiscriminator selects between `ProfileVoiceItem` and `ProfileDataItem`.\n",
      "oneOf": [
        {
          "$ref": "#/$defs/ProfileVoiceItem"
        },
        {
          "$ref": "#/$defs/ProfileDataItem"
        }
      ]
    },
    "ProfileVoiceItem": {
      "type": "object",
      "description": "Voice item inside a profile — references an `AudioObject` by id. The `label` is\nthe parameter name used to match against test scripts.\n",
      "required": [
        "type",
        "id",
        "audioId",
        "label"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "voice"
          ]
        },
        "id": {
          "type": "string",
          "description": "Stable item id (server-generated)."
        },
        "audioId": {
          "type": "string",
          "format": "uuid",
          "description": "Reference to `AudioObject.id` in the same workspace."
        },
        "label": {
          "type": "string",
          "description": "Parameter label — used to match this profile against test configs that bind\nto a parameter of the same name.\n"
        },
        "description": {
          "type": "string"
        }
      }
    }
  }
}