{
  "$id": "https://intentschema.org/intents/productivity/tasks/item/update/v1.json",
  "fqdn": "org.intentschema.productivity.tasks.item.update.v1",
  "title": "Update task item",
  "description": "Update fields on an existing task via JSON Patch (RFC 6902).",
  "payload": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "required": [
      "target"
    ],
    "properties": {
      "target": {
        "allOf": [
          {
            "$ref": "https://intentschema.org/common/target/v1.json"
          },
          {
            "required": [
              "external_id"
            ]
          }
        ]
      },
      "object": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "due_at": {
            "type": "string",
            "format": "date-time"
          },
          "priority": {
            "enum": [
              "low",
              "normal",
              "high"
            ]
          },
          "status": {
            "enum": [
              "needs_action",
              "in_process",
              "completed",
              "cancelled"
            ]
          },
          "assignee": {
            "type": "string",
            "format": "email",
            "description": "RFC 5321 mailbox. Plain address (jane@example.com) or with display name (\"Jane Doe\" <jane@example.com>)."
          }
        }
      },
      "idempotency_key": {
        "type": "string"
      },
      "patch": {
        "type": "array",
        "items": {
          "type": "object",
          "required": [
            "op",
            "path"
          ],
          "properties": {
            "op": {
              "enum": [
                "add",
                "remove",
                "replace",
                "move",
                "copy",
                "test"
              ]
            },
            "path": {
              "type": "string"
            },
            "value": {},
            "from": {
              "type": "string"
            }
          }
        }
      }
    },
    "anyOf": [
      {
        "required": [
          "object"
        ]
      },
      {
        "required": [
          "patch"
        ]
      }
    ]
  },
  "result": {
    "type": "object",
    "properties": {
      "external_id": {
        "type": "string"
      },
      "updated_at": {
        "type": "string",
        "format": "date-time"
      },
      "etag": {
        "type": "string"
      }
    }
  },
  "examples": [
    {
      "name": "change due date",
      "value": {
        "target": {
          "system": "asana",
          "external_id": "task_abc"
        },
        "patch": [
          {
            "op": "replace",
            "path": "/due_at",
            "value": "2026-05-01T17:00:00-07:00"
          }
        ]
      }
    }
  ]
}
