{
  "$id": "https://intentschema.org/intents/productivity/notes/note/list/v1.json",
  "fqdn": "org.intentschema.productivity.notes.note.list.v1",
  "title": "List notes",
  "description": "List notes in a notes app, optionally filtered by folder, tag, 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"
          },
          "filter": {
            "type": "object",
            "properties": {
              "folder": {
                "type": "string"
              },
              "tag": {
                "type": "string"
              },
              "modified_after": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "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"
            },
            "snippet": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "updated_at": {
              "type": "string",
              "format": "date-time"
            }
          }
        }
      },
      "next_cursor": {
        "type": "string"
      }
    }
  },
  "examples": [
    {
      "name": "by tag",
      "value": {
        "target": {
          "system": "notion"
        },
        "object": {
          "filter": {
            "tag": "standup"
          }
        }
      }
    }
  ]
}
