Skip to main content
POST
/
api
/
v1
/
contexts
Create file context
curl --request POST \
  --url https://api.uplint.dev/api/v1/contexts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "context_key": "patient_reports",
  "display_name": "Patient Reports",
  "description": "Medical reports uploaded by patients",
  "allowed_extensions": [
    "pdf",
    "png",
    "jpg",
    "jpeg"
  ],
  "max_file_size_mb": 25,
  "reject_blank_files": true,
  "reject_corrupt_files": true,
  "scan_for_viruses": true,
  "upload_rate_limit": {
    "max_uploads": 100,
    "window_seconds": 60
  },
  "storage_quota_mb": 10240
}
'
{
  "status": "SUCCESS",
  "message": "<string>",
  "data": {
    "context_id": "<string>",
    "context_key": "<string>",
    "tenant_id": "<string>",
    "display_name": "<string>",
    "description": "<string>",
    "allowed_extensions": [
      "<string>"
    ],
    "max_file_size_mb": 123,
    "storage_path_template": "<string>",
    "reject_blank_files": true,
    "reject_corrupt_files": true,
    "scan_for_viruses": true,
    "upload_rate_limit": {
      "max_uploads": 5000,
      "window_seconds": 1800
    },
    "storage_quota_mb": 123,
    "storage_used_bytes": 123,
    "status": "active",
    "metadata": {}
  },
  "timestamp": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Pass an API key or JWT token. API keys can be sent as Authorization: Bearer <key> or Authorization: <key>.

Body

application/json
context_key
string
required

Unique, immutable identifier in snake_case.

Required string length: 1 - 100
display_name
string
required

Human-readable name.

Required string length: 1 - 255
description
string | null
Maximum string length: 1000
allowed_extensions
string[]

Allowed file extensions (e.g. ["pdf", "png"]). Empty array allows all.

max_file_size_mb
integer
default:10

Maximum file size in megabytes.

Required range: 1 <= x <= 500
storage_path_template
string | null

Custom S3 path template for uploaded files.

Maximum string length: 500
reject_blank_files
boolean
default:true

Reject files detected as blank or placeholder content.

reject_corrupt_files
boolean
default:true

Reject files that fail integrity checks.

scan_for_viruses
boolean
default:true

Scan files for malware using ClamAV.

upload_rate_limit
object

Optional per-context upload rate limit.

storage_quota_mb
integer | null

Storage quota in MB. null means unlimited.

Required range: 1 <= x <= 10485760
metadata
object

Response

File context created.

status
enum<string>
Available options:
SUCCESS
message
string
data
object
timestamp
string<date-time>