Skip to main content
PATCH
/
api
/
v1
/
contexts
/
{context_key}
curl -X PATCH "https://api.fileguard.io/api/v1/contexts/patient_reports" \
  -H "Authorization: Bearer fg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "allowed_extensions": ["pdf", "jpg"],
    "max_file_size_mb": 15
  }'
{
  "status": "SUCCESS",
  "message": "File context updated successfully",
  "data": {
    "context_id": "ctx_q1w2e3r4t5y6",
    "context_key": "patient_reports",
    "display_name": "Patient Reports",
    "allowed_extensions": ["pdf", "jpg"],
    "max_file_size_mb": 15,
    "status": "active",
    "updated_at": "2026-01-04T11:00:00Z"
  },
  "timestamp": "2026-01-04T11: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.

Update a file context’s settings. All fields are optional.

Path Parameters

context_key
string
required
The context key (cannot be changed)

Request Body

display_name
string
Human-readable name
description
string
Context description
allowed_extensions
array
Allowed file extensions
max_file_size_mb
integer
Maximum file size in MB
reject_blank_files
boolean
Reject blank files
reject_corrupt_files
boolean
Reject corrupt files
scan_for_viruses
boolean
Enable virus scanning
storage_quota_mb
integer
Storage quota in MB (null to remove)
status
string
Context status: active or inactive
curl -X PATCH "https://api.fileguard.io/api/v1/contexts/patient_reports" \
  -H "Authorization: Bearer fg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "allowed_extensions": ["pdf", "jpg"],
    "max_file_size_mb": 15
  }'
{
  "status": "SUCCESS",
  "message": "File context updated successfully",
  "data": {
    "context_id": "ctx_q1w2e3r4t5y6",
    "context_key": "patient_reports",
    "display_name": "Patient Reports",
    "allowed_extensions": ["pdf", "jpg"],
    "max_file_size_mb": 15,
    "status": "active",
    "updated_at": "2026-01-04T11:00:00Z"
  },
  "timestamp": "2026-01-04T11:00:00Z"
}

Required Scope

Requires admin scope on your API key.