Skip to content

Latest commit

 

History

History
44 lines (38 loc) · 1.02 KB

File metadata and controls

44 lines (38 loc) · 1.02 KB
title Save file
section api
sidebar true

PUT /repositories/file

Create or update a UTF-8 file, commit, and create the next release tag.

Request body

Field Type Description
creator_user_id string Owner
payment_request_id string Payment request
relative_path string Path inside repo, e.g. docs/spec.md
content string File body (UTF-8)
message string? Optional commit message

Response 200

{
  "path": "docs/spec.md",
  "commit_sha": "…",
  "version_tag": "v2"
}
curl -sS -X PUT "$BASE/repositories/file" \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-User-Id: user-1" \
  -H "Content-Type: application/json" \
  -d '{
    "creator_user_id":"user-1",
    "payment_request_id":"pr-100",
    "relative_path":"invoice.md",
    "content":"# Invoice\nTotal: 100",
    "message":"Add invoice"
  }'