Update

  • PUT
  • /workspaces
  • /:workspace
  • /projects
  • /:project_name
  • /repository
  • /contents
  • /:path

Updates an existing file in the repository

Request

REQUIRED SCOPES
REPOSITORY_WRITE
URL PARAMETERS
workspacerequiredstring
The human-readable ID of the workspace

Example: "my-company"

project_namerequiredstring
The human-readable ID of the project

Example: "my-project"

pathrequiredstring
The path to the file in the repository

Constraints: Pattern: .+

Example: "src/main.js"

POST PARAMETERS
branchstring
The name of the branch to commit to
messagerequiredstring
The commit message
contentrequiredstring
The base64-encoded content of the file

Response

RESPONSE BODY
urlread-onlystring
API endpoint to GET this object
html_urlread-onlystring
Web URL to view this object in Buddy.works
contentRepositoryContentView
commitShortCommitView

Last modified on Jan 26, 2026

Request example

curl -X PUT "https://api.buddy.works/workspaces/:workspace/projects/:project_name/repository/contents/:path" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "content": "IyBBUEkgRG9jdW1lbnRhdGlvbgoKVGhpcyBkb2N1bWVudCBkZXNjcmliZXMgdGhlIEFQSSBlbmRwb2ludHMu", "message": "Update API documentation", "branch": "master" }'