curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"repo_url": "https://github.com/owner/repo", "branch": "main"}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={
"repo_url": "https://github.com/owner/repo",
"branch": "main",
},
)
data = response.json()
print(f"Cloned to {data['path']} on branch {data['branch']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
repo_url: "https://github.com/owner/repo",
branch: "main",
}),
}
);
const data = await response.json();
console.log(`Cloned to ${data.path} on branch ${data.branch}`);
{
"session_id": "ses_abc123",
"repo_url": "https://github.com/owner/repo",
"branch": "main",
"path": "/home/user/repo"
}
Git
Clone Repository
Clone a git repository into the sandbox
POST
/
api
/
sessions
/
{session_id}
/
clone-repo
curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"repo_url": "https://github.com/owner/repo", "branch": "main"}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={
"repo_url": "https://github.com/owner/repo",
"branch": "main",
},
)
data = response.json()
print(f"Cloned to {data['path']} on branch {data['branch']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
repo_url: "https://github.com/owner/repo",
branch: "main",
}),
}
);
const data = await response.json();
console.log(`Cloned to ${data.path} on branch ${data.branch}`);
{
"session_id": "ses_abc123",
"repo_url": "https://github.com/owner/repo",
"branch": "main",
"path": "/home/user/repo"
}
Clones a git repository into the session’s sandbox. Supports public repos and private repos when a GitHub App installation or user token is configured.
Required scope:
sessions:write
Path Parameters
string
required
The session ID (e.g.
ses_abc123).Headers
string
required
Bearer token. Example:
Bearer runtm_xxxBody
string
required
Repository URL (e.g.
https://github.com/owner/repo).string
Branch to clone. Defaults to the repository’s default branch.
Response
string
Session ID.
string
Cloned repository URL.
string
Branch that was checked out.
string
Path where the repo was cloned in the sandbox.
curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"repo_url": "https://github.com/owner/repo", "branch": "main"}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={
"repo_url": "https://github.com/owner/repo",
"branch": "main",
},
)
data = response.json()
print(f"Cloned to {data['path']} on branch {data['branch']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/clone-repo",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
repo_url: "https://github.com/owner/repo",
branch: "main",
}),
}
);
const data = await response.json();
console.log(`Cloned to ${data.path} on branch ${data.branch}`);
{
"session_id": "ses_abc123",
"repo_url": "https://github.com/owner/repo",
"branch": "main",
"path": "/home/user/repo"
}