{
  "openapi": "3.0.1",
  "info": {
    "title": "Send HTTP Requests - Bulk API Calls for Clay, n8n & Make",
    "description": "Send GET, POST, PUT, PATCH or DELETE requests one at a time or in bulk. JSON answers parsed, chosen fields as columns, retries with backoff, a polite rate cap. Built for Clay tables.",
    "version": "0.1",
    "x-build-id": "8HUzrFVflGbcowPHq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/afterstar~send-http-requests/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-afterstar-send-http-requests",
        "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/afterstar~send-http-requests/runs": {
      "post": {
        "operationId": "runs-sync-afterstar-send-http-requests",
        "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/afterstar~send-http-requests/run-sync": {
      "post": {
        "operationId": "run-sync-afterstar-send-http-requests",
        "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": {
          "url": {
            "title": "URL",
            "type": "string",
            "description": "The address to call. For one request (one Clay row) this is all you need. Leave it empty to send only the list in 'Requests'."
          },
          "method": {
            "title": "Method",
            "enum": [
              "GET",
              "POST",
              "PUT",
              "PATCH",
              "DELETE",
              "HEAD",
              "OPTIONS"
            ],
            "type": "string",
            "description": "For the URL above, and for every request in the list that doesn't name its own.",
            "default": "GET"
          },
          "headers": {
            "title": "Headers",
            "type": "object",
            "description": "Sent with every request, for example {\"Authorization\": \"Bearer ...\"} or {\"X-API-Key\": \"...\"}. A request in the list can add or override its own. Never written to the log or the results."
          },
          "params": {
            "title": "Query parameters",
            "type": "object",
            "description": "Added to the URL's query string, for every request: {\"page\": 2, \"limit\": 50}. Values of names like key, token or secret show as *** in the results."
          },
          "data": {
            "title": "Body (JSON)",
            "type": "object",
            "description": "Body for the URL above (POST, PUT, PATCH). Sent as JSON with Content-Type application/json, or form-encoded if your headers say application/x-www-form-urlencoded."
          },
          "bodyText": {
            "title": "Body (raw text)",
            "type": "string",
            "description": "Instead of the JSON body: any text, like XML or a=1&b=2. Set the Content-Type in Headers (default text/plain)."
          },
          "lookupKey": {
            "title": "Lookup key",
            "type": "string",
            "description": "Anything you want back on the result row, like a row ID, to join answers to your own rows."
          },
          "requests": {
            "title": "Requests (bulk)",
            "type": "array",
            "description": "A list of URLs, or of objects {\"url\", \"method\", \"headers\", \"params\", \"data\", \"lookupKey\"}. Only url is needed; method, headers and params from above are the defaults. Example: [\"https://api.example.com/a\", {\"url\": \"https://api.example.com/b\", \"method\": \"POST\", \"data\": {\"id\": 7}, \"lookupKey\": \"row-2\"}]"
          },
          "liftFields": {
            "title": "Fields to lift into columns",
            "type": "array",
            "description": "Paths in the JSON answer that you want as their own columns: 'title', 'data.user.email', 'items[0].id' (or 'items.0.id'). Name the column with 'name=path'. A path that isn't there gives null.",
            "items": {
              "type": "string"
            }
          },
          "parseJson": {
            "title": "Parse JSON answers",
            "type": "boolean",
            "description": "On: a JSON answer goes into the 'json' field as data. Off: every answer is plain text in 'body'.",
            "default": true
          },
          "maxResponseBytes": {
            "title": "Max answer size (bytes)",
            "minimum": 1000,
            "maximum": 5000000,
            "type": "integer",
            "description": "Longer answers are cut here and marked truncated: true (a cut JSON answer stays text). Up to 5,000,000.",
            "default": 512000
          },
          "callbackUrl": {
            "title": "Callback URL",
            "type": "string",
            "description": "Optional: each finished row is also POSTed here as JSON, like a Clay webhook table or an n8n webhook. Never charged."
          },
          "responseTimeout": {
            "title": "Timeout per attempt (seconds)",
            "minimum": 1,
            "maximum": 300000,
            "type": "integer",
            "description": "How long one attempt may take, answer included. 1-300 seconds; numbers over 1,000 are read as milliseconds.",
            "default": 30
          },
          "retryOnFailure": {
            "title": "Retry on failure",
            "type": "boolean",
            "description": "Retry with growing waits (and the server's Retry-After) on 429, 503 and connection failures; on 408, 425, 500, 502, 504 and timeouts too for GET, HEAD, PUT, DELETE. A 4xx answer is never retried. Retries are part of the same request: charged once.",
            "default": true
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries after the first attempt (0-5).",
            "default": 2
          },
          "followRedirects": {
            "title": "Follow redirects",
            "type": "boolean",
            "description": "Off: a 301/302 answer is the result itself (see its 'location' header).",
            "default": true
          },
          "maxConcurrency": {
            "title": "Requests at once",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many requests run in parallel (1-20).",
            "default": 5
          },
          "maxRequestsPerSecondPerHost": {
            "title": "Max requests per second per host",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "A polite cap per website or API (1-20), retries included. Lower it if the API limits you.",
            "default": 5
          },
          "maxRequests": {
            "title": "Max requests per run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Requests past this are not sent (and not charged). Up to 10,000 per run.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}