Skyvern: File Download Task
Skyvern tasks.downloadFiles: arguments, response, policy and SDK examples.
← Tasks operations · Get started
Operation skyvern.download_files_v1_run_tasks_download_files_post
Provider route: POST /v1/run/tasks/download_files. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/skyvern with npm, or alter-sdk-skyvern with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { SkyvernIntegration } from "@alter-ai/skyvern";
async function execute(input: Parameters<SkyvernIntegration["tasks"]["downloadFiles"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new SkyvernIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.tasks.downloadFiles(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_skyvern import SkyvernIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = SkyvernIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.tasks.download_files(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
headers | object | Optional | Additional keys: not allowed |
headers.x-user-agent | JSON | Optional | |
headers.x-user-agent (anyOf 1) | string | Alternative | |
headers.x-user-agent (anyOf 2) | null | Alternative | |
body | Model | Required within parent | Expand File Download Task — request body — body |
Referenced models: File Download Task — request body — body
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Login Task — response body |
Referenced models: Login Task — response body
Schemas
Section titled “Schemas”3 more schemas are linked from the tables above, on the schema pages.
File Download Task — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
browser_address | JSON | Optional | The CDP address for the task. |
browser_address (anyOf 1) | string | Alternative | |
browser_address (anyOf 2) | null | Alternative | |
browser_profile_id | JSON | Optional | ID of a browser profile to reuse for this run |
browser_profile_id (anyOf 1) | string | Alternative | |
browser_profile_id (anyOf 2) | null | Alternative | |
browser_session_id | JSON | Optional | ID of the browser session to use, which is prefixed by `pbs_` e.g. `pbs_123456` |
browser_session_id (anyOf 1) | string | Alternative | |
browser_session_id (anyOf 2) | null | Alternative | |
cdp_connect_headers | JSON | Optional | HTTP headers attached ONLY to the CDP WebSocket handshake when connecting to a remote browser via browser_address. Never forwarded to target websites. |
cdp_connect_headers (anyOf 1) | object | Alternative | Additional keys: see wildcard field |
cdp_connect_headers (anyOf 1).* | string | Additional keys | |
cdp_connect_headers (anyOf 2) | null | Alternative | |
download_suffix | JSON | Optional | Complete filename for the downloaded file. Supports {{ original_filename }}, which keeps the name the site gave the file, so {{ original_filename }} alone preserves it and prefix_{{ original_filename }} prefixes it. The source extension is used unless the configured filename includes an extension, which overrides it. {{ original_filename }} must be a standalone interpolation without filters or other transformations. |
download_suffix (anyOf 1) | string | Alternative | |
download_suffix (anyOf 2) | null | Alternative | |
download_timeout | JSON | Optional | Timeout in seconds for the download operation |
download_timeout (anyOf 1) | number | Alternative | |
download_timeout (anyOf 2) | null | Alternative | |
extra_http_headers | JSON | Optional | Additional HTTP headers to include in requests |
extra_http_headers (anyOf 1) | object | Alternative | Additional keys: see wildcard field |
extra_http_headers (anyOf 1).* | string | Additional keys | |
extra_http_headers (anyOf 2) | null | Alternative | |
max_screenshot_scrolling_times | JSON | Optional | Maximum number of times to scroll for screenshots |
max_screenshot_scrolling_times (anyOf 1) | integer | Alternative | |
max_screenshot_scrolling_times (anyOf 2) | null | Alternative | |
max_steps_per_run | JSON | Optional | Maximum number of steps to execute |
max_steps_per_run (anyOf 1) | integer | Alternative | |
max_steps_per_run (anyOf 2) | null | Alternative | |
navigation_goal | string | Required within parent | Instructions for navigating to and downloading the file |
proxy_location | JSON | Optional | Proxy location to use |
proxy_location (anyOf 1) | string | Alternative | One of: RESIDENTIAL, US-CA, US-NY, US-TX, US-FL, US-WA, RESIDENTIAL_ES, RESIDENTIAL_IE, RESIDENTIAL_GB, RESIDENTIAL_IN, RESIDENTIAL_JP, RESIDENTIAL_FR, RESIDENTIAL_DE, RESIDENTIAL_NZ, RESIDENTIAL_ZA, RESIDENTIAL_AR, RESIDENTIAL_AU, RESIDENTIAL_BR, RESIDENTIAL_TR, RESIDENTIAL_CA, RESIDENTIAL_MX, RESIDENTIAL_IT, RESIDENTIAL_NL, RESIDENTIAL_PH, RESIDENTIAL_KR, RESIDENTIAL_SA, RESIDENTIAL_ISP, NONE |
proxy_location (anyOf 2) | null | Alternative | |
start_fresh_browser | boolean | Optional | When true, start this run from a fresh, empty browser and ignore any saved browser memory — no memory is read or written. A verified sign-in during the run still updates the credential's saved login. Default: false |
totp_identifier | JSON | Optional | Identifier for TOTP (Time-based One-Time Password) if required |
totp_identifier (anyOf 1) | string | Alternative | |
totp_identifier (anyOf 2) | null | Alternative | |
totp_url | JSON | Optional | TOTP URL to fetch one-time passwords |
totp_url (anyOf 1) | string | Alternative | |
totp_url (anyOf 2) | null | Alternative | |
url | JSON | Optional | Website URL |
url (anyOf 1) | string | Alternative | |
url (anyOf 2) | null | Alternative | |
webhook_url | JSON | Optional | Webhook URL to send status updates |
webhook_url (anyOf 1) | string | Alternative | |
webhook_url (anyOf 2) | null | Alternative |
Login Task — response body — browser seed source string
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | string | Root | Which layer of the seed-precedence chain seeded a run's browser (provenance). Resolved once at run setup, before any browser creation, for all run types (C-semantics). - override: explicit request browser_profile_id (one-run-only pick via API) - picked: the workflow's explicit profile pick (workflows.browser_profile_id) — "always start here" - own_memory: the workflow's own auto-profile (no pick + persist_browser_session) - credential: the run's selected credential's profile (rotation-aware; also the empty-own boot) - fresh: no seed profile - degraded_fresh: a resolved profile failed to load; ran fresh Known values: override, picked, own_memory, credential, fresh, degraded_fresh |
Login Task — response body — browser_settings_receipt / source: workflow version, session request, existing session, status: verified, mismatch, unapplied, unknown
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
actual_timezone_id | JSON | Optional | The timezone the browser reported when measured, or null when it could not be measured. |
actual_timezone_id (anyOf 1) | string | Alternative | |
actual_timezone_id (anyOf 2) | null | Alternative | |
requested_timezone_id | string | Required within parent | The timezone that was requested. |
source | string | Required within parent | Where the requested setting came from. Known values: workflow_version, session_request, existing_session |
status | string | Required within parent | `verified` when the browser reported the requested timezone or an IANA alias of it (Chromium reports `Asia/Calcutta` for `Asia/Kolkata`), `mismatch` when it reported another zone, `unapplied` when the browser already existed and was left unchanged, `unknown` when it could not be measured. Known values: verified, mismatch, unapplied, unknown |
warning | JSON | Optional | |
warning (anyOf 1) | string | Alternative | |
warning (anyOf 2) | null | Alternative |
Get a session — response body — recordings array item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Information about a downloaded file, including URL and checksum. |
artifact_id | JSON | Optional | Artifact row id for refresh-on-read |
artifact_id (anyOf 1) | string | Alternative | |
artifact_id (anyOf 2) | null | Alternative | |
checksum | JSON | Optional | SHA-256 checksum of the file |
checksum (anyOf 1) | string | Alternative | |
checksum (anyOf 2) | null | Alternative | |
file_size | JSON | Optional | Size of the file in bytes |
file_size (anyOf 1) | JSON | Alternative | |
file_size (anyOf 1) (anyOf 1) | integer | Alternative | |
file_size (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
file_size (anyOf 2) | null | Alternative | |
filename | JSON | Optional | Original filename |
filename (anyOf 1) | string | Alternative | |
filename (anyOf 2) | null | Alternative | |
modified_at | JSON | Optional | Modified time of the file |
modified_at (anyOf 1) | string | Alternative | Format: date-time |
modified_at (anyOf 2) | null | Alternative | |
url | string | Required within parent | URL to access the file |
Login Task — response body — script run ai fallback triggered, script id, script revision id
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
ai_fallback_triggered | boolean | Optional | Default: false |
script_id | JSON | Optional | |
script_id (anyOf 1) | string | Alternative | |
script_id (anyOf 2) | null | Alternative | |
script_revision_id | JSON | Optional | |
script_revision_id (anyOf 1) | string | Alternative | |
script_revision_id (anyOf 2) | null | Alternative |
Update an agent — response body — proxy location city, country, is ISP, subdivision
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Granular proxy geo-targeting request with country, optional subdivision, and optional city. |
city | JSON | Optional | City name in English from GeoNames (e.g., 'New York', 'Los Angeles', 'London') |
city (anyOf 1) | string | Alternative | Maximum length: 100 |
city (anyOf 2) | null | Alternative | |
country | string | Required within parent | ISO 3166-1 alpha-2 country code (e.g., 'US', 'GB', 'DE') Maximum length: 2 Minimum length: 2 |
isISP | boolean | Optional | Whether this geo target is marked as an ISP proxy location. Default: false |
subdivision | JSON | Optional | ISO 3166-2 subdivision code without country prefix (e.g., 'CA' for California, 'NY' for New York) |
subdivision (anyOf 1) | string | Alternative | Maximum length: 10 |
subdivision (anyOf 2) | null | Alternative |
Update an agent — response body — proxy location string
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | string | Root | Known values: RESIDENTIAL, US-CA, US-NY, US-TX, US-FL, US-WA, RESIDENTIAL_ES, RESIDENTIAL_IE, RESIDENTIAL_GB, RESIDENTIAL_IN, RESIDENTIAL_JP, RESIDENTIAL_FR, RESIDENTIAL_DE, RESIDENTIAL_NZ, RESIDENTIAL_ZA, RESIDENTIAL_AR, RESIDENTIAL_AU, RESIDENTIAL_BR, RESIDENTIAL_TR, RESIDENTIAL_CA, RESIDENTIAL_MX, RESIDENTIAL_IT, RESIDENTIAL_NL, RESIDENTIAL_PH, RESIDENTIAL_KR, RESIDENTIAL_SA, RESIDENTIAL_ISP, NONE |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: skyvern.download_files_v1_run_tasks_download_files_post. Catalog operation: download_files_v1_run_tasks_download_files_post. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.