Commits
Create commit
Commit confirmed file versions with a message. The array is `fileVersions`, and each entry carries the `version` you confirmed plus an action of add, modify, or delete. Commits are sequentially numbered per project; the response returns `sequenceNum` and HTTP 201. Max 25,000 files per request — for larger pushes use the draft-commit endpoints, which stage refs across many calls and finalize them as one atomic commit. Send `X-Idempotency-Key` to make a retry safe. A 409 with `code: "file_locked"` means a teammate holds a lock on one of the files.
/api/v1/projects/{projectId}/commitsRequest
{
"message": "Updated hero animations",
"branch": "main",
"fileVersions": [
{ "fileId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "version": 12, "action": "modify" },
{ "fileId": "9c0f1a77-4e2b-4d18-b3aa-51c7e9d0b246", "version": 1, "action": "add" }
]
}Response
{
"id": "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
"sequenceNum": 25,
"message": "Updated hero animations",
"fileCount": 2
}Examples
curl -X POST https://usourcecontrol.com/api/v1/projects/7c9e6679-7425-40de-944b-e07fc1f90ae7/commits \
-H "Authorization: Bearer usc_your_project_key" \
-H "Content-Type: application/json" \
-H "X-Idempotency-Key: 8f14e45f-ceea-467a-9f6b-1d3c2b7a5e90" \
-d '{
"message": "Updated hero animations",
"fileVersions": [
{ "fileId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "version": 12, "action": "modify" },
{ "fileId": "9c0f1a77-4e2b-4d18-b3aa-51c7e9d0b246", "version": 1, "action": "add" }
]
}'Try it
Kept in this tab only, sent straight to the API, and never to our servers. Create one in your project’s settings.
This is a POST request against the live API. It will really run, on the real project the key belongs to.