apicheats.dev Cheat sheet Raw .md
PUT

Try PUT /repos/{owner}/{repo}/contents/{path} — GitHub API

GitHub playground

Create or update file contents

Credentials

Kept in this tab only. Requests go through apicheats.dev's same-origin proxy straight to api.github.com; the proxy stores and logs nothing about them.

Headers

Path

Body application/json

6 body fields
  • message · required · string — The commit message.
  • content · required · string — The new file content, using Base64 encoding.
  • sha · optional · string — **Required if you are updating a file**. The blob SHA of the file being replaced.
  • branch · optional · string — The branch name. Default: the repository’s default branch.
  • committer · optional · object — The person that committed the file. Default: the authenticated user.
  • author · optional · object — The author of the file. Default: The `committer` or the authenticated user if you omit `committer`.