---
title: "Put a folder of the sandbox under Git, so its changes show from now on: a `.gitignore` for dependencies, builds and `.env` files when it has none, then a first commit of what is there. A folder already inside a repository is refused with `409`."
method: POST
path: "/ai/conversations/{public_id}/sandbox/changes/track"
tags: ["AI Chat"]
---

# Put a folder of the sandbox under Git, so its changes show from now on: a \`.gitignore\` for dependencies, builds and \`.env\` files when it has none, then a first commit of what is there. A folder already inside a repository is refused with \`409\`.

`POST /ai/conversations/{public_id}/sandbox/changes/track`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/ai/conversations/{public_id}/sandbox/changes/track`
- Auth: HTTP bearer

## Path parameters

- `public_id` string, required

## Request body

- TrackSandboxChangesRequest: A folder to put under Git.
  - `path` string, nullable: Absolute, or relative to the work directory; the work directory when omitted.

## Response `200`

Tracking started; the changes as they are now

- SandboxChanges: The Git changes of every repository found under the work directory.
  - `git_available` boolean, required: False when the sandbox has no `git`: nothing can be tracked.
  - `repos` GitRepoChanges[], required: Repositories at most three levels below the work directory, outside `node_modules`.
    - `branch` string, nullable: The checked-out branch, or the short commit when detached.
    - `files` GitChangedFile[], required
      - `change` 'modified' | 'added' | 'deleted' | 'renamed' | 'copied' | 'type_changed' | 'untracked' | 'conflicted', required: How a file differs from the last commit.
      - `old_path` string, nullable: The path before a rename or copy.
      - `path` string, required: Path relative to the repository root.
      - `staged` boolean, required: True when the change is staged (in the index).
    - `has_commits` boolean, required: False for a repository with no commit yet: every file is new.
    - `name` string, required: The root relative to the work directory (`.` for the work directory).
    - `root` string, required: Absolute path of the repository root.
    - `truncated` boolean, required: True when more files changed than are listed.
  - `work_dir` string, required

## Other responses

- `400`: Invalid path
- `401`: Unauthorized
- `403`: Insufficient permissions
- `404`: Conversation, sandbox or folder not found
- `409`: The folder is already tracked, no sandbox is linked, or it could not be started
- `500`: The Git command failed
- `503`: This server has no sandbox backend
- `504`: The sandbox did not answer in time

## Changes

> 81 revisions in range; 1 not diffed.

- **2026-10-20** `79089e9f49ee`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/ai/conversations/:public_id/sandbox/changes/track/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) · [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) · [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/ab6d5d19e930?raw)
