Assets (Thumbnails)

Image typed files can be dynamically resized and transformed to fit any need.

Endpoints
   GET /:project/assets/:key

Get an asset

Get a resized file. Files are resized on demand.

Parameters

project required

The project you're targetting.

key required

private_hash of the file.

Query

key optional

The key of the asset size configured in settings.

w optional

Width of the file in pixels.

h optional

Height of the file in pixels.

f optional

Fit. One of crop, contain.

q optional

Quality of compression. Number between 1 and 100.

If you're using key, you don't need to specify any of the other query parameters. If you're using w, h, or any of the others, you're required to provide them all. This allows Directus to match it against the whitelist in settings. If you have the whitelist turned off completely, any combination is allowed.

Endpoint
   GET /:project/assets/:key