diff --git a/docs/hub/api.md b/docs/hub/api.md index ea22aeb6d..fc422ab41 100644 --- a/docs/hub/api.md +++ b/docs/hub/api.md @@ -20,4 +20,5 @@ We have open endpoints that you can use to retrieve information from the Hub as | /api/repos/{type}/{repo_id}/settings PUT | Update repo visibility. | `update_repo_visibility()` | ```headers = { "authorization" : "Bearer $token" }``` ```json= {"private":"private"}``` | | | /api/repos/move POST | Move a repository (rename within same namespace or transfer from user to organization). | `move_repo()` | ```headers = { "authorization" : "Bearer $token" }``` ```json= {"fromRepo" : "namespace/repo_name", "toRepo" : "namespace2/repo_name2"}``` | | | /api/{type}/{repo_id}/upload/{revision}/{path_in_repo} POST | Upload a file to a specific repository. | `upload_file()` | ```headers = { "authorization" : "Bearer $token" }``` ```"data"="bytestream"``` | | -| /api/whoami-v2 GET | Get username and organizations the user belongs to. | `whoami(token)` | ```headers = { "authorization" : "Bearer $token" }``` | | \ No newline at end of file +| /api/{type}/{repo_id}/commit/{revision} POST | Commit multiple files at once. Specifying LFS files will automatically edit the .gitattributes files to properly track them. You need to preupload LFS files using the LFS protocol before the commit. Supports both the `application/json` and `application/x-ndjson` content types, use [ndjson](http://ndjson.org/) to upload streaming data line by line for large payloads. | `create_commit()` | ```headers = { "authorization" : "Bearer $token" }``` ```"json"= {"summary": "summary", "description": "description", "parentCommit"?: "deadbeef", "files": [{"path": "README.md", content: "file content", encoding: "utf-8" \| "base64"}], "lfsFiles": [{"path": "tf_model.h5", "algo": "sha256", "oid": sha256 of the lfs file, size: 456000000}], "deletedFiles": [{"path": "oldfile.old"}] }``` ```"x-ndjson"={"key": "header, "value": {"summary": "summary", "description": "description", "parentCommit"?: "deadbeef"}}\n{"key": "file", "value": {"path": "README.md", content: "file content", encoding: "utf-8" \| "base64"}}\n{"key": "lfsFile", "value": {"path": "tf_model.h5", "algo": "sha256", "oid": sha256 of the lfs file, size: 456000000}}\n{"key": "deletedFile", "value": {"path": "oldfile1.old"}}\n{"key": "deletedFile", "value": {"path": "oldfile2.old"}}``` | | +| /api/whoami-v2 GET | Get username and organizations the user belongs to. | `whoami(token)` | ```headers = { "authorization" : "Bearer $token" }``` | |