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
}
'import requests
url = "https://api.uplint.dev/api/v1/contexts"
payload = {
"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
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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
})
};
fetch('https://api.uplint.dev/api/v1/contexts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.uplint.dev/api/v1/contexts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.uplint.dev/api/v1/contexts"
payload := strings.NewReader("{\n \"context_key\": \"patient_reports\",\n \"display_name\": \"Patient Reports\",\n \"description\": \"Medical reports uploaded by patients\",\n \"allowed_extensions\": [\n \"pdf\",\n \"png\",\n \"jpg\",\n \"jpeg\"\n ],\n \"max_file_size_mb\": 25,\n \"reject_blank_files\": true,\n \"reject_corrupt_files\": true,\n \"scan_for_viruses\": true,\n \"upload_rate_limit\": {\n \"max_uploads\": 100,\n \"window_seconds\": 60\n },\n \"storage_quota_mb\": 10240\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.uplint.dev/api/v1/contexts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"context_key\": \"patient_reports\",\n \"display_name\": \"Patient Reports\",\n \"description\": \"Medical reports uploaded by patients\",\n \"allowed_extensions\": [\n \"pdf\",\n \"png\",\n \"jpg\",\n \"jpeg\"\n ],\n \"max_file_size_mb\": 25,\n \"reject_blank_files\": true,\n \"reject_corrupt_files\": true,\n \"scan_for_viruses\": true,\n \"upload_rate_limit\": {\n \"max_uploads\": 100,\n \"window_seconds\": 60\n },\n \"storage_quota_mb\": 10240\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uplint.dev/api/v1/contexts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"context_key\": \"patient_reports\",\n \"display_name\": \"Patient Reports\",\n \"description\": \"Medical reports uploaded by patients\",\n \"allowed_extensions\": [\n \"pdf\",\n \"png\",\n \"jpg\",\n \"jpeg\"\n ],\n \"max_file_size_mb\": 25,\n \"reject_blank_files\": true,\n \"reject_corrupt_files\": true,\n \"scan_for_viruses\": true,\n \"upload_rate_limit\": {\n \"max_uploads\": 100,\n \"window_seconds\": 60\n },\n \"storage_quota_mb\": 10240\n}"
response = http.request(request)
puts response.read_body{
"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,
"metadata": {},
"storage_config_id": "<string>"
},
"timestamp": "2023-11-07T05:31:56Z"
}{
"status": "ERROR",
"message": "Invalid or missing API key",
"errors": [
"Authentication required"
],
"timestamp": "2026-02-10T12:00:00Z"
}{
"status": "ERROR",
"message": "<string>",
"errors": [
"<string>"
],
"timestamp": "2023-11-07T05:31:56Z"
}{
"status": "ERROR",
"message": "Validation error",
"errors": [
"name: field required"
],
"timestamp": "2026-02-10T12:00:00Z"
}Create File Context
Create a new file context (upload pipeline). Contexts define the rules applied to every file uploaded under them — allowed extensions, size limits, blank/corrupt rejection, virus scanning, rate limits, and storage quotas.
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
}
'import requests
url = "https://api.uplint.dev/api/v1/contexts"
payload = {
"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
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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
})
};
fetch('https://api.uplint.dev/api/v1/contexts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.uplint.dev/api/v1/contexts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.uplint.dev/api/v1/contexts"
payload := strings.NewReader("{\n \"context_key\": \"patient_reports\",\n \"display_name\": \"Patient Reports\",\n \"description\": \"Medical reports uploaded by patients\",\n \"allowed_extensions\": [\n \"pdf\",\n \"png\",\n \"jpg\",\n \"jpeg\"\n ],\n \"max_file_size_mb\": 25,\n \"reject_blank_files\": true,\n \"reject_corrupt_files\": true,\n \"scan_for_viruses\": true,\n \"upload_rate_limit\": {\n \"max_uploads\": 100,\n \"window_seconds\": 60\n },\n \"storage_quota_mb\": 10240\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.uplint.dev/api/v1/contexts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"context_key\": \"patient_reports\",\n \"display_name\": \"Patient Reports\",\n \"description\": \"Medical reports uploaded by patients\",\n \"allowed_extensions\": [\n \"pdf\",\n \"png\",\n \"jpg\",\n \"jpeg\"\n ],\n \"max_file_size_mb\": 25,\n \"reject_blank_files\": true,\n \"reject_corrupt_files\": true,\n \"scan_for_viruses\": true,\n \"upload_rate_limit\": {\n \"max_uploads\": 100,\n \"window_seconds\": 60\n },\n \"storage_quota_mb\": 10240\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uplint.dev/api/v1/contexts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"context_key\": \"patient_reports\",\n \"display_name\": \"Patient Reports\",\n \"description\": \"Medical reports uploaded by patients\",\n \"allowed_extensions\": [\n \"pdf\",\n \"png\",\n \"jpg\",\n \"jpeg\"\n ],\n \"max_file_size_mb\": 25,\n \"reject_blank_files\": true,\n \"reject_corrupt_files\": true,\n \"scan_for_viruses\": true,\n \"upload_rate_limit\": {\n \"max_uploads\": 100,\n \"window_seconds\": 60\n },\n \"storage_quota_mb\": 10240\n}"
response = http.request(request)
puts response.read_body{
"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,
"metadata": {},
"storage_config_id": "<string>"
},
"timestamp": "2023-11-07T05:31:56Z"
}{
"status": "ERROR",
"message": "Invalid or missing API key",
"errors": [
"Authentication required"
],
"timestamp": "2026-02-10T12:00:00Z"
}{
"status": "ERROR",
"message": "<string>",
"errors": [
"<string>"
],
"timestamp": "2023-11-07T05:31:56Z"
}{
"status": "ERROR",
"message": "Validation error",
"errors": [
"name: field required"
],
"timestamp": "2026-02-10T12:00:00Z"
}Authorizations
Pass an API key or JWT token. API keys can be sent as Authorization: Bearer <key> or Authorization: <key>.
Body
Unique, immutable identifier in snake_case.
1 - 100^[a-z][a-z0-9_]*$Human-readable name.
1 - 2551000Allowed file extensions (e.g. ["pdf", "png"]). Empty array allows all.
Maximum file size in megabytes.
1 <= x <= 500Custom S3 path template for uploaded files.
500Reject files detected as blank or placeholder content.
Reject files that fail integrity checks.
Scan files for malware using ClamAV.
Optional per-context upload rate limit.
Show child attributes
Show child attributes
Storage quota in MB. null means unlimited.
1 <= x <= 10485760ID of the storage bucket (config_id) this context routes uploads to. null uses the tenant's default bucket.
"cfg_a1b2c3d4e5f6"
Was this page helpful?

