Skip to main content

Files

These endpoints operate on cloud object storage your environment can reach — S3 and Google Cloud Storage buckets.

note

These endpoints do not touch the /mnt/cache disk, which is a separate filesystem UDFs read and write directly. See the /mnt/cache disk.

Paths

Every endpoint takes a path query parameter, using the scheme of the underlying store:

SchemeStorage
s3://An Amazon S3 bucket
gs://A Google Cloud Storage bucket

List files

GET /files/list

Scope: public or authorized

Returns an array of object keys under path.

Query parameters

ParameterTypeRequiredDescription
pathstringYesPrefix to list
client_idstringNoEnvironment context — see finding your client_id

With metadata

GET /files/list-details

Scope: public or authorized

Returns an array of objects. Accepts the same query parameters as List files.

FieldTypeDescription
urlstringFull path to the object
file_namestringObject name
is_directorybooleanWhether the entry is a prefix
sizeintegerSize in bytes
last_modifiedstringLast modification timestamp

Read a file

GET /files/get

Scope: public or authorized

Redirects (307) to a presigned URL valid for one hour. Follow redirects to download the bytes.

Query parameters

ParameterTypeRequiredDescription
pathstringYesObject to read
client_idstringNoEnvironment context

Upload a file

PUT /files/upload

Scope: environment

Streams the raw request body to path in S3. Returns the resulting s3:// URL. To upload to Google Cloud Storage, use Upload a file to GCS instead.

Query parameters

ParameterTypeRequiredDescription
pathstringYesDestination path
content_typestringNoContent type to store
client_idstringNoEnvironment context
curl -X PUT \
-H "Authorization: Fused-Service-Token $FUSED_SERVICE_ACCOUNT_TOKEN" \
--data-binary @local.parquet \
"https://www.fused.io/server/v1/files/upload?path=s3%3A%2F%2Fmy-bucket%2Ffile.parquet"

For large files, prefer a signed upload so the bytes go straight to cloud storage.

Upload to a scratch path

POST /files/upload-temp

Scope: environment

Streams the body to a server-chosen temporary path and returns it. Use this to stage an ad-hoc input without picking a destination.

Query parameters

ParameterTypeRequiredDescription
extensionstringNoFile extension to give the scratch object
content_typestringNoContent type to store
client_idstringNoEnvironment context

Upload a file to GCS

PUT /files/upload-gcs

Scope: environment

Uploads to a Google Cloud Storage bucket. Unlike PUT /files/upload, the body is multipart form data rather than raw bytes, and client_id is required.

Query parameters

ParameterTypeRequiredDescription
pathstringYesDestination gs:// path
client_idstringYesEnvironment context — see finding your client_id

Body

Multipart form data with the file in a file_name field.

curl -X PUT \
-H "Authorization: Fused-Service-Token $FUSED_SERVICE_ACCOUNT_TOKEN" \
-F "file_name=@local.parquet" \
"https://www.fused.io/server/v1/files/upload-gcs?path=gs%3A%2F%2Fmy-bucket%2Ffile.parquet&client_id=<client_id>"

Delete a file or prefix

DELETE /files/delete

Scope: environment

Deletes one object, or every object under a prefix. Returns true.

Query parameters

ParameterTypeRequiredDescription
pathstringYesObject or prefix to delete
max_deletion_depthinteger | stringNoMaximum prefix depth to recurse. Default 3; pass "unlimited" to remove the guard.
client_idstringNoEnvironment context
danger

Deleting a prefix removes every object beneath it up to max_deletion_depth. The default depth is a guardrail — raising it, and especially passing "unlimited", makes it easy to delete far more than intended.

Signed URLs

Signed URLs let a client read or write cloud storage directly, without proxying bytes through Fused. All signatures are valid for one hour.

Sign a download

GET /files/sign

Scope: public or authorized

Returns a URL string for path.

note

The returned string is not always a presigned URL — for public objects it may be the plain public URL, and in some configurations a Fused-proxied URL. Treat it as an opaque URL to fetch.

Sign an upload

GET /files/sign-upload

Scope: environment

Returns an S3 POST policy — {"url": …, "fields": {…}} — that a client can post the file to directly.

Query parameters

ParameterTypeRequiredDescription
pathstringYesDestination path
content_lengthintegerYesExact size in bytes; pinned as a condition of the policy
content_typestringNoContent type; pinned when supplied
client_idstringNoEnvironment context

A companion GET /files/sign-upload-temp returns a policy for a server-chosen scratch path, taking content_length, extension, and content_type. Its response is {"signed_post": …, "storage_url": …}.

Resolve a path

POST /files/resolve

Scope: public or authorized

Expands a Fused-managed path alias to the concrete storage URL it maps to, and validates that you may access it. Returns the resolved URL as a string.

Use this when another tool needs the real object location rather than the Fused alias.

Query parameters

ParameterTypeRequiredDescription
pathstringYesPath to resolve
job_idstringNoResolve against the storage a specific job used

Get a bucket policy for your own bucket

GET /files/s3-iam-policy

Scope: environment

Generates an S3 bucket policy granting your environment's job and real-time roles access to a bucket you own. Takes bucket_name and returns the policy document.

This is the policy referenced by the Amazon S3 integration setup, which is also where you attach the bucket to your environment.

info

The generated policy grants broad (s3:*) access to those roles. Narrow the actions before applying it if your bucket holds anything the UDFs should not modify.

See also