Files

Download a file

Fetches the file itself. The response is not the bytes but a 302 redirect to a short-lived signed storage URL, so any HTTP client that follows redirects gets the content.

GET
https://files.magicdoor.com/files/{fileId}/{filename}

Authorization

Authorizationstringrequired
Bearer token — Send your API token in the Authorization header as Bearer <token>. Requests without a valid token are rejected with 401 Unauthorized.

Path parameters

fileIdstringrequired

The file to fetch, as a Snowflake id in decimal-string form. Must be a positive whole number.

example: 1831208734196891648
filenamestring

An optional trailing segment that renames the file for this download only — nothing is renamed in MagicDoor. Leave the whole segment off and the stored name is used. When you do send it, it must be 3 to 200 characters, and it must be URL-escaped.

example: lease-agreement.pdf

Query parameters

downloadboolean

true makes the storage URL send Content-Disposition: attachment, so a browser saves the file instead of displaying it. Leave it off and browsers show what they can inline.

default: falseexample: false

Response

302 · Redirect to the signed storage URL that holds the content

Locationstring

The signed storage URL. It is valid for seven days and needs no MagicDoor access token of its own, so treat it as a secret. There is no response body.

401 · The access token is missing, expired, or invalid

404 · No such file, the file has been deleted, or it belongs to another company

Two requests, two credentials

The first request is to MagicDoor and needs your access token. The second is to storage and is authorised by the signature in the URL. Most clients handle both for you — cURL needs --location, and fetch follows redirects by default.

Do not send your MagicDoor Authorization header on to the storage URL. Some clients strip it across hosts and some do not; storage does not want it either way.

The trailing filename segment is a display name for this one download. With download=true it becomes the name the browser saves the file under; without it, it mostly just makes the URL readable. It never changes anything stored in MagicDoor, and the file is still found by its id whatever you put there.