{
  "openapi": "3.0.1",
  "info": {
    "title": "cz.basketball Schedule Watcher",
    "description": "Watches a cz.basketball team's fixtures for schedule changes (new/moved/cancelled games, time & venue changes) and optionally syncs them to Google Calendar. Sends email and webhook notifications on every change.",
    "version": "0.1",
    "x-build-id": "3NgwyS8LHEwSbhBoc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zdenek_kuncar~cbf-cz-schedule-watcher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zdenek_kuncar-cbf-cz-schedule-watcher",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/zdenek_kuncar~cbf-cz-schedule-watcher/runs": {
      "post": {
        "operationId": "runs-sync-zdenek_kuncar-cbf-cz-schedule-watcher",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/zdenek_kuncar~cbf-cz-schedule-watcher/run-sync": {
      "post": {
        "operationId": "run-sync-zdenek_kuncar-cbf-cz-schedule-watcher",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "teamId",
          "teamName"
        ],
        "properties": {
          "teamId": {
            "title": "Team ID",
            "type": "string",
            "description": "The cz.basketball team ID. Found in the team page URL: https://cz.basketball/tym/<TEAM_ID>. This ID is stable across seasons. Default is BASKET OPAVA 2010.",
            "default": "13093"
          },
          "teamName": {
            "title": "Team name (display)",
            "type": "string",
            "description": "Human-readable team name, used in calendar event titles and notifications. Should match how the team is named on cz.basketball.",
            "default": "BASKET OPAVA 2010"
          },
          "year": {
            "title": "Season year (optional)",
            "minimum": 2000,
            "maximum": 2100,
            "type": "integer",
            "description": "The season's starting year, i.e. the ?y= value on the team page. Season 2026/27 = 2026. Leave empty to auto-detect the current season (rolls over in August), so the Actor keeps working every year without changes."
          },
          "skipPastGames": {
            "title": "Ignore games in the past",
            "type": "boolean",
            "description": "Only track and sync games scheduled for today or later. Changes to games already played are ignored.",
            "default": true
          },
          "notifyEmail": {
            "title": "Notification email (optional)",
            "type": "string",
            "description": "Email address to receive a summary whenever the schedule changes, sent via Gmail from your own connected Google account — see the Google account fields below. Can be any address, not just your own. Leave empty to disable email."
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "type": "string",
            "description": "If set, the Actor POSTs a JSON payload with the detected changes to this URL (Zapier, Make, Slack Incoming Webhook, your own endpoint, ...). Leave empty to disable."
          },
          "notifyOnFirstRun": {
            "title": "Notify on first run",
            "type": "boolean",
            "description": "On the very first run there is no previous snapshot, so every game looks 'new'. Keep this off to seed silently; turn on to receive the full initial list.",
            "default": false
          },
          "enableCalendar": {
            "title": "Sync to Google Calendar (optional)",
            "type": "boolean",
            "description": "OPTIONAL. Turn on if you want fixtures mirrored as Google Calendar events. If off, the Actor just detects changes and notifies you. Requires the Google account fields below — see the README for a 5-minute setup.",
            "default": false
          },
          "googleCalendarId": {
            "title": "Google Calendar ID",
            "type": "string",
            "description": "Which calendar to write to. 'primary' is your main calendar; otherwise the calendar's ID (looks like an email address), found in Google Calendar > Settings > Integrate calendar. Only used when Calendar sync is on.",
            "default": "primary"
          },
          "googleClientId": {
            "title": "Google OAuth Client ID",
            "type": "string",
            "description": "OAuth 2.0 Client ID from Google Cloud Console. Needed for Calendar sync and/or Gmail email notifications."
          },
          "googleClientSecret": {
            "title": "Google OAuth Client Secret",
            "type": "string",
            "description": "OAuth 2.0 Client Secret from Google Cloud Console."
          },
          "googleRefreshToken": {
            "title": "Google OAuth Refresh Token",
            "type": "string",
            "description": "Long-lived refresh token obtained via the one-time consent flow (run `npm run get-token` locally, see README). Must be authorized for both Calendar and Gmail send access if you use both features."
          },
          "eventDurationMinutes": {
            "title": "Calendar event duration (minutes)",
            "minimum": 30,
            "maximum": 360,
            "type": "integer",
            "description": "How long each game event should last in the calendar.",
            "default": 120
          },
          "dryRun": {
            "title": "Dry run",
            "type": "boolean",
            "description": "Detect and report changes but do NOT write to Google Calendar. Useful for testing.",
            "default": false
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}