{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/datagalaxy/json-schema/datagalaxy-search-body-schema.json",
  "title": "SearchBody",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/datagalaxy-openapi.yml#/components/schemas/SearchBody",
  "properties": {
    "query": {
      "$ref": "#/$defs/SearchQuery"
    },
    "versionId": {
      "type": "string",
      "description": "Version to search in. <br>\nIf `versionId` is not provided, the search scope will be extended to all the workspaces you have access to.\nSet it whenever you know it to make the search faster."
    },
    "limit": {
      "type": "number",
      "format": "double",
      "description": "Maximum number of objects returned, between 1 and 5000",
      "default": 50
    },
    "includedAttributes": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "description": "List of attributes identified by their <code>attributeKey</code> or <code>attributePath</code> to be\nreturned in the search result.<br>\n<br>\nUse the <code>attributePath</code> if an attribute is a custom attribute or is linked to a dataType. A custom\nattribute's path is its key name preceded by a single period. For example, a custom attribute with the\n<code>attributeKey</code> value \"allCustomProp42\" has the <code>attributePath</code> value \".allCustomProp42\"."
    },
    "includeAccessData": {
      "type": "boolean",
      "description": "If set to <code>true</code>, returns access rights the current token has on each item"
    },
    "filters": {
      "items": {
        "$ref": "#/$defs/SearchFilter"
      },
      "type": "array",
      "description": "Use filters to refines your search result"
    },
    "saveSearchPayload": {
      "type": "boolean",
      "description": "If set to <code>true</code>, the search payload will be saved in the <b>queries history</b>.\\\nRequest the <code>GET /v2/history/search/queries</code> to retrieve it.",
      "default": false
    }
  },
  "type": "object",
  "additionalProperties": false,
  "$defs": {
    "SearchFilter": {
      "description": "Use filters to refines your search result",
      "properties": {
        "attributeKey": {
          "type": "string",
          "description": "AttributeKey you want your filter to be applied on. AttributeKeys can be found with the `GET /v2/attributes` endpoint"
        },
        "operator": {
          "$ref": "#/$defs/SearchFilterOperator",
          "description": "Filter operator. Attribute - Operator compatibility is described in the route description"
        },
        "values": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "items": {
                "type": "number",
                "format": "double"
              },
              "type": "array"
            },
            {
              "items": {
                "type": "boolean"
              },
              "type": "array"
            }
          ],
          "description": "Values to be filtered. An object matches the filter if it matches any of the values.<br>\nDate operators other than `range` take an empty array.<br>\nFilters on attributes referencing users (User, Person) or tags (ManagedTags, ClientTags) expect their values to be arrays of ids (stringified Uuid)<br>\nUser ids can be found with `GET /v2/users`, and other attribute ids with `GET /v2/attributes/values`"
        }
      },
      "required": [
        "attributeKey",
        "operator",
        "values"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "SearchFilterOperator": {
      "enum": [
        "contains",
        "startsWith",
        "endsWith",
        "equals",
        "excludes",
        "matchAll",
        "range",
        "notEquals",
        "lowerThan",
        "lowerOrEqualTo",
        "greaterThan",
        "greaterOrEqualTo",
        "pastHour",
        "today",
        "yesterday",
        "currentWeek",
        "pastWeek",
        "beforeCurrentWeek",
        "beforePastWeek",
        "currentMonth",
        "pastMonth",
        "beforeCurrentMonth",
        "beforePastMonth",
        "beforeToday",
        "currentYear",
        "last365days",
        "isEmpty",
        "isNotEmpty"
      ],
      "type": "string"
    },
    "SearchQuery": {
      "type": "string",
      "description": "This term will be searched in the following attributes of an object: <i>name, technicalName, description, summary and local synonym names</i>"
    }
  }
}