---
title: "Initialize github sandbox with data"
method: POST
path: "/sandbox/github/{sandbox_id}/initialize"
tags: ["sandbox"]
---

# Initialize github sandbox with data

`POST /sandbox/github/{sandbox_id}/initialize`

Initialize the sandbox with github-specific data following the defined schema.

## Path parameters

- `sandbox_id` string, required — The unique sandbox identifier

## Query parameters

- `init_default_data` boolean — If true, use default test data for initialization

## Request body

- GitHubDataInput — Complete GitHub sandbox data structure
  - `repos` GitHubRepoInput[], nullable — List of repositories
    - `name` string, required — Repository name
    - `description` string, nullable — Repository description
    - `branches` GitHubBranchInput[], nullable — List of branches with their folder structures
      - `name` string, required — Branch name
      - `folders` GitHubFolderInput — GitHub Folder object
        - `name` string, required — Folder name
        - `path` string, required — Folder path within the repository
        - `files` GitHubFile[], nullable — Files within this folder
          - `name` string, required — File name
          - `path` string, required — File path within the repository
          - `content` string, nullable — File content
        - `folders` GitHubFolderInput[], nullable — Subfolders within this folder
    - `prs` GitHubPullRequest[], nullable — List of pull requests
      - `id` integer, nullable — PR ID (read-only, set by GitHub)
      - `pr_title` string, required — Pull request title
      - `description` string, nullable — Pull request description/body
      - `status` string, nullable — PR state: open, closed, or merged
      - `source_branch` string, required — Head branch name
      - `target_branch` string — Base branch name
      - `labels` string[], nullable — List of label names
    - `issues` GitHubIssue[], nullable — List of issues
      - `id` integer, nullable — Issue ID (read-only, set by GitHub)
      - `issue_title` string, required — Issue title
      - `description` string, nullable — Issue description/body
      - `status` string, nullable — Issue state: open or closed
      - `labels` string[], nullable — List of label names

## Response `200`

Successful Response

- InitializeSandboxResponse — Response model for sandbox initialization
  - `sandbox_id` string, required — Sandbox identifier
  - `status` 'idle' | 'occupied' | 'error', required — Status of a sandbox instance - matches database enum
  - `message` string, required — Initialization result message

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/klavis-ai/apis/klavis-ai-https-www-klavis-ai.md) · [All operations](https://skmtc.net/klavis-ai/apis/klavis-ai-https-www-klavis-ai/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/klavis-ai/klavis-ai-https-www-klavis-ai/revisions/1f05ced7280f/schema)
