Skip to main content
POST
/
api
/
v1
/
api-keys
curl -X POST "https://api.fileguard.io/api/v1/api-keys" \
  -H "Authorization: Bearer fg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production Upload Key",
    "scopes": ["upload", "download", "metadata"],
    "expires_in_days": 365
  }'
{
  "status": "SUCCESS",
  "message": "API key created successfully. Store the key securely - it won't be shown again.",
  "data": {
    "api_key_id": "key_m1n2o3p4q5r6",
    "api_key": "fg_aBcDeFgHiJkLmNoPqRsTuVwXyZ123456789012",
    "name": "Production Upload Key",
    "scopes": ["upload", "download", "metadata"],
    "expires_at": "2027-01-04T10:00:00Z"
  },
  "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.

Create a new API key for your tenant.
The API key value is only returned once. Store it securely!

Request Body

name
string
required
Descriptive name (1-255 chars)
scopes
array
default:"[\"upload\", \"download\"]"
List of permissions: upload, download, metadata, delete, admin
expires_in_days
integer
Days until expiration (1-365). Null for no expiration.
metadata
object
Custom metadata
curl -X POST "https://api.fileguard.io/api/v1/api-keys" \
  -H "Authorization: Bearer fg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production Upload Key",
    "scopes": ["upload", "download", "metadata"],
    "expires_in_days": 365
  }'
{
  "status": "SUCCESS",
  "message": "API key created successfully. Store the key securely - it won't be shown again.",
  "data": {
    "api_key_id": "key_m1n2o3p4q5r6",
    "api_key": "fg_aBcDeFgHiJkLmNoPqRsTuVwXyZ123456789012",
    "name": "Production Upload Key",
    "scopes": ["upload", "download", "metadata"],
    "expires_at": "2027-01-04T10:00:00Z"
  },
  "timestamp": "2026-01-04T10:00:00Z"
}