Skip to main content
GET
/
api
/
sandboxes
cURL
curl --request GET \
  --url https://recoup-api.vercel.app/api/sandboxes \
  --header 'x-api-key: <api-key>'
{
  "status": "success",
  "sandboxes": [
    {
      "sandboxId": "sbx_abc123def456",
      "sandboxStatus": "running",
      "timeout": 300000,
      "createdAt": "2024-01-15T10:30:00.000Z",
      "runId": "run_xyz789abc123"
    }
  ],
  "snapshot_id": "snap_abc123def456",
  "github_repo": "https://github.com/username/repo",
  "filetree": [
    {
      "path": "src/index.ts",
      "type": "blob",
      "sha": "abc123def456",
      "size": 1024
    }
  ],
  "error": "<string>"
}

Authorizations

x-api-key
string
header
required

Your Recoup API key. Learn more.

Query Parameters

sandbox_id
string

Filter by a specific sandbox ID. When provided, returns only the sandbox matching this ID. Must be a sandbox that your account or organization is an admin of.

Example:

"sbx_abc123def456"

account_id
string<uuid>

Filter to a specific account. Only applicable for organization API keys - org keys can filter to any account within their organization. Personal keys cannot use this parameter.

Response

Sandboxes retrieved successfully

Response containing sandbox information

status
enum<string>
required

Status of the request

Available options:
success,
error
sandboxes
object[]
required

Array of sandbox objects

snapshot_id
string | null

The account's saved snapshot ID used for creating new sandboxes. Null if no snapshot has been saved.

Example:

"snap_abc123def456"

github_repo
string | null

The GitHub repository URL associated with the account's sandbox environment. Used as the filesystem source when restoring sandboxes.

Example:

"https://github.com/username/repo"

filetree
object[] | null

The recursive file tree of the account's GitHub repository. Null if no github_repo is set or if the fetch fails.

error
string

Error message (only present if status is error)