{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/grepr/json-schema/grepr-search-issues-request-schema.json",
  "title": "SearchIssuesRequest",
  "description": "Filters for searching the issues the caller can see. Every filter is optional; all given filters must match. Results are ordered by full-text rank when `query` is given, else by latest sighting.",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/grepr-openapi.json#/components/schemas/SearchIssuesRequest",
  "properties": {
    "assignee": {
      "$ref": "#/$defs/IssueAssigneeFilter"
    },
    "closedWithinDays": {
      "description": "Include closed issues closed within this many days. Absent: 30 when `states` is absent, with those closed as IGNORED or NOT_A_PROBLEM kept at any age, and no window when it is given. Given, it's exact.",
      "format": "int32",
      "maximum": 3650,
      "minimum": 0,
      "type": "integer"
    },
    "cursor": {
      "description": "The `nextCursor` of the previous page, sent with the same filters.",
      "maxLength": 1024,
      "minLength": 0,
      "type": "string"
    },
    "entities": {
      "additionalProperties": {
        "description": "Entity tags to match: every key must match, and any of a key's values matches it. Keys and values match in any case. An unprefixed key is put in the `entity:` namespace.",
        "items": {
          "description": "Entity tags to match: every key must match, and any of a key's values matches it. Keys and values match in any case. An unprefixed key is put in the `entity:` namespace.",
          "type": "string"
        },
        "type": "array"
      },
      "description": "Entity tags to match: every key must match, and any of a key's values matches it. Keys and values match in any case. An unprefixed key is put in the `entity:` namespace.",
      "type": "object"
    },
    "fingerprint": {
      "description": "Only issues with exactly this fingerprint.",
      "maxLength": 256,
      "minLength": 0,
      "type": "string"
    },
    "labels": {
      "description": "Only issues carrying every one of these labels.",
      "items": {
        "description": "Only issues carrying every one of these labels.",
        "type": "string"
      },
      "maxItems": 20,
      "minItems": 0,
      "type": "array"
    },
    "limit": {
      "description": "The page size, at most 100; absent: 25.",
      "format": "int32",
      "maximum": 100,
      "minimum": 1,
      "type": "integer"
    },
    "linkedTo": {
      "$ref": "#/$defs/IssueLinkRef"
    },
    "priority": {
      "description": "Only issues at this priority or more urgent.",
      "enum": [
        "P0",
        "P1",
        "P2",
        "P3"
      ],
      "type": "string"
    },
    "query": {
      "description": "Words to search the whole issue for, comments included, split and stemmed as the issue is, so checkout-api is also checkout and api: an issue matches when it has any one of them, and those with the most, above all in their title, fingerprint and entities, come first.",
      "maxLength": 500,
      "minLength": 0,
      "type": "string"
    },
    "states": {
      "description": "Only issues in these states. Absent: open issues plus those closed within `closedWithinDays`, and, when that is absent too, those closed as IGNORED or NOT_A_PROBLEM at any age.",
      "items": {
        "description": "Only issues in these states. Absent: open issues plus those closed within `closedWithinDays`, and, when that is absent too, those closed as IGNORED or NOT_A_PROBLEM at any age.",
        "enum": [
          "TRIAGE",
          "READY",
          "IN_PROGRESS",
          "WAITING",
          "MONITORING",
          "CLOSED"
        ],
        "type": "string"
      },
      "type": "array"
    },
    "teamIds": {
      "description": "Only issues one of these teams can see: linked to one of them, or shared with all teams.",
      "items": {
        "description": "Only issues one of these teams can see: linked to one of them, or shared with all teams.",
        "type": "string"
      },
      "maxItems": 50,
      "minItems": 0,
      "type": "array"
    },
    "updatedSince": {
      "description": "Only issues changed at or after this time.",
      "format": "date-time",
      "type": "string"
    }
  },
  "type": "object",
  "$defs": {
    "IssueAssigneeFilter": {
      "description": "Whose active assignments a search matches. A deleted agent's assignment never counts, as it does not block a close.",
      "properties": {
        "id": {
          "description": "The agent's or person's id, for `AGENT` and `PERSON` only.",
          "maxLength": 255,
          "minLength": 0,
          "type": "string"
        },
        "kind": {
          "description": "`ME` for the caller, `UNASSIGNED` for issues nobody is working on, or `AGENT`/`PERSON` for one assignee.",
          "enum": [
            "ME",
            "UNASSIGNED",
            "AGENT",
            "PERSON"
          ],
          "type": "string"
        }
      },
      "required": [
        "kind"
      ],
      "type": "object"
    },
    "IssueLinkRef": {
      "description": "A linked object to find issues by, such as a pipeline or an investigation.",
      "properties": {
        "kind": {
          "description": "What the object is.",
          "enum": [
            "PIPELINE",
            "INVESTIGATION",
            "MEMORY",
            "AGENT_SUGGESTION",
            "EXTERNAL",
            "ISSUE"
          ],
          "type": "string"
        },
        "target": {
          "description": "Its id, or the URL for an external link.",
          "maxLength": 4096,
          "minLength": 0,
          "type": "string"
        }
      },
      "required": [
        "kind",
        "target"
      ],
      "type": "object"
    }
  }
}