Skip to main content
POST
Signed URLs
Generate a signed URL to access a private file. Signed URLs expire after the specified duration.
This endpoint requires a secret key (sk_). Public keys cannot generate signed URLs.

Request

Path Parameters

string
required
The file ID. Example: f_abc123xyz

Body Parameters

integer
required
URL validity in seconds. Max: 604800 (7 days).

Response

string
required
Signed URL that grants temporary access to the file.
string
required
ISO 8601 timestamp when the URL expires.

Examples

Generate a 1-Hour URL

Response

Common Expiration Times

Use Cases

Secure File Downloads

Image Previews

Errors

Best Practices

Generate URLs with the minimum required validity. This limits exposure if a URL is leaked.
Don’t store signed URLs. Generate them when needed—they’re fast to create.
Generate signed URLs on your server and pass them to the client. Never expose your secret key.