Skip to main content
POST
/
scenario-studio
/
jobs
Create Scenario job
curl --request POST \
  --url https://api.exec.com/rest/v1/scenario-studio/jobs \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "user_email": "[email protected]",
  "prompt": "Create a discovery call scenario with a skeptical IT director who is concerned about integration complexity",
  "context": "## Prospect Information\n- Company: TechCorp Inc.\n- Industry: Financial Services\n- Size: 500 employees\n- Current pain point: Manual data entry across systems\n",
  "request_id": "salesforce-opp-12345",
  "callback_url": "https://hooks.acme.com/exec-scenarios",
  "callback_headers": {
    "Authorization": "Bearer webhook-secret-token"
  }
}
'
import requests

url = "https://api.exec.com/rest/v1/scenario-studio/jobs"

payload = {
"user_email": "[email protected]",
"prompt": "Create a discovery call scenario with a skeptical IT director who is concerned about integration complexity",
"context": "## Prospect Information
- Company: TechCorp Inc.
- Industry: Financial Services
- Size: 500 employees
- Current pain point: Manual data entry across systems
",
"request_id": "salesforce-opp-12345",
"callback_url": "https://hooks.acme.com/exec-scenarios",
"callback_headers": { "Authorization": "Bearer webhook-secret-token" }
}
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({
user_email: '[email protected]',
prompt: 'Create a discovery call scenario with a skeptical IT director who is concerned about integration complexity',
context: '## Prospect Information\n- Company: TechCorp Inc.\n- Industry: Financial Services\n- Size: 500 employees\n- Current pain point: Manual data entry across systems\n',
request_id: 'salesforce-opp-12345',
callback_url: 'https://hooks.acme.com/exec-scenarios',
callback_headers: {Authorization: 'Bearer webhook-secret-token'}
})
};

fetch('https://api.exec.com/rest/v1/scenario-studio/jobs', 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.exec.com/rest/v1/scenario-studio/jobs",
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([
'user_email' => '[email protected]',
'prompt' => 'Create a discovery call scenario with a skeptical IT director who is concerned about integration complexity',
'context' => '## Prospect Information
- Company: TechCorp Inc.
- Industry: Financial Services
- Size: 500 employees
- Current pain point: Manual data entry across systems
',
'request_id' => 'salesforce-opp-12345',
'callback_url' => 'https://hooks.acme.com/exec-scenarios',
'callback_headers' => [
'Authorization' => 'Bearer webhook-secret-token'
]
]),
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.exec.com/rest/v1/scenario-studio/jobs"

payload := strings.NewReader("{\n \"user_email\": \"[email protected]\",\n \"prompt\": \"Create a discovery call scenario with a skeptical IT director who is concerned about integration complexity\",\n \"context\": \"## Prospect Information\\n- Company: TechCorp Inc.\\n- Industry: Financial Services\\n- Size: 500 employees\\n- Current pain point: Manual data entry across systems\\n\",\n \"request_id\": \"salesforce-opp-12345\",\n \"callback_url\": \"https://hooks.acme.com/exec-scenarios\",\n \"callback_headers\": {\n \"Authorization\": \"Bearer webhook-secret-token\"\n }\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.exec.com/rest/v1/scenario-studio/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_email\": \"[email protected]\",\n \"prompt\": \"Create a discovery call scenario with a skeptical IT director who is concerned about integration complexity\",\n \"context\": \"## Prospect Information\\n- Company: TechCorp Inc.\\n- Industry: Financial Services\\n- Size: 500 employees\\n- Current pain point: Manual data entry across systems\\n\",\n \"request_id\": \"salesforce-opp-12345\",\n \"callback_url\": \"https://hooks.acme.com/exec-scenarios\",\n \"callback_headers\": {\n \"Authorization\": \"Bearer webhook-secret-token\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.exec.com/rest/v1/scenario-studio/jobs")

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 \"user_email\": \"[email protected]\",\n \"prompt\": \"Create a discovery call scenario with a skeptical IT director who is concerned about integration complexity\",\n \"context\": \"## Prospect Information\\n- Company: TechCorp Inc.\\n- Industry: Financial Services\\n- Size: 500 employees\\n- Current pain point: Manual data entry across systems\\n\",\n \"request_id\": \"salesforce-opp-12345\",\n \"callback_url\": \"https://hooks.acme.com/exec-scenarios\",\n \"callback_headers\": {\n \"Authorization\": \"Bearer webhook-secret-token\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "j1o2b3i4d5x6",
  "status": "completed",
  "scenario": {
    "id": "s1c2e3n4a5r6",
    "slug": "discovery-call-skeptical-it-director",
    "name": "Discovery Call with IT Director"
  },
  "error": null,
  "created_at": "2024-03-01T10:00:00Z",
  "started_at": "2024-03-01T10:00:05Z",
  "completed_at": "2024-03-01T10:02:30Z",
  "duration_seconds": 145,
  "is_new": false
}

Authorizations

Authorization
string
header
required

API key created in Settings > API.

Format: exec_live_ followed by 40 alphanumeric characters.

Body

application/json
user_email
string<email>
required

Email of the user to create the scenario for (must be a workspace member)

prompt
string
required

Instructions for the AI agent describing what scenario to create

Maximum string length: 10000
context
string

Additional context in Markdown format (e.g., CRM data, meeting notes, product info). This is provided to the AI agent as background information.

Maximum string length: 50000
scenario_slug
string

Slug of an existing scenario to remix/iterate on. The AI will use this as a starting point and apply your prompt as modifications.

request_id
string

Client-provided idempotency key. If a job with this ID already exists, returns the existing job instead of creating a new one.

callback_url
string<uri>

URL to receive a webhook POST when the job completes

callback_headers
object

Custom headers to include in the callback request (e.g., authorization)

Response

Existing job returned (idempotent duplicate — a job with this request_id already exists)

id
string

Job identifier

status
enum<string>

Current job status

Available options:
queued,
processing,
completed,
failed,
cancelled
scenario
object | null

Created scenario details (only present when status is "completed")

error
object | null

Error details (only present when status is "failed")

created_at
string<date-time>

When the job was created

started_at
string<date-time> | null

When the job started processing

completed_at
string<date-time> | null

When the job finished (success, failure, or cancelled)

duration_seconds
number | null

Processing duration in seconds (only present when job has completed)

is_new
boolean

Always false when an existing job is returned via request_id