{
  "openapi": "3.0.1",
  "info": {
    "title": "HTTP Request Runner — Bulk API Calls with Retries & Auth",
    "description": "Run batches of HTTP requests (GET/POST/PUT/DELETE, custom headers/body, Bearer/Basic auth, retries with backoff, concurrency) and collect every response into a dataset. Universal API glue for n8n, Make, Zapier, and AI agents.",
    "version": "0.1",
    "x-build-id": "pbQ35c0HR5FIzvh9c"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/glueworks~http-request-runner/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-glueworks-http-request-runner",
        "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/glueworks~http-request-runner/runs": {
      "post": {
        "operationId": "runs-sync-glueworks-http-request-runner",
        "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/glueworks~http-request-runner/run-sync": {
      "post": {
        "operationId": "run-sync-glueworks-http-request-runner",
        "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": {
          "requests": {
            "title": "Requests",
            "type": "array",
            "description": "List of requests to execute. Each item: <code>url</code> (required), <code>method</code> (GET/POST/PUT/PATCH/DELETE/HEAD/OPTIONS, default GET), optional <code>headers</code> (object), optional <code>body</code> (string sent as-is, or JSON object/array sent as <code>application/json</code>), optional <code>name</code> (label copied to the output record). Plain URL strings are also accepted."
          },
          "urlTemplate": {
            "title": "URL template (batch mode)",
            "type": "string",
            "description": "Alternative to <code>requests</code>: a URL with <code>{{value}}</code> (for scalar values) or <code>{{field}}</code> (for object values) placeholders, expanded once per item in <b>Template values</b>. Values are URL-encoded automatically. Can be combined with <code>requests</code>."
          },
          "templateValues": {
            "title": "Template values",
            "type": "array",
            "description": "One request is generated per item. Items may be strings/numbers (fill <code>{{value}}</code>) or objects (fill <code>{{field}}</code> per key)."
          },
          "templateMethod": {
            "title": "Template method",
            "enum": [
              "GET",
              "POST",
              "PUT",
              "PATCH",
              "DELETE",
              "HEAD",
              "OPTIONS"
            ],
            "type": "string",
            "description": "HTTP method for template-generated requests.",
            "default": "GET"
          },
          "bodyTemplate": {
            "title": "Body template",
            "type": "string",
            "description": "Optional request body for template-generated requests, with the same <code>{{value}}</code>/<code>{{field}}</code> placeholders (not URL-encoded). Sent as a raw string — set a Content-Type via <b>Global headers</b> if needed."
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "How many requests run in parallel.",
            "default": 5
          },
          "timeoutSeconds": {
            "title": "Timeout (seconds)",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "Per-request timeout.",
            "default": 30
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries per request on network errors and retryable statuses (408, 425, 429, 5xx), with exponential backoff.",
            "default": 2
          },
          "retryBackoffSeconds": {
            "title": "Retry backoff (seconds)",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "Base backoff before the first retry; doubles on each subsequent retry.",
            "default": 1
          },
          "abortOnFailure": {
            "title": "Abort on failure",
            "type": "boolean",
            "description": "If enabled, the first failed request stops the rest of the batch (remaining requests are recorded as skipped and not charged).",
            "default": false
          },
          "authType": {
            "title": "Authentication",
            "enum": [
              "none",
              "bearer",
              "basic"
            ],
            "type": "string",
            "description": "Adds an <code>Authorization</code> header to every request. Per-request headers can still override it.",
            "default": "none"
          },
          "authToken": {
            "title": "Bearer token",
            "type": "string",
            "description": "Token for <code>Authorization: Bearer …</code> (used when Authentication = Bearer)."
          },
          "authUsername": {
            "title": "Basic auth username",
            "type": "string",
            "description": "Used when Authentication = Basic."
          },
          "authPassword": {
            "title": "Basic auth password",
            "type": "string",
            "description": "Used when Authentication = Basic."
          },
          "globalHeaders": {
            "title": "Global headers",
            "type": "object",
            "description": "Headers added to every request (per-request headers win on conflict)."
          },
          "responseFormat": {
            "title": "Response parsing",
            "enum": [
              "auto",
              "json",
              "text",
              "base64",
              "none"
            ],
            "type": "string",
            "description": "<code>auto</code>: JSON when the Content-Type says so, text otherwise. <code>json</code>/<code>text</code>/<code>base64</code> force a format. <code>none</code> stores no body (status/headers only — smallest records).",
            "default": "auto"
          },
          "extractFields": {
            "title": "Extract fields (JSONPath)",
            "type": "object",
            "description": "Optional. Map of <code>outputField → path</code> (dotted keys + <code>[n]</code> indexes, e.g. <code>data.items[0].id</code>). When the response is JSON, only these fields are stored (in <code>extracted</code>) instead of the full body — keeps datasets small and workflow-ready."
          },
          "maxRequests": {
            "title": "Max requests per run",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Safety cap — extra requests beyond this are dropped (reported in the summary).",
            "default": 500
          },
          "maxResponseBytes": {
            "title": "Max response size (bytes)",
            "minimum": 1024,
            "maximum": 10000000,
            "type": "integer",
            "description": "Response bodies are truncated beyond this size (<code>bodyTruncated: true</code> in the record).",
            "default": 1000000
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}