{
  "openapi": "3.0.1",
  "info": {
    "title": "Send Email with Dataset Attachments — CSV, Excel, SMTP",
    "description": "E-mail Apify results as CSV, Excel or JSON attachments with an HTML table in the body, or send any notification, through your own SMTP (Gmail, Outlook, Zoho, SES) or Resend. Use it after any scraper. $0.005 per e-mail.",
    "version": "0.0",
    "x-build-id": "RixycPhY92KFnMwhO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/saliga~send-email-dataset-attachments/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-saliga-send-email-dataset-attachments",
        "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/saliga~send-email-dataset-attachments/runs": {
      "post": {
        "operationId": "runs-sync-saliga-send-email-dataset-attachments",
        "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/saliga~send-email-dataset-attachments/run-sync": {
      "post": {
        "operationId": "run-sync-saliga-send-email-dataset-attachments",
        "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",
        "required": [
          "to"
        ],
        "properties": {
          "to": {
            "title": "To",
            "type": "string",
            "description": "Recipients, comma separated. At most 50 recipients in total (to, cc, bcc)."
          },
          "cc": {
            "title": "Cc",
            "type": "string",
            "description": "Copy recipients, comma separated."
          },
          "bcc": {
            "title": "Bcc",
            "type": "string",
            "description": "Hidden copy recipients, comma separated."
          },
          "subject": {
            "title": "Subject",
            "type": "string",
            "description": "{{rowCount}} is replaced by the number of dataset rows, e.g. \"{{rowCount}} new leads today\"."
          },
          "text": {
            "title": "Text",
            "type": "string",
            "description": "Plain-text body."
          },
          "html": {
            "title": "HTML body",
            "type": "string",
            "description": "Optional HTML body. With a dataset, the results table is added below it."
          },
          "replyTo": {
            "title": "Reply-to",
            "type": "string",
            "description": "Address replies go to, if not the sender."
          },
          "datasetId": {
            "title": "Dataset to send",
            "type": "string",
            "description": "The results to send, e.g. the default dataset of a scraper run. In an integration, map the dataset ID of the run here."
          },
          "attachmentFormats": {
            "title": "Attach as",
            "type": "array",
            "description": "Nested fields become columns like address/city.",
            "items": {
              "type": "string",
              "enum": [
                "csv",
                "xlsx",
                "json"
              ],
              "enumTitles": [
                "CSV",
                "Excel (.xlsx)",
                "JSON"
              ]
            },
            "default": [
              "csv"
            ]
          },
          "attachmentName": {
            "title": "File name",
            "type": "string",
            "description": "File name of the attachments, without extension.",
            "default": "results"
          },
          "includeTable": {
            "title": "Table in the e-mail body",
            "type": "boolean",
            "description": "The first rows as an HTML table (up to 15 columns).",
            "default": true
          },
          "tableMaxRows": {
            "title": "Rows in the table",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many rows the table in the body shows (the attachments always have all rows).",
            "default": 50
          },
          "columns": {
            "title": "Columns",
            "type": "array",
            "description": "Only these columns, in this order (attachments and table). Empty: all.",
            "items": {
              "type": "string"
            }
          },
          "skipIfEmpty": {
            "title": "Don't send when the dataset is empty",
            "type": "boolean",
            "description": "Handy for daily monitors: no new results, no e-mail (and no charge).",
            "default": false
          },
          "from": {
            "title": "From address",
            "type": "string",
            "description": "The sender. Must be allowed by your mail server (for Gmail: your own address). Empty: the SMTP user."
          },
          "fromName": {
            "title": "From name",
            "type": "string",
            "description": "Sender name shown in the inbox, e.g. Lead Bot."
          },
          "smtpHost": {
            "title": "SMTP server",
            "type": "string",
            "description": "Gmail: smtp.gmail.com · Outlook/Microsoft 365: smtp.office365.com · Zoho: smtp.zoho.com · Amazon SES: email-smtp.<region>.amazonaws.com"
          },
          "smtpPort": {
            "title": "SMTP port",
            "type": "integer",
            "description": "465 (SSL) or 587 (STARTTLS). Empty: 465."
          },
          "smtpSecurity": {
            "title": "Security",
            "enum": [
              "ssl",
              "starttls",
              "none"
            ],
            "type": "string",
            "description": "Empty: chosen from the port."
          },
          "smtpUser": {
            "title": "SMTP user",
            "type": "string",
            "description": "Usually your full e-mail address."
          },
          "smtpPassword": {
            "title": "SMTP password",
            "type": "string",
            "description": "For Gmail and Outlook an app password (see the README). Stored encrypted."
          },
          "resendApiKey": {
            "title": "Resend API key",
            "type": "string",
            "description": "Instead of SMTP: send through Resend (resend.com) with a verified domain."
          },
          "isMock": {
            "title": "Preview only",
            "type": "boolean",
            "description": "Build the e-mail and save it as PREVIEW.html without sending. Also used when no SMTP server or Resend key is given.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}