Download file legacy
GET /v1/organisations/{organisation_id}/workspaces/{workspace_id}/files/{file_id}/content Deprecated
Downloads a clean version. HEAD answers the same headers without the body. Served as an attachment unless disposition=inline and the type is on the inline allow-list; HTML and SVG never are.
Authentication
Send an API key, or an access token from your organisation’s identity provider, in the Authorization header. How API keys work
Scope the API key needs: files:read
Security schemes in the OpenAPI document: session_cookie (cookie __Host-ivy_session)bearer (bearer)api_key (bearer)
Parameters
-
organisation_idpathstringrequired -
workspace_idpathstringrequired -
file_idpathstringrequired -
versionqueryinteger (int32)A clean version; defaults to the newest clean one.
-
Defaults to
attachment. -
formatquerystringA native document's export format (one of its
connector.export_formats); defaults topdfinline and the editable format as an attachment. -
Rangeheaderstring|nullOne
bytes=range -
If-None-Matchheaderstring|null
Responses
- 200
application/octet-streamstring (binary)The content of the newest clean version (or
version), with its sniffedContent-TypeandETag: "{version_id}" - 206
application/octet-streamstring (binary)The requested
Range - 304 No content
If-None-Matchmatches -
unauthenticated -
workspace_content_restricted,insufficient_scope -
No such file or version in this space
-
file_scanning(Retry-After),file_quarantinedorfile_scan_failed: no clean version -
range_not_satisfiable -
rate_limited: the API key's requests per minute are used up; retry afterRetry-Afterseconds -
internal -
storage_unavailable; orunavailable: the database is briefly unavailable; retry afterRetry-Afterseconds
Error codes
Errors come back as an ErrorBody whose code is one of these.
- 401
unauthenticated - 403
workspace_content_restrictedinsufficient_scope - 404
not_foundgeneric code for this status - 409
file_scanningfile_quarantinedfile_scan_failed - 416
range_not_satisfiable - 429
rate_limited - 500
internal - 503
storage_unavailableunavailable
Examples
curl "$IVY_API_URL/v1/organisations/$ORGANISATION_ID/workspaces/$WORKSPACE_ID/files/$FILE_ID/content" \
-H "Authorization: Bearer $IVY_API_KEY" import { client, downloadFileLegacy } from "@spacivapp/ivy-sdk";
client.setConfig({
baseUrl: process.env.IVY_API_URL,
headers: { Authorization: `Bearer ${process.env.IVY_API_KEY}` },
});
const { data, error, response } = await downloadFileLegacy({
path: { organisation_id: organisationId, workspace_id: workspaceId, file_id: fileId },
}); "string"