{
  "openapi": "3.0.1",
  "info": {
    "title": "Mastodon Keyword & Mention Monitor",
    "description": "Watch Mastodon hashtags, keywords and accounts. Scheduled runs remember what they already saw and deliver only NEW matching posts, with optional webhook alerts (Discord, Slack, generic) and a digest mode. Built on the documented Mastodon API.",
    "version": "1.0",
    "x-build-id": "AgCykqy26WakvE3Z1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/muhzuhaib~mastodon-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-muhzuhaib-mastodon-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/muhzuhaib~mastodon-monitor/runs": {
      "post": {
        "operationId": "runs-sync-muhzuhaib-mastodon-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/muhzuhaib~mastodon-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-muhzuhaib-mastodon-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": {
          "watchlist": {
            "title": "Watchlist",
            "type": "array",
            "description": "What to watch. Hashtag watches work with no setup. Keyword watches do full-text search and need an access token. Account watches deliver every new post by one account (accepts user@instance or a profile URL).",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "hashtag",
                    "keyword",
                    "account"
                  ],
                  "title": "Watch type",
                  "description": "Which kind of watch this is: hashtag needs no setup, keyword does full-text search and needs a token, account follows one profile."
                },
                "tag": {
                  "type": "string",
                  "title": "Hashtag (hashtag watches), without the #",
                  "description": "The hashtag to follow for a hashtag watch, written without the leading #."
                },
                "query": {
                  "type": "string",
                  "title": "Search query (keyword watches). Supports \"exact phrase\" and -exclusions.",
                  "description": "The search phrase for a keyword watch. Supports exact phrases in quotes and negation with a leading minus."
                },
                "handle": {
                  "type": "string",
                  "title": "Account handle (account watches), e.g. user@instance",
                  "description": "The account to follow, as user@instance or a full profile URL."
                },
                "label": {
                  "type": "string",
                  "title": "Optional label shown in results and alerts",
                  "description": "Your name for this watch. It appears on every delivered post and is the unit that billing counts."
                }
              }
            }
          },
          "instance": {
            "title": "Mastodon instance",
            "type": "string",
            "description": "Base URL of the server to watch, e.g. https://mastodon.social (default). Public data comes from this server's API."
          },
          "mastodonToken": {
            "title": "Access token (only needed for keyword watches)",
            "type": "string",
            "description": "Create it on your Mastodon server: Preferences, Development, New application (scope read:search), then copy the token here. Hashtag and account watches work without it."
          },
          "alerts": {
            "title": "Webhook alerts",
            "type": "object",
            "description": "Optional webhook delivery. Leave the mode on 'none' to write results to the dataset only. Any target that resolves to a private, loopback or link-local address is refused, and redirects are never followed.",
            "properties": {
              "mode": {
                "title": "Alert mode",
                "type": "string",
                "enum": [
                  "none",
                  "per-batch",
                  "per-match"
                ],
                "description": "per-batch: one webhook POST per run with all new matches. per-match: one POST per new match. Webhook delivery is included: it is not charged separately.",
                "prefill": "none"
              },
              "webhookUrl": {
                "title": "Webhook URL",
                "type": "string",
                "description": "Public https endpoint that receives the alert POST (Discord or Slack webhook URL, or your own receiver).",
                "editor": "textfield"
              },
              "format": {
                "title": "Payload format",
                "type": "string",
                "enum": [
                  "generic",
                  "discord",
                  "slack"
                ],
                "description": "discord and slack produce ready-to-post webhook payloads. generic posts a plain JSON object.",
                "prefill": "generic"
              }
            }
          },
          "digest": {
            "title": "Digest mode",
            "type": "boolean",
            "description": "Instead of one dataset item per match, write ONE summary item per run (matches listed inside it). It does not change what you pay: billing is per watch per day either way.",
            "default": false
          },
          "excludeReplies": {
            "title": "Exclude replies",
            "type": "boolean",
            "description": "Skip posts that are replies to other posts.",
            "default": true
          },
          "excludeReblogs": {
            "title": "Exclude reblogs",
            "type": "boolean",
            "description": "Skip boosted posts. When off, a reblog is credited to the original post so it is never charged twice.",
            "default": true
          },
          "minFavourites": {
            "title": "Minimum favourites",
            "minimum": 0,
            "type": "integer",
            "description": "Only deliver posts with at least this many favourites (0 = all).",
            "default": 0
          },
          "languages": {
            "title": "Language filter",
            "type": "array",
            "description": "Only deliver posts tagged with these ISO 639-1 codes, e.g. en, de. Empty = all languages."
          },
          "maxPostsPerWatch": {
            "title": "Max posts per watch per run",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Caps how many new posts one watch can deliver in a single run (and therefore the per-run cost).",
            "default": 100
          },
          "sinceMinutes": {
            "title": "Look-back window (minutes)",
            "minimum": 5,
            "type": "integer",
            "description": "Only posts newer than this window are considered. Keep it a bit longer than your schedule interval.",
            "default": 1440
          },
          "debug": {
            "title": "Debug",
            "type": "boolean",
            "description": "Write extra diagnostic lines to the run log. It changes nothing about what is delivered or charged.",
            "default": false
          },
          "stateStoreName": {
            "title": "Memory store name",
            "type": "string",
            "description": "The named key-value store holding which posts have already been delivered. Change it to keep separate watch lists apart, for example one per client. Leave it alone unless you need that.",
            "default": "mastodon-monitor-state"
          },
          "maxEventsPerRun": {
            "title": "Max billable events per run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard spend guard: the most watch-days this run may charge. The dataset still receives everything found, and a watch-day the cap held back is billed on the next run instead of being lost. Default 200."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}