Drive
16 routes. Paths are relative to https://api.intersink.com/v1.
- GET/drive/filesList
- GET/drive/files/{id}Get one
- PATCH/drive/files/{id}Update
- DELETE/drive/files/{id}Remove
- GET/drive/files/quotaQuota
- POST/drive/files/uploadUpload
- GET/drive/foldersList
- POST/drive/foldersCreate
- GET/drive/folders/{id}Contents
- PATCH/drive/folders/{id}Update
- DELETE/drive/folders/{id}Remove
- GET/drive/folders/{id}/propertiesProperties
- POST/drive/profile/coverSet cover
- DELETE/drive/profile/coverRemove cover
- POST/drive/profile/pfpSet pfp
- DELETE/drive/profile/pfpRemove pfp
List
GET/drive/files
Needs a signed-in user (Bearer token or access_token cookie).
All the caller's files (no filter = every source), paginated.
Parameters
| Name | Type | Description |
|---|---|---|
| folder_id | number, query | Minimum 1. |
| profile_id | string, query | |
| source_type | string, query | |
| file_category | string, query | |
| page | number, query | Minimum 1. |
| limit | number, query | Minimum 1. |
Response
200. The payload in data is not described in the spec yet.
Get one
GET/drive/files/{id}
Needs a signed-in user (Bearer token or access_token cookie).
One file's metadata + serving URL (+ size / size_human). id = INTEGER.
Parameters
| Name | Type | Description |
|---|---|---|
| idrequired | number, path |
Response
200. The payload in data is not described in the spec yet.
Update
PATCH/drive/files/{id}
Needs a signed-in user (Bearer token or access_token cookie).
Rename a file. id = INTEGER.
Parameters
| Name | Type | Description |
|---|---|---|
| idrequired | number, path |
Request body application/json
| Field | Type | Description |
|---|---|---|
| name | string | At most 255 characters. |
| folder_id | number | Minimum 1. |
Response
200. The payload in data is not described in the spec yet.
Remove
DELETE/drive/files/{id}
Needs a signed-in user (Bearer token or access_token cookie).
Delete a file (rebuilt R2 path + record + storage decrement). id = INTEGER.
Parameters
| Name | Type | Description |
|---|---|---|
| idrequired | number, path |
Response
200. The payload in data is not described in the spec yet.
Quota
GET/drive/files/quota
Needs a signed-in user (Bearer token or access_token cookie).
The caller's storage use and limit (bytes, plus human sizes).
Response
200. The payload in data is not described in the spec yet.
Upload
POST/drive/files/upload
Needs a signed-in user (Bearer token or access_token cookie).
POST /drive/files/upload, multipart/form-data: a file part + optional text
fields (source_type, folder_id, filename) sent BEFORE the file. The backend
streams the bytes to R2; size + category are derived server-side.
Response
201. The payload in data is of type object.
List
GET/drive/folders
Needs a signed-in user (Bearer token or access_token cookie).
Folders at a level (root by default, or under ?parent_folder_id=). Optional ?profile_id= narrows to one of the caller's profiles.
Parameters
| Name | Type | Description |
|---|---|---|
| parent_folder_id | number, query | Minimum 1. |
| profile_id | string, query |
Response
200. The payload in data is not described in the spec yet.
Create
POST/drive/folders
Needs a signed-in user (Bearer token or access_token cookie).
Create a folder (no R2 write).
Request body application/json
| Field | Type | Description |
|---|---|---|
| namerequired | string | At most 120 characters. |
| parent_folder_id | number | Minimum 1. |
Response
201. The payload in data is not described in the spec yet.
Contents
GET/drive/folders/{id}
Needs a signed-in user (Bearer token or access_token cookie).
A folder + its contents (subfolders + files, each with a serving URL).
Parameters
| Name | Type | Description |
|---|---|---|
| idrequired | number, path |
Response
200. The payload in data is not described in the spec yet.
Update
PATCH/drive/folders/{id}
Needs a signed-in user (Bearer token or access_token cookie).
Rename and/or move a folder (parent_folder_id:null → root; cycle-guarded).
Parameters
| Name | Type | Description |
|---|---|---|
| idrequired | number, path |
Request body application/json
| Field | Type | Description |
|---|---|---|
| name | string | At most 120 characters. |
| parent_folder_id | number | Minimum 1. |
Response
200. The payload in data is not described in the spec yet.
Remove
DELETE/drive/folders/{id}
Needs a signed-in user (Bearer token or access_token cookie).
Delete a folder and CASCADE (subtree records; files when linking exists).
Parameters
| Name | Type | Description |
|---|---|---|
| idrequired | number, path |
Response
200. The payload in data is not described in the spec yet.
Properties
GET/drive/folders/{id}/properties
Needs a signed-in user (Bearer token or access_token cookie).
Folder properties: on-demand recursive total_size / file_count / folder_count.
Parameters
| Name | Type | Description |
|---|---|---|
| idrequired | number, path |
Response
200. The payload in data is not described in the spec yet.
Set cover
POST/drive/profile/cover
Needs a signed-in user (Bearer token or access_token cookie).
Request body application/json
| Field | Type | Description |
|---|---|---|
| profile_idrequired | string | |
| file_idrequired | number | Id of a file the caller already uploaded (file.id is an INTEGER). Minimum 1. |
Response
200. The payload in data is not described in the spec yet.
Remove cover
DELETE/drive/profile/cover
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| profile_idrequired | string, query |
Response
200. The payload in data is not described in the spec yet.
Set pfp
POST/drive/profile/pfp
Needs a signed-in user (Bearer token or access_token cookie).
Request body application/json
| Field | Type | Description |
|---|---|---|
| profile_idrequired | string | |
| file_idrequired | number | Id of a file the caller already uploaded (file.id is an INTEGER). Minimum 1. |
Response
200. The payload in data is not described in the spec yet.
Remove pfp
DELETE/drive/profile/pfp
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| profile_idrequired | string, query |
Response
200. The payload in data is not described in the spec yet.