Skip to content

Knowledge Atlas files through the Biocompile API

Last updated

On this page

The Biocompile API works on your Knowledge Atlas files, the same files you see in the app. With files:read a token lists, reads and downloads them, and with files:write it uploads, creates folders, renames, moves and deletes. Every rule of the app applies, so you change only your own files.

The Knowledge Atlas is the file browser in Biocompile that shows your organization’s files, indexed folders and research records in one place and previews them in the browser.

File operations live under https://app.biocompile.com/api/v1/kh/files/. They have no organization in their path and act in the organization your token is pinned to. Pin your personal access token to one organization, or pass organization_id when you exchange it.

List and download files

GET /api/v1/kh/files/ lists the files you can read, a page at a time. path lists one folder’s direct children, and search filters by name:

curl -s "https://app.biocompile.com/api/v1/kh/files/?path=/projects/kinase-screen&per_page=50" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

GET /api/v1/kh/files/{file_id} returns one item’s details, and GET /api/v1/kh/files/{file_id}/download returns its bytes. Downloads support HTTP Range requests, so an interrupted download can resume.

Upload a file

Uploads are resumable, so a large file survives a dropped connection. An upload takes four steps:

  1. Start it with POST /api/v1/kh/files/uploads, giving the filename, the file_size and the target absolute_path. Result: the answer holds an upload ID and the chunk size.
  2. Send each chunk with PUT /api/v1/kh/files/uploads/{upload_id}/chunks/{chunk_index}.
  3. Finish with POST /api/v1/kh/files/uploads/{upload_id}/complete.
  4. Poll GET /api/v1/kh/files/uploads/{upload_id} until processing ends. Result: the status names the new file’s ID.

If the connection drops, read the upload’s status, send the missing chunks and complete it. DELETE /api/v1/kh/files/uploads/{upload_id} cancels an upload. When the name is already taken, on_conflict decides: overwrite (the default) stores a new version, rename keeps both and error refuses the upload.

Organize files

files:write also creates folders and renames, moves and deletes items:

OperationWhat it does
POST /api/v1/kh/files/foldersCreates a folder under path
PATCH /api/v1/kh/files/{file_id}/moveRenames or moves an item to new_path, with a folder’s contents
PATCH /api/v1/kh/files/{file_id}Changes a file’s description or tags
DELETE /api/v1/kh/files/{file_id}Moves an item to the trash, with a folder’s contents
curl -s --request PATCH "https://app.biocompile.com/api/v1/kh/files/$FILE_ID/move" \
  -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \
  -d '{"new_path": "/projects/kinase-screen/plate_reader_OD600_2026-03.csv"}'

A deleted item leaves every listing at once and is purged after your organization’s retention period. A delete is refused while a research record, a Run or a sandbox still uses the item.

Who may change what

The API allows exactly what the app allows:

  • You read files that are yours or shared with you, and change or delete only your own.
  • A colleague’s file answers 404 to a change, even when it is shared with you.
  • Read-only items, such as the outputs a Run keeps, cannot be moved, renamed or deleted.
  • Paths are absolute and start with /. Each name holds 1 to 255 characters and no / or \.

Common questions

Can a script upload large files to Biocompile?

Yes. Uploads are sent in chunks and can resume after a dropped connection, so file size is not limited by a single request.

Why does the file API answer 403 organization_required with a valid token?

The token is not pinned to an organization. Pin the personal access token, or pass organization_id when you exchange it. A service account token is always pinned.

Can a service account read every file?

A service account reads the files your organization makes visible to its members. Project grants do not narrow file access, so give files:read only to accounts that may see them.

Controller: Biocompile, Inc.

Your first project starts here.

Free to start, with credits included.

We use this address to prefill your signup. A founder may email you once to help you get started. No newsletter. Privacy Policy

Already have an account? Sign in