Skip to main content
POST
/
v1
/
runs
Create Run
curl --request POST \
  --url https://api.cyberdesk.io/v1/runs \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "main_prompt": "<string>",
  "main_agent_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "model_metadata": {
    "main_agent_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "cache_detection_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "fallback_model_1_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "fallback_model_2_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  },
  "machine_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "pool_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "input_values": {},
  "file_inputs": [
    {
      "filename": "<string>",
      "content": "<string>",
      "target_path": "<string>",
      "cleanup_imports_after_run": false
    }
  ],
  "sensitive_input_values": {},
  "session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "start_session": false,
  "session_alias": "<string>",
  "release_session_after": true
}
'
import requests

url = "https://api.cyberdesk.io/v1/runs"

payload = {
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"main_prompt": "<string>",
"main_agent_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model_metadata": {
"main_agent_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cache_detection_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fallback_model_1_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fallback_model_2_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"machine_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pool_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"input_values": {},
"file_inputs": [
{
"filename": "<string>",
"content": "<string>",
"target_path": "<string>",
"cleanup_imports_after_run": False
}
],
"sensitive_input_values": {},
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start_session": False,
"session_alias": "<string>",
"release_session_after": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
workflow_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
main_prompt: '<string>',
main_agent_model_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
model_metadata: {
main_agent_model_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
cache_detection_model_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
fallback_model_1_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
fallback_model_2_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
machine_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
pool_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
input_values: {},
file_inputs: [
{
filename: '<string>',
content: '<string>',
target_path: '<string>',
cleanup_imports_after_run: false
}
],
sensitive_input_values: {},
session_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
start_session: false,
session_alias: '<string>',
release_session_after: true
})
};

fetch('https://api.cyberdesk.io/v1/runs', 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.cyberdesk.io/v1/runs",
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' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'main_prompt' => '<string>',
'main_agent_model_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'model_metadata' => [
'main_agent_model_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'cache_detection_model_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'fallback_model_1_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'fallback_model_2_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'machine_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'pool_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'input_values' => [

],
'file_inputs' => [
[
'filename' => '<string>',
'content' => '<string>',
'target_path' => '<string>',
'cleanup_imports_after_run' => false
]
],
'sensitive_input_values' => [

],
'session_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'start_session' => false,
'session_alias' => '<string>',
'release_session_after' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.cyberdesk.io/v1/runs"

payload := strings.NewReader("{\n \"workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"main_prompt\": \"<string>\",\n \"main_agent_model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"model_metadata\": {\n \"main_agent_model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cache_detection_model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"fallback_model_1_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"fallback_model_2_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"machine_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pool_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"input_values\": {},\n \"file_inputs\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"target_path\": \"<string>\",\n \"cleanup_imports_after_run\": false\n }\n ],\n \"sensitive_input_values\": {},\n \"session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"start_session\": false,\n \"session_alias\": \"<string>\",\n \"release_session_after\": true\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
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.cyberdesk.io/v1/runs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"main_prompt\": \"<string>\",\n \"main_agent_model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"model_metadata\": {\n \"main_agent_model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cache_detection_model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"fallback_model_1_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"fallback_model_2_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"machine_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pool_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"input_values\": {},\n \"file_inputs\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"target_path\": \"<string>\",\n \"cleanup_imports_after_run\": false\n }\n ],\n \"sensitive_input_values\": {},\n \"session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"start_session\": false,\n \"session_alias\": \"<string>\",\n \"release_session_after\": true\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.cyberdesk.io/v1/runs")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"main_prompt\": \"<string>\",\n \"main_agent_model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"model_metadata\": {\n \"main_agent_model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cache_detection_model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"fallback_model_1_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"fallback_model_2_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"machine_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pool_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"input_values\": {},\n \"file_inputs\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"target_path\": \"<string>\",\n \"cleanup_imports_after_run\": false\n }\n ],\n \"sensitive_input_values\": {},\n \"session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"start_session\": false,\n \"session_alias\": \"<string>\",\n \"release_session_after\": true\n}"

response = http.request(request)
puts response.read_body
{
  "workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "machine_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "organization_id": "<string>",
  "error": [
    "<string>"
  ],
  "output_data": {},
  "input_attachment_ids": [
    "<string>"
  ],
  "output_attachment_ids": [
    "<string>"
  ],
  "run_message_history": [
    {}
  ],
  "input_values": {},
  "main_prompt": "<string>",
  "model_metadata": {
    "main_agent_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "cache_detection_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "fallback_model_1_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "fallback_model_2_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  },
  "pool_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "sensitive_input_aliases": {},
  "usage_metadata": {},
  "post_run_checks": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "post_run_check_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "snapshot_version": 123,
      "name": "<string>",
      "description": "<string>",
      "order": 123,
      "file_names": [
        "<string>"
      ],
      "file_name_regex": "<string>",
      "expected_match_count": 123,
      "expected_match_count_ref": "<string>",
      "loop_input": "<string>",
      "loop_item_filename_template": "<string>",
      "allow_missing_attachments": false,
      "check_prompt": "<string>",
      "model": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "started_at": "2023-11-07T05:31:56Z",
      "ended_at": "2023-11-07T05:31:56Z",
      "error_message": "<string>",
      "messages": [
        "<string>"
      ],
      "matched_filenames": [
        "<string>"
      ]
    }
  ],
  "session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "session_alias": "<string>",
  "release_session_after": true,
  "started_at": "2023-11-07T05:31:56Z",
  "ended_at": "2023-11-07T05:31:56Z"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Idempotency-Key
string

Unique key for idempotent requests. If provided, the server ensures the request is processed at most once. Retries with the same key return the original response. SDKs auto-generate this for write requests.

Example:

"550e8400-e29b-41d4-a716-446655440000"

Body

application/json

Schema for creating a run

workflow_id
string<uuid>
required
main_prompt
string | null

Optional per-run prompt override. When provided, this run executes the supplied prompt text instead of the workflow's stored main_prompt.

Minimum string length: 1
main_agent_model_id
string<uuid> | null

Optional per-run main agent ModelConfiguration.id override. Stored as run model_metadata.main_agent_model_id and used only for this run.

model_metadata
WorkflowModelMetadata · object | null

Optional per-run model configuration metadata. Provided fields override the workflow's model_metadata for this run only.

machine_id
string<uuid> | null

Machine ID. If not provided, an available machine will be automatically selected.

pool_ids
string<uuid>[] | null

Pool IDs to filter available machines. Machine must belong to all of these pools (intersection). Ignored when machine_id is provided.

input_values
Input Values · object | null

Input values for workflow variables

file_inputs
FileInput · object[] | null

Files to upload to the machine

sensitive_input_values
Sensitive Input Values · object | null

Sensitive input values (supports nested objects). These are not stored and will be written to a secure vault and referenced by alias only. In workflow input_schema, sensitive root keys are validated under a '$' prefixed key (for example input key 'api_key' is '$api_key').

session_id
string<uuid> | null

Join an existing session; overrides machine_id/pool_ids

start_session
boolean | null
default:false

Start a new session on the machine used by this run. Session ID will be this run's ID.

session_alias
string | null

Persist outputs under this alias for $ref in this session

release_session_after
boolean | null

Release the session after this run completes successfully

Response

Successful Response

Run response schema

workflow_id
string<uuid>
required
machine_id
string<uuid> | null
required
id
string<uuid>
required
status
enum<string>
required
Available options:
scheduling,
running,
running_checks,
success,
cancelled,
task_failed,
error
created_at
string<date-time>
required
user_id
string<uuid> | null
organization_id
string | null
error
string[] | null
output_data
Output Data · object | null
input_attachment_ids
string[] | null
output_attachment_ids
string[] | null
run_message_history
Run Message History · object[] | null
input_values
Input Values · object | null
main_prompt
string | null

Per-run prompt override used for execution. Null means the run falls back to the workflow's current main_prompt.

model_metadata
WorkflowModelMetadata · object | null

Per-run model metadata overrides used for execution. Null means the run falls back to the workflow's model_metadata.

pool_ids
string<uuid>[] | null
sensitive_input_aliases
Sensitive Input Aliases · object | null
usage_metadata
Usage Metadata · object | null

Arbitrary usage/billing metadata captured during a run (schema is flexible)

post_run_checks
RunPostRunCheckSnapshot · object[] | null

Version-tolerant snapshot/results for the run's post-run checks.

session_id
string<uuid> | null
session_alias
string | null
release_session_after
boolean | null
started_at
string<date-time> | null
ended_at
string<date-time> | null