---
title: Create a version from sandbox changes
description: "Stages everything in the run's checkout and commits a version, pushed to the repo with a short-lived brokered credential (WIBLO-085.7)."
api_method: POST
api_path: "/v1/agent-runs/{runId}/git/commit"
canonical_url: https://wiblo.app/docs/developers/api/agent-git/create-agent-run-git-version
last_updated: 2026-07-28T17:31:44+02:00
md_url: https://wiblo.app/docs/developers/api/agent-git/create-agent-run-git-version.md
---

# Create a version from sandbox changes

`POST /v1/agent-runs/{runId}/git/commit`

Stages everything in the run's checkout and commits a version, pushed to the repo with a short-lived brokered credential (WIBLO-085.7). `committed: false` when the tree was already clean. Versions are identified by commit sha only. Per-user rate-limited at 20/60s.

## Path parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `runId` | `string` | Yes |  |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `message` | `string` | No |  |

## Request

**curl**

```bash
curl https://api.wiblo.app/v1/agent-runs/{runId}/git/commit \
  -X POST \
  -H "Authorization: Bearer $WIBLO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "message": "..."
}'
```

**TypeScript**

```ts
import { createSdk, createAgentRunGitVersion } from "@workspace/sdk"

const sdk = createSdk({ baseUrl: "https://api.wiblo.app" })

const { data, error } = await createAgentRunGitVersion({
  client: sdk,
  path: { runId: "..." },
  body: {
    "message": "..."
  },
})
```

## Responses

**`200`** — The version commit (or a clean-tree no-op). Returns `AgentGitVersionResponse`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `runId` | `string` | Yes |  |
| `committed` | `boolean` | Yes |  |
| `sha` | `string` | Yes |  |

**`401`** — No valid session cookie or `wbl_*` bearer was present. Returns `ApiErrorEnvelope`.

**`404`** — No run visible to the caller with this id (`AGENT_RUN_NOT_FOUND`). Returns `ApiErrorEnvelope`.

**`409`** — No live sandbox session holds the checkout (`AGENT_SANDBOX_UNAVAILABLE`), or a turn is already running in the run's thread (`TURN_ALREADY_ACTIVE`). Returns `ApiErrorEnvelope`.

**`422`** — Path/body validation failed, or the run has no Git source (`AGENT_RUN_NOT_GIT_BACKED`). Returns `ApiErrorEnvelope`.

**`429`** — Rate limit exceeded. The body's `error.code` is `RATE_LIMITED` and `error.details.retry_after` is the same number of seconds as the `Retry-After` header. Returns `ApiErrorEnvelope`.

**`502`** — The Git operation failed against the provider/checkout (`UPSTREAM_UNAVAILABLE`). Returns `ApiErrorEnvelope`.
