{
  "openapi": "3.0.1",
  "info": {
    "title": "AskUI Integration",
    "description": "AskUI Integration runs UI automation tasks through AskUI-compatible environments using natural language or structured steps. It returns task status, screenshots, logs, action traces, timing, and session metadata for QA, RPA, DevOps, and automation workflows.",
    "version": "0.0",
    "x-build-id": "9hb4GIufEoVP4Bprb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sovanza.inc~askui-integration/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sovanza.inc-askui-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~askui-integration/runs": {
      "post": {
        "operationId": "runs-sync-sovanza.inc-askui-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~askui-integration/run-sync": {
      "post": {
        "operationId": "run-sync-sovanza.inc-askui-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",
        "required": [
          "tasks"
        ],
        "properties": {
          "tasks": {
            "title": "Automation Tasks",
            "type": "array",
            "description": "List of AskUI automation task requests. Each item defines a UI automation job to validate, dispatch, or execute.",
            "items": {
              "type": "object",
              "properties": {
                "taskId": {
                  "title": "Task ID",
                  "type": "string",
                  "description": "Unique identifier for this task. Auto-generated if omitted.",
                  "editor": "textfield"
                },
                "title": {
                  "title": "Task Title",
                  "type": "string",
                  "description": "Short descriptive name for the automation task.",
                  "editor": "textfield"
                },
                "instruction": {
                  "title": "Instruction",
                  "type": "string",
                  "description": "Natural language instruction describing what the automation should do.",
                  "editor": "textarea"
                },
                "taskMode": {
                  "title": "Task Mode",
                  "type": "string",
                  "description": "How this task is defined: natural_language, structured_steps, or hybrid.",
                  "editor": "textfield"
                },
                "platformHint": {
                  "title": "Platform Hint",
                  "type": "string",
                  "description": "Hint for the target platform: windows, macos, linux, android, ios, browser.",
                  "editor": "textfield"
                },
                "applicationHint": {
                  "title": "Application Hint",
                  "type": "string",
                  "description": "Hint for the target application (e.g. chrome, excel, calculator).",
                  "editor": "textfield"
                },
                "deviceTarget": {
                  "title": "Device Target",
                  "type": "string",
                  "description": "Specific device or VM identifier to target.",
                  "editor": "textfield"
                },
                "context": {
                  "title": "Context",
                  "type": "string",
                  "description": "Additional context or notes for the automation task.",
                  "editor": "textarea"
                },
                "variables": {
                  "title": "Variables",
                  "type": "object",
                  "description": "Key-value variables to inject into the task (e.g. URLs, search terms).",
                  "editor": "json"
                },
                "steps": {
                  "title": "Structured Steps",
                  "type": "array",
                  "description": "Ordered list of structured automation steps (for structured_steps or hybrid mode).",
                  "editor": "json"
                },
                "expectedOutcome": {
                  "title": "Expected Outcome",
                  "type": "string",
                  "description": "What the successful completion of this task looks like.",
                  "editor": "textfield"
                }
              }
            }
          },
          "runMode": {
            "title": "Run Mode",
            "enum": [
              "dry_run",
              "execute",
              "validate_only"
            ],
            "type": "string",
            "description": "Execution mode. 'dry_run' validates and previews payloads without executing. 'execute' dispatches to the target adapter. 'validate_only' checks task validity.",
            "default": "dry_run"
          },
          "taskDefinitionStyle": {
            "title": "Task Definition Style",
            "enum": [
              "natural_language",
              "structured_steps",
              "hybrid"
            ],
            "type": "string",
            "description": "Default task definition style. Individual tasks can override via taskMode.",
            "default": "hybrid"
          },
          "targetEnvironment": {
            "title": "Target Environment",
            "enum": [
              "askui_remote",
              "askui_local_agent",
              "adapter_mock"
            ],
            "type": "string",
            "description": "Where tasks are dispatched. 'adapter_mock' runs locally with deterministic fake outputs. 'askui_remote' dispatches to an AskUI-compatible API. 'askui_local_agent' is a placeholder for local AskUI Agent OS.",
            "default": "adapter_mock"
          },
          "askUiBaseUrl": {
            "title": "AskUI Base URL",
            "type": "string",
            "description": "Base URL for the AskUI-compatible execution API or gateway. Required for askui_remote mode.",
            "default": ""
          },
          "askUiWorkspaceId": {
            "title": "AskUI Workspace ID",
            "type": "string",
            "description": "Workspace identifier for the AskUI environment.",
            "default": ""
          },
          "askUiAccessToken": {
            "title": "AskUI Access Token",
            "type": "string",
            "description": "Secret access token for authenticating with the AskUI API. Never logged or included in output."
          },
          "sessionId": {
            "title": "Session ID",
            "type": "string",
            "description": "Optional existing AskUI or agent session identifier to reuse.",
            "default": ""
          },
          "createNewSession": {
            "title": "Create New Session",
            "type": "boolean",
            "description": "Whether to create a new AskUI session if no sessionId is provided.",
            "default": true
          },
          "platform": {
            "title": "Platform",
            "enum": [
              "windows",
              "macos",
              "linux",
              "android",
              "ios",
              "browser",
              "auto"
            ],
            "type": "string",
            "description": "Default target platform for automation tasks.",
            "default": "auto"
          },
          "applicationType": {
            "title": "Application Type",
            "enum": [
              "desktop_app",
              "web_app",
              "mobile_app",
              "citrix",
              "terminal",
              "unknown"
            ],
            "type": "string",
            "description": "Default application type for automation tasks.",
            "default": "unknown"
          },
          "includeScreenshots": {
            "title": "Include Screenshots",
            "type": "boolean",
            "description": "Collect screenshot artifacts from task execution.",
            "default": true
          },
          "includeExecutionLogs": {
            "title": "Include Execution Logs",
            "type": "boolean",
            "description": "Collect execution log entries from task runs.",
            "default": true
          },
          "includeActionTrace": {
            "title": "Include Action Trace",
            "type": "boolean",
            "description": "Collect step-by-step action trace from execution.",
            "default": true
          },
          "includeArtifacts": {
            "title": "Include Artifacts",
            "type": "boolean",
            "description": "Collect all execution artifacts (screenshots, logs, traces).",
            "default": true
          },
          "maxTasks": {
            "title": "Max Tasks",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of tasks to process in a single run.",
            "default": 50
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum number of tasks to execute concurrently.",
            "default": 3
          },
          "requestTimeoutSecs": {
            "title": "Request Timeout (seconds)",
            "minimum": 5,
            "maximum": 600,
            "type": "integer",
            "description": "Timeout in seconds for individual HTTP requests to the AskUI adapter.",
            "default": 60
          },
          "pollIntervalSecs": {
            "title": "Poll Interval (seconds)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Seconds between status polling attempts during task execution.",
            "default": 3
          },
          "maxExecutionWaitSecs": {
            "title": "Max Execution Wait (seconds)",
            "minimum": 10,
            "maximum": 3600,
            "type": "integer",
            "description": "Maximum seconds to wait for a single task to complete before timing out.",
            "default": 300
          },
          "failFast": {
            "title": "Fail Fast",
            "type": "boolean",
            "description": "Stop the entire run on the first task failure instead of continuing.",
            "default": false
          },
          "includeDebugFields": {
            "title": "Include Debug Fields",
            "type": "boolean",
            "description": "Add diagnostic fields (adapter info, polling stats, normalization reasons) to output. Never includes secrets.",
            "default": false
          },
          "outputMode": {
            "title": "Output Mode",
            "enum": [
              "dataset",
              "kv_store",
              "both"
            ],
            "type": "string",
            "description": "Where to write results. 'dataset' writes individual rows, 'kv_store' writes a combined export, 'both' does both.",
            "default": "dataset"
          },
          "outputKvStoreKey": {
            "title": "Output KV Store Key",
            "type": "string",
            "description": "Key name used when writing the combined export to the key-value store.",
            "default": "ASKUI_OUTPUT"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}