{
  "openapi": "3.0.1",
  "info": {
    "title": "Dataset to Email — CSV, XLSX, JSON via your SMTP or API",
    "description": "Emails any Apify dataset as CSV, XLSX or JSON attachments with an HTML preview table, through your own SMTP server (Gmail or any host) or Resend, SendGrid, Mailgun, Postmark or Brevo. Works as an integration. $0.005 per email sent; dry runs and failures are free.",
    "version": "0.1",
    "x-build-id": "rslNtg6zIBxJnLI7u"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/teal_blacksmith~dataset-to-email/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-teal_blacksmith-dataset-to-email",
        "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/teal_blacksmith~dataset-to-email/runs": {
      "post": {
        "operationId": "runs-sync-teal_blacksmith-dataset-to-email",
        "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/teal_blacksmith~dataset-to-email/run-sync": {
      "post": {
        "operationId": "run-sync-teal_blacksmith-dataset-to-email",
        "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",
          "from"
        ],
        "properties": {
          "to": {
            "title": "To",
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "description": "Recipient email addresses. \"to\", \"cc\" and \"bcc\" together allow at most 20 addresses per run. This Actor is for reports and alerts, not for bulk or marketing email.",
            "items": {
              "type": "string"
            }
          },
          "from": {
            "title": "From",
            "type": "string",
            "description": "A sender address you own and that your SMTP account or email API is allowed to send as. A display name is allowed: Reports <reports@yourdomain.com>."
          },
          "cc": {
            "title": "Cc",
            "maxItems": 20,
            "type": "array",
            "description": "Optional copy recipients.",
            "items": {
              "type": "string"
            }
          },
          "bcc": {
            "title": "Bcc",
            "maxItems": 20,
            "type": "array",
            "description": "Optional hidden copy recipients.",
            "items": {
              "type": "string"
            }
          },
          "replyTo": {
            "title": "Reply-To",
            "type": "string",
            "description": "Optional address that replies should go to."
          },
          "dryRun": {
            "title": "Dry run (do not send)",
            "type": "boolean",
            "description": "When on, nothing is sent and no provider settings are needed. The rendered email (subject, HTML body, attachment names and sizes) is saved to the key-value store record EMAIL_PREVIEW, and the HTML body to EMAIL_PREVIEW.html. Turn it off to send.",
            "default": false
          },
          "datasetId": {
            "title": "Dataset ID",
            "type": "string",
            "description": "Apify dataset to send. When this Actor is attached as an integration to another Actor, set this to {{resource.defaultDatasetId}} (the dataset of the run that triggered it). Leave empty when you pass Rows."
          },
          "rows": {
            "title": "Rows (JSON)",
            "type": "array",
            "description": "A JSON array of objects to send instead of a dataset, for example [{\"name\": \"Ann\", \"age\": 30}]. Handy for AI agents and small reports. Ignored when the Actor runs as an integration."
          },
          "fields": {
            "title": "Columns and order",
            "type": "array",
            "description": "Column names to include, in this order. Nested data uses dot notation (details.color); a parent name (details) includes all columns under it. Leave empty for all columns in first-seen order.",
            "items": {
              "type": "string"
            }
          },
          "omitFields": {
            "title": "Columns to leave out",
            "type": "array",
            "description": "Column names to exclude. A parent name (details) excludes all columns under it.",
            "items": {
              "type": "string"
            }
          },
          "maxRows": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Read at most this many rows. When the source has more, the email says so and the result has the reason ROWS_TRUNCATED_AT_MAX_ROWS.",
            "default": 10000
          },
          "skipIfEmpty": {
            "title": "Skip when there are no rows",
            "type": "boolean",
            "description": "Off: a \"no results\" email is sent when the source has 0 rows. On: nothing is sent and the status is skipped_empty.",
            "default": false
          },
          "subject": {
            "title": "Subject",
            "type": "string",
            "description": "Leave empty for a default subject. Placeholders: {{itemCount}}, {{datasetId}}, {{actorName}}, {{runId}}, {{runStatus}}, {{date}}."
          },
          "text": {
            "title": "Text body",
            "type": "string",
            "description": "Optional plain-text body. Placeholders as in Subject, plus {{datasetUrl}} and {{previewTable}}."
          },
          "html": {
            "title": "HTML body",
            "type": "string",
            "description": "Optional HTML body. Placeholders as in Subject, plus {{datasetUrl}} and {{previewTable}} (the preview table as HTML). Placeholder values are HTML-escaped."
          },
          "previewRows": {
            "title": "Preview rows in the body",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Number of rows in the preview table. 0 removes the table.",
            "default": 20
          },
          "attachmentFormats": {
            "title": "Attachment formats",
            "uniqueItems": true,
            "type": "array",
            "description": "Any of csv, xlsx, json. An empty list sends no attachment. CSV is UTF-8 with BOM and opens correctly in Excel.",
            "items": {
              "type": "string",
              "enum": [
                "csv",
                "xlsx",
                "json"
              ],
              "enumTitles": [
                "CSV",
                "XLSX (Excel)",
                "JSON"
              ]
            },
            "default": [
              "csv"
            ]
          },
          "maxAttachmentMb": {
            "title": "Max total attachment size (MB)",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "When the attachments together are larger than this, they are left out, download links to the dataset are put in the body instead, and the result has the reason ATTACHMENT_TOO_LARGE_LINKED. The run does not fail.",
            "default": 10
          },
          "provider": {
            "title": "Send with",
            "enum": [
              "smtp",
              "resend",
              "sendgrid",
              "mailgun",
              "postmark",
              "brevo"
            ],
            "type": "string",
            "description": "Your own SMTP server or one of the email APIs. The email is sent from your account, not from Apify.",
            "default": "smtp"
          },
          "smtpHost": {
            "title": "SMTP host",
            "type": "string",
            "description": "For example smtp.gmail.com. Must be a public mail server; private, loopback and internal addresses are refused."
          },
          "smtpPort": {
            "title": "SMTP port",
            "minimum": 25,
            "maximum": 2525,
            "type": "integer",
            "description": "587 (STARTTLS), 465 (implicit TLS), 2525 or 25. Other ports are refused.",
            "default": 587
          },
          "smtpSecure": {
            "title": "Implicit TLS",
            "type": "boolean",
            "description": "Connect with TLS from the first byte. Always on for port 465. Leave off for 587, 2525 and 25, where STARTTLS is used and required.",
            "default": false
          },
          "smtpUser": {
            "title": "SMTP user",
            "type": "string",
            "description": "Usually your full email address."
          },
          "smtpPassword": {
            "title": "SMTP password",
            "type": "string",
            "description": "Stored encrypted. For Gmail use an app password, not your account password."
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Stored encrypted. Resend API key, SendGrid API key, Mailgun sending key, Postmark server token, or Brevo API key."
          },
          "mailgunDomain": {
            "title": "Mailgun domain",
            "type": "string",
            "description": "Mailgun only: your sending domain, for example mg.example.com."
          },
          "mailgunRegion": {
            "title": "Mailgun region",
            "enum": [
              "us",
              "eu"
            ],
            "type": "string",
            "description": "Mailgun only: us (api.mailgun.net) or eu (api.eu.mailgun.net).",
            "default": "us"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}