curl --request POST \
--url https://app.factorize.sh/api/v1/runs/{runId}/trace/replay \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "primary"
}
'import requests
url = "https://app.factorize.sh/api/v1/runs/{runId}/trace/replay"
payload = {
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "primary"
}
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({requestId: '3c90c3cc-0d44-4b50-8888-8dd25736052a', source: 'primary'})
};
fetch('https://app.factorize.sh/api/v1/runs/{runId}/trace/replay', 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://app.factorize.sh/api/v1/runs/{runId}/trace/replay",
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([
'requestId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'source' => 'primary'
]),
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://app.factorize.sh/api/v1/runs/{runId}/trace/replay"
payload := strings.NewReader("{\n \"requestId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source\": \"primary\"\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://app.factorize.sh/api/v1/runs/{runId}/trace/replay")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"requestId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source\": \"primary\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.factorize.sh/api/v1/runs/{runId}/trace/replay")
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 \"requestId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source\": \"primary\"\n}"
response = http.request(request)
puts response.read_body{
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "projected",
"reason": "run_active",
"sourceKind": "execution_stream",
"sha256": "<string>",
"parserVersion": "<string>",
"reconciliation": {}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Replay a retained trace artifact or restore a native-session projection
Requires runs:write and an interactive tenant owner session. One terminal run per request, limited to 10 attempts per tenant per minute including retries and failures. Projection and result commit atomically; no artifacts are deleted. Retry failed requests with the same requestId. Conflicting reuse is rejected. Missing bytes cannot be recovered. Does not change the source declaration of an active or future run.
Requires the runs:write scope.
An interactive owner session is required; bearer tokens cannot call this operation.
curl --request POST \
--url https://app.factorize.sh/api/v1/runs/{runId}/trace/replay \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "primary"
}
'import requests
url = "https://app.factorize.sh/api/v1/runs/{runId}/trace/replay"
payload = {
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "primary"
}
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({requestId: '3c90c3cc-0d44-4b50-8888-8dd25736052a', source: 'primary'})
};
fetch('https://app.factorize.sh/api/v1/runs/{runId}/trace/replay', 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://app.factorize.sh/api/v1/runs/{runId}/trace/replay",
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([
'requestId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'source' => 'primary'
]),
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://app.factorize.sh/api/v1/runs/{runId}/trace/replay"
payload := strings.NewReader("{\n \"requestId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source\": \"primary\"\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://app.factorize.sh/api/v1/runs/{runId}/trace/replay")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"requestId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source\": \"primary\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.factorize.sh/api/v1/runs/{runId}/trace/replay")
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 \"requestId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"source\": \"primary\"\n}"
response = http.request(request)
puts response.read_body{
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "projected",
"reason": "run_active",
"sourceKind": "execution_stream",
"sha256": "<string>",
"parserVersion": "<string>",
"reconciliation": {}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Body
Tenant-scoped idempotency key; preserve it when retrying. Use a new key to reconsider a previously skipped or unrecoverable run.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Primary replays the persisted source declaration (native for historical runs); native_session selects retained native bytes for other providers or historical native-only Codex runs. Canonical Codex runs reject native replay.
primary, native_session Response
Durable replay result
projected, already_projected, skipped, unrecoverable run_active, ambiguous_artifacts, missing_artifact, unsupported_artifact, artifact_not_retained execution_stream, native_session