Guides
Organise with folders
Keep API transcripts in folders that also show up in the ScribeFiles dashboard.
Code examples use API and HEADERS (headers in JavaScript), set up as in the Quickstart.
Why folders
Folders group transcripts by client, show or project. They're shared with the dashboard: a folder you create through the API shows up in the ScribeFiles sidebar, and the other way round.
Create a folder and send files to it
# Create the folder once
curl https://scribefiles.com/v1/folders \
-H "Authorization: Bearer $SCRIBEFILES_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Client interviews"}'
# Then send files straight into it
curl https://scribefiles.com/v1/transcripts \
-H "Authorization: Bearer $SCRIBEFILES_API_KEY" \
-F file=@call.mp3 \
-F folder_id=FOLDER_ID
folder = requests.post(f"{API}/folders", headers=HEADERS, json={"name": "Client interviews"}).json()
with open("call.mp3", "rb") as f:
requests.post(f"{API}/transcripts", headers=HEADERS, files={"file": f},
data={"folder_id": folder["id"]})
const folder = await (await fetch(`${API}/folders`, {
method: "POST",
headers: { ...headers, "Content-Type": "application/json" },
body: JSON.stringify({ name: "Client interviews" }),
})).json();
form.append("folder_id", String(folder.id));
await fetch(`${API}/transcripts`, { method: "POST", headers, body: form });
Folder names are unique per account (ignoring capitals): creating one that exists gives a 409 conflict. List your folders to find an existing one.
Move a transcript
Set folder_id with update, or set it to null to take the transcript out of its folder.
curl -X PATCH https://scribefiles.com/v1/transcripts/TRANSCRIPT_ID \
-H "Authorization: Bearer $SCRIBEFILES_API_KEY" \
-H "Content-Type: application/json" \
-d '{"folder_id": FOLDER_ID}'
requests.patch(f"{API}/transcripts/{transcript_id}", headers=HEADERS, json={"folder_id": folder["id"]})
await fetch(`${API}/transcripts/${transcriptId}`, {
method: "PATCH",
headers: { ...headers, "Content-Type": "application/json" },
body: JSON.stringify({ folder_id: folder.id }),
});
List what's in a folder
curl "https://scribefiles.com/v1/transcripts?folder_id=FOLDER_ID" \
-H "Authorization: Bearer $SCRIBEFILES_API_KEY"
items = requests.get(f"{API}/transcripts", headers=HEADERS, params={"folder_id": folder["id"]}).json()["data"]
const { data } = await (await fetch(`${API}/transcripts?folder_id=${folder.id}`, { headers })).json();
Deleting a folder
Deleting a folder never deletes transcripts: the ones inside simply leave the folder.
Questions about the API? Contact us.