{
  "$id": "https://intentschema.org/intents/productivity/calendar/event/create/v1.json",
  "fqdn": "org.intentschema.productivity.calendar.event.create.v1",
  "title": "Create calendar event",
  "description": "Creates a new calendar event, optionally inviting attendees. Time fields follow RFC 3339. Recurrence follows iCalendar RRULE (RFC 5545).",
  "payload": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "required": [
      "target",
      "object"
    ],
    "properties": {
      "target": {
        "$ref": "https://intentschema.org/common/target/v1.json"
      },
      "object": {
        "type": "object",
        "required": [
          "summary",
          "start",
          "end"
        ],
        "properties": {
          "summary": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "timezone": {
            "type": "string",
            "description": "IANA timezone name (e.g., America/Los_Angeles). Required if start/end are floating."
          },
          "all_day": {
            "type": "boolean",
            "default": false
          },
          "attendees": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "email",
              "description": "RFC 5321 mailbox. Plain address (jane@example.com) or with display name (\"Jane Doe\" <jane@example.com>)."
            }
          },
          "recurrence": {
            "type": "string",
            "description": "RFC 5545 RRULE string."
          },
          "reminders": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "minutes_before": {
                  "type": "integer",
                  "minimum": 0
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "popup",
                    "email"
                  ]
                }
              }
            }
          }
        }
      },
      "idempotency_key": {
        "type": "string"
      }
    }
  },
  "result": {
    "type": "object",
    "required": [
      "external_id",
      "created_at"
    ],
    "properties": {
      "external_id": {
        "type": "string",
        "description": "Provider event id."
      },
      "created_at": {
        "type": "string",
        "format": "date-time"
      },
      "html_link": {
        "type": "string",
        "format": "uri"
      }
    }
  },
  "examples": [
    {
      "name": "simple 1:1 meeting",
      "value": {
        "target": {
          "system": "google_calendar"
        },
        "object": {
          "summary": "Coffee with Jane",
          "start": "2026-04-22T15:00:00-07:00",
          "end": "2026-04-22T15:30:00-07:00",
          "timezone": "America/Los_Angeles"
        }
      }
    },
    {
      "name": "recurring team standup with attendees",
      "value": {
        "target": {
          "system": "google_calendar"
        },
        "object": {
          "summary": "Eng standup",
          "start": "2026-04-20T09:30:00-07:00",
          "end": "2026-04-20T09:45:00-07:00",
          "timezone": "America/Los_Angeles",
          "attendees": [
            "eng@example.com"
          ],
          "recurrence": "RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR",
          "reminders": [
            {
              "minutes_before": 10,
              "method": "popup"
            }
          ]
        }
      }
    }
  ]
}
