{
  "openapi": "3.0.1",
  "info": {
    "title": "Google API Discovery Drift Monitor",
    "description": "Monitor Google's public Discovery API directory and selected discovery documents for API version, preferred flag, revision, schema, and method-surface drift.",
    "version": "0.0",
    "x-build-id": "AM6pgHI9Weow5FMFg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/defenestrator~google-api-discovery-drift-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-defenestrator-google-api-discovery-drift-monitor",
        "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/defenestrator~google-api-discovery-drift-monitor/runs": {
      "post": {
        "operationId": "runs-sync-defenestrator-google-api-discovery-drift-monitor",
        "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/defenestrator~google-api-discovery-drift-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-defenestrator-google-api-discovery-drift-monitor",
        "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",
        "properties": {
          "apiNamePatterns": {
            "title": "API name patterns",
            "type": "array",
            "description": "Exact names or wildcard patterns for Google APIs to monitor from the public Discovery directory, such as drive, gmail, calendar, sheets, admin, storage, compute, cloudresourcemanager, iam, or serviceusage. Patterns also match id and title.",
            "items": {
              "type": "string"
            }
          },
          "criticalApiNames": {
            "title": "Critical API names",
            "type": "array",
            "description": "API names that should be promoted to high priority when they are missing, become non-preferred, or drift from the previous baseline.",
            "items": {
              "type": "string"
            },
            "default": [
              "drive",
              "gmail",
              "calendar",
              "sheets"
            ]
          },
          "includeNonPreferredVersions": {
            "title": "Include non-preferred versions",
            "type": "boolean",
            "description": "If true, include matching API versions even when Google's Discovery directory marks them as non-preferred. This is useful for legacy Admin SDK variants and upgrade monitoring.",
            "default": false
          },
          "alertOnNonPreferredVersions": {
            "title": "Alert on non-preferred versions",
            "type": "boolean",
            "description": "If true, rows marked preferred=false in the Discovery directory create alerts so deprecated or legacy versions are visible.",
            "default": false
          },
          "fetchDiscoveryDocuments": {
            "title": "Fetch discovery documents",
            "type": "boolean",
            "description": "If true, fetch selected public discoveryRestUrl documents to compute revision, method, schema, scope, and semantic-surface fingerprints.",
            "default": true
          },
          "maxDiscoveryDocuments": {
            "title": "Max discovery documents",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of matched discoveryRestUrl documents to fetch in one run. Directory-only rows are still emitted for additional matches up to maxRows.",
            "default": 4
          },
          "baselineDataset": {
            "title": "Previous run dataset",
            "type": "string",
            "description": "Optional previous run dataset for drift comparison. Use the picker so this limited-permission Actor receives READ access to the selected private dataset."
          },
          "baselineDatasetId": {
            "title": "Previous dataset ID (advanced)",
            "type": "string",
            "description": "Advanced/API fallback for a previous dataset ID. Prefer the picker under limited permissions."
          },
          "baselineRows": {
            "title": "Inline previous rows",
            "type": "array",
            "description": "Optional rows copied from a previous run. Rows with rowKey plus semanticHash or discoveryHash are used for drift comparison.",
            "items": {
              "type": "object"
            },
            "default": []
          },
          "expectedApiVersions": {
            "title": "Expected API versions",
            "type": "object",
            "description": "Optional JSON object mapping API names to expected version strings or arrays, for example {\"drive\":[\"v3\"],\"gmail\":[\"v1\"]}. Unexpected matching versions create warning rows.",
            "default": {}
          },
          "alertOnNewApiVersion": {
            "title": "Alert on new API version after baseline",
            "type": "boolean",
            "description": "If true, a selected Google API version absent from the previous baseline creates an alert.",
            "default": true
          },
          "alertOnPreferredChange": {
            "title": "Alert on preferred flag drift",
            "type": "boolean",
            "description": "If true, a change in Google's preferred flag compared with baseline creates an alert.",
            "default": true
          },
          "alertOnRevisionChange": {
            "title": "Alert on discovery revision drift",
            "type": "boolean",
            "description": "If true, a changed public discovery-document revision compared with baseline creates an alert.",
            "default": true
          },
          "alertOnDiscoveryHashDrift": {
            "title": "Alert on discovery surface hash drift",
            "type": "boolean",
            "description": "If true, a changed semantic discovery-document fingerprint compared with baseline creates an alert.",
            "default": true
          },
          "alertOnMissingWatchedApi": {
            "title": "Alert on missing watched API",
            "type": "boolean",
            "description": "If true, exact watched API names without wildcard characters that are absent from the directory create missing-source alert rows.",
            "default": true
          },
          "includeUnchangedRows": {
            "title": "Include unchanged rows",
            "type": "boolean",
            "description": "If false, only alert, changed, or error rows are pushed to the dataset. OUTPUT.snapshot still includes the selected checked rows up to maxRows.",
            "default": true
          },
          "maxRows": {
            "title": "Max dataset rows",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum rows to emit after alert/change priority sorting. Keep this bounded for cheap scheduled monitoring.",
            "default": 20
          },
          "maxDirectoryBytes": {
            "title": "Max directory bytes",
            "minimum": 100000,
            "maximum": 10000000,
            "type": "integer",
            "description": "Maximum size of the public Google Discovery API directory response after HTTP decoding.",
            "default": 2000000
          },
          "maxDiscoveryBytes": {
            "title": "Max discovery document bytes",
            "minimum": 100000,
            "maximum": 25000000,
            "type": "integer",
            "description": "Maximum size of each selected public discoveryRestUrl document after HTTP decoding.",
            "default": 5000000
          },
          "requestTimeoutSecs": {
            "title": "Request timeout seconds",
            "minimum": 5,
            "maximum": 90,
            "type": "integer",
            "description": "Timeout for each public Google Discovery API request.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}