Run a task

Run a task

Headers

x-api-keystringOptional

Skyvern API key for authentication. API key can be found at https://app.skyvern.com/settings.

x-user-agentstringOptional

Request

This endpoint expects an object.
promptstringRequired

The goal or task description for Skyvern to accomplish

urlstringOptional

The starting URL for the task. If not provided, Skyvern will attempt to determine an appropriate URL

engineenumOptional

The engine that powers the agent task. The default value is skyvern-2.0, the latest Skyvern agent that performs pretty well with complex and multi-step tasks. skyvern-1.0 is good for simple tasks like filling a form, or searching for information on Google. The openai-cua engine uses OpenAI’s CUA model. The anthropic-cua uses Anthropic’s Claude Sonnet 3.7 model with the computer use tool.

Allowed values:
titlestringOptional

The title for the task

proxy_locationenumOptional

Geographic Proxy location to route the browser traffic through. This is only available in Skyvern Cloud.

Available geotargeting options:

  • RESIDENTIAL: the default value. Skyvern Cloud uses a random US residential proxy.
  • RESIDENTIAL_ES: Spain
  • RESIDENTIAL_IE: Ireland
  • RESIDENTIAL_GB: United Kingdom
  • RESIDENTIAL_IN: India
  • RESIDENTIAL_JP: Japan
  • RESIDENTIAL_FR: France
  • RESIDENTIAL_DE: Germany
  • RESIDENTIAL_NZ: New Zealand
  • RESIDENTIAL_ZA: South Africa
  • RESIDENTIAL_AR: Argentina
  • RESIDENTIAL_ISP: ISP proxy
  • US-CA: California
  • US-NY: New York
  • US-TX: Texas
  • US-FL: Florida
  • US-WA: Washington
  • NONE: No proxy
data_extraction_schemamap from strings to any or list of any or stringOptional

The schema for data to be extracted from the webpage. If you’re looking for consistent data schema being returned by the agent, it’s highly recommended to use https://json-schema.org/.

error_code_mappingmap from strings to optional stringsOptional

Custom mapping of error codes to error messages if Skyvern encounters an error.

max_stepsintegerOptional

Maximum number of steps the task can take. Task will fail if it exceeds this number. Cautions: you are charged per step so please set this number to a reasonable value. Contact sales@skyvern.com for custom pricing.

webhook_urlstringOptional

URL to send task status updates to after a run is finished. Refer to https://docs.skyvern.com/running-tasks/webhooks-faq for more details.

totp_identifierstringOptional

Identifier for the TOTP/2FA/MFA code when the code is pushed to Skyvern. Refer to https://docs.skyvern.com/credentials/totp#option-3-push-code-to-skyvern for more details.

totp_urlstringOptional

URL that serves TOTP/2FA/MFA codes for Skyvern to use during the workflow run. Refer to https://docs.skyvern.com/credentials/totp#option-2-get-code-from-your-endpoint for more details.

browser_session_idstringOptional

Run the task or workflow in the specific Skyvern browser session. Having a browser session can persist the real-time state of the browser, so that the next run can continue from where the previous run left off.

publish_workflowbooleanOptionalDefaults to false

Whether to publish this task as a reusable workflow. Only available for skyvern-2.0.

include_action_history_in_verificationbooleanOptional

Whether to include action history when verifying that the task is complete

Response

Successfully run task

run_idstring

Unique identifier for this run. Run ID starts with tsk_ for task runs and wr_ for workflow runs.

statusenum

Current status of the run

created_atdatetime

Timestamp when this run was created

modified_atdatetime

Timestamp when this run was last modified

outputmap from strings to any or list of any or stringOptional

Output data from the run, if any. Format/schema depends on the data extracted by the run.

downloaded_fileslist of objectsOptional

List of files downloaded during the run

recording_urlstringOptional

URL to the recording of the run

screenshot_urlslist of stringsOptional

List of last n screenshot URLs in reverse chronological order - the first one the list is the latest screenshot.

failure_reasonstringOptional

Reason for failure if the run failed or terminated

app_urlstringOptional

URL to the application UI where the run can be viewed

run_requestobjectOptional

The original request parameters used to start this task run

Errors