---
title: "Save file"
method: PUT
path: "/api/v1/projects/{projectUuid}/git/branches/{branch}/files"
tags: ["Git Files"]
---

# Save file

`PUT /api/v1/projects/{projectUuid}/git/branches/{branch}/files`

Create or update a file. Provide sha to update existing file, omit for new file.

## Path parameters

- `projectUuid` string, required
- `branch` string, required

## Request body

- object
  - `message` string
  - `sha` string
  - `content` string, required
  - `path` string, required

## Response `200`

Success

- ApiGitFileSavedResponse
  - `results` object, required
    - `path` string, required
    - `sha` string, required
  - `status` 'ok', required

## Other responses

- `default` — Error

---

[API](https://skmtc.dev/lightdash/apis/lightdash-api.md) · [All operations](https://skmtc.dev/lightdash/apis/lightdash-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/lightdash/lightdash-api/revisions/40c933755c9a/schema)
