{
  "openapi": "3.0.1",
  "info": {
    "title": "Laravel Integration",
    "description": "Laravel Integration connects Laravel apps with Apify to run Actors, process trigger datasets, send signed webhook callbacks, forward dataset IDs, and support scraper orchestration, queue workflows, and Actor chaining.",
    "version": "0.0",
    "x-build-id": "QNnjjOIhdkQWrKnUe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sovanza.inc~laravel-integration/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sovanza.inc-laravel-integration",
        "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/sovanza.inc~laravel-integration/runs": {
      "post": {
        "operationId": "runs-sync-sovanza.inc-laravel-integration",
        "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/sovanza.inc~laravel-integration/run-sync": {
      "post": {
        "operationId": "run-sync-sovanza.inc-laravel-integration",
        "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": {
          "runHealthCheckOnStart": {
            "title": "Run health-check demo on start",
            "type": "boolean",
            "description": "If true, writes one demo dataset row and exits (Apify Console Try actor / CI validation). If false, executes the selected integration mode.",
            "default": false
          },
          "mode": {
            "title": "Integration mode",
            "enum": [
              "run_actor",
              "process_trigger",
              "forward_dataset"
            ],
            "type": "string",
            "description": "run_actor: call another Apify Actor with parameters from Laravel. process_trigger: read dataset items from an integration trigger payload and copy them to this run's dataset. forward_dataset: POST dataset metadata (and optional preview) to your Laravel webhook.",
            "default": "run_actor"
          },
          "laravelWebhookUrl": {
            "title": "Laravel webhook URL",
            "type": "string",
            "description": "HTTPS endpoint on your Laravel app that receives run progress and completion callbacks (e.g. https://your-app.test/api/apify/webhook)."
          },
          "laravelBaseUrl": {
            "title": "Laravel base URL",
            "type": "string",
            "description": "Base URL of your Laravel application (included in callback payloads for traceability)."
          },
          "laravelQueue": {
            "title": "Laravel queue name",
            "type": "string",
            "description": "Queue connection name your Laravel app should use when dispatching jobs from the webhook (passed in callback payload).",
            "default": "default"
          },
          "correlationId": {
            "title": "Correlation ID",
            "type": "string",
            "description": "Optional ID from your Laravel request/job so callbacks can be matched to the originating job."
          },
          "targetActorId": {
            "title": "Target Actor ID",
            "type": "string",
            "description": "Apify Actor ID or username/actor-name to run when mode=run_actor (e.g. sovanza.inc/python-scraper or YOUR_USER/my-scraper)."
          },
          "startUrls": {
            "title": "Start URLs (shortcut)",
            "type": "array",
            "description": "Shortcut for python-scraper when mode=run_actor. Merged into targetActorInput.startUrls. No cookies required.",
            "items": {
              "type": "string"
            }
          },
          "targetActorInput": {
            "title": "Target Actor input (JSON)",
            "type": "object",
            "description": "Full input object passed to the target Actor. Default targets python-scraper (startUrls). For other Actors put their required fields here or use top-level shortcut fields."
          },
          "waitForFinish": {
            "title": "Wait for target Actor to finish",
            "type": "boolean",
            "description": "If true, blocks until the target Actor run completes (up to waitSecs). If false, starts the run and returns immediately.",
            "default": true
          },
          "waitSecs": {
            "title": "Wait timeout (seconds)",
            "minimum": 0,
            "maximum": 3600,
            "type": "integer",
            "description": "Maximum seconds to wait for the target Actor when waitForFinish is true.",
            "default": 300
          },
          "pushResultsToLaravel": {
            "title": "Push final results to Laravel",
            "type": "boolean",
            "description": "Send a final SUCCEEDED callback to laravelWebhookUrl when the run completes successfully.",
            "default": true
          },
          "callbackOnProgress": {
            "title": "Callback on progress",
            "type": "boolean",
            "description": "Send STARTED/PROCESSING callbacks during long operations.",
            "default": true
          },
          "includeDatasetPreviewInCallback": {
            "title": "Include dataset preview in callback",
            "type": "boolean",
            "description": "Attach up to maxCallbackItems rows from the result dataset in the final Laravel callback.",
            "default": false
          },
          "maxCallbackItems": {
            "title": "Max items in callback preview",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum dataset rows to include in Laravel callback payloads when preview is enabled.",
            "default": 50
          },
          "maxDatasetItems": {
            "title": "Max dataset items to process",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "When mode=process_trigger, maximum number of source dataset rows to read and copy.",
            "default": 1000
          },
          "datasetBatchSize": {
            "title": "Dataset batch size",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Number of dataset items fetched per batch when processing trigger datasets.",
            "default": 100
          },
          "mergeProxyIntoTargetActor": {
            "title": "Merge proxy into target Actor input",
            "type": "boolean",
            "description": "If true and proxyConfiguration is set, injects it into targetActorInput when the target input does not already define proxyConfiguration.",
            "default": true
          },
          "useDemoFallbackOnPublicActorError": {
            "title": "Demo fallback when public Actors are disabled",
            "type": "boolean",
            "description": "If true and Actor.call fails because your Apify plan cannot run public Actors (e.g. apify/hello-world), writes a demo result row instead of failing. Use your own username/actor-name in production.",
            "default": true
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Retry count for Actor calls and Laravel webhook requests.",
            "default": 3
          },
          "retryDelayMs": {
            "title": "Retry delay (ms)",
            "minimum": 100,
            "maximum": 60000,
            "type": "integer",
            "description": "Base delay between retries (multiplied by attempt number).",
            "default": 1000
          },
          "sourceDatasetId": {
            "title": "Source dataset ID (advanced)",
            "type": "string",
            "description": "Override dataset ID. When empty, the Actor reads payload.resource.defaultDatasetId from Apify integration triggers automatically."
          },
          "sourceKeyValueStoreId": {
            "title": "Source key-value store ID (advanced)",
            "type": "string",
            "description": "Override KV store ID from trigger payload (payload.resource.defaultKeyValueStoreId)."
          },
          "sourceRunId": {
            "title": "Source run ID (advanced)",
            "type": "string",
            "description": "Override triggering run ID (payload.resource.id)."
          },
          "laravelWebhookSecret": {
            "title": "Laravel webhook secret (optional)",
            "type": "string",
            "description": "Shared secret used to sign callbacks with X-Apify-Signature (HMAC SHA-256). Store the same value in Laravel as APIFY_WEBHOOK_SECRET. Stored as a secret input and never written to the dataset."
          },
          "laravelApiToken": {
            "title": "Laravel API token (optional)",
            "type": "string",
            "description": "Optional Bearer token sent as Authorization header when calling your Laravel webhook. Stored as a secret input."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy settings forwarded to child Actors when mergeProxyIntoTargetActor is enabled.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}