{
  "openapi": "3.0.1",
  "info": {
    "title": "Flexible HTTP Request Runner",
    "description": "Execute batches of public HTTP requests with custom methods, headers, query parameters, bodies, retries, and structured status, response header, body, timing, redirect, and error records.",
    "version": "0.1",
    "x-build-id": "ghZx5dqJplS9IXd36"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation-lab~flexible-http-request-runner/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation-lab-flexible-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/automation-lab~flexible-http-request-runner/runs": {
      "post": {
        "operationId": "runs-sync-automation-lab-flexible-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/automation-lab~flexible-http-request-runner/run-sync": {
      "post": {
        "operationId": "run-sync-automation-lab-flexible-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",
        "required": [
          "requests"
        ],
        "properties": {
          "requests": {
            "title": "HTTP requests",
            "minItems": 1,
            "maxItems": 1000,
            "type": "array",
            "description": "Requests to public endpoints. Supports GET, HEAD, POST, PUT, PATCH, DELETE, and OPTIONS with custom headers, query parameters, and JSON or text bodies.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "id": {
                  "title": "Request ID",
                  "type": "string",
                  "description": "Unique request identity used in the output."
                },
                "label": {
                  "title": "Label",
                  "type": "string",
                  "description": "Optional human-readable request label."
                },
                "url": {
                  "title": "URL",
                  "type": "string",
                  "editor": "textfield",
                  "description": "Absolute public HTTP or HTTPS URL. Private, local, reserved, and link-local destinations are blocked."
                },
                "method": {
                  "title": "Method",
                  "type": "string",
                  "description": "HTTP request method.",
                  "enum": [
                    "GET",
                    "HEAD",
                    "POST",
                    "PUT",
                    "PATCH",
                    "DELETE",
                    "OPTIONS"
                  ],
                  "default": "GET"
                },
                "headers": {
                  "title": "Headers",
                  "type": "object",
                  "description": "Optional request headers. Sensitive values are redacted from output."
                },
                "query": {
                  "title": "Query parameters",
                  "type": "object",
                  "description": "Query parameters appended to the URL. Arrays produce repeated parameters."
                },
                "body": {
                  "title": "Request body",
                  "type": "object",
                  "editor": "json",
                  "description": "Optional JSON object body for POST, PUT, PATCH, DELETE, or OPTIONS. API callers may also supply a text or other JSON value."
                }
              }
            }
          },
          "timeoutSecs": {
            "title": "Timeout per attempt (seconds)",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum time for one request attempt.",
            "default": 30
          },
          "maxConcurrency": {
            "title": "Maximum concurrency",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "Maximum requests executed at the same time.",
            "default": 5
          },
          "maxRetries": {
            "title": "Maximum retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries per request after network errors or configured transient status codes.",
            "default": 2
          },
          "retryOnStatusCodes": {
            "title": "Retry status codes",
            "type": "array",
            "description": "HTTP status codes that trigger bounded exponential backoff.",
            "items": {
              "type": "integer",
              "minimum": 400,
              "maximum": 599
            },
            "default": [
              408,
              425,
              429,
              500,
              502,
              503,
              504
            ]
          },
          "followRedirects": {
            "title": "Follow redirects",
            "type": "boolean",
            "description": "Follow HTTP redirects while revalidating every destination as public.",
            "default": true
          },
          "maxRedirects": {
            "title": "Maximum redirects",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum redirects followed for each request.",
            "default": 5
          },
          "maxResponseBytes": {
            "title": "Maximum stored response bytes",
            "minimum": 1000,
            "maximum": 5000000,
            "type": "integer",
            "description": "Maximum response-body bytes retained per request. Larger bodies are safely truncated and marked.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}