curl --request POST \
--url https://api.klavis.ai/sandbox/github/{sandbox_id}/initialize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"repos": [
{
"name": "test-repo",
"description": "A test repository for GitHub sandbox",
"branches": [
{
"name": "main",
"folders": {
"name": "root",
"path": "",
"files": [
{
"name": "README.md",
"path": "README.md",
"content": "# Test Repository\n\nThis is a test repository for the GitHub sandbox.\n\n## Features\n- Test files\n- Test folders\n- Sample issues and PRs"
}
],
"folders": [
{
"name": "src",
"path": "src",
"files": [
{
"name": "main.py",
"path": "src/main.py",
"content": "def main():\n print('Hello, GitHub Sandbox!')\n\nif __name__ == '__main__':\n main()"
}
],
"folders": []
}
]
}
},
{
"name": "feature-branch",
"folders": {
"name": "root",
"path": "",
"files": [
{
"name": "README.md",
"path": "README.md",
"content": "# Test Repository\n\nThis is a test repository for the GitHub sandbox.\n\n## Features\n- Test files\n- Test folders\n- Sample issues and PRs\n- New feature in development"
}
],
"folders": [
{
"name": "src",
"path": "src",
"files": [
{
"name": "main.py",
"path": "src/main.py",
"content": "def main():\n print('Hello, GitHub Sandbox!')\n print('New feature added!')\n\nif __name__ == '__main__':\n main()"
},
{
"name": "feature.py",
"path": "src/feature.py",
"content": "def new_feature():\n return 'This is a new feature'\n"
}
],
"folders": []
}
]
}
}
],
"issues": [
{
"issue_title": "Sample issue for testing",
"description": "This is a test issue created for GitHub sandbox testing.\n\n## Description\nWe should implement feature X.\n\n## Steps\n1. Plan the feature\n2. Implement the code\n3. Write tests",
"status": "open",
"labels": [
"bug",
"enhancement"
]
}
],
"prs": [
{
"pr_title": "Add new feature",
"description": "This PR adds a new feature to the repository.\n\n## Changes\n- Added new functionality\n- Updated documentation\n- Added tests",
"status": "open",
"source_branch": "feature-branch",
"target_branch": "main",
"labels": [
"enhancement"
]
}
]
}
]
}
EOF{
"sandbox_id": "<string>",
"status": "idle",
"message": "<string>",
"records_created": {}
}Initialize the sandbox with github-specific data following the defined schema.
curl --request POST \
--url https://api.klavis.ai/sandbox/github/{sandbox_id}/initialize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"repos": [
{
"name": "test-repo",
"description": "A test repository for GitHub sandbox",
"branches": [
{
"name": "main",
"folders": {
"name": "root",
"path": "",
"files": [
{
"name": "README.md",
"path": "README.md",
"content": "# Test Repository\n\nThis is a test repository for the GitHub sandbox.\n\n## Features\n- Test files\n- Test folders\n- Sample issues and PRs"
}
],
"folders": [
{
"name": "src",
"path": "src",
"files": [
{
"name": "main.py",
"path": "src/main.py",
"content": "def main():\n print('Hello, GitHub Sandbox!')\n\nif __name__ == '__main__':\n main()"
}
],
"folders": []
}
]
}
},
{
"name": "feature-branch",
"folders": {
"name": "root",
"path": "",
"files": [
{
"name": "README.md",
"path": "README.md",
"content": "# Test Repository\n\nThis is a test repository for the GitHub sandbox.\n\n## Features\n- Test files\n- Test folders\n- Sample issues and PRs\n- New feature in development"
}
],
"folders": [
{
"name": "src",
"path": "src",
"files": [
{
"name": "main.py",
"path": "src/main.py",
"content": "def main():\n print('Hello, GitHub Sandbox!')\n print('New feature added!')\n\nif __name__ == '__main__':\n main()"
},
{
"name": "feature.py",
"path": "src/feature.py",
"content": "def new_feature():\n return 'This is a new feature'\n"
}
],
"folders": []
}
]
}
}
],
"issues": [
{
"issue_title": "Sample issue for testing",
"description": "This is a test issue created for GitHub sandbox testing.\n\n## Description\nWe should implement feature X.\n\n## Steps\n1. Plan the feature\n2. Implement the code\n3. Write tests",
"status": "open",
"labels": [
"bug",
"enhancement"
]
}
],
"prs": [
{
"pr_title": "Add new feature",
"description": "This PR adds a new feature to the repository.\n\n## Changes\n- Added new functionality\n- Updated documentation\n- Added tests",
"status": "open",
"source_branch": "feature-branch",
"target_branch": "main",
"labels": [
"enhancement"
]
}
]
}
]
}
EOF{
"sandbox_id": "<string>",
"status": "idle",
"message": "<string>",
"records_created": {}
}Your Klavis AI API key.
The unique sandbox identifier
If true, use default test data for initialization
Complete GitHub sandbox data structure
List of repositories
Show child attributes
Successful Response
Response model for sandbox initialization