DAW file sync
DAW file sync keeps a DAW's project folder (FL Studio first, through Freestyle for Mac) in step with a Freestyle project as immutable versions. A version is a manifest of files; each file is a content-addressed blob named by the SHA-256 of its bytes. File bytes never pass through the API: uploads go straight to storage with a short-lived signed URL, and downloads are a redirect to one.
Model and access
- Link: one per Freestyle project and DAW (
fl,logic,audacity,ableton,reaper). Creating it again returns the same link. - Version:
{versionId, linkId, parentVersionId, author{id, username}, deviceId, deviceName, daw, dawVersion, message, createdAt, size, seq, fork}plus itsmanifest.seqcounts 1, 2, 3… per link in server order. Versions are never changed or merged. - Fork: two versions with the same parent (two with no parent included) are both kept and both reported with
fork: true. Resolving a fork is the client's job: create a new version whose parent is the one you keep. - Roles come from the project's sharing settings, exactly as in the Studio: viewers read links, versions and file contents; editors and owners also create links and versions.
- Scopes: reads need
projects:read; creating links and versions needsprojects:write; uploads needmedia:upload. All routes need Freestyle Pro, like every Studio API v1 route.
Links
curl -X POST https://freestyle.audio/api/v1/sync/links \
-H "Authorization: Bearer $FREESTYLE_TOKEN" -H "Content-Type: application/json" \
-d '{"projectId": "<project_id>", "daw": "fl", "rootName": "Song.flp", "deviceId": "mac-1", "deviceName": "Studio Mac"}'
# 201 {"linkId", "projectId", "daw", "rootName", "role", "headVersionId": null, "versionCount": 0, "createdAt", "created": true}createSyncLink answers 201 the first time and 200 with created: false after that; a viewer gets 403 editor_required and a project you cannot see is 404. GET /api/v1/sync/links lists the links of every project you own or were invited to, and GET /api/v1/sync/projects/{project_id}/links those of one project. Both are oldest first and page with the standard {"data", "pagination": {"limit", "hasMore", "nextCursor"}} envelope: query limit (1–200, default 50) and cursor, where cursor is the previous page's pagination.nextCursor, an opaque value bound to that list (a cursor from another list is 400 invalid_cursor). Versions page differently (after, below).
Uploading files
Hash every file first. For each hash a version will reference:
- Open an upload session.
POST /api/v1/sync/blobs/{sha256}/uploadswith{"size": <bytes>}.200 {"state": "stored"}means the file is already available to you: skip it.201returnsuploadUrl(a signed URL for your own staging object, valid about 3600 s),uploadExpiresAt,blockSizeBytes(4 MiB),blockCountandmaxBlockCount. Calling it again for the same hash returns a fresh URL for the same staging object, so an interrupted upload resumes. - Upload straight to storage with the Azure Blob REST API on
uploadUrl(sendx-ms-version: 2021-08-06on every call). Small files can use onePUT; larger ones go in blocks:- Resume:
GET <uploadUrl>&comp=blocklist&blocklisttype=uncommittedlists the blocks storage already holds (a404means none). - Each block:
PUT <uploadUrl>&comp=block&blockid=<id>with the nextblockSizeBytesslice as the body. Block ids are base64 of a fixed-length string (all ids the same length), URL-encoded in the query. - Finish:
PUT <uploadUrl>&comp=blocklistwith<BlockList><Latest>id</Latest>…</BlockList>in order. - One shot (small or empty files):
PUT <uploadUrl>withx-ms-blob-type: BlockBloband the whole file.
DELETE /api/v1/sync/blobs/{sha256}/uploads(its blocks are discarded) or it expires after 7 days. Storage that holds more than the declared size is discarded. - Resume:
- Commit.
POST /api/v1/sync/blobs/{sha256}/commitchecks that the staging object exists with the declared size (409 upload_incompletebefore the block list is committed;409 size_mismatchif the size differs, in which case the staged bytes are discarded and you upload again) and verifies it. A file of at most 4 MiB is verified inside the commit request, which answers200 {"state": "stored"}or200 {"state": "rejected", "reason"}directly. Larger files are queued:202 {"state": "verifying"}. A small file can also answer202when the server is already verifying several files inline, or storage was briefly unavailable; treat it like a large one. - Wait for verification (after a
202).GET /api/v1/sync/blobs/{sha256}?wait=10long-polls: while the state isuploadingorverifyingthe answer is held until it changes orwaitseconds pass (at most 20), then the current state comes back. Withoutwaitit answers at once. At most 4 of your requests (and 32 on the server) wait at the same time; beyond that the answer is immediate, so just call again. Repeat untilstored, orrejectedwith areason:hash_mismatch,size_mismatch,executable_refused(native executables and#!scripts are not accepted),upload_missing,upload_modified(the staging object changed after the commit) orverification_failed. After a rejection, open a new session and upload again.
POST /api/v1/sync/blobs/9f86d0…/uploads {"size": 192000000}
← 201 {"state": "uploading", "uploadUrl": "https://…blob.core.windows.net/…?…", "blockSizeBytes": 4194304, …}
PUT <uploadUrl>&comp=block&blockid=YmxvY2stMDAwMDAw (4 MiB) … repeated
PUT <uploadUrl>&comp=blocklist <BlockList><Latest>YmxvY2stMDAwMDAw</Latest>…</BlockList>
POST /api/v1/sync/blobs/9f86d0…/commit
← 202 {"state": "verifying"} (a file of 4 MiB or less: 200 {"state": "stored"} here)
GET /api/v1/sync/blobs/9f86d0…?wait=10 (held until verification ends)
← 200 {"sha256": "9f86d0…", "size": 192000000, "state": "stored"}Privacy. The API never tells you whether someone else holds a file. A hash is available to you only when your own upload of it was verified, or a version of a project you can read references it. Otherwise you upload it, even if another account stored the same bytes.
Versions
POST /api/v1/sync/links/{link_id}/versions with {manifest, parentVersionId, message, daw, dawVersion, deviceId, deviceName?} answers 201 {versionId, createdAt, seq, fork}. The manifest is stored exactly as sent:
{"files": [{"path": "Song.flp", "size": 81234, "sha256": "…", "mode": "file"},
{"path": "Samples/kick.wav", "size": 412000, "sha256": "…", "mode": "file", "originalPath": "…"}],
"root": "Song.flp",
"meta": {"title": "Song", "tempo": 140, "channels": 12, "missingSamples": [], "factorySamples": [], "warnings": []}}- Paths are relative,
/-separated, with no empty,.or..segment, no backslash and no duplicates (compared ignoring case and Unicode normalization, as macOS does:A.flpanda.flpcollide);rootmust be one of the files; every file needs an integersizeand asha256. Otherwise400 invalid_manifest. At most 20000 files and 4 MiB of manifest JSON;messageat most 2000 characters. - Hashes that are not available to you:
409 blobs_missingwith the list inerror.details.missing. Upload those and retry. - A size that differs from the stored blob:
400 blob_size_mismatch. AparentVersionIdfrom another link:400 invalid_parent. A link holds at most 10000 versions (409 version_limit). The manifest's JSON bytes count toward the author's storage quota (429 upload_quota). - Send an
Idempotency-Keyso a retry after a lost response does not create a second version.
GET /api/v1/sync/links/{link_id}/versions?after=<versionId>&limit= lists versions oldest first (without manifests; limit 50 by default, at most 100), only those after after when given. This list takes no cursor: when pagination.hasMore is true, pass pagination.nextCursor (which is the last versionId of the page) as after. An after that is not a version of this link is 400 invalid_argument. GET /api/v1/sync/links/{link_id}/versions/{version_id} adds the manifest.
Downloading files
GET /api/v1/sync/blobs/{sha256}/content answers 302 with a Location on storage, valid for at most 600 s and served as an attachment. Follow it without the Authorization header; Range: bytes=N- works there for resuming. The redirect is only given when a version of a project you can read references the hash; otherwise 404.
Push: new versions and presence
Open one WebSocket to wss://<origin>/api/ws/daw-files with Authorization: Bearer <token> on the upgrade request (scope projects:read). Query parameters: linkId=a,b (optional; without it you follow every link of every project you own or were invited to, including links created later), deviceId and deviceName (shown in presence). A missing or invalid token is a plain 401; a missing scope is 403 insufficient_scope.
← {"type": "welcome", "linkIds": ["…"], "serverTime": 1763300000.12}
← {"type": "presence", "linkId": "…", "users": [{"id", "username", "deviceId", "deviceName"}, …]}
← {"type": "version.created", "linkId", "versionId", "projectId", "parentVersionId", "deviceId", "fork"}
→ {"type": "ping", "t0": 12.5}
← {"type": "pong", "t0": 12.5, "serverTime": …}presence is sent to the project's members (its owner and the people it is shared with) following a link whenever such a socket starts or stops following it. Someone who follows a public project's link by linkId without being a member gets version.created but no presence, and does not appear in it. A socket that follows everything picks up, without reconnecting and with an immediate presence, a project's first link as soon as createSyncLink creates it, also for a project created after the socket opened (for example by import_daw_project), and a project shared with you later together with its links; its version.created frames follow from then on. Access is re-checked when the project's sharing changes and at least every 60 s: a collaborator who was removed stops receiving events and leaves presence, and a revoked app gets an error frame authorization_revoked before the socket closes. Other errors: server_busy (more than 8 of your sockets, or the server is full), slow_consumer (your connection fell too far behind), peer_timeout and not_available. After a reconnect, catch up with listSyncVersions?after= the last version you know.
Updating the web Studio from a version
The server never imports versions into the Studio by itself. To make the Studio match an FL Studio project file, send the file to POST /api/v1/projects/{project_id}/daw-import/upload (scope media:upload, editor or owner, Pro) or MCP import_daw_project with project_id: {"format": "flp", "base64", "filename"}, at most 25 MB decoded (a .flp or a zipped loop package), scanned like any upload. The REST call is an upload: send an Idempotency-Key; it pays the upload admission (429 upload_concurrency / upload_quota) and its own budgets, 30 per hour per account and 20 per hour per project (429 rate_limited).
- Replaced, exactly as a new import creates them: lanes and clips (takes), patterns and their placements, buses and every plug-in chain (effects and instruments), the backing track (cleared: an imported project has none), the master level and the tempo, key and tempo map.
- Kept: the project itself (its id and sync links), title, artist, cover, notes, sharing and collaborators, saves, lyrics and chat. The old lanes and clips are retired, not destroyed.
- What can replace. FL Studio projects whose audio clips are not stretched or tempo-conformed. Anything else, and every Logic project, answers
400 replace_import_unsupportedand changes nothing; import those as a new project. - Undo. The replace writes a save of the project as it was, in the same transaction (named
Before importing <file name>):previousSaveId. It belongs to the project: the owner and every editor see it in the project's saves and canrestoreProjectSaveit (MCPrestore_project_save). The newest 5 of these per project are kept. A failed import changes nothing and leaves no save. - Open Studios. Every open Studio tab of the project, yours included, reconciles to the new contents at once. The live engine session, if one is open, reloads from the saved project in the background (
engine.reload: "scheduled"; one reload per project at a time); if that fails, the next open loads the new contents. While the project is recording it is not reloaded (engine.reload: "skipped",engine.notesays why).reloadEngineSessionreloads and waits. - Errors:
403 editor_required(viewers, or access lost during the import),404 not_found,400 invalid_argument(format or file name),400 replace_import_unsupported,400 idempotency_key_required,413 file_too_large,400 project_import_invalid,502 project_import_failedor the importer's ownflp_import_*code.
POST /api/v1/projects/<project_id>/daw-import/upload
Idempotency-Key: 6f1c…
{"format": "flp", "filename": "Song.flp", "base64": "RkxoZA…"}
← 200 {"ok": true, "created": false, "replaced": true, "format": "flp", "previousSaveId": "…",
"project": {…}, "projectUrl": "…", "engine": {"reload": "scheduled", …}, "warnings": […]}Errors
Every failure uses the Studio API error envelope: {"error": {"code", "message", "stage", "requestId", "details"?}}. code is the stable value to branch on; message is for people; stage is validation for refused input (every 400/409 here), auth for 401/403, rate_limit for 429; requestId (also the X-Request-Id header) is what to quote in a report. details is present only when the error carries data: blobs_missing has details.missing (the hashes to upload), size_mismatch on commit has details.declaredBytes and details.stagedBytes, upload_incomplete has details.retryAfterSec, a 503 has details.retryAfterSec plus Retry-After. Plain validation errors such as invalid_argument or invalid_manifest have no details; the message says what is wrong.
409 {"error": {"code": "blobs_missing", "message": "…", "stage": "validation",
"details": {"missing": ["9f86d0…"]}, "requestId": "…"}}
400 {"error": {"code": "invalid_manifest", "message": "…", "stage": "validation", "requestId": "…"}}Limits
| Limit | Value |
|---|---|
| Largest file | 8 GiB (413 file_too_large) |
| Storage per account (every file you uploaded and hold, uploads in progress and your version manifests) | 100 GiB (429 upload_quota) |
| Uploads in progress at once | 20 (429 upload_concurrency) |
| Commits per hour | 6000 |
| Verified inside the commit request | files up to 4 MiB |
getSyncBlob?wait= | at most 20 s; 4 waiting requests per account |
| Upload sessions never committed | removed after 7 days |
| Versions per link | 10000 (409 version_limit) |
| Files no version uses | deleted 30 days after their last upload (your quota is released) |
/api/ws/daw-files sockets | 8 per account |
Every call also pays the interactive rate budget described in Rate limits & errors.