{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/coactive/main/json-schema/coactive-datasets-dataset-create-request-schema.json",
  "title": "DatasetCreateRequest",
  "description": "Create a dataset schema",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coactive-datasets-dataset-api-openapi.yml#/components/schemas/datasets_DatasetCreateRequest",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the dataset, must be unique per organization and must only contain alphanumeric and underscore characters."
    },
    "encoder_name": {
      "$ref": "#/$defs/datasets_VisualEncoderNameEnum",
      "description": "The model used to extract visual and audio features from assets."
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "A short summary of what the dataset includes or is intended for."
    },
    "allowed_asset_types": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/datasets_AssetTypeEnum"
      },
      "description": "Types of assets allowed in this dataset."
    },
    "keyframe_sampling_method": {
      "$ref": "#/$defs/datasets_KeyframeSamplingMethodEnum",
      "description": "Sampling method to extract keyframes from videos in dataset."
    },
    "keyframe_uniform_fps_sampling_rate": {
      "type": [
        "number",
        "null"
      ],
      "format": "double",
      "description": "If using uniform sampling method, number of keyframes/sec to sample from videos (allowed values: ≥ .00001 to 5 fps)."
    },
    "store_original": {
      "type": "boolean",
      "default": true,
      "description": "Whether to store original files."
    },
    "store_preview": {
      "type": "boolean",
      "default": true,
      "description": "Whether to store preview versions."
    },
    "metadata_fields_to_index": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "The metadata fields to index for the dataset."
    },
    "metadata_fields_to_embed": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "The metadata fields to embed for the dataset."
    },
    "dataset_config": {
      "oneOf": [
        {
          "$ref": "#/$defs/datasets_DatasetConfig"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "name",
    "encoder_name"
  ],
  "$defs": {
    "datasets_AssetTypeEnum": {
      "type": "string",
      "enum": [
        "image",
        "video"
      ],
      "description": "Indicates the type of asset",
      "title": "AssetTypeEnum"
    },
    "datasets_CompositeSettings": {
      "type": "object",
      "properties": {
        "maximum_slice_duration_seconds": {
          "type": "integer",
          "description": "Maximum duration in seconds for a single composite slice."
        }
      },
      "required": [
        "maximum_slice_duration_seconds"
      ],
      "title": "CompositeSettings"
    },
    "datasets_DatasetConfig": {
      "type": "object",
      "properties": {
        "embedding_id": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "format": "uuid"
          },
          "description": "Mapping from encoder modality to the UUID of the embedding model used for that modality."
        },
        "encoder_name": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Mapping from encoder modality to the name of the encoder model used for that modality."
        },
        "extra_config": {
          "oneOf": [
            {
              "$ref": "#/$defs/datasets_ExtraConfig"
            },
            {
              "type": "null"
            }
          ],
          "description": "Optional extra configuration for composite types."
        },
        "hybrid_search": {
          "oneOf": [
            {
              "$ref": "#/$defs/datasets_HybridSearchConfig"
            },
            {
              "type": "null"
            }
          ],
          "description": "Optional hybrid search configuration specifying modality weights."
        },
        "context_studio_enabled": {
          "type": [
            "boolean",
            "null"
          ],
          "default": false,
          "description": "Whether Context Studio is enabled for this dataset."
        },
        "metadata_fields_to_embed": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          },
          "description": "Metadata fields whose values are embedded."
        },
        "metadata_fields_to_index": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          },
          "description": "Metadata fields that are indexed for filtering and search."
        },
        "celebrity_detection_enabled": {
          "type": [
            "boolean",
            "null"
          ],
          "default": false,
          "description": "Whether celebrity detection is enabled for this dataset."
        },
        "agentic_search_metadata_description": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": {
            "type": "string"
          },
          "description": "Per-key descriptions of metadata fields."
        },
        "asset_identifier_key": {
          "type": [
            "string",
            "null"
          ],
          "description": "The metadata field name that uniquely identifies each asset in the dataset."
        },
        "context_studio_export_json_connection_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The name of the connection required for external s3 export. (this is related to context_studio feature)."
        }
      },
      "required": [
        "embedding_id",
        "encoder_name"
      ],
      "title": "DatasetConfig"
    },
    "datasets_ExtraConfig": {
      "type": "object",
      "properties": {
        "composite_settings": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/datasets_CompositeSettings"
          },
          "description": "Mapping of composite type name to its settings."
        }
      },
      "required": [
        "composite_settings"
      ],
      "title": "ExtraConfig"
    },
    "datasets_HybridSearchConfig": {
      "type": "object",
      "properties": {
        "weights": {
          "type": "object",
          "additionalProperties": {
            "type": "number",
            "format": "double"
          },
          "description": "Weights for each modality used in hybrid search scoring."
        }
      },
      "required": [
        "weights"
      ],
      "title": "HybridSearchConfig"
    },
    "datasets_KeyframeSamplingMethodEnum": {
      "type": "string",
      "enum": [
        "intelligent",
        "uniform"
      ],
      "description": "Indicates the method used to sample keyframes from a video",
      "title": "KeyframeSamplingMethodEnum"
    },
    "datasets_VisualEncoderNameEnum": {
      "type": "string",
      "enum": [
        "multimodal",
        "multimodal-tx-large2",
        "multimodal-tx-large3",
        "multimodal-tx-large4",
        "nova2-multimodal",
        "resnet-50",
        "resnet-50-reduced"
      ],
      "title": "VisualEncoderNameEnum"
    }
  }
}