v13
latestOpenAPI 3.1.02026-08-033122950.3 KBmodels
Commit
For legacy reason, we support both application/json and application/x-ndjson but we recommend using application/x-ndjson to create a commit.
JSON-lines payload:
{
"key": "header",
"value": {
"summary": "string (REQUIRED)",
"description": "string (OPTIONAL - defaults to empty string)",
"parentCommit": "string (OPTIONAL - 40-character hex SHA)"
}
}
{
"key": "file",
"value": {
"path": "string (REQUIRED)",
"content": "string (OPTIONAL - required if oldPath not set)",
"encoding": "utf-8 | base64 (OPTIONAL - defaults to utf-8)",
"oldPath": "string (OPTIONAL - for move/rename operations)"
}
}
{
"key": "deletedEntry",
"value": {
"path": "string (REQUIRED)"
}
}
{
"key": "lfsFile",
"value": {
"path": "string (REQUIRED - max 1000 chars)",
"oid": "string (OPTIONAL - required if oldPath not set, 64 hex chars)",
"algo": "sha256 (OPTIONAL - only sha256 supported)",
"size": "number (OPTIONAL - required if oldPath is set)",
"oldPath": "string (OPTIONAL - for move/rename operations)"
}
}
JSON payload:
{
"summary": "string (REQUIRED)",
"description": "string (OPTIONAL - defaults to empty string)",
"parentCommit": "string (OPTIONAL - 40-character hex SHA)"
"files": [
{
"path": "string (REQUIRED)",
"content": "string (OPTIONAL - required if oldPath not set)",
"encoding": "utf-8 | base64 (OPTIONAL - defaults to utf-8)",
"oldPath": "string (OPTIONAL - for move/rename operations)"
}
],
"deletedEntries": [
{
"path": "string (REQUIRED)"
}
],
"lfsFiles": [
{
"path": "string (REQUIRED - max 1000 chars)",
"oid": "string (OPTIONAL - required if oldPath not set, 64 hex chars)",
"algo": "sha256 (OPTIONAL - only sha256 supported)",
"size": "number (OPTIONAL - required if oldPath is set)",
"oldPath": "string (OPTIONAL - for move/rename operations)"
}
]
}
post/api/models/{namespace}/{repo}/commit/{rev}
Path parameters
namespacestring required
repostring required
revstring required
Query parameters
{"stackTrail":"paths:/api/models/{namespace}/{repo}/commit/{rev}:post:parameters:3:schema","oasType":"schema","type":"unknown","description":"Whether to create a pull request from the commit"}
{"stackTrail":"paths:/api/models/{namespace}/{repo}/commit/{rev}:post:parameters:4:schema","oasType":"schema","type":"unknown","description":"For Spaces, whether to try to hot reload the commit (only for single python files updates)"}
Headers
Content-Type'application/json' | 'application/x-ndjson'
application/x-ndjson if you to commit by json lines
Response
The response of the commit