API ReferenceSessions (prev Tool Router)
Create a presigned upload URL for a mount filev3.1
Generates a presigned upload URL for uploading a file to a workbench session mount. The caller should PUT the file content directly to the returned URL.
Authorization
ApiKeyAuth x-api-key<token>
Project API key authentication
In: header
Path Parameters
session_idstringRequired
The unique identifier of the tool router session
Format:
toolRouterSessionIdmount_idstringRequired
ID of the storage mount
Request Body
application/json
mount_relative_pathstringRequired
Supports subdirectories (e.g. "data/output.csv", "images/charts/chart.png")
mimetypestring
MIME type of the file being uploaded
Response Body
application/json
application/json
application/json
application/json
application/json
import requestsurl = "https://example.com/api/v3.1/tool_router/session/trs_1a2b3c4d5e6f/mounts/files/upload_url"body = """{ "mount_relative_path": "report.pdf"}"""response = requests.request("POST", url, data = body, headers = { "Content-Type": "application/json"})print(response.text){ "upload_url": "string", "mount_relative_path": "string", "sandbox_mount_prefix": "string", "expires_at": "string"}