Skip to main content
Scout Drive exposes a REST API for all file and folder operations. Every endpoint requires authentication and returns consistent JSON responses. This reference covers each endpoint in full — parameters, response shapes, curl examples, and SDK equivalents — so you can integrate Drive into any application or automate file management in your agents and workflows.

Authentication

All Drive API endpoints require a Bearer token in the Authorization header:
You can generate and manage API keys under Settings → API Keys in the Scout dashboard.

Base URL

Rate Limits

When you exceed a rate limit, the API returns 429 Too Many Requests. Check the Retry-After response header for the number of seconds to wait before retrying.

Endpoint Summary


POST /drive/upload

Upload one or more files to Drive. Each file can be placed at a specific path using the metadata array.

Request

Parameters

file[]
required
One or more files sent as multipart form data fields. Each file corresponds by index to an entry in the metadata array.
JSON string
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

string
Fully qualified destination path, for example /reports/2024/q1.pdf. Takes the highest priority when resolving the file location.
string
Destination folder path, for example /reports/2024. Combined with name if both are provided.
string
Destination filename, for example q1-report.pdf. Combined with folder if provided, otherwise stored at the root.

Path Resolution Priority

For each file at index i, the destination path is resolved in this order:

Response

200 OK
string
Unique identifier for the uploaded file.
string
Stored filename.
string
Full path where the file was stored in Drive.
string
Direct URL to access the file content.
integer
File size in bytes.
string
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

string
Fully qualified file path, for example /reports/report.pdf. Use this or name + folder — not both.
string
Filename to retrieve, for example report.pdf. Must be used together with folder.
string
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 no folder is specified.

Request

Query Parameters

string
default:"/"
Folder path to list, for example /reports. Defaults to root (/) if omitted.
boolean
default:"false"
When true, returns all nested files and folders at every depth within the target folder.

Response

200 OK
string
The folder path that was listed.
array
Files directly inside the folder. Includes all nested files when recursive: true.
string
Unique file identifier.
string
Filename.
string
Full path to the file in Drive.
integer
File size in bytes.
string
ISO 8601 creation timestamp.
array
Immediate subfolders within the listed folder.
string
Unique folder identifier.
string
Folder name.
string
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

string
required
Full path for the new folder, for example /reports/2024/q1. Intermediate folders are created automatically.

Response

200 OK
string
Unique identifier for the created folder.
string
Full path of the created folder.
string
ISO 8601 creation timestamp.

Examples


DELETE /drive/folders

Delete a folder from Drive. By default, deletion fails if the folder contains files or subfolders. Set recursive: true to force deletion of all contents.
Deletion is permanent. Files and folders removed with this endpoint cannot be recovered. Use the archive pattern — move files to /archive/... — if you want to preserve history.

Request

Query Parameters

string
required
Full path of the folder to delete, for example /reports/archived.
boolean
default:"false"
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
boolean
true if deletion succeeded.
string
Path of the deleted folder.
integer
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

Common Error Scenarios

Missing required parameter (422)
File not found (404)
Non-empty folder without recursive flag (409)
Rate limit exceeded (429)

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.