---
title: "Files through the Biocompile API"
description: "Read published Biocompile files by identifier, and upload, rename, move, replace and delete files as drafts in a workbench through the API."
url: https://www.biocompile.com/docs/api-files/
section: "API and integrations"
last_updated: 2026-11-20
app_url: https://app.biocompile.com/workbenches
---

# Files through the Biocompile API

> Read published Biocompile files by identifier, and upload, rename, move, replace and delete files as drafts in a workbench through the API.

Source: https://www.biocompile.com/docs/api-files/. Index of all Biocompile documentation: https://www.biocompile.com/docs/index.md

A file in Biocompile is a record of the project like a hypothesis: it has an identifier
(`fil_…`), and every contribution that changes it publishes a new revision (`fil_ab12.3`) that
never changes. With `files:read` a token reads published files and the files in your
workbenches. With `files:write` it uploads, renames, moves, replaces and deletes files as
drafts in a workbench, which reach the project when you contribute them.

Paths start with `/api/v1/organizations/{organization_id}`.

## Read a published file

`GET .../files/{ref}` returns a file's details: its name, folder, media type, description,
tags and revision. `GET .../files/{ref}/content` returns its bytes. Add `?revision=N` to read an
older revision:

```bash
curl -s "https://app.biocompile.com/api/v1/organizations/$ORG_ID/files/fil_cd34/content?revision=2" \
  -H "Authorization: Bearer $ACCESS_TOKEN" -o plate_reader.csv
```

## Work with files in a workbench

`GET .../workbenches/{workbench_id}/files` shows the workbench as one tree: its drafts over the
bound project's published files, each with a `state` (`published`, `draft_new`, `draft_edit`
or `draft_delete`).

| Operation | What it does |
|---|---|
| `POST .../workbenches/{workbench_id}/files` | Uploads a file as a new draft with its own identifier |
| `PATCH .../workbenches/{workbench_id}/files/{ref}` | Renames, moves, describes or tags a file, as a draft |
| `PUT .../workbenches/{workbench_id}/files/{ref}/content` | Replaces a file's content, as a draft |
| `DELETE .../workbenches/{workbench_id}/files/{ref}` | Discards a new file's draft, or drafts the deletion of a published file |
| `GET .../workbenches/{workbench_id}/files/{ref}/content` | The bytes as the workbench sees them |

```bash
curl -s --request POST "https://app.biocompile.com/api/v1/organizations/$ORG_ID/workbenches/$WORKBENCH_ID/files" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -F "file=@plate_reader_OD600_2026-03.csv" -F "path=/raw" -F "description=March plate reader"
```

One upload is one request of at most 512 MiB. Nothing changes for anyone else until you
contribute the drafts. A deleted file leaves the project then, and its published revisions
stay citable.

## Who may change what

- A workbench is yours: other people get `404` for it.
- You read the published files of projects you can open.
- A file a Run or a paper contains is never changed in place: changing it makes a copy.

## Common questions

### Where did the folder and resumable upload operations go?

Files are records of the research project now, so they are changed as drafts in a workbench.
Folders are a file's `path`, and an upload is one request.

### Can a service account upload files?

Yes, into its own workbenches. A person contributes them to the project.

## Related

- [Change a project through the API](https://www.biocompile.com/docs/api-workbenches.md)
- [API authentication](https://www.biocompile.com/docs/api-authentication.md)
- [Run analyses and approve spending](https://www.biocompile.com/docs/api-runs-and-spending.md)
- [Biocompile API reference](https://www.biocompile.com/docs/api-reference.md)

## Get access to Biocompile

Biocompile is used in the browser at https://app.biocompile.com. It is free to start and no payment method is required: sign up at https://app.biocompile.com/signup?mc_cta=docs-md&mc_path=/docs/api-files.md. If your team already uses Biocompile, ask an organization admin to invite you. Research teams that want hands-on setup can apply for the founder-led pilot at https://www.biocompile.com/pilot/. Questions: https://www.biocompile.com/contact/.
