Drive API

Base path: https://developerapi.motaware.com/drive/v1

Scopes: drive.read for the GET routes, drive.write for everything else (it also allows reads). The person's Motaware plan must include Drive, otherwise the answer is 403 entitlement.app_unavailable. On a lapsed plan reads and downloads keep working and changes get 403.

Endpoints

MethodPathPurpose
GET/foldersTop-level folders
POST/foldersCreate a folder: { "name", "parentId"? }
GET/folders/{id}A folder with its subfolders, files and breadcrumb
PATCH/folders/{id}Rename, move or star: { "name"?, "parentId"?, "moveToRoot"?, "isStarred"? }
DELETE/folders/{id}Move a folder to the trash
POST/folders/{id}/restoreRestore a folder from the trash
GET/filesFiles in a folder (folderId; none = top level), paged
GET/files/recent?count=30Recently used files
GET/files/starredStarred files and folders
POST/files/uploadUpload a file (multipart, up to 1 GB)
GET/files/{id}One file with details
PATCH/files/{id}Rename, move, describe or star: { "name"?, "folderId"?, "moveToRoot"?, "description"?, "isStarred"? }
DELETE/files/{id}Move a file to the trash
POST/files/{id}/restoreRestore a file from the trash
GET/files/{id}/downloadA short-lived download link
GET/search?q=&type=Search names; type one of images, videos, audio, pdfs, documents, archives, folders
GET/trashItems in the trash
GET/storageStorage used and quota, by file type

Folders and files

There's no root folder object: the top level is folderId / parentId null. To move to the top level, send {"moveToRoot": true}. DELETE moves items to the trash; restore them with /restore.

Folder fields: id, name, parentId, ownerName, fileCount, subFolderCount, permission, isStarred, createdAt, updatedAt, deletedAt. File fields: id, name, mimeType, sizeBytes, ownerName, folderId, folderName, description, isStarred, status, permission, canDownload, createdAt, updatedAt, lastAccessedAt, deletedAt; the detail adds versionCount, commentCount, shareCount, folderPath, tags.

GET /files takes pageNumber, pageSize (default 20), sortBy and sortDescending. Folder contents, search, trash, recent and starred return everything.

Uploading

Send multipart/form-data with the file in file and optionally folderId, relativePath (creates the folders in it) and conflict: keepboth (default) or replace (adds a new version of a file with the same name). One request, up to 1 GB.

Every upload is virus-scanned before it's stored, which can take a while for large files. Possible refusals: 413 over the plan's storage quota, 422 the file is infected, 503 the scanner is unavailable (try again later).

Downloading

GET /files/{id}/download returns { url, inline, previewKind, expiresAt }. url is an absolute https://drive.motaware.com/… link that works without credentials for about 15 minutes and supports Range requests. Fetch it right away and don't store or share it.

Examples

curl -X POST https://developerapi.motaware.com/drive/v1/files/upload \
  -H "Authorization: Bearer $MOTAWARE_API_KEY" \
  -F "file=@report.pdf" -F "folderId={folderId}"

curl https://developerapi.motaware.com/drive/v1/files/{id}/download \
  -H "Authorization: Bearer $MOTAWARE_API_KEY"

Not available yet

Sharing and public links, comments, versions, tags, copying, zip downloads, permanent deletion and emptying the trash.