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.
API Key Authentication
All FileGuard API requests require authentication via an API key in theAuthorization header.
Creating API Keys
Create API keys from your dashboard or via the API:API Key Format
FileGuard API keys follow this format:- Prefix:
fg_(identifies FileGuard keys) - Random string: 38 characters
Scopes
API keys have scopes that control what operations they can perform:| Scope | Description |
|---|---|
upload | Upload files to storage |
download | Get pre-signed download URLs |
metadata | Read file and context metadata, list files |
delete | Delete files (soft delete) |
admin | Full access - includes all other scopes |
Scope Examples
Upload-only key (for client applications):Key Expiration
Set expiration for temporary keys:Key Status
| Status | Description |
|---|---|
active | Key is valid and usable |
disabled | Key is temporarily disabled (can be re-enabled) |
revoked | Key is permanently revoked |
expired | Key has passed its expiration date |
Error Responses
Invalid API Key (401)
Insufficient Scope (403)
Disabled API Key (401)
Best Practices
Use environment variables
Use environment variables
Never hardcode API keys in source code:
Rotate keys regularly
Rotate keys regularly
Create new keys and revoke old ones periodically, especially for production environments.
Use separate keys per environment
Use separate keys per environment
Create different keys for development, staging, and production with appropriate scopes.
Monitor key usage
Monitor key usage
Check
last_used_at to identify unused keys that should be revoked.Set expiration for integrations
Set expiration for integrations
Use
expires_in_days for keys shared with third parties or temporary integrations.