{
  "$id": "https://intentschema.org/intents/productivity/tasks/item/list/v1.json",
  "fqdn": "org.intentschema.productivity.tasks.item.list.v1",
  "title": "List task items",
  "description": "List tasks by status, assignee, project, or text.",
  "payload": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "required": [
      "target"
    ],
    "properties": {
      "target": {
        "$ref": "https://intentschema.org/common/target/v1.json"
      },
      "object": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Optional provider-specific search string."
          },
          "filter": {
            "type": "object",
            "properties": {
              "project_id": {
                "type": "string"
              },
              "assignee": {
                "type": "string",
                "format": "email"
              },
              "status": {
                "enum": [
                  "needs_action",
                  "in_process",
                  "completed",
                  "cancelled"
                ]
              },
              "due_after": {
                "type": "string",
                "format": "date-time"
              },
              "due_before": {
                "type": "string",
                "format": "date-time"
              },
              "text": {
                "type": "string"
              }
            }
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 500,
            "default": 50
          },
          "cursor": {
            "type": "string"
          }
        }
      }
    }
  },
  "result": {
    "type": "object",
    "required": [
      "items"
    ],
    "properties": {
      "items": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "external_id": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "due_at": {
              "type": "string",
              "format": "date-time"
            },
            "assignee": {
              "type": "string",
              "format": "email",
              "description": "RFC 5321 mailbox. Plain address (jane@example.com) or with display name (\"Jane Doe\" <jane@example.com>)."
            }
          }
        }
      },
      "next_cursor": {
        "type": "string",
        "description": "Present when more results are available."
      },
      "estimated_total": {
        "type": "integer"
      }
    }
  },
  "examples": [
    {
      "name": "my open tasks",
      "value": {
        "target": {
          "system": "asana"
        },
        "object": {
          "filter": {
            "assignee": "alice@acme.com",
            "status": "needs_action"
          }
        }
      }
    }
  ]
}
