Skip to content

Get a download URL

getDownloadUrl

GET /api/v1/shares/{share_id}/download-url

Scope: foldr.readRate cost: 2

A short-lived URL that downloads the file straight from its storage, for clients that cannot follow a redirect to another host

Only on shares with direct downloads; the same governance rules as content apply. A native Google document is never given one (it is exported through Foldr: use content).

Terminal window
curl "$FOLDR/api/v1/shares/$SHARE_ID/download-url" \
-H "Authorization: Bearer $TOKEN"

$FOLDR is your site’s address (for example https://files.example.com) and $TOKEN is an access token. See Getting access.

NameInTypeRequiredDescription
share_idpathstringYesThe share’s id.
pathquerystringNoPath of the file.
StatusMeaningBody
200The DownloadUrl.application/json: DownloadUrl

DownloadUrl:

FieldTypeDescription
urlstring (uri)Required. The URL. It carries its own authorisation: send it no Foldr token, and do not log or share it.
expires_atstring (date-time)Required. The URL works until at least this time (RFC 3339, UTC); some storage keeps it working longer.

Example:

{
"url": "https://files.example.com/",
"expires_at": "2026-11-04T09:30:00Z"
}

Every error is an application/problem+json document (ProblemDetails); branch on its type or code. See Errors.

StatusProblem typesWhen
400invalid-path
invalid-request
One of: Invalid path (invalid-path); Invalid request (invalid-request).
401invalid-tokenInvalid token (invalid-token).
403download-blocked
insufficient-scope
One of: Download blocked (download-blocked); Insufficient scope (insufficient-scope).
404not-foundNot found (not-found).
409ambiguous-path
approved-version-unavailable
no-direct-download
not-a-file
not-downloadable
storage-account-not-connected
One of: Ambiguous path (ambiguous-path); Approved version unavailable (approved-version-unavailable); No direct download (no-direct-download); Not a file (not-a-file); Not downloadable (not-downloadable); Storage account not connected (storage-account-not-connected).
429rate-limitedToo many requests (rate-limited).
500internal-errorInternal error (internal-error).
503share-unavailable
share-unreachable
One of: Share unavailable (share-unavailable); Share unreachable (share-unreachable).