Download a file

Downloads a file with a specified ID.

SecuritySecretApiKey or JWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

ID of the resource.

query Parameters
imageSize
string^[1-9]{1}[0-9]{1,3}x[1-9]{1}[0-9]{1,3}$

Resize image to specified size. Supports any sizes from 10x10 to 2000x2000, in the following format: {width}x{height}. If the value is invalid, the image returns the original size. This parameter is ignored for non-image files.

Example: imageSize=700x700
Responses
200

File retrieved.

Response Headers
Content-Length
integer

Number of bytes in the file.

Example: 48
Content-Type
string

MIME type of the file.

Example: "image/png"
Response Schema:
string <binary>
302

Resource moved.

401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

404

Resource not found.

get/files/{id}/download
Request samples
const file = await api.files.download({id: 'my-file-id'});

// access the file ArrayBuffer to view the content 
console.log(file.data);
Response samples
"string"