Probably you are looking for
PUT /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/browse/{path:.*}
From the documentation of API
PUT
/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/browse/{path:.*}
Update the content of path, on the given repository and branch. This
resource accepts PUT multipart form data, containing the file in a
form-field named content. An example curl request to update
'README.md' would be:
curl -X PUT -u username:password -F [email protected] -F
'message=Updated using file-edit REST API' -F branch=master -F
sourceCommitId=5636641a50b http://example.com/rest/api/latest/projects/PROJECT_1/repos/repo_1/browse/README.md
- branch: the branch on which the path should be modified or created
- content: the full content of the file at path message: the message
associated with this change, to be used as the commit message. Or null
if the default message should be used.
- sourceCommitId: the commit ID
of the file before it was edited, used to identify if content has
changed. Or null if this is a new file.
The file can be updated or
created on a new branch. In this case, the sourceBranch parameter
should be provided to identify the starting point for the new branch
and the branch parameter identifies the branch to create the new
commit on.