{"openapi":"3.1.0","info":{"title":"Content-Disposition API","version":"1.0.0","description":"Parse and build HTTP Content-Disposition headers (RFC 6266, with RFC 5987 filename* encoding). The parse endpoint reads a header into its disposition type (attachment, inline or form-data), its filename — correctly decoding the extended filename*=UTF-8''… form and preferring it over a plain filename exactly as the specification requires — the form-data field name, and any remaining parameters. The build endpoint assembles a correct header from simple fields and, when a filename contains non-ASCII characters (accents, emoji, CJK), automatically emits both an ASCII fallback filename and the percent-encoded filename*, so every browser shows the right download name while older clients still work. Everything is computed locally and deterministically, so it is instant and private — no file is ever fetched or stored. Ideal for file-download and upload endpoints, object storage and CDNs, content gateways and proxies, email and multipart handling, and debugging why a download is mis-named. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This builds and parses the header string itself; it does not serve a file.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/contentdisposition-api","description":"oanor gateway"}],"tags":[{"name":"Disposition"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/build":{"get":{"operationId":"get_v1_build","tags":["Disposition"],"summary":"Build a Content-Disposition header","description":"","parameters":[{"name":"type","in":"query","required":false,"description":"attachment (default), inline or form-data","schema":{"type":"string"},"example":"attachment"},{"name":"filename","in":"query","required":false,"description":"The download filename (any Unicode)","schema":{"type":"string"},"example":"report.pdf"},{"name":"name","in":"query","required":false,"description":"The form field name (for form-data)","schema":{"type":"string"}},{"name":"ascii_only","in":"query","required":false,"description":"true to force a plain ASCII filename","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"content_disposition":"attachment; filename=\"report.pdf\""},"meta":{"timestamp":"2026-06-03T09:25:02.265Z","request_id":"a720162b-b9cc-4b1d-af47-1cc01fe72f70"},"status":"ok","message":"Build a Content-Disposition header","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/parse":{"get":{"operationId":"get_v1_parse","tags":["Disposition"],"summary":"Parse a Content-Disposition header","description":"","parameters":[{"name":"header","in":"query","required":true,"description":"A Content-Disposition header value","schema":{"type":"string"},"example":"attachment; filename=\"report.pdf\""}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"type":"attachment","filename":"report.pdf","parameters":{"filename":"report.pdf"}},"meta":{"timestamp":"2026-06-03T09:25:02.379Z","request_id":"97b027d2-45aa-4170-a450-7d941e55790d"},"status":"ok","message":"Parse a Content-Disposition header","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"name":"Content-Disposition API","notes":"Per RFC 6266, filename* (extended, Unicode) takes precedence over a plain filename when both are present. Non-ASCII filenames are emitted as both filename (ASCII fallback) and filename*. This builds and parses the header string — it does not serve a file. Nothing is stored.","version":"v1","endpoints":[{"path":"/v1/parse","params":{"header":"a Content-Disposition header value (required)"},"returns":"the disposition type, filename, form field name and parameters"},{"path":"/v1/build","params":{"name":"the form field name (for form-data)","type":"attachment (default), inline or form-data","filename":"the download filename (any Unicode)","ascii_only":"true to force a plain ASCII filename"},"returns":"the Content-Disposition header string"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Parse and build HTTP Content-Disposition headers (RFC 6266 with RFC 5987 filename* encoding). The parse endpoint reads a header into its disposition type (attachment, inline or form-data), its filename — correctly decoding the extended filename*=UTF-8''… form and preferring it over a plain filename, as the spec requires — the form-data field name, and any other parameters. The build endpoint assembles a correct header from simple fields and, when a filename contains non-ASCII characters, automatically emits both an ASCII fallback filename and the percent-encoded filename* so every browser gets the right name. Pure local, no key."},"meta":{"timestamp":"2026-06-03T09:25:02.489Z","request_id":"861eb6b2-1a22-4c52-9d58-1ed13ddcf6a4"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":2935,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":445,"monthly_call_quota":12450,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2435,"monthly_call_quota":175500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6235,"monthly_call_quota":920000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/contentdisposition-api"}