curl --request POST \
--url https://api.recursion.labelbox.com/managed-agents/v1/simulation-scenarios/draft-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source": {
"automationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventSourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"providerDeliveryId": "<string>",
"triggerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "delivery"
}
}
'import requests
url = "https://api.recursion.labelbox.com/managed-agents/v1/simulation-scenarios/draft-preview"
payload = { "source": {
"automationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventSourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"providerDeliveryId": "<string>",
"triggerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "delivery"
} }
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({
source: {
automationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
eventSourceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
providerDeliveryId: '<string>',
triggerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
type: 'delivery'
}
})
};
fetch('https://api.recursion.labelbox.com/managed-agents/v1/simulation-scenarios/draft-preview', 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.recursion.labelbox.com/managed-agents/v1/simulation-scenarios/draft-preview",
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([
'source' => [
'automationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'eventSourceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'providerDeliveryId' => '<string>',
'triggerId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'type' => 'delivery'
]
]),
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.recursion.labelbox.com/managed-agents/v1/simulation-scenarios/draft-preview"
payload := strings.NewReader("{\n \"source\": {\n \"automationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"eventSourceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"providerDeliveryId\": \"<string>\",\n \"triggerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"delivery\"\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.recursion.labelbox.com/managed-agents/v1/simulation-scenarios/draft-preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source\": {\n \"automationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"eventSourceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"providerDeliveryId\": \"<string>\",\n \"triggerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"delivery\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recursion.labelbox.com/managed-agents/v1/simulation-scenarios/draft-preview")
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 \"source\": {\n \"automationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"eventSourceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"providerDeliveryId\": \"<string>\",\n \"triggerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"delivery\"\n }\n}"
response = http.request(request)
puts response.read_body{
"automationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lossy": [
{
"code": "github_delivery_header",
"message": "<string>"
}
],
"scenario": {}
}{
"code": "invalid_json",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "unauthorized",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "forbidden",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "not_found",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "payload_too_large",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "unsupported_media_type",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "simulation_scenario_draft_invalid",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "rate_limit_exceeded",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "internal_error",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "bad_gateway",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "managed_agents_unavailable",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "gateway_timeout",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}Preview a scenario drafted from real traffic
A side-effect-free read that turns one delivery an automation trigger admitted, or the session an automation run started, into an unsaved scenario checked against the automation as it is now: the trigger input the automation received, and for a session the later Slack thread messages, webhook deliveries or GitHub events it continued with as follow-ups, or a resumed schedule’s later occurrences as followUpOccurrences. Every detail a scenario cannot carry is reported in lossy. Requires the role that can edit the automation: the draft carries customer content. An expired or foreign delivery or session, or a delivery the trigger did not admit, is not found; an event source other than the trigger’s, a trigger the automation does not have or has removed or disabled (a 400 on source.triggerId or source.sessionId), or a draft the automation can no longer run is refused.
curl --request POST \
--url https://api.recursion.labelbox.com/managed-agents/v1/simulation-scenarios/draft-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source": {
"automationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventSourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"providerDeliveryId": "<string>",
"triggerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "delivery"
}
}
'import requests
url = "https://api.recursion.labelbox.com/managed-agents/v1/simulation-scenarios/draft-preview"
payload = { "source": {
"automationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventSourceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"providerDeliveryId": "<string>",
"triggerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "delivery"
} }
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({
source: {
automationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
eventSourceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
providerDeliveryId: '<string>',
triggerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
type: 'delivery'
}
})
};
fetch('https://api.recursion.labelbox.com/managed-agents/v1/simulation-scenarios/draft-preview', 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.recursion.labelbox.com/managed-agents/v1/simulation-scenarios/draft-preview",
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([
'source' => [
'automationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'eventSourceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'providerDeliveryId' => '<string>',
'triggerId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'type' => 'delivery'
]
]),
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.recursion.labelbox.com/managed-agents/v1/simulation-scenarios/draft-preview"
payload := strings.NewReader("{\n \"source\": {\n \"automationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"eventSourceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"providerDeliveryId\": \"<string>\",\n \"triggerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"delivery\"\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.recursion.labelbox.com/managed-agents/v1/simulation-scenarios/draft-preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source\": {\n \"automationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"eventSourceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"providerDeliveryId\": \"<string>\",\n \"triggerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"delivery\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recursion.labelbox.com/managed-agents/v1/simulation-scenarios/draft-preview")
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 \"source\": {\n \"automationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"eventSourceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"providerDeliveryId\": \"<string>\",\n \"triggerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"delivery\"\n }\n}"
response = http.request(request)
puts response.read_body{
"automationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lossy": [
{
"code": "github_delivery_header",
"message": "<string>"
}
],
"scenario": {}
}{
"code": "invalid_json",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "unauthorized",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "forbidden",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "not_found",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "payload_too_large",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "unsupported_media_type",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "simulation_scenario_draft_invalid",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "rate_limit_exceeded",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "internal_error",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "bad_gateway",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "managed_agents_unavailable",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "gateway_timeout",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}Authorizations
Headers
Body
Response
OK