{
  "openapi": "3.0.1",
  "info": {
    "title": "HTTP Request - Batch API Calls [$4/1K]",
    "description": "Send GET, POST, PUT, PATCH and DELETE API calls from Apify in batches for Clay, n8n and Make: encrypted secrets, retries, lookup keys, structured results. $4 per 1,000 HTTP responses; blocks, timeouts and retries are never charged.",
    "version": "0.1",
    "x-build-id": "vOsrd8w3qcjOZjZSu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automa-flow~http-request-batch/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automa-flow-http-request-batch",
        "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/automa-flow~http-request-batch/runs": {
      "post": {
        "operationId": "runs-sync-automa-flow-http-request-batch",
        "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/automa-flow~http-request-batch/run-sync": {
      "post": {
        "operationId": "run-sync-automa-flow-http-request-batch",
        "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": [
          "requests"
        ],
        "properties": {
          "requests": {
            "title": "HTTP requests",
            "minItems": 1,
            "maxItems": 1000,
            "type": "array",
            "description": "1-1000 HTTP requests to execute in this run. Each item becomes one Dataset row with matching inputIndex / lookupKey; malformed items become uncharged INVALID_INPUT rows without stopping valid items.",
            "items": {
              "type": "object",
              "properties": {
                "lookupKey": {
                  "type": "string",
                  "title": "Lookup key",
                  "description": "Optional id to match this response back to a Clay/n8n/Make row (max 200 chars).",
                  "maxLength": 200
                },
                "method": {
                  "type": "string",
                  "title": "HTTP method",
                  "description": "HTTP method for this request: GET, POST, PUT, PATCH, DELETE, HEAD or OPTIONS.",
                  "default": "GET"
                },
                "url": {
                  "type": "string",
                  "title": "URL",
                  "description": "Public http:// or https:// URL. Private, loopback, link-local and metadata targets are blocked.",
                  "minLength": 1,
                  "maxLength": 2048
                },
                "headers": {
                  "type": "object",
                  "title": "Headers",
                  "description": "Non-secret request headers. Put Authorization / API keys in secretHeaders instead."
                },
                "query": {
                  "type": "object",
                  "title": "Query parameters",
                  "description": "Query string parameters merged into the URL. Prefer secretHeaders over secret query values."
                },
                "body": {
                  "type": "object",
                  "title": "JSON object body",
                  "description": "Optional JSON object body. Not allowed for GET/HEAD and mutually exclusive with bodyText/bodyArray.",
                  "editor": "json"
                },
                "bodyText": {
                  "type": "string",
                  "title": "Raw text body",
                  "description": "Optional raw text body. Not allowed for GET/HEAD and mutually exclusive with body/bodyArray.",
                  "editor": "textfield"
                },
                "bodyArray": {
                  "type": "array",
                  "title": "JSON array body",
                  "description": "Optional JSON array body. Not allowed for GET/HEAD and mutually exclusive with body/bodyText.",
                  "editor": "json"
                },
                "timeoutSecs": {
                  "type": "integer",
                  "title": "Timeout override (seconds)",
                  "description": "Optional per-request timeout within the global 1-120 second limits.",
                  "minimum": 1,
                  "maximum": 120
                }
              }
            }
          },
          "secretHeaders": {
            "title": "Secret headers",
            "type": "object",
            "description": "Encrypted shared headers merged into every request (for example Authorization). Values are never written to Dataset rows or logs."
          },
          "timeoutSecs": {
            "title": "Default timeout (seconds)",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "Default per-request timeout when a request does not set timeoutSecs.",
            "default": 30
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many requests to run at once (1-50). Default 20.",
            "default": 20
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Extra attempts after the first try for timeouts, network errors and retryable HTTP statuses (408/429/5xx). By default only safe methods (GET/HEAD/OPTIONS) are retried. Retries are not billed.",
            "default": 2
          },
          "retryNonIdempotent": {
            "title": "Retry POST/PUT/PATCH/DELETE",
            "type": "boolean",
            "description": "When false (default), only GET/HEAD/OPTIONS are retried. Enable only when your target tolerates duplicate non-idempotent requests.",
            "default": false
          },
          "maxResponseBytes": {
            "title": "Max response bytes",
            "minimum": 1024,
            "maximum": 1048576,
            "type": "integer",
            "description": "Hard streaming cap per response (1 KiB - 1 MiB). Oversized responses are marked RESPONSE_TOO_LARGE.",
            "default": 262144
          },
          "treatNon2xxAsError": {
            "title": "Treat non-2xx as HTTP_ERROR",
            "type": "boolean",
            "description": "When false (default), a reached HTTP response is status SUCCESS with ok=false for non-2xx. When true, non-2xx rows use status HTTP_ERROR.",
            "default": false
          },
          "callbackUrl": {
            "title": "Callback URL",
            "maxLength": 2048,
            "type": "string",
            "description": "Optional public URL that receives one POST per completed valid request with the Dataset row JSON. Same SSRF policy as target URLs. Retries reuse an Idempotency-Key and are not billed."
          },
          "callbackSecretHeaders": {
            "title": "Callback secret headers",
            "type": "object",
            "description": "Encrypted headers for the optional callback POST only."
          },
          "maxRequests": {
            "title": "Max requests this run",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Reject the run when the requests array is longer than this cap (1-1000). Default 100 for safe first runs.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}