Path Parameters
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.
The repository ID that was updated
Commit hash for the updated repo head
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"]
}