Storage
Create signed URLs
Mint signed URLs in bulk for many objects in one request.
Batch variant of create_signed_url. Sends one HTTP request, returns one Hash per input path. Useful for slideshow galleries, paginated downloads, anything that needs many time-limited URLs at once.
Signature
supabase.storage.from(bucket_id).create_signed_urls(paths,expires_in:,download: nil)Parameters
| Name | Type | Required | Description |
|---|---|---|---|
paths | Array<String> | Required | Object paths inside the bucket. A single String is auto-wrapped into a one-element array. |
expires_in | Integer | Required | Lifetime of every signed URL in the batch, in seconds. Stringified into the wire payload. |
download | Boolean, String | Optional | true to force Content-Disposition: attachment on every URL in the batch. Pass a String to set a single override filename used for all URLs (filename collisions across the batch are the caller’s problem). |
Returns
Returns
Array<Hash>
One Hash per input path. Each entry carries "error" (nil on success, message string on failure), "path" (the requested path), and the URL under both "signedURL" and "signedUrl". Per-path errors do NOT raise — check the error field before reading the URL.
Example — bulk signed URLs for a gallery
paths = (1..12).map { |i| "gallery/2026/photo-#{i}.jpg" }
items = supabase.storage.from("private-gallery").create_signed_urls(
paths,
expires_in: 60 * 60 # one hour
)
items.each do |item|
next if item["error"]
puts "#{item['path']} → #{item['signedURL']}"
endExample — force download on all URLs
supabase.storage.from("invoices").create_signed_urls(
["2026/Q2/INV-0001.pdf", "2026/Q2/INV-0002.pdf"],
expires_in: 600,
download: true
)Example — handle per-path errors
items = supabase.storage.from("private-uploads").create_signed_urls(
["exists.png", "missing.png"],
expires_in: 60
)
ok, failed = items.partition { |it| it["error"].nil? }
puts "signed #{ok.size}; failed #{failed.size}: #{failed.map { |it| it['path'] }.join(', ')}"Both `signedURL` and `signedUrl` keys are populated
Each Hash in the returned array carries the URL under both "signedURL" and "signedUrl" — either key returns the same string. See the same note on create_signed_url for the full rationale.