curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt/rewind" \
-H "Authorization: Bearer runtm_xxx"
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt/rewind",
headers={"Authorization": "Bearer runtm_xxx"},
)
data = response.json()
print(f"Reverted {len(data['reverted_files'])} files")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt/rewind",
{
method: "POST",
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const data = await response.json();
console.log(`Reverted ${data.reverted_files.length} files`);
{
"session_id": "ses_abc123",
"rewound": true,
"reverted_files": [
"/src/routes/users.ts",
"/src/middleware/validate.ts"
]
}
Prompts
Rewind Prompt
Undo the last prompt and its changes
POST
/
api
/
sessions
/
{session_id}
/
prompt
/
rewind
curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt/rewind" \
-H "Authorization: Bearer runtm_xxx"
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt/rewind",
headers={"Authorization": "Bearer runtm_xxx"},
)
data = response.json()
print(f"Reverted {len(data['reverted_files'])} files")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt/rewind",
{
method: "POST",
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const data = await response.json();
console.log(`Reverted ${data.reverted_files.length} files`);
{
"session_id": "ses_abc123",
"rewound": true,
"reverted_files": [
"/src/routes/users.ts",
"/src/middleware/validate.ts"
]
}
Rewinds the session to the state before the last prompt was executed. File changes made by the agent are reverted.
Required scope:
sessions:write
Path Parameters
string
required
The session ID (e.g.
ses_abc123).Headers
string
required
Bearer token. Example:
Bearer runtm_xxxResponse
string
Session ID.
boolean
Whether the rewind was successful.
array
List of file paths that were reverted.
curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt/rewind" \
-H "Authorization: Bearer runtm_xxx"
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt/rewind",
headers={"Authorization": "Bearer runtm_xxx"},
)
data = response.json()
print(f"Reverted {len(data['reverted_files'])} files")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt/rewind",
{
method: "POST",
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const data = await response.json();
console.log(`Reverted ${data.reverted_files.length} files`);
{
"session_id": "ses_abc123",
"rewound": true,
"reverted_files": [
"/src/routes/users.ts",
"/src/middleware/validate.ts"
]
}