{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/audiostack/json-schema/audiostack-post-sound-templates-query-request-schema.json",
  "title": "PostSoundTemplatesQueryRequest",
  "description": "Request body for sound-templates query endpoint.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/audiostack-assets-sound-templates-api-openapi.yml#/components/schemas/PostSoundTemplatesQueryRequest",
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "default": "",
      "title": "Search query",
      "description": "Free text search query passed to the search engine. This is used to search for sound templates with some fuzzy matching.\n"
    },
    "filters": {
      "type": "array",
      "title": "Filters",
      "description": "Filters to apply. Each item is an object with one operator key (e.g. \"in\")\nand a value object with one filter field and its values.\n",
      "items": {
        "type": "object",
        "title": "Sound templates filter",
        "description": "Filter object for sound template queries.",
        "properties": {
          "in": {
            "oneOf": [
              {
                "type": "object",
                "title": "Alias filter",
                "required": [
                  "alias"
                ],
                "additionalProperties": false,
                "properties": {
                  "alias": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "title": "Specify alias filter condition",
                    "description": "Specify the alias filter condition. You can specify multiple accepted values by adding them to the array.\n"
                  }
                }
              },
              {
                "type": "object",
                "title": "Energy filter",
                "required": [
                  "energy"
                ],
                "additionalProperties": false,
                "properties": {
                  "energy": {
                    "type": "array",
                    "items": {
                      "$ref": "#/$defs/items"
                    },
                    "title": "Specify energy filter condition",
                    "description": "Specify the energy filter condition. You can specify multiple accepted values by adding them to the array.\n"
                  }
                }
              },
              {
                "type": "object",
                "title": "Genre filter",
                "required": [
                  "genre"
                ],
                "additionalProperties": false,
                "properties": {
                  "genre": {
                    "type": "array",
                    "items": {
                      "$ref": "#/$defs/items"
                    },
                    "title": "Specify genre filter condition",
                    "description": "Specify the genre filter condition. You can specify multiple accepted values by adding them to the array.\n"
                  }
                }
              },
              {
                "type": "object",
                "title": "Instrument filter",
                "required": [
                  "instrument"
                ],
                "additionalProperties": false,
                "properties": {
                  "instrument": {
                    "type": "array",
                    "items": {
                      "$ref": "#/$defs/items"
                    },
                    "title": "Specify instrument filter condition",
                    "description": "Specify the instrument filter condition. You can specify multiple accepted values by adding them to the array.\n"
                  }
                }
              },
              {
                "type": "object",
                "title": "Key filter",
                "required": [
                  "key"
                ],
                "additionalProperties": false,
                "properties": {
                  "key": {
                    "type": "array",
                    "items": {
                      "$ref": "#/$defs/items"
                    },
                    "title": "Specify key filter condition",
                    "description": "Specify the key filter condition. You can specify multiple accepted values by adding them to the array.\n"
                  }
                }
              },
              {
                "type": "object",
                "title": "Mood filter",
                "required": [
                  "mood"
                ],
                "additionalProperties": false,
                "properties": {
                  "mood": {
                    "type": "array",
                    "items": {
                      "$ref": "#/$defs/items"
                    },
                    "title": "Specify mood filter condition",
                    "description": "Specify the mood filter condition. You can specify multiple accepted values by adding them to the array.\n"
                  }
                }
              },
              {
                "type": "object",
                "title": "Tempo filter",
                "required": [
                  "tempo"
                ],
                "additionalProperties": false,
                "properties": {
                  "tempo": {
                    "type": "array",
                    "items": {
                      "$ref": "#/$defs/items"
                    },
                    "title": "Specify tempo filter condition",
                    "description": "Specify the tempo filter condition. You can specify multiple accepted values by adding them to the array.\n"
                  }
                }
              },
              {
                "type": "object",
                "title": "Holidays filter",
                "required": [
                  "holidays"
                ],
                "additionalProperties": false,
                "properties": {
                  "holidays": {
                    "type": "array",
                    "items": {
                      "$ref": "#/$defs/items"
                    },
                    "title": "Specify holidays filter condition",
                    "description": "Specify the holidays filter condition. You can specify multiple accepted values by adding them to the array.\n"
                  }
                }
              },
              {
                "type": "object",
                "title": "Type filter",
                "required": [
                  "type"
                ],
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "type": "array",
                    "items": {
                      "$ref": "#/$defs/0"
                    },
                    "title": "Specify type filter condition",
                    "description": "Specify the type filter condition. You can specify multiple accepted values by adding them to the array.\n"
                  }
                }
              }
            ]
          },
          "greaterThanOrEquals": {
            "oneOf": [
              {
                "type": "object",
                "title": "BPM filter",
                "required": [
                  "bpm"
                ],
                "additionalProperties": false,
                "properties": {
                  "bpm": {
                    "type": "integer",
                    "title": "Specify BPM filter condition",
                    "description": "Specify the BPM filter condition as an integer value.\n"
                  }
                }
              }
            ]
          },
          "lessThanOrEquals": {
            "oneOf": [
              {
                "type": "object",
                "title": "BPM filter",
                "required": [
                  "bpm"
                ],
                "additionalProperties": false,
                "properties": {
                  "bpm": {
                    "type": "integer",
                    "title": "Specify BPM filter condition",
                    "description": "Specify the BPM filter condition as an integer value.\n"
                  }
                }
              }
            ]
          }
        }
      }
    },
    "forceApplyFilters": {
      "title": "Force apply filters",
      "type": "boolean",
      "default": true,
      "description": "When true, applies filters strictly even with few results. In instances where the filters\nare overly restrictive, you may get fewer results than desired.\n"
    },
    "minimumNumberOfResults": {
      "type": "integer",
      "default": 3,
      "title": "Minimum number of results",
      "description": "In instances where you want to ensure a minimum number of results, you can set this parameter.\nYou must also set forceApplyFilters to false. Filter conditions will be relaxed to attempt to\nreturn the minimum number of results.\n"
    },
    "sort": {
      "title": "Sort field",
      "$ref": "#/$defs/SoundTemplatesSortValues"
    },
    "page": {
      "type": "integer",
      "minimum": 1,
      "default": 1,
      "title": "Page number",
      "description": "Page number to return (1-indexed)."
    },
    "pageLimit": {
      "type": "integer",
      "minimum": 1,
      "default": 1000,
      "title": "Page limit",
      "description": "Number of items per page."
    }
  },
  "$defs": {
    "SoundTemplatesSortValues": {
      "type": "string",
      "enum": [
        "alias"
      ],
      "description": "Field to sort results by. If omitted, results are sorted by AudioStack's internal sorting."
    }
  }
}