REST API Reference
The V1 API powers the desktop app and supports custom integrations. Every endpoint includes curl, TypeScript, and JSON examples you can copy directly.
Authentication
All API requests require a project key sent via the Authorization header. Keys use the usc_ prefix and can be generated from the web dashboard under project settings.
Base URL
https://usourcecontrol.comAuth header
Bearer usc_...Content type
application/jsoncurl -X POST https://usourcecontrol.com/api/v1/auth/validate-key \
-H "Authorization: Bearer usc_your_project_key" \
-H "Content-Type: application/json"Endpoints
/api/v1/auth/validate-keyValidate project key
Authenticate a project key and receive project metadata including project ID, name, organization, and storage configuration.
curl -X POST https://usourcecontrol.com/api/v1/auth/validate-key \
-H "Authorization: Bearer usc_your_project_key" \
-H "Content-Type: application/json"{
"project": {
"id": "proj_abc123",
"name": "MyGame",
"orgId": "org_xyz789",
"orgName": "My Studio"
}
}const res = await fetch("https://usourcecontrol.com/api/v1/auth/validate-key", {
method: "POST",
headers: {
"Authorization": "Bearer usc_your_project_key",
"Content-Type": "application/json",
},
});
const { project } = await res.json();
console.log(project.name); // "MyGame"/api/v1/projects/{id}/syncSync file status
Compare local file hashes against remote to determine which files need uploading or downloading. Send an array of local file paths and their SHA-256 hashes.
curl -X POST https://usourcecontrol.com/api/v1/projects/proj_abc123/sync \
-H "Authorization: Bearer usc_your_project_key" \
-H "Content-Type: application/json" \
-d '{
"files": [
{ "path": "Content/Maps/MainLevel.umap", "hash": "a1b2c3..." },
{ "path": "Content/Characters/Hero.uasset", "hash": "d4e5f6..." }
]
}'{
"files": [
{ "path": "Content/Maps/MainLevel.umap", "hash": "a1b2c3..." },
{ "path": "Content/Characters/Hero.uasset", "hash": "d4e5f6..." }
]
}{
"toUpload": ["Content/Maps/MainLevel.umap"],
"toDownload": ["Content/Characters/Enemy.uasset"],
"conflicts": [],
"upToDate": ["Content/Characters/Hero.uasset"]
}const res = await fetch(`https://usourcecontrol.com/api/v1/projects/${projectId}/sync`, {
method: "POST",
headers: {
"Authorization": `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
files: localFiles.map(f => ({ path: f.path, hash: f.sha256 })),
}),
});
const { toUpload, toDownload, conflicts } = await res.json();/api/v1/projects/{id}/files/uploadInitiate file upload
Request a presigned upload URL for a file. Upload the file directly to storage using the returned URL, then call the confirm endpoint. Max file size: 10 GB.
curl -X POST https://usourcecontrol.com/api/v1/projects/proj_abc123/files/upload \
-H "Authorization: Bearer usc_your_project_key" \
-H "Content-Type: application/json" \
-d '{
"path": "Content/Maps/MainLevel.umap",
"hash": "a1b2c3...",
"size": 524288000
}'{
"path": "Content/Maps/MainLevel.umap",
"hash": "a1b2c3...",
"size": 524288000
}{
"uploadUrl": "https://storage.bunnycdn.com/...",
"fileId": "file_abc123",
"confirmUrl": "/api/v1/projects/{id}/files/upload/confirm"
}// Step 1: Get presigned URL
const initRes = await fetch(`https://usourcecontrol.com/api/v1/projects/${projectId}/files/upload`, {
method: "POST",
headers: { "Authorization": `Bearer ${apiKey}`, "Content-Type": "application/json" },
body: JSON.stringify({ path: "Content/Maps/MainLevel.umap", hash, size }),
});
const { uploadUrl, fileId, confirmUrl } = await initRes.json();
// Step 2: Upload file to storage
await fetch(uploadUrl, { method: "PUT", body: fileBuffer });
// Step 3: Confirm upload
await fetch(`https://usourcecontrol.com${confirmUrl}`, {
method: "POST",
headers: { "Authorization": `Bearer ${apiKey}`, "Content-Type": "application/json" },
body: JSON.stringify({ fileId }),
});/api/v1/projects/{id}/commitsCreate commit
Batch-commit uploaded files with a message. All files must be confirmed before committing. Commits are sequentially numbered per project. Max 10,000 files per commit.
curl -X POST https://usourcecontrol.com/api/v1/projects/proj_abc123/commits \
-H "Authorization: Bearer usc_your_project_key" \
-H "Content-Type: application/json" \
-d '{
"message": "Updated hero animations",
"files": [
{ "fileId": "file_abc123", "action": "modified" },
{ "fileId": "file_def456", "action": "added" }
]
}'{
"message": "Updated hero animations",
"files": [
{ "fileId": "file_abc123", "action": "modified" },
{ "fileId": "file_def456", "action": "added" }
]
}{
"commit": {
"id": "commit_abc123",
"number": 25,
"message": "Updated hero animations",
"fileCount": 2,
"createdAt": "2026-04-16T14:30:00Z"
}
}const res = await fetch(`https://usourcecontrol.com/api/v1/projects/${projectId}/commits`, {
method: "POST",
headers: { "Authorization": `Bearer ${apiKey}`, "Content-Type": "application/json" },
body: JSON.stringify({
message: "Updated hero animations",
files: uploadedFiles.map(f => ({ fileId: f.id, action: f.action })),
}),
});
const { commit } = await res.json();
console.log(`Commit #${commit.number} created`);/api/v1/projects/{id}/files/{fileId}/versionsList file versions
Retrieve every version of a file with download URLs and metadata. Versions are ordered from newest to oldest.
curl -X GET https://usourcecontrol.com/api/v1/projects/proj_abc123/files/file_abc123/versions \
-H "Authorization: Bearer usc_your_project_key"{
"versions": [
{
"version": 12,
"hash": "a1b2c3...",
"size": 524288000,
"downloadUrl": "https://cdn.usourcecontrol.com/...",
"uploadedBy": "Sarah Chen",
"createdAt": "2026-04-16T14:30:00Z"
}
]
}const res = await fetch(
`https://usourcecontrol.com/api/v1/projects/${projectId}/files/${fileId}/versions`,
{ headers: { "Authorization": `Bearer ${apiKey}` } },
);
const { versions } = await res.json();
const latest = versions[0];
console.log(`v${latest.version} — ${latest.uploadedBy}`);/api/v1/projects/{id}/restoreRestore file version
Restore one or more files to a previous version. This creates new versions with the restored content, preserving history.
curl -X POST https://usourcecontrol.com/api/v1/projects/proj_abc123/restore \
-H "Authorization: Bearer usc_your_project_key" \
-H "Content-Type: application/json" \
-d '{
"files": [
{ "fileId": "file_abc123", "version": 8 }
]
}'{
"files": [
{ "fileId": "file_abc123", "version": 8 }
]
}{
"restored": [
{
"fileId": "file_abc123",
"previousVersion": 12,
"restoredVersion": 8,
"newVersion": 13
}
]
}const res = await fetch(`https://usourcecontrol.com/api/v1/projects/${projectId}/restore`, {
method: "POST",
headers: { "Authorization": `Bearer ${apiKey}`, "Content-Type": "application/json" },
body: JSON.stringify({
files: [{ fileId: "file_abc123", version: 8 }],
}),
});
const { restored } = await res.json();
console.log(`Restored to v${restored[0].restoredVersion}, new version: v${restored[0].newVersion}`);