Drives and ids
There are two kinds of drive:- Your Drive is personal. It holds your own files and folders, plus what others have shared with you and the folders of projects you are in.
- Shared drives belong to a team. What you can do in one depends on your role in it.
Every item has
permission, your access to it, and canEdit, whether you can rename, move or add to it:
- Your Drive:
owner,admin,editor,commenterorviewer, from a share, a folder above it or a project. Owners, admins and editors can change things. - Shared drives: your role. Managers and contributors can add and change files; commenters and viewers can only read.
Browse
GET /v1/drive/items lists the root of your Drive. Folders come first, then files, each by name.
GET /v1/drive/shared-drives lists the shared drives you are a member of, with your role.
Read a file
GET /v1/drive/files/{driveFileId} returns a file’s metadata. GET /v1/drive/files/{driveFileId}/content returns a pre-signed download URL, valid for 15 minutes, and for text files the start of the content inline:
- Text files include CSV, TSV, SDF, PDB, XYZ and FASTA. Other files have
content: null; download them fromurl. contentholds whole lines, up tomaxBytes(256 KB by default, up to 1 MB).- For CSV and TSV,
rowscaps the data rows after the header (200 by default, up to 10,000). truncatedsays the file goes on; download the rest fromurl.
Use a Drive file as a run input
Pass a Drive file id where a run takes a file id, the same way as an upload’sfile_… id:
- Any file you can read works:
dfile_…from your Drive or shared with you, orsdfile_…from a shared drive. - The key needs
data:readas well asruns:write. - The engine’s input formats and size limits apply as for uploads.
GET /v1/engines/{engine}lists them. - The run gets its own copy of the file when it starts. Changing, moving or trashing the Drive file afterwards doesn’t change the run.
Upload a file
Uploading into Drive takes three requests: reserve the file,PUT the bytes, then complete it.
- The first response has the file’s id, its final
nameand theuploadto make. Send thePUTbeforeupload.expiresAt. - Complete checks the bytes are in place and the size matches. Until the
PUThas finished it answers409 CONFLICT. Calling it again returns the file. - Leave out
folderIdfor the root. For a shared drive, give ansdfld_…folder or adriveId. - If a file with that name is already there, it is renamed
name (1),name (2)and so on. Send"onConflict": "error"to get409 CONFLICTinstead.
Save an upload or a run output to Drive
POST /v1/drive/import copies an upload or a run’s output into Drive as a new file, so it shows in the web app:
name renames the copy, and onConflict works as for uploads. The copy is independent of the original.
Organize
- Create a folder:
POST /v1/drive/folderswith aname, and aparentIdordriveId. Names must be unique in their folder; a duplicate answers409 CONFLICT. - Rename or move:
PATCH /v1/drive/items/{itemId}with a newname, aparentIdto move it into (nullfor the root), or both. You need edit access to the item and the destination. Items move only within the same drive: not between your Drive and a shared drive. Items linked to a project stay in that project. - Trash:
DELETE /v1/drive/items/{itemId}moves a file or folder, with everything in it, to the trash. Restore it from the web app’s Trash. In your Drive it needs edit access. In a shared drive, managers can trash anything and contributors only files they added.
Limits
Not in this version
- Sharing Drive items, and managing shared-drive members.
- Restoring from the trash, and deleting permanently. Use the web app.
- Moving items between your Drive and a shared drive.
- Format conversions (RevScan) and editing (RevEdit).
Scopes
MCP tools
create_run accepts Drive file ids in inputs. For example: “Dock the ligands in screening/round3.sdf into my KRAS structure with RevScreen, then save the top hits to the same folder.” See the tools reference for each tool’s arguments.
