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

# Create Repository File

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

## Request

- The document declares no server URL.
- Auth: none declared
- TypeScript: <https://skmtc.dev/modaic-ai/apis/modaic-api/docs/api/v2/repos/:entity_name/:repo_name/contents/:filepath/post.ts> (a function with typed inputs; its response is checked against the schema)

Create 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

- CreateFileRequest
  - `author` Author, required
    - `email` string, required
    - `name` string, required
  - `branch` string
  - `comitter` Committer, required
    - `email` string, required
    - `name` string, required
  - `content` string, required
  - `message` string, required
  - `new_branch` string, nullable
  - `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)
