Topolo Docs Topolo Platform
Open workspace

Create download URL

Create a time-limited signed download address for an accessible existing file. No file bytes are downloaded by this request.

Outcome

Create a time-limited signed download address for an accessible existing file. No file bytes are downloaded by this request.

Before you start

  • Verify identity, pin environment and organization, and discover a granted Bytes workspace before choosing file keys.
  • The action requires files:read. Select a verified workspace resource separately from action input; a body field cannot supply a workspace grant.
  • Scope org uses the verified workspace shared root; private uses the caller’s private subtree. The accepted legacy all value resolves to org and does not grant cross-organization browsing. The bucket input cannot switch the configured R2 binding.
  • Authorize the described effect or private-data export before passing CLI --confirm or MCP confirm:true. GET listing/search can persist derived data; HTTP method alone does not establish a read-only action.

Discover the target

topolo whoami --json
topolo actions get app_topolo_bytes.download.signed_url.create --detail --json
topolo resources topolo-bytes --json
topolo workspaces list topolo-bytes --json
  • File keys are paths returned by files.list/search in the selected workspace and scope. Discover the granted workspace id; do not derive access from fixture ids.

Request

POST /api/download/signed-url

Save action input as payload.json. The reviewed plan separates path identifiers, query fields and the HTTP body. Set BYTES_WORKSPACE_ID from granted resource discovery.

Inspect and test this action in the signed action console. A test response still requires the verification below.

Input fields

FieldRequiredTypeConstraints
keyRequiredstring{"minLength":1}
scopeOptionalstring{"enum":["org","private","all"]}
expirationMinutesOptionalnumber{}
downloadFilenameOptionalstring{}

Exact input schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "key": {
      "type": "string",
      "minLength": 1
    },
    "scope": {
      "type": "string",
      "enum": [
        "org",
        "private",
        "all"
      ]
    },
    "expirationMinutes": {
      "type": "number"
    },
    "downloadFilename": {
      "type": "string"
    }
  },
  "required": [
    "key"
  ],
  "additionalProperties": false
}

Effects

  • Returns a capability-bearing signed URL for the specified storage object.

Interpret the response

The response identifier path is $.key for file. An empty list does not discover a target.

Check expiresAt and the returned key; retrieve only the intended file before expiry. Keep signed URLs private and do not expose them in shared logs.

The schema describes supported success fields; optional metadata and integration-dependent values may vary. Errors have the exact shapes shown in refused examples.

Success schema:

{
  "type": "object",
  "required": [
    "success",
    "signedUrl",
    "expiresAt",
    "key",
    "scope"
  ],
  "properties": {
    "success": {
      "type": "boolean"
    },
    "signedUrl": {
      "type": "string"
    },
    "expiresAt": {
      "type": "string"
    },
    "key": {
      "type": "string"
    },
    "scope": {
      "type": "string"
    }
  }
}

Worked examples

Actual exported Worker handlers with local Miniflare R2/KV. Auth, workspace grants, R2 multipart, notification, usage and semantic integrations are simulated at their configured test boundaries. Synthetic ids, timestamps and signed URLs confer no live access. No deployed provider outcome, external delivery or live grant is established. Upload-session credential values are explicitly redacted; binary responses use the tested SDK transport envelope. Replace synthetic identifiers through credential-scoped discovery. Refused scenarios document failure boundaries; they are not successful workflows.

Successful request

Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.

Input · payload.json:

{
  "key": "tiny.mp4",
  "expirationMinutes": 60
}

CLI:

