Authentication
All Drive API endpoints require a Bearer token in theAuthorization header:
Base URL
Rate Limits
| Endpoint | Limit |
|---|---|
POST /drive/upload | 100 requests per minute |
GET /drive/download | 500 requests per minute |
GET /drive/list | 300 requests per minute |
POST /drive/folders | 100 requests per minute |
DELETE /drive/folders | 50 requests per minute |
429 Too Many Requests. Check the Retry-After response header for the number of seconds to wait before retrying.
Endpoint Summary
| Action | Method | Endpoint |
|---|---|---|
| Upload files | POST | /drive/upload |
| Download a file | GET | /drive/download |
| List folder contents | GET | /drive/list |
| Create a folder | POST | /drive/folders |
| Delete a folder | DELETE | /drive/folders |
POST /drive/upload
Upload one or more files to Drive. Each file can be placed at a specific path using themetadata array.
Request
Parameters
One or more files sent as multipart form data fields. Each file corresponds by index to an entry in the
metadata array.A JSON array of metadata objects, one per file, controlling where each file is stored. If omitted, files are stored at the root using their original filenames.
Metadata Object Fields
Fully qualified destination path, for example
/reports/2024/q1.pdf. Takes the highest priority when resolving the file location.Destination folder path, for example
/reports/2024. Combined with name if both are provided.Destination filename, for example
q1-report.pdf. Combined with folder if provided, otherwise stored at the root.Path Resolution Priority
For each file at indexi, the destination path is resolved in this order:
| Priority | Condition | Result |
|---|---|---|
| 1 | path is set | Use path as the fully qualified location |
| 2 | folder + name both set | {folder}/{name} |
| 3 | folder only | {folder}/{original_filename} |
| 4 | name only | /{name} (root) |
| 5 | Neither set | /{original_filename} (root) |
Response
200 OK
Unique identifier for the uploaded file.
Stored filename.
Full path where the file was stored in Drive.
Direct URL to access the file content.
File size in bytes.
ISO 8601 timestamp of when the file was created.
Examples
GET /drive/download
Download a single file from Drive. Returns the raw file content as a binary stream.Request
Query Parameters
Fully qualified file path, for example
/reports/report.pdf. Use this or name + folder — not both.Filename to retrieve, for example
report.pdf. Must be used together with folder.Folder to search within, for example
/reports. Must be used together with name.Provide either
path alone, or both name and folder together. The request returns 400 Bad Request if neither combination is supplied.Response
200 OK — Returns the file content as a binary stream. Response headers include:
Examples
GET /drive/list
List the files and subfolders within a Drive folder. Defaults to the root folder if nofolder is specified.
Request
Query Parameters
Folder path to list, for example
/reports. Defaults to root (/) if omitted.When
true, returns all nested files and folders at every depth within the target folder.Response
200 OK
The folder path that was listed.
Files directly inside the folder. Includes all nested files when
recursive: true.Unique file identifier.
Filename.
Full path to the file in Drive.
File size in bytes.
ISO 8601 creation timestamp.
Immediate subfolders within the listed folder.
Unique folder identifier.
Folder name.
Full folder path in Drive.
Examples
POST /drive/folders
Create a new folder in Drive. Intermediate parent folders are created automatically if they do not already exist.Request
Request Body
Full path for the new folder, for example
/reports/2024/q1. Intermediate folders are created automatically.Response
200 OK
Unique identifier for the created folder.
Full path of the created folder.
ISO 8601 creation timestamp.
Examples
DELETE /drive/folders
Delete a folder from Drive. By default, deletion fails if the folder contains files or subfolders. Setrecursive: true to force deletion of all contents.
Request
Query Parameters
Full path of the folder to delete, for example
/reports/archived.When
true, deletes all files and subfolders within the target folder. When false and the folder is non-empty, the request returns 409 Conflict.Response
200 OK
true if deletion succeeded.Path of the deleted folder.
Number of files deleted, including files in subfolders when
recursive: true.Examples
Error Handling
All Drive API errors follow a consistent JSON structure:HTTP Status Codes
| Status | Code | Description |
|---|---|---|
200 | — | Request succeeded |
400 | bad_request | Malformed request — missing required fields or invalid JSON |
401 | unauthorized | Missing or invalid API key |
404 | not_found | The specified file or folder does not exist |
409 | conflict | Attempted to delete a non-empty folder without recursive: true |
422 | validation_error | Request parameters failed validation; message describes the invalid parameter |
429 | rate_limited | Too many requests; check Retry-After header |
500 | internal_error | Unexpected server error; contact Scout support if it persists |
Common Error Scenarios
Missing required parameter (422)Next Steps
Drive Overview
Learn how Drive works, common use cases, and how to give agents file access.
Databases Overview
Use Databases for structured data and semantic search across your agent’s knowledge base.