{
  "openapi": "3.0.1",
  "info": {
    "title": "Send Dataset Rows to Webhook, Slack or Discord: Only New Rows",
    "description": "Send any Apify dataset's rows to a Slack or Discord channel, Zapier, n8n or your own webhook: one by one or in batches, only rows not sent before if you like. Handles rate limits, escapes scraped text, reports what was delivered, charges only for delivered requests. Runs with limited permissions.",
    "version": "0.1",
    "x-build-id": "IxukjbjFTwogQXZOH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/humble-echidna~dataset-to-webhook/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-humble-echidna-dataset-to-webhook",
        "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/humble-echidna~dataset-to-webhook/runs": {
      "post": {
        "operationId": "runs-sync-humble-echidna-dataset-to-webhook",
        "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/humble-echidna~dataset-to-webhook/run-sync": {
      "post": {
        "operationId": "run-sync-humble-echidna-dataset-to-webhook",
        "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": "Apify dataset to send",
            "type": "string",
            "description": "The dataset whose rows to send: its id or name, or pick it in the form. Read-only, this one only. In an integration after a scraper, set it to `{{resource.defaultDatasetId}}`: Apify lets the run read only a dataset named here, not one in the integration's payload. When set, items is ignored."
          },
          "items": {
            "title": "Or: rows to send (JSON array)",
            "type": "array",
            "description": "Rows typed in as a JSON array of objects, instead of a dataset, e.g. to test your webhook. The prefill is three sample job rows: with no webhookUrl they're only previewed; with one they are really sent. Ignored when datasetId is set."
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Where the rows go: a Slack incoming webhook, a Zapier or n8n catch hook, or your own endpoint (public http or https, ports 80 and 443). Stored encrypted and never logged. Leave it empty for a free preview of what would be sent. Empty by default."
          },
          "format": {
            "title": "Format",
            "enum": [
              "auto",
              "json",
              "slack",
              "discord"
            ],
            "type": "string",
            "description": "`auto` (the default) picks from the address: Slack's webhook address gets `slack`, Discord's gets `discord`, anything else `json`. Choose `slack` for Slack-compatible receivers such as Mattermost. Discord delivery is refused today (its robots.txt disallows /api; see README).",
            "default": "auto"
          },
          "messageTemplate": {
            "title": "Message template (Slack, Discord)",
            "type": "string",
            "description": "One row's line in a chat message, with `{field}` for values and dots for nested fields, e.g. `*{title}* at {company}: {url}`. Values are escaped so a row can't ping a channel or hide a link. Single braces, because Apify fills in double ones. Empty (the default): the row's first 8 simple fields. Not used for `json`."
          },
          "messageTitle": {
            "title": "Message title (Slack, Discord)",
            "type": "string",
            "description": "Optional first line of each chat message; `{count}` becomes the rows in that message, e.g. `{count} new jobs`. Empty by default. Not used for `json`."
          },
          "fields": {
            "title": "Only these fields",
            "type": "array",
            "description": "Send only these fields, one per line or comma-separated; dots reach nested ones and the name stays as written. Empty (the default): the whole row. In chat messages it applies when there's no template.",
            "items": {
              "type": "string"
            }
          },
          "batchSize": {
            "title": "Rows per request",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many rows go in one request (1 to 1000), and you pay per request, so bigger batches cost less. 1 sends the row as a JSON object; more sends a JSON array. Default when empty: 1 for `json`, 20 for `slack`, 10 for `discord`. Chat messages also split at the platform's length limit, and JSON at 5 MB."
          },
          "method": {
            "title": "HTTP method",
            "enum": [
              "POST",
              "PUT",
              "PATCH"
            ],
            "type": "string",
            "description": "`POST` (the default), `PUT` or `PATCH`. JSON format only; Slack and Discord always get POST.",
            "default": "POST"
          },
          "headers": {
            "title": "Request headers",
            "type": "object",
            "description": "Extra headers as a JSON object, e.g. `{\"Authorization\": \"Bearer ...\"}`, for your own endpoint. Stored encrypted and never logged. Empty by default. JSON format only. Host, User-Agent, Content-Length and similar can't be replaced."
          },
          "onlyNew": {
            "title": "Only rows not delivered by earlier runs",
            "type": "boolean",
            "description": "Default false. When true, rows this actor delivered to this destination in earlier runs are skipped, free, as are repeats within the run. A row counts only once the destination accepted it, so failed or unclear ones come back next run. Fingerprints stay in a key-value store in your account.",
            "default": false
          },
          "onlyNewKey": {
            "title": "What makes a row the same",
            "type": "array",
            "description": "Fields that identify a row for onlyNew, e.g. `url` or `name, city`; dots reach nested fields. Empty (the default): the whole row, so any changed value makes it new again. Changing this starts a new memory.",
            "items": {
              "type": "string"
            }
          },
          "memoryName": {
            "title": "Memory name",
            "type": "string",
            "description": "Optional name for what onlyNew remembers, e.g. `new-jobs`, at most 63 letters, digits or hyphens. Empty (the default): one memory per task or scraper and destination. Set a name to share it, or to keep it when the webhook address changes."
          },
          "dryRun": {
            "title": "Preview only (send nothing)",
            "type": "boolean",
            "description": "Default false. When true, nothing is sent or charged: the dataset shows the first 20 requests' bodies exactly as they would go. Also what a run does when webhookUrl is empty.",
            "default": false
          },
          "retryIfUnsure": {
            "title": "Retry when the outcome is unclear",
            "type": "boolean",
            "description": "Default true. After a 5xx, a timeout or a dropped connection the destination may already have the rows, so a retry can double-send: it's up to 2 more tries and the log row says `duplicatePossible`. False: no retry, the row is reported as `unknown`. A 429 is always retried, since it can't double-send.",
            "default": true
          },
          "secondsBetweenRequests": {
            "title": "Seconds between requests",
            "minimum": 0,
            "maximum": 60,
            "type": "number",
            "description": "Least time between requests, 0 to 60, default 0.2. Slack is held to at least 1 and Discord to 2.1, their published limits. Requests go one at a time, in row order, and wait as long as the destination's Retry-After asks, up to 90 seconds.",
            "default": 0.2
          },
          "failRunOnError": {
            "title": "End the run as Failed if anything wasn't delivered",
            "type": "boolean",
            "description": "Default false: the run ends Succeeded and the status, SUMMARY and log rows say what was delivered. True: it ends Failed when any row failed or is unclear, or the dataset couldn't be read, so Apify's run-failed alerts fire.",
            "default": false
          },
          "maxRows": {
            "title": "Max rows per run",
            "minimum": 1,
            "type": "integer",
            "description": "Send at most this many rows, e.g. 100. Minimum 1; empty (the default) for no limit. With onlyNew, the rest go next run."
          },
          "maxRequests": {
            "title": "Max requests per run",
            "minimum": 1,
            "type": "integer",
            "description": "Make at most this many requests, e.g. 100. Minimum 1; empty (the default) for no limit. The run also stops cleanly at the maximum cost per run in the run options, whichever comes first."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}