# Upload file

> For AI agents: the complete documentation index is at https://buddy.works/llms.txt

`POST /workspaces/:workspace/artifacts/:artifact_id/versions/:version_id/commit/upload`

Upload a file to be committed to a GIT artifact

**Required Scopes:** `ARTIFACT_WRITE`

## URL Parameters

```typescript
interface URLParameters {
  /** The human-readable ID of the workspace */
  workspace: string; // Example: "my-company"
  /** The Artifact ID */
  artifact_id: string; // Example: "x5169jL2"
  /** The Version ID */
  version_id: string; // Example: "a9f84k2L"
}
```

## Query Parameters

```typescript
interface QueryParameters {
  /** The name of the file being uploaded */
  filename?: string; // Example: "app.js"
}
```

## Response Body

```typescript
interface ResponseBody {
  /** The original name of the uploaded file */
  name?: string;
  /** The opaque upload reference to pass back when creating a commit */
  upload_path?: string;
}
```

## Request Example

```bash
curl -X POST "https://api.buddy.works/workspaces/:workspace/artifacts/:artifact_id/versions/:version_id/commit/upload" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "Content-Type: application/json"
```

## Response Example

**Status:** `201 File uploaded successfully`

```json
{
  "name": "app.js",
  "upload_path": "a1b2c3d4_app.js"
}
```

---
Original source: https://buddy.works/docs/api/artifacts/versions/commits/upload