{
  "openapi": "3.0.1",
  "info": {
    "title": "new-items-notifier",
    "description": "Get Telegram or Discord alerts for NEW items in any Apify dataset. Attach it to your scraper as an integration: it remembers what was already sent, filters items and formats messages with a template.",
    "version": "0.0",
    "x-build-id": "OKhXTKnXD8dLgDhGg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ab_workflow~apify-actors/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ab_workflow-apify-actors",
        "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/ab_workflow~apify-actors/runs": {
      "post": {
        "operationId": "runs-sync-ab_workflow-apify-actors",
        "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/ab_workflow~apify-actors/run-sync": {
      "post": {
        "operationId": "run-sync-ab_workflow-apify-actors",
        "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": {
          "datasetId": {
            "title": "Dataset",
            "type": "string",
            "description": "The dataset whose items you want to be notified about. Leave empty when this Actor runs as an integration of another Actor - the dataset of the run that triggered it is used automatically. Tip: in the integration setup you can set this field to {{resource.defaultDatasetId}}."
          },
          "telegramBotToken": {
            "title": "Telegram bot token",
            "type": "string",
            "description": "Token of your Telegram bot from @BotFather (looks like 123456789:AA...). Stored encrypted; never logged or saved in outputs. Leave empty to skip Telegram."
          },
          "telegramChatId": {
            "title": "Telegram chat ID",
            "type": "string",
            "description": "Where the bot posts: a numeric chat ID (e.g. 123456789 for a private chat, -1001234567890 for a group/channel) or a public channel username like @mychannel. The bot must be a member (an admin, for channels)."
          },
          "discordWebhookUrl": {
            "title": "Discord webhook URL",
            "type": "string",
            "description": "Webhook URL from Discord: Server Settings → Integrations → Webhooks → New Webhook → Copy Webhook URL. Must start with https://discord.com/api/webhooks/. Stored encrypted; never logged. Leave empty to skip Discord."
          },
          "messageTemplate": {
            "title": "Message template",
            "type": "string",
            "description": "Text of each message. Use {{field}} placeholders, including nested fields like {{location.city}} or {{images.0}}. Missing fields render as empty text. Values are escaped automatically. Telegram HTML tags such as <b>, <i>, <a href=\"...\"> may be used in the template (converted to Markdown for Discord). Clear it to send only the fields listed below.",
            "default": "🆕 {{title}}\n{{url}}"
          },
          "fields": {
            "title": "Fields to list",
            "type": "array",
            "description": "Optional. Fields to add below the template as \"field: value\" lines (nested paths allowed, e.g. location.city). If both the template and this list are empty, the first 10 simple fields of each item are listed.",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Sending mode",
            "enum": [
              "perItem",
              "digest"
            ],
            "type": "string",
            "description": "\"One message per item\" posts each new item separately. \"Digest\" combines all new items into one message (split automatically if it is too long).",
            "default": "perItem"
          },
          "digestTitle": {
            "title": "Digest title",
            "type": "string",
            "description": "Optional heading of the digest message. {{count}} is replaced by the number of new items. Used only in Digest mode.",
            "default": "🆕 {{count}} new item(s)"
          },
          "onlyNew": {
            "title": "Send only new items",
            "type": "boolean",
            "description": "Skip items that were already delivered in previous runs (with the same state key). Turn off to send every item that passes the filters.",
            "default": true
          },
          "dedupeKey": {
            "title": "Unique item field",
            "type": "string",
            "description": "Field that identifies an item, used to recognise items that were already sent (nested paths allowed, e.g. product.id). If an item does not have it, a SHA-256 hash of the whole item is used instead. Leave empty to always use the hash.",
            "default": "url"
          },
          "stateKey": {
            "title": "State key",
            "pattern": "^[A-Za-z0-9_.-]{1,100}$",
            "type": "string",
            "description": "Name of the memory of already-sent items. Use a different key for each separate alert (e.g. \"jobs-berlin\", \"flats-vienna\"). Letters, digits, - _ . only.",
            "default": "default"
          },
          "filters": {
            "title": "Filters",
            "maxItems": 20,
            "type": "array",
            "description": "Optional. Only items matching ALL filters are sent. Operators: contains (case-insensitive text), equals, gte / lte (numbers, e.g. price lte 1200), exists (field is present and not empty).",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "title": "Field",
                  "type": "string",
                  "description": "Item field, nested paths allowed (e.g. price or location.city).",
                  "editor": "textfield",
                  "minLength": 1
                },
                "operator": {
                  "title": "Operator",
                  "type": "string",
                  "description": "How to compare the field with the value.",
                  "editor": "select",
                  "enum": [
                    "contains",
                    "equals",
                    "gte",
                    "lte",
                    "exists"
                  ],
                  "enumTitles": [
                    "contains",
                    "equals",
                    "≥ (gte)",
                    "≤ (lte)",
                    "exists"
                  ],
                  "default": "contains"
                },
                "value": {
                  "title": "Value",
                  "type": "string",
                  "description": "Value to compare with (not needed for \"exists\"). Use a number for gte / lte.",
                  "editor": "textfield"
                }
              },
              "required": [
                "field",
                "operator"
              ]
            }
          },
          "maxMessages": {
            "title": "Max messages per channel",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Safety cap on how many messages are posted to each channel in one run. Items over the cap are not marked as sent, so they are delivered in the next run.",
            "default": 50
          },
          "maxItemsToRead": {
            "title": "Max items to read",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "How many items to read from the dataset (from the start).",
            "default": 1000
          },
          "sendNoNewItemsNotice": {
            "title": "Notify when there are no new items",
            "type": "boolean",
            "description": "Send a short \"No new items\" message when nothing new was found (counts as a delivered message).",
            "default": false
          },
          "dryRun": {
            "title": "Dry run (preview only)",
            "type": "boolean",
            "description": "Build the messages and show previews in the log and output, but send nothing, charge nothing and do not remember items as sent.",
            "default": false
          },
          "payload": {
            "title": "Integration payload",
            "type": "object",
            "description": "Filled in automatically when this Actor is triggered as an integration (contains the triggering run). You do not need to edit it."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}