PUT
/
v1
/
repo
/
{repo_id}
/
file
/
public
/
{file_path}
curl -X PUT https://api.relace.run/v1/repo/3fa85f64-5717-4562-b3fc-2c963f66afa6/file/public/src%2Fmain.py \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/octet-stream" \
  --data-binary "def main():
    print('Hello World!')

if __name__ == '__main__':
    main()"
{
  "repo_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "repo_head": "abc123def456789",
  "changed_files": ["src/main.py"]
}

Path Parameters

repo_id
string
required
Repo ID
file_path
string
required
Path to the file within the repository (URL encoded)

Request Body

The request body should contain the raw file content as binary data. Set the Content-Type header to application/octet-stream.

Response

Returns HTTP status 201 Created on success.
repo_id
string
The repository ID that was updated
repo_head
string
Commit hash for the updated repo head
changed_files
array
Array of file paths that were modified
curl -X PUT https://api.relace.run/v1/repo/3fa85f64-5717-4562-b3fc-2c963f66afa6/file/public/src%2Fmain.py \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/octet-stream" \
  --data-binary "def main():
    print('Hello World!')

if __name__ == '__main__':
    main()"
{
  "repo_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "repo_head": "abc123def456789",
  "changed_files": ["src/main.py"]
}