---
title: "Update Repository File"
method: PUT
path: "/api/v2/repos/{entity_name}/{repo_name}/contents/{filepath}"
---

# Update Repository File

`PUT /api/v2/repos/{entity_name}/{repo_name}/contents/{filepath}`

Update a file in a repo repository

## Path parameters

- `entity_name` string, required
- `repo_name` string, required
- `filepath` string, required

## Headers

- `authorization` string, nullable

## Cookies

- `modaic_session` string, nullable

## Request body

- UpdateFileRequest
  - `author` Author, required
    - `email` string, required
    - `name` string, required
  - `branch` string
  - `comitter` Committer, required
    - `email` string, required
    - `name` string, required
  - `content` string, required
  - `from_path` string, nullable
  - `message` string, required
  - `new_branch` string, nullable
  - `sha` string, required
  - `signoff` boolean, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/modaic-ai/apis/modaic-api.md) · [All operations](https://skmtc.dev/modaic-ai/apis/modaic-api/llms.txt) · [OpenAPI document](https://skmtc.dev/modaic-ai/apis/modaic-api/revisions/43a90513ac59?raw)