topolo actions validate app_topolo_bytes.download.signed_url.create --data @payload.json --json
topolo actions plan app_topolo_bytes.download.signed_url.create --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_bytes.download.signed_url.create --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_bytes.download.signed_url.create",
    "input": {
      "key": "tiny.mp4",
      "expirationMinutes": 60
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 200:

{
  "success": true,
  "signedUrl": "https://bytes-api.test.local/api/signed-download?data=%7B%22key%22%3A%22organizations%2Forg_acme%2Fworkspaces%2Fworkspace_acme%2Ftiny.mp4%22%2C%22expiresAt%22%3A%222026-10-04T02%3A57%3A55.425Z%22%2C%22downloadFilename%22%3A%22tiny.mp4%22%7D&sig=3627c337857d457cf77f57de0efaf3988f93e0b68f9a33bd88066e8de6087039",
  "expiresAt": "2026-10-04T02:57:55.425Z",
  "key": "tiny.mp4",
  "scope": "org"
}

HTTP 200. Check expiresAt and the returned key; retrieve only the intended file before expiry. Keep signed URLs private and do not expose them in shared logs.

Another supported request

Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.

Input · payload.json:

{
  "key": "clip.webm",
  "expirationMinutes": 60
}

CLI:

topolo actions validate app_topolo_bytes.download.signed_url.create --data @payload.json --json
topolo actions plan app_topolo_bytes.download.signed_url.create --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_bytes.download.signed_url.create --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_bytes.download.signed_url.create",
    "input": {
      "key": "clip.webm",
      "expirationMinutes": 60
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 200:

{
  "success": true,
  "signedUrl": "https://bytes-api.test.local/api/signed-download?data=%7B%22key%22%3A%22organizations%2Forg_acme%2Fworkspaces%2Fworkspace_acme%2Fclip.webm%22%2C%22expiresAt%22%3A%222026-10-04T02%3A57%3A55.433Z%22%2C%22downloadFilename%22%3A%22clip.webm%22%7D&sig=1fe3a918f457a9acc3fe5a8b262b4f4214feec367c916090c2629e438ea35977",
  "expiresAt": "2026-10-04T02:57:55.433Z",
  "key": "clip.webm",
  "scope": "org"
}

HTTP 200. Check expiresAt and the returned key; retrieve only the intended file before expiry. Keep signed URLs private and do not expose them in shared logs.

Another supported request

Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.

Input · payload.json:

{
  "key": "whole.txt",
  "expirationMinutes": 60
}

CLI:

topolo actions validate app_topolo_bytes.download.signed_url.create --data @payload.json --json
topolo actions plan app_topolo_bytes.download.signed_url.create --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_bytes.download.signed_url.create --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_bytes.download.signed_url.create",
    "input": {
      "key": "whole.txt",
      "expirationMinutes": 60
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 200:

{
  "success": true,
  "signedUrl": "https://bytes-api.test.local/api/signed-download?data=%7B%22key%22%3A%22organizations%2Forg_acme%2Fworkspaces%2Fworkspace_acme%2Fwhole.txt%22%2C%22expiresAt%22%3A%222026-10-04T02%3A57%3A55.437Z%22%2C%22downloadFilename%22%3A%22whole.txt%22%7D&sig=03804987be10bea425cfe83a02568a017d34602f5831e8f17203e47173043982",
  "expiresAt": "2026-10-04T02:57:55.437Z",
  "key": "whole.txt",
  "scope": "org"
}

HTTP 200. Check expiresAt and the returned key; retrieve only the intended file before expiry. Keep signed URLs private and do not expose them in shared logs.

Refused request · HTTP 400

Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.

Input · payload.json:

{}

CLI:

topolo actions validate app_topolo_bytes.download.signed_url.create --data @payload.json --json
topolo actions plan app_topolo_bytes.download.signed_url.create --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 400:

{
  "success": false,
  "error": "File key is required"
}

HTTP 400. This request was refused; preserve the exact response and correct its cause before retrying.

Refused request · HTTP 404

Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.

Input · payload.json:

{
  "key": "nope.txt"
}

CLI:

topolo actions validate app_topolo_bytes.download.signed_url.create --data @payload.json --json
topolo actions plan app_topolo_bytes.download.signed_url.create --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 404:

{
  "success": false,
  "error": "File not found"
}

HTTP 404. This request was refused; preserve the exact response and correct its cause before retrying.

Verify the result

  • Check expiresAt and the returned key; retrieve only the intended file before expiry. Keep signed URLs private and do not expose them in shared logs.

Errors and recovery

  • File key is required (HTTP 400): Correct the exact fields using the discovered input schema and prerequisites. Refused input examples demonstrate errors and must not be executed as successful workflows.
  • File not found (HTTP 404): Discover the existing file, share or release in the intended scope. A missing or inaccessible target is not authorization to create a replacement.

Authentication, the action-input validator or resource middleware can refuse a request before this handler. Preserve the exact request id, error and selected credential context. The fixtures establish no live credentials or configured provider.

Recovery boundary

There is no individual URL-revocation action. Let it expire; broader credential or file changes require separate authorization.

  • List files: List one page of files and directories in the verified workspace; eligible files can have derived thumbnails generated during listing.

Evidence

Actual exported Worker handlers with local Miniflare R2/KV. Auth, workspace grants, R2 multipart, notification, usage and semantic integrations are simulated at their configured test boundaries. Synthetic ids, timestamps and signed URLs confer no live access. No deployed provider outcome, external delivery or live grant is established. Upload-session credential values are explicitly redacted; binary responses use the tested SDK transport envelope. Capture digests and test scenarios are retained in the source fixture records.