{
  "openapi": "3.0.1",
  "info": {
    "title": "Alerts Sender: Email, Slack, Discord & Teams",
    "description": "Send an alert or a digest to email (your Resend, Postmark, SendGrid or SMTP account), Slack, Discord, Microsoft Teams or any webhook, with a table of results rendered for each. Run it after another actor or on a schedule. $1 per 1,000 messages delivered.",
    "version": "0.1",
    "x-build-id": "eM9g3tsU3rXWWXigu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cleanpull~alerts-sender/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cleanpull-alerts-sender",
        "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/cleanpull~alerts-sender/runs": {
      "post": {
        "operationId": "runs-sync-cleanpull-alerts-sender",
        "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/cleanpull~alerts-sender/run-sync": {
      "post": {
        "operationId": "run-sync-cleanpull-alerts-sender",
        "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": {
          "subject": {
            "title": "Subject",
            "type": "string",
            "description": "The email subject, and the title of the chat message.",
            "default": "CleanPull alert"
          },
          "message": {
            "title": "Message",
            "type": "string",
            "description": "The text, in light markdown: **bold**, *italics*, [links](https://…), # headings, - lists. Rendered for each channel."
          },
          "html": {
            "title": "Email HTML (optional)",
            "type": "string",
            "description": "Optional. Your own HTML for the email body, used instead of the rendered message."
          },
          "items": {
            "title": "Items",
            "type": "array",
            "description": "Optional. Rows to show as a table under the message (JSON objects), for example the changes a monitor found."
          },
          "datasetId": {
            "title": "Items from a dataset",
            "type": "string",
            "description": "Optional. A dataset whose rows are added to the table (for example the run that triggered this alert). Pick it here so this actor is given read access to it."
          },
          "itemFields": {
            "title": "Table columns",
            "type": "array",
            "description": "Optional. The item fields to show as columns, in order. Empty: the first item's first 6 fields.",
            "items": {
              "type": "string"
            }
          },
          "maxItemsShown": {
            "title": "Rows shown",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "At most this many rows in the table; the message says how many more there were.",
            "default": 25
          },
          "skipIfNoItems": {
            "title": "Skip when there are no items",
            "type": "boolean",
            "description": "Send nothing (and charge nothing) when the table would be empty: for alerts that should fire only when a monitor found something.",
            "default": false
          },
          "preview": {
            "title": "Preview only",
            "type": "boolean",
            "description": "Render the message for every channel and send nothing (apify/send-mail's isMock).",
            "default": false
          },
          "emailTo": {
            "title": "Email to",
            "type": "array",
            "description": "Recipients, one per line (at most 50 in all). Each one gets the email separately, so recipients never see each other's addresses (see Send separately).",
            "items": {
              "type": "string"
            }
          },
          "emailCc": {
            "title": "Email CC",
            "type": "array",
            "description": "Optional. Copied recipients (shown to everyone; with CCs the email goes out once to all).",
            "items": {
              "type": "string"
            }
          },
          "emailBcc": {
            "title": "Email BCC",
            "type": "array",
            "description": "Optional. Hidden recipients.",
            "items": {
              "type": "string"
            }
          },
          "emailSeparately": {
            "title": "Send separately",
            "type": "boolean",
            "description": "Send each recipient their own email (no one sees the other addresses; each email is billed). Off: one email to all of them.",
            "default": true
          },
          "emailFrom": {
            "title": "Email from",
            "type": "string",
            "description": "The sender, on a domain your provider lets you send from, for example alerts@yourdomain.com or \"Alerts <alerts@yourdomain.com>\"."
          },
          "emailReplyTo": {
            "title": "Reply to",
            "type": "string",
            "description": "Optional. Where replies go."
          },
          "emailProvider": {
            "title": "Email provider",
            "enum": [
              "resend",
              "postmark",
              "sendgrid",
              "smtp"
            ],
            "type": "string",
            "description": "How the email is sent: with your account at Resend, Postmark or SendGrid (API key), or through any SMTP server (Gmail, Outlook, Mailgun, your own).",
            "default": "resend"
          },
          "emailApiKey": {
            "title": "Email API key",
            "type": "string",
            "description": "Your Resend, Postmark (server token) or SendGrid API key. Stored encrypted; never shown in logs or results."
          },
          "attachments": {
            "title": "Attachments",
            "type": "array",
            "description": "Optional. Files as [{\"filename\": \"report.csv\", \"data\": \"<base64>\", \"contentType\": \"text/csv\"}], at most 10 files and 5 MB in all."
          },
          "smtpHost": {
            "title": "SMTP host",
            "type": "string",
            "description": "For SMTP: the server, for example smtp.gmail.com or smtp.office365.com."
          },
          "smtpPort": {
            "title": "SMTP port",
            "minimum": 1,
            "maximum": 65535,
            "type": "integer",
            "description": "For SMTP: 587 (STARTTLS) or 465 (TLS, with Secure on).",
            "default": 587
          },
          "smtpSecure": {
            "title": "SMTP secure (port 465)",
            "type": "boolean",
            "description": "On for servers that use TLS from the start (usually port 465). Off: STARTTLS on 587.",
            "default": false
          },
          "smtpUser": {
            "title": "SMTP user",
            "type": "string",
            "description": "For SMTP: the login, usually your email address."
          },
          "smtpPassword": {
            "title": "SMTP password",
            "type": "string",
            "description": "For SMTP: the password or app password. Stored encrypted; never shown in logs or results."
          },
          "slackWebhookUrl": {
            "title": "Slack webhook",
            "type": "string",
            "description": "A Slack incoming webhook (https://hooks.slack.com/services/…)."
          },
          "discordWebhookUrl": {
            "title": "Discord webhook",
            "type": "string",
            "description": "A Discord channel webhook (https://discord.com/api/webhooks/…)."
          },
          "teamsWebhookUrl": {
            "title": "Microsoft Teams webhook",
            "type": "string",
            "description": "A Teams workflow webhook (\"Post to a channel when a webhook request is received\"); the message arrives as an Adaptive Card."
          },
          "webhookUrl": {
            "title": "Other webhook",
            "type": "string",
            "description": "Any https endpoint (Zapier, Make, n8n, your own): receives the subject, text, markdown and items as JSON."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}