Create
- POST
- /workspaces
- /:domain
- /projects
- /:project_name
- /repository
- /contents
Creates a new file in the repository.
Example:
curl -X POST "https://api.buddy.works/workspaces/:domain/projects/:project_name/repository/contents" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"path": "test.txt",
"branch": "development",
"message": "add test.txt",
"content": "TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gTnVuYyBwcmV0aXVtIG9kaW8gZWdldCB0ZWxsdXMgYWxpcXVhbSwgdmVsIHZ1bHB1dGF0ZSBzYXBpZW4gdmVzdGlidWx1bS4="
}'
EXAMPLE RESPONSE{ "content": { "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/repository/contents/test.txt?revision=f659e787d8f6c19c125c60c025afa9d0def29fed", "html_url": "https://app.buddy.works/buddy/company-website/repository/content/revision/f659e787d8f6c19c125c60c025afa9d0def29fed/test.txt", "content_type": "FILE", "encoding": "base64", "size": 128, "name": "test.txt", "path": "test.txt", "content": "TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gTnVuYyBwcmV0aXVtIG9kaW8gZWdldCB0ZWxsdXMgYWxpcXVhbSwgdmVsIHZ1bHB1dGF0ZSBzYXBpZW4gdmVzdGlidWx1bS4=" }, "commit": { "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/repository/commits/f659e787d8f6c19c125c60c025afa9d0def29fed", "html_url": "https://app.buddy.works/buddy/company-website/repository/commit/f659e787d8f6c19c125c60c025afa9d0def29fed", "revision": "f659e787d8f6c19c125c60c025afa9d0def29fed", "author_date": "2016-03-02T12:31:32Z", "commit_date": "2016-03-02T12:31:32Z", "message": "add test.txt", "committer": { "url": "https://api.buddy.works/workspaces/buddy/member/1", "html_url": "https://app.buddy.works/buddy/profile/1", "id": 1, "name": "Mike Benson", "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png" }, "author": { "url": "https://api.buddy.works/workspaces/buddy/member/1", "html_url": "https://app.buddy.works/buddy/profile/1", "id": 1, "name": "Mike Benson", "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png" } } }
STATUS201 Created
LIMITSX-Rate-Limit-Limit: 1 X-Rate-Limit-Remaining: 999