Share Object

Generate a temporary, unauthenticated link to download an object.
EndpointMethodAdmin Required
/api/v1/objects/sharePOSTNo

Generates a time-limited link that anyone can use to download an object, with no credentials required. The link is an opaque, unguessable token mapped to the object server-side - it never contains the bucket name, key, or any access key.

Request Body

bucket
string required
Name of the bucket. Must be owned by the authenticated user.
key
string required
Object key to share.
expiresInSeconds
integer required
How long the link stays valid, in seconds. Must be between 1 and 604800 (7 days).

Example

{
    "bucket": "my-bucket",
    "key": "report.pdf",
    "expiresInSeconds": 3600
}

Response

{
    "url": "https://api.example.com/api/v1/shared/3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "expiresAt": "2025-01-15T13:00:00Z"
}
url
string
The public, unauthenticated URL. Fetching it with GET returns the object's contents directly, with a Content-Disposition header set to the object's original filename.
expiresAt
string
ISO 8601 timestamp of when the link stops working.
The link is revoked automatically once it expires - a background task removes expired links roughly once a minute. There is currently no endpoint to revoke a link early.

Errors

StatusReason
400expiresInSeconds is outside the 1-604800 range
404Bucket not found (or not owned by you), or object not found