Create script
curl --request POST \
--url https://api.skyvern.com/v1/scripts \
--header 'Content-Type: application/json' \
--data '
{
"workflow_id": "<string>",
"run_id": "<string>",
"files": {
"content": "cHJpbnQoIkhlbGxvLCBXb3JsZCEiKQ==",
"encoding": "base64",
"mime_type": "text/x-python",
"path": "main.py"
}
}
'import requests
url = "https://api.skyvern.com/v1/scripts"
payload = {
"workflow_id": "<string>",
"run_id": "<string>",
"files": {
"content": "cHJpbnQoIkhlbGxvLCBXb3JsZCEiKQ==",
"encoding": "base64",
"mime_type": "text/x-python",
"path": "main.py"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
workflow_id: '<string>',
run_id: '<string>',
files: {
content: 'cHJpbnQoIkhlbGxvLCBXb3JsZCEiKQ==',
encoding: 'base64',
mime_type: 'text/x-python',
path: 'main.py'
}
})
};
fetch('https://api.skyvern.com/v1/scripts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.skyvern.com/v1/scripts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'workflow_id' => '<string>',
'run_id' => '<string>',
'files' => [
'content' => 'cHJpbnQoIkhlbGxvLCBXb3JsZCEiKQ==',
'encoding' => 'base64',
'mime_type' => 'text/x-python',
'path' => 'main.py'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.skyvern.com/v1/scripts"
payload := strings.NewReader("{\n \"workflow_id\": \"<string>\",\n \"run_id\": \"<string>\",\n \"files\": {\n \"content\": \"cHJpbnQoIkhlbGxvLCBXb3JsZCEiKQ==\",\n \"encoding\": \"base64\",\n \"mime_type\": \"text/x-python\",\n \"path\": \"main.py\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.skyvern.com/v1/scripts")
.header("Content-Type", "application/json")
.body("{\n \"workflow_id\": \"<string>\",\n \"run_id\": \"<string>\",\n \"files\": {\n \"content\": \"cHJpbnQoIkhlbGxvLCBXb3JsZCEiKQ==\",\n \"encoding\": \"base64\",\n \"mime_type\": \"text/x-python\",\n \"path\": \"main.py\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.skyvern.com/v1/scripts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"workflow_id\": \"<string>\",\n \"run_id\": \"<string>\",\n \"files\": {\n \"content\": \"cHJpbnQoIkhlbGxvLCBXb3JsZCEiKQ==\",\n \"encoding\": \"base64\",\n \"mime_type\": \"text/x-python\",\n \"path\": \"main.py\"\n }\n}"
response = http.request(request)
puts response.read_body{
"script_id": "<string>",
"version": 123,
"file_count": 123,
"file_tree": {},
"created_at": "2023-11-07T05:31:56Z",
"run_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Scripts
Create script
Create a new script with optional files and metadata
POST
/
v1
/
scripts
Create script
curl --request POST \
--url https://api.skyvern.com/v1/scripts \
--header 'Content-Type: application/json' \
--data '
{
"workflow_id": "<string>",
"run_id": "<string>",
"files": {
"content": "cHJpbnQoIkhlbGxvLCBXb3JsZCEiKQ==",
"encoding": "base64",
"mime_type": "text/x-python",
"path": "main.py"
}
}
'import requests
url = "https://api.skyvern.com/v1/scripts"
payload = {
"workflow_id": "<string>",
"run_id": "<string>",
"files": {
"content": "cHJpbnQoIkhlbGxvLCBXb3JsZCEiKQ==",
"encoding": "base64",
"mime_type": "text/x-python",
"path": "main.py"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
workflow_id: '<string>',
run_id: '<string>',
files: {
content: 'cHJpbnQoIkhlbGxvLCBXb3JsZCEiKQ==',
encoding: 'base64',
mime_type: 'text/x-python',
path: 'main.py'
}
})
};
fetch('https://api.skyvern.com/v1/scripts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.skyvern.com/v1/scripts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'workflow_id' => '<string>',
'run_id' => '<string>',
'files' => [
'content' => 'cHJpbnQoIkhlbGxvLCBXb3JsZCEiKQ==',
'encoding' => 'base64',
'mime_type' => 'text/x-python',
'path' => 'main.py'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.skyvern.com/v1/scripts"
payload := strings.NewReader("{\n \"workflow_id\": \"<string>\",\n \"run_id\": \"<string>\",\n \"files\": {\n \"content\": \"cHJpbnQoIkhlbGxvLCBXb3JsZCEiKQ==\",\n \"encoding\": \"base64\",\n \"mime_type\": \"text/x-python\",\n \"path\": \"main.py\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.skyvern.com/v1/scripts")
.header("Content-Type", "application/json")
.body("{\n \"workflow_id\": \"<string>\",\n \"run_id\": \"<string>\",\n \"files\": {\n \"content\": \"cHJpbnQoIkhlbGxvLCBXb3JsZCEiKQ==\",\n \"encoding\": \"base64\",\n \"mime_type\": \"text/x-python\",\n \"path\": \"main.py\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.skyvern.com/v1/scripts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"workflow_id\": \"<string>\",\n \"run_id\": \"<string>\",\n \"files\": {\n \"content\": \"cHJpbnQoIkhlbGxvLCBXb3JsZCEiKQ==\",\n \"encoding\": \"base64\",\n \"mime_type\": \"text/x-python\",\n \"path\": \"main.py\"\n }\n}"
response = http.request(request)
puts response.read_body{
"script_id": "<string>",
"version": 123,
"file_count": 123,
"file_tree": {},
"created_at": "2023-11-07T05:31:56Z",
"run_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
Skyvern API key for authentication. API key can be found at https://app.skyvern.com/settings.
Body
application/json
Associated workflow ID
Associated run ID
Array of files to include in the script
Show child attributes
Show child attributes
Example:
{
"content": "cHJpbnQoIkhlbGxvLCBXb3JsZCEiKQ==",
"encoding": "base64",
"mime_type": "text/x-python",
"path": "main.py"
}
Response
Successful Response
Unique script identifier
Example:
"s_abc123"
Script version number
Example:
1
Total number of files in the script
Hierarchical file tree structure
Show child attributes
Show child attributes
Timestamp when the script was created
ID of the workflow run or task run that generated this script
Was this page helpful?
⌘I

