/api/v1/eas
Fetch the file renderings for several files at once. The file ids are passed as a JSON array in the query; the response is a map keyed by file ID. A file is shown if the user holds RIGHT_ASSET_SHOW or RIGHT_ASSET_DOWNLOAD on the original or on at least one of its versions. There is no blanket login gate: an unauthenticated request is served via the deep_link system user if deep linking is enabled. Use GET /eas/{fileId} to address a single file.
Differs from easydb 5: easydb 5 requires an authenticated user on GET /eas ("The user must be authenticated."); fylr has no login gate here — a missing token is served as the anonymous deep_link user, and a denied request is 403 (InsufficientRights), never 401.
Since fylr 6.35, the file URLs in the responses of GET /eas, PUT/POST /eas/put, POST /eas/{fileId}, /eas/rput and /eas/produce are signed like those of /db and search (?x-fylr-signature=…), so they load without an access token. file_url_expire sets the validity in days, 0 returns unsigned URLs. To reach into a zip, put the path in front of the query: …/original.zip/index.html?x-fylr-signature=….
GET /eas/{fileId} — Get information about a file. The file is shown if the caller holds RIGHT_ASSET_SHOW or RIGHT_ASSET_DOWNLOAD on the original or any version.
Get information about a file. The file is shown if the caller holds `asset_show` or `asset_download` on the original or any version.
Access token in the Authorization header:
Authorization: Bearer <token>.
The ID of the file.
The _uuid of the object the file is linked into. This is used for the permission check.
If set, the fylr database is queried for duplicates of the file. The _duplicate property will be added to the response.
If mapping is given, the file's metadata is used to compile a _mapped_metadata object in the response. mapping can either be the _id of the mapping or the keyword standard. The standard mapping will use the object type (and pool i.A.) to determine the standard mapping.
The object type for which the mapping is compiled.
The mask the mapping is compiled for.
The pool_id sets the pool id to determine the mapping if standard is requested.
How much of the file is rendered. standard (also empty or omitted) adds
versions, long adds versions and metadata, short has neither.
versions renders nothing but versions, each with its url, width
and height; _mapped_metadata and _duplicates are left out. Plugins
get file values of the base configuration in this format. Values are
case-sensitive: any other value (LONG, full) renders like short.
Number of days the signed file URLs contained in the response stay valid. A
signed URL is accepted by /eas/download on its own, without a session, until
it expires — which is what saves the download the per-record rights check. The
/eas responses (GET, PUT, POST, rput, produce) sign their urls the
same way, so a browser can load them without its token in the url.
If omitted, system.file_url_expire.default_days applies. The value is capped
at system.file_url_expire.max_days; a caller holding the system.root right
is not capped, since the cap exists to stop a regular user minting a
long-lived URL for a file they may only see today, and does not apply to a
caller who may read every file anyway. This is what lets fylr backup store
URLs its restore can still fetch weeks later.
The response is the file rendering object for the addressed
file id (returned directly, not wrapped in a map keyed by id —
the keyed map applies only to the multi-id GET /eas?ids=[...]).
Differs from easydb 5: easydb 5 has no single-id path — even one
asset is fetched via GET /eas?ids=[...] and returned as "A JSON
object containing entries for each requested ID". fylr adds
GET /eas/{fileId} and returns the file object directly.
The file rendering. Format depends on format (default standard).
The caller may not see the file: it holds neither
asset_show nor asset_download on the original or
any version (and no deep_link access applies). The code is
InsufficientRights. This endpoint returns no 401; a missing
or invalid token is treated as an anonymous request.
{}POST /eas/{fileId} — Change information about a file. The caller must be allowed to produce the file (its uploader, or a user with write access to a linked object).
Change information about a file. The caller must be allowed to produce the file (its uploader, or a user with write access to a linked object).
Change information about a file. Access is checked via
rightcheck.ProduceFile: the caller passes if it is the file's
uploader, or if the file is linked to an object on which the caller
holds both write and asset_upload. The target file
must be an original. The body must set at least one of filename,
reference or custom_produce_config; otherwise the request is
rejected with 400 (ServerGeneric). The patched file is written
back to the file table inside the request transaction, so the
change takes effect on commit of this request — there is no working
copy and no separate commit step.
Access token in the Authorization header:
Authorization: Bearer <token>.
The ID of the file.
If set, the call is only checking if the current user is allowed to update the file information.
Number of days the signed file URLs contained in the response stay valid. A
signed URL is accepted by /eas/download on its own, without a session, until
it expires — which is what saves the download the per-record rights check. The
/eas responses (GET, PUT, POST, rput, produce) sign their urls the
same way, so a browser can load them without its token in the url.
If omitted, system.file_url_expire.default_days applies. The value is capped
at system.file_url_expire.max_days; a caller holding the system.root right
is not capped, since the cap exists to stop a regular user minting a
long-lived URL for a file they may only see today, and does not apply to a
caller who may read every file anyway. This is what lets fylr backup store
URLs its restore can still fetch weeks later.
The new filename of the file. It is stored as original_filepath.
The reference string for the file. Note that the reference is unique across all files in the storage.
Update was successful.
The file rendering in standard format.
The update could not be processed. Surfaces as ServerGeneric
when the body sets none of filename / reference /
custom_produce_config, when the target file is not an
original, or when the new filename would push the file over
its class size limit; and as ReadOnlyMode when the instance is
read-only.
The caller is not allowed to produce the file: it is neither the
uploader nor a user with write + asset_upload on
a linked object. The code is InsufficientRights (the caller
cannot even see the file) or RightRequired (visible but not
writable). This endpoint returns no 401; a missing or invalid
token is treated as an anonymous request and rejected with 403.
{
"status": {
"acknowledged": "ok"
}
}GET /eas — Get information about a file.
Access token in the Authorization header:
Authorization: Bearer <token>.
A json formatted array of file IDs. Example: [1,3,4].
The _uuid of the object the file is linked into. This is used for the permission check.
If set, the fylr database is queried for duplicates of the file. The _duplicate property will be added to the response.
If mapping is given, the file's metadata is used to compile a _mapped_metadata object in the response. mapping can either be the _id of the mapping or the keyword standard. The standard mapping will use the object type (and pool i.A.) to determine the standard mapping.
The object type for which the mapping is compiled.
The mask the mapping is compiled for.
The pool_id sets the pool id to determine the mapping if standard is requested.
How much of the file is rendered. standard (also empty or omitted) adds
versions, long adds versions and metadata, short has neither.
versions renders nothing but versions, each with its url, width
and height; _mapped_metadata and _duplicates are left out. Plugins
get file values of the base configuration in this format. Values are
case-sensitive: any other value (LONG, full) renders like short.
Configuration for recipes used in the metadata mapping profile. The value must be an JSON-encoded object. See collections for a details description of the format.
Number of days the signed file URLs contained in the response stay valid. A
signed URL is accepted by /eas/download on its own, without a session, until
it expires — which is what saves the download the per-record rights check. The
/eas responses (GET, PUT, POST, rput, produce) sign their urls the
same way, so a browser can load them without its token in the url.
If omitted, system.file_url_expire.default_days applies. The value is capped
at system.file_url_expire.max_days; a caller holding the system.root right
is not capped, since the cap exists to stop a regular user minting a
long-lived URL for a file they may only see today, and does not apply to a
caller who may read every file anyway. This is what lets fylr backup store
URLs its restore can still fetch weeks later.
The response contains the file infos in a map.
The file rendering. The key is the file ID.
The caller may not see the file: it holds neither
asset_show nor asset_download on the original
or any version (and no deep_link access applies). The code
is InsufficientRights. This endpoint returns no 401; a
missing or invalid token is treated as an anonymous request.
{
"ANY_ADDITIONAL_PROPERTY": {}
}Last updated