{
  "openapi": "3.0.1",
  "info": {
    "title": "Send Email Report & Slack, Discord, Teams, Telegram Alerts",
    "description": "Send a dataset report when any scraper finishes: email (your own SMTP or Resend) with a preview table and CSV/JSON attachment, plus Slack, Discord, Microsoft Teams, Telegram or webhook alerts. Sends only when there are items, retries each channel on its own. $0.0009 per notification.",
    "version": "0.0",
    "x-build-id": "LTMkkjnOICz1biPK8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/charlesmarkette~send-email-report-slack-discord-teams-telegram-alerts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-charlesmarkette-send-email-report-slack-discord-teams-telegram-alerts",
        "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/charlesmarkette~send-email-report-slack-discord-teams-telegram-alerts/runs": {
      "post": {
        "operationId": "runs-sync-charlesmarkette-send-email-report-slack-discord-teams-telegram-alerts",
        "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/charlesmarkette~send-email-report-slack-discord-teams-telegram-alerts/run-sync": {
      "post": {
        "operationId": "run-sync-charlesmarkette-send-email-report-slack-discord-teams-telegram-alerts",
        "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 to summarize, usually the scraper run's output. In an integration (Integrations → Connect Actor or task), use {{resource.defaultDatasetId}}. Leave empty to send a test message with 3 sample items."
          },
          "runUrl": {
            "title": "Run URL",
            "type": "string",
            "description": "Optional link to the run, shown in the message."
          },
          "actorName": {
            "title": "Name shown in messages",
            "type": "string",
            "description": "Optional, e.g. 'Amazon price tracker'. Default: 'Your Apify run'."
          },
          "condition": {
            "title": "When to send",
            "enum": [
              "onlyIfItems",
              "always",
              "minItems"
            ],
            "type": "string",
            "description": "Runs that don't meet the condition send nothing and are free.",
            "default": "onlyIfItems"
          },
          "minItems": {
            "title": "Minimum items",
            "minimum": 0,
            "type": "integer",
            "description": "Used with 'Only if the dataset has at least Minimum items'.",
            "default": 1
          },
          "dryRun": {
            "title": "Dry run (render only, don't send)",
            "type": "boolean",
            "description": "Renders every configured message into OUTPUT and the dataset without sending anything (free). With no channel configured, it previews all channels.",
            "default": false
          },
          "subject": {
            "title": "Subject / title",
            "type": "string",
            "description": "Email subject and chat message title. Default: '{actorName}: {itemCount} items'."
          },
          "messageTemplate": {
            "title": "Message",
            "type": "string",
            "description": "Text above the preview. Default: '{actorName} finished with {itemCount} items.' Links to the dataset and run are added automatically."
          },
          "previewFields": {
            "title": "Preview fields",
            "type": "array",
            "description": "Fields to show for each item, e.g. 'title', 'price', 'url'. Dots for nested fields ('seller.name'). Empty = the first 8 fields.",
            "items": {
              "type": "string"
            }
          },
          "previewRows": {
            "title": "Preview rows",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "How many items to show (max 100). Chat apps may show fewer to stay within their message limits.",
            "default": 10
          },
          "smtpHost": {
            "title": "SMTP server",
            "type": "string",
            "description": "e.g. smtp.gmail.com, smtp.office365.com, smtp.sendgrid.net, email-smtp.us-east-1.amazonaws.com"
          },
          "smtpPort": {
            "title": "SMTP port",
            "minimum": 1,
            "maximum": 65535,
            "type": "integer",
            "description": "Default: 587 for STARTTLS, 465 for SSL, 25 for none."
          },
          "smtpSecurity": {
            "title": "SMTP security",
            "enum": [
              "starttls",
              "ssl",
              "none"
            ],
            "type": "string",
            "description": "How to encrypt the connection to the SMTP server.",
            "default": "starttls"
          },
          "smtpUsername": {
            "title": "SMTP username",
            "type": "string",
            "description": "Usually your email address or the provider's SMTP user name. Leave empty for servers without login."
          },
          "smtpPassword": {
            "title": "SMTP password",
            "type": "string",
            "description": "Stored encrypted. Gmail, Outlook and iCloud need an app password."
          },
          "resendApiKey": {
            "title": "Resend API key",
            "type": "string",
            "description": "Instead of SMTP: a Resend API key (re_…) with sending access. Stored encrypted."
          },
          "emailFrom": {
            "title": "From",
            "type": "string",
            "description": "e.g. 'Scraper alerts <alerts@yourdomain.com>'. Must be an address your provider lets you send from (with Resend, a verified domain)."
          },
          "emailTo": {
            "title": "To",
            "type": "array",
            "description": "One or more recipients.",
            "items": {
              "type": "string"
            }
          },
          "emailCc": {
            "title": "Cc",
            "type": "array",
            "description": "Optional.",
            "items": {
              "type": "string"
            }
          },
          "emailBcc": {
            "title": "Bcc",
            "type": "array",
            "description": "Optional. Never shown to other recipients.",
            "items": {
              "type": "string"
            }
          },
          "emailReplyTo": {
            "title": "Reply-To",
            "type": "string",
            "description": "Optional."
          },
          "attachment": {
            "title": "Attach the dataset",
            "enum": [
              "none",
              "csv",
              "json"
            ],
            "type": "string",
            "description": "Email only. Attachments are limited to about 10 MB: bigger datasets attach the first items and the email says so.",
            "default": "none"
          },
          "slackWebhookUrl": {
            "title": "Slack incoming webhook URL",
            "type": "string",
            "description": "https://hooks.slack.com/services/… Stored encrypted."
          },
          "discordWebhookUrl": {
            "title": "Discord webhook URL",
            "type": "string",
            "description": "https://discord.com/api/webhooks/… Stored encrypted."
          },
          "discordUsername": {
            "title": "Discord bot name",
            "type": "string",
            "description": "Optional name to post as (overrides the webhook's name)."
          },
          "teamsWebhookUrl": {
            "title": "Microsoft Teams webhook URL (Workflows)",
            "type": "string",
            "description": "The URL of a Teams Workflows 'Send webhook alerts to a channel' flow (or an incoming webhook). Stored encrypted."
          },
          "telegramBotToken": {
            "title": "Telegram bot token",
            "type": "string",
            "description": "From @BotFather, like 123456789:AA… Stored encrypted."
          },
          "telegramChatId": {
            "title": "Telegram chat ID",
            "type": "string",
            "description": "Your user ID, a group ID (starts with -) or @channelusername. The bot must be in the group, or an admin of the channel."
          },
          "genericWebhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Receives a JSON POST with itemCount, datasetId, datasetUrl, runUrl, actorName and the first items. Stored encrypted."
          },
          "genericWebhookHeaders": {
            "title": "Webhook headers",
            "type": "object",
            "description": "Optional JSON object, e.g. {\"Authorization\": \"Bearer …\"}. Stored encrypted."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}