Skyvern: Deploy script
Skyvern scripts.deployScript: arguments, response, policy and SDK examples.
← Scripts operations · Get started
Operation skyvern.deploy_script_v1_scripts_script_id_deploy_post
Provider route: POST /v1/scripts/{script_id}/deploy. 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["scripts"]["deployScript"]>[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.scripts.deployScript(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.scripts.deploy_script(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.script_id | string | Required within parent | The unique identifier of the script |
body | Model | Required within parent | Expand Deploy script — request body — body |
Referenced models: Deploy script — 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 Create script — response body |
Referenced models: Create script — response body
Schemas
Section titled “Schemas”Deploy script — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Request model for deploying a script with updated files. |
files | array | Required within parent | Array of files to include in the script |
files[] | Model | Each item | Expand Deploy script — request body — body files item |
Referenced models: Deploy script — request body — body files item
Create script — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
created_at | string | Required within parent | Timestamp when the script was created Format: date-time |
file_count | JSON | Required within parent | |
file_count (anyOf 1) | integer | Alternative | Total number of files in the script |
file_count (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
file_tree | object | Required within parent | Hierarchical file tree structure Additional keys: see wildcard field |
file_tree.* | Model | Additional keys | Expand Create script — response body — file tree value |
run_id | JSON | Optional | ID of the workflow run or task run that generated this script |
run_id (anyOf 1) | string | Alternative | |
run_id (anyOf 2) | null | Alternative | |
script_id | string | Required within parent | Unique script identifier |
version | JSON | Required within parent | |
version (anyOf 1) | integer | Alternative | Script version number |
version (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Referenced models: Create script — response body — file tree value
Deploy script — request body — body files item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Model representing a file in a script. |
content | string | Required within parent | Base64 encoded file content |
encoding | string | Optional | Supported file content encodings. Content encoding One of: base64, utf-8 Default: base64 |
mime_type | JSON | Optional | MIME type (auto-detected if not provided) |
mime_type (anyOf 1) | string | Alternative | |
mime_type (anyOf 2) | null | Alternative | |
path | string | Required within parent | File path relative to script root |
Create script — response body — file tree value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Model representing a file or directory in the file tree. |
children | JSON | Optional | Child nodes for directories |
children (anyOf 1) | object | Alternative | Additional keys: see wildcard field |
children (anyOf 1).* | Model | Additional keys | Expand Create script — response body — file tree value |
children (anyOf 2) | null | Alternative | |
content_hash | JSON | Optional | SHA256 hash of file content |
content_hash (anyOf 1) | string | Alternative | |
content_hash (anyOf 2) | null | Alternative | |
created_at | string | Required within parent | Timestamp when the file was created Format: date-time |
mime_type | JSON | Optional | MIME type of the file |
mime_type (anyOf 1) | string | Alternative | |
mime_type (anyOf 2) | null | Alternative | |
size | JSON | Optional | File size in bytes |
size (anyOf 1) | JSON | Alternative | |
size (anyOf 1) (anyOf 1) | integer | Alternative | |
size (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
size (anyOf 2) | null | Alternative | |
type | string | Required within parent | Type of node: 'file' or 'directory' |
Referenced models: Create script — response body — file tree value
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: skyvern.deploy_script_v1_scripts_script_id_deploy_post. Catalog operation: deploy_script_v1_scripts__script_id__deploy_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.