{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/kontaktio/main/json-schema/kontaktio-search-meta-schema.json",
  "title": "Search Metadata",
  "description": "Additional information, pagination and metadata about an API response",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kontaktio-command-api-openapi.yml#/components/schemas/SearchMeta",
  "type": "object",
  "properties": {
    "filter": {
      "type": "string",
      "description": "Filter query used in the API call"
    },
    "startIndex": {
      "type": "integer",
      "description": "Start index for the results array"
    },
    "maxResult": {
      "type": "integer",
      "description": "Maximum numbers of results in a single response"
    },
    "prevResults": {
      "type": "string",
      "description": "URL for the previous page of results",
      "format": "URL"
    },
    "count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Number of results. Not `null` only when the `queryType` is set to `COUNTED` or `SEARCH_META`."
    },
    "orderBy": {
      "type": "string",
      "enum": [
        "CREATED"
      ]
    },
    "nextResults": {
      "type": "string",
      "format": "URL",
      "description": "URL for the next page of results"
    },
    "queryType": {
      "description": "Query type. `COUNTED` - returns a number of results in the `count` field. `SEARCH_META` - returns only the `searchMeta` object, but with a number of results in the `count` field.",
      "type": "string",
      "enum": [
        "NORMAL",
        "COUNTED",
        "SEARCH_META"
      ],
      "default": "NORMAL"
    },
    "order": {
      "type": "string",
      "description": "Sorting order - `ASC`ending (default) or `DESC`ending",
      "enum": [
        "ASC",
        "DESC"
      ],
      "default": "ASC"
    }
  }
}