v3
Drive

Get a signed URL for uploading a file to Definite Drive (API)

Generate a signed URL for directly uploading a file to Definite Drive (GCS).

Authenticate with your API key in the Authorization header:
`Authorization: Bearer <your-api-key>`

The file will be accessible in E2B sandboxes at `/home/user/drive/{path}`
via the gcsfuse mount. Files persist across sessions and are shared with all
team members.

**Example:**
```
POST /v3/drive/upload-url
Authorization: Bearer def-xxxx-your-api-key
Content-Type: application/json

{"path": "data/reports/q4-2024.csv"}
```
post/v3/drive/upload-url

Request body

pathstring nullable

Destination path within the drive (e.g., 'data/reports/q4.csv'). Required when temporary=False; ignored when temporary=True (the server chooses a path).

temporaryboolean

If True, the file is written under '_tmp/<date>/<uuid>/...' and auto-deleted after ttl_days via a GCS lifecycle rule on the bucket's customTime. path is ignored.

ttl_daysinteger

Only applies when temporary=True. Days until the temporary file is auto-deleted.

filename_hintstring nullable

Only applies when temporary=True. Suggested filename (preserves suffix for UX).

Response

Signed URL generated successfully

upload_urlstring required

Signed PUT URL for direct upload to GCS

http_methodstring

HTTP method to use with upload_url

headersobject

Headers that the client MUST send with the upload request. Includes Content-Type and, for temporary uploads, X-Goog-Custom-Time.

gcs_pathstring required

Full GCS path where the file will be stored

drive_pathstring required

Path in sandbox where the file will be accessible: /home/user/drive/{file_name}

expires_atstring date-time nullable

When the file will be auto-deleted. Only set for temporary uploads.

Changes

No recorded changes to this endpoint across all 1 revision of this API.