Skip to main content
GET
/
api
/
v1
/
files
/
{file_id}
curl "https://api.fileguard.io/api/v1/files/file_z1x2c3v4b5n6?expires_in=600" \
  -H "Authorization: Bearer fg_your_api_key"
{
  "status": "SUCCESS",
  "data": {
    "file_id": "file_z1x2c3v4b5n6",
    "download_url": "https://bucket.s3.ap-south-1.amazonaws.com/file-service/patient_reports/2026/01/file_z1x2c3v4b5n6.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&...",
    "expires_in_seconds": 600,
    "original_filename": "blood_test.pdf",
    "content_type": "application/pdf"
  },
  "timestamp": "2026-01-04T10:00:00Z"
}

Documentation Index

Fetch the complete documentation index at: https://fileguard.dev/docs/llms.txt

Use this file to discover all available pages before exploring further.

Get a time-limited pre-signed URL to download a file directly from S3.

Path Parameters

file_id
string
required
Unique file identifier (e.g., file_z1x2c3v4b5n6)

Query Parameters

expires_in
integer
default:"300"
URL expiration time in seconds (60-3600)

Response

data
object
curl "https://api.fileguard.io/api/v1/files/file_z1x2c3v4b5n6?expires_in=600" \
  -H "Authorization: Bearer fg_your_api_key"
{
  "status": "SUCCESS",
  "data": {
    "file_id": "file_z1x2c3v4b5n6",
    "download_url": "https://bucket.s3.ap-south-1.amazonaws.com/file-service/patient_reports/2026/01/file_z1x2c3v4b5n6.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&...",
    "expires_in_seconds": 600,
    "original_filename": "blood_test.pdf",
    "content_type": "application/pdf"
  },
  "timestamp": "2026-01-04T10:00:00Z"
}

Required Scope

Requires download scope on your API key.

How Pre-signed URLs Work

  1. Call this endpoint with your API key to get a pre-signed URL
  2. The URL contains temporary credentials embedded in query parameters
  3. Use the URL directly to download - no Authorization header needed
  4. The URL expires after expires_in_seconds
Don’t store pre-signed URLs long-term. Always request a fresh URL when needed.

Download Count Tracking

Each call to this endpoint:
  • Increments the file’s download_count
  • Updates last_downloaded_at timestamp
Use GET /files/{file_id}/metadata to check download statistics.