Docs menu

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_id path string required
  • workspace_id path string required
  • file_id path string required
  • version query integer (int32)

    A clean version; defaults to the newest clean one.

  • disposition query Disposition

    Defaults to attachment.

  • format query string

    A native document's export format (one of its connector.export_formats); defaults to pdf inline and the editable format as an attachment.

  • Range header string | null

    One bytes= range

  • If-None-Match header string | null

Responses

  • 200 application/octet-stream string (binary)

    The content of the newest clean version (or version), with its sniffed Content-Type and ETag: "{version_id}"

  • 206 application/octet-stream string (binary)

    The requested Range

  • 304 No content

    If-None-Match matches

  • 401 application/json ErrorBody

    unauthenticated

  • 403 application/json ErrorBody

    workspace_content_restricted, insufficient_scope

  • 404 application/json ErrorBody

    No such file or version in this space

  • 409 application/json ErrorBody

    file_scanning (Retry-After), file_quarantined or file_scan_failed: no clean version

  • 416 application/json ErrorBody

    range_not_satisfiable

  • 429 application/json ErrorBody

    rate_limited: the API key's requests per minute are used up; retry after Retry-After seconds

  • 500 application/json ErrorBody

    internal

  • 503 application/json ErrorBody

    storage_unavailable; or unavailable: the database is briefly unavailable; retry after Retry-After seconds

Error codes

Errors come back as an ErrorBody whose code is one of these.

  • 401 unauthenticated
  • 403 workspace_content_restrictedinsufficient_scope
  • 404 not_found generic code for this status
  • 409 file_scanningfile_quarantinedfile_scan_failed
  • 416 range_not_satisfiable
  • 429 rate_limited
  • 500 internal
  • 503 storage_unavailableunavailable

Examples

curl
curl "$IVY_API_URL/v1/organisations/$ORGANISATION_ID/workspaces/$WORKSPACE_ID/files/$FILE_ID/content" \
  -H "Authorization: Bearer $IVY_API_KEY"
JavaScript SDK
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 },
});
Example response (200)
"string"