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"
  }
}
'
{
  "id": "j1o2b3i4d5x6",
  "status": "queued",
  "scenario": null,
  "error": null,
  "created_at": "2024-03-01T10:00:00Z",
  "started_at": null,
  "completed_at": null,
  "duration_seconds": null,
  "is_new": true
}

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

Job created successfully

id
string

Job identifier (12-character hex string)

status
enum<string>

Current job status

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

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

error
object

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
integer | null

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

is_new
boolean

True if a new job was created, false if an existing job was returned via request_id