{"openapi":"3.1.0","info":{"title":"DocConvert API","description":"\nDocument conversion and processing API.\n\n## Skip the Docs — Use Our MCP Server\n\nYou don't need to read through these docs manually. Connect your AI coding assistant (Claude, Cursor, Windsurf, etc.) to our **MCP server** and let it explore the API for you.\n\nYour AI will:\n- Discover available endpoints and their capabilities\n- Generate working code examples tailored to your use case\n- Handle authentication and error patterns correctly\n\n**No SDKs required.** No third-party dependencies to audit or maintain. Just clean HTTP calls using your language's native libraries (`httpx`, `fetch`, `curl`, etc.).\n\n👉 **[Set up MCP in 2 minutes →](https://www.filegraph.ai/mcp)**\n\n---\n\n## Features\n- **Smart text extraction** from any document format\n- **PDF operations**: merge, split, compress, encrypt, decrypt\n- **Format conversion**: between PDF, DOCX, XLSX, PPTX, images, HTML\n- **OCR**: extract text from images and scanned documents\n\n## Authentication\n\nAll endpoints require an API key in the `X-API-Key` header:\n\n```\nX-API-Key: your-api-key-here\n```\n\n## Quick Start\n\n```python\nhttpx.post(\"https://api.filegraph.ai/any/to-text\",\n    headers={\n      \"X-API-Key\": \"YOUR_API_KEY\"\n    },\n    params={\n      \"ocr_language\": \"eng\",\n      \"ocr_fallback\": \"true\"\n    },\n    files=[\n      (\"file\", open(\"document.pdf\", \"rb\"))\n    ]\n)\n```\n\n## Documentation\n\n- **API Reference**: [filegraph.ai/docs](https://filegraph.ai/docs)\n- **LLM-friendly**: [/llms.txt](/llms.txt)\n\n## Rate Limits\n\nRate limits and file size limits are based on your plan. See your dashboard for details.\n    ","version":"0.1.0"},"paths":{"/context/overview":{"get":{"tags":["Context"],"summary":"API overview and general documentation","description":"API overview: authentication, rate limits, errors, and available endpoint groups.","operationId":"filegraph_api_overview","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Filegraph Api Overview"}}}}}}},"/context/text-extraction":{"get":{"tags":["Context"],"summary":"Text extraction endpoint documentation","description":"Docs for /any/to-text, /any/info, /any/to-struct — extract text with smart format detection and ocr, analyze file metadata, extract structured data with LLM.","operationId":"filegraph_text_extraction_docs","parameters":[{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Language for code examples (e.g. 'go_native', 'shell_curl'). Defaults to Python HTTPX.","title":"Language"},"description":"Language for code examples (e.g. 'go_native', 'shell_curl'). Defaults to Python HTTPX."},{"name":"endpoint","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Get docs for a single endpoint only (reduces response size). Valid values: /any/to-text, /any/info, /any/to-struct","title":"Endpoint"},"description":"Get docs for a single endpoint only (reduces response size). Valid values: /any/to-text, /any/info, /any/to-struct"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Filegraph Text Extraction Docs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/context/pdf-text-conversion":{"get":{"tags":["Context"],"summary":"PDF text extraction and conversion documentation","description":"Docs for /pdf/to-text, /pdf/to-docx, /pdf/to-image — extract text with ocr, convert pdf to docx or images.","operationId":"filegraph_pdf_text_conversion_docs","parameters":[{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Language for code examples (e.g. 'go_native', 'shell_curl'). Defaults to Python HTTPX.","title":"Language"},"description":"Language for code examples (e.g. 'go_native', 'shell_curl'). Defaults to Python HTTPX."},{"name":"endpoint","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Get docs for a single endpoint only (reduces response size). Valid values: /pdf/to-text, /pdf/to-docx, /pdf/to-image","title":"Endpoint"},"description":"Get docs for a single endpoint only (reduces response size). Valid values: /pdf/to-text, /pdf/to-docx, /pdf/to-image"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Filegraph Pdf Text Conversion Docs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/context/pdf-manipulation":{"get":{"tags":["Context"],"summary":"PDF manipulation documentation","description":"Docs for /pdf/merge, /pdf/split, /pdf/compress, /pdf/rotate — merge, split, compress, and rotate pdf files.","operationId":"filegraph_pdf_manipulation_docs","parameters":[{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Language for code examples (e.g. 'go_native', 'shell_curl'). Defaults to Python HTTPX.","title":"Language"},"description":"Language for code examples (e.g. 'go_native', 'shell_curl'). Defaults to Python HTTPX."},{"name":"endpoint","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Get docs for a single endpoint only (reduces response size). Valid values: /pdf/merge, /pdf/split, /pdf/compress, /pdf/rotate","title":"Endpoint"},"description":"Get docs for a single endpoint only (reduces response size). Valid values: /pdf/merge, /pdf/split, /pdf/compress, /pdf/rotate"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Filegraph Pdf Manipulation Docs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/context/pdf-security":{"get":{"tags":["Context"],"summary":"PDF security documentation","description":"Docs for /pdf/encrypt, /pdf/decrypt — encrypt and decrypt pdf files with password protection.","operationId":"filegraph_pdf_security_docs","parameters":[{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Language for code examples (e.g. 'go_native', 'shell_curl'). Defaults to Python HTTPX.","title":"Language"},"description":"Language for code examples (e.g. 'go_native', 'shell_curl'). Defaults to Python HTTPX."},{"name":"endpoint","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Get docs for a single endpoint only (reduces response size). Valid values: /pdf/encrypt, /pdf/decrypt","title":"Endpoint"},"description":"Get docs for a single endpoint only (reduces response size). Valid values: /pdf/encrypt, /pdf/decrypt"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Filegraph Pdf Security Docs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/context/image-ocr":{"get":{"tags":["Context"],"summary":"Image processing endpoint documentation","description":"Docs for /image/to-text, /image/to-pdf, /image/resize — extract text via ocr, convert images to pdf, resize images.","operationId":"filegraph_image_processing_docs","parameters":[{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Language for code examples (e.g. 'go_native', 'shell_curl'). Defaults to Python HTTPX.","title":"Language"},"description":"Language for code examples (e.g. 'go_native', 'shell_curl'). Defaults to Python HTTPX."},{"name":"endpoint","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Get docs for a single endpoint only (reduces response size). Valid values: /image/to-text, /image/to-pdf, /image/resize","title":"Endpoint"},"description":"Get docs for a single endpoint only (reduces response size). Valid values: /image/to-text, /image/to-pdf, /image/resize"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Filegraph Image Processing Docs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/context/office-documents":{"get":{"tags":["Context"],"summary":"Office documents endpoint documentation","description":"Docs for /docx/to-text, /docx/to-pdf, /xlsx/to-text, /xlsx/to-pdf, /xlsx/to-csv, /pptx/to-text, /pptx/to-pdf, /pptx/to-images — extract text/data, convert word/excel/powerpoint to pdf/csv/images.","operationId":"filegraph_office_documents_docs","parameters":[{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Language for code examples (e.g. 'go_native', 'shell_curl'). Defaults to Python HTTPX.","title":"Language"},"description":"Language for code examples (e.g. 'go_native', 'shell_curl'). Defaults to Python HTTPX."},{"name":"endpoint","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Get docs for a single endpoint only (reduces response size). Valid values: /docx/to-text, /docx/to-pdf, /xlsx/to-text, /xlsx/to-pdf, /xlsx/to-csv, /pptx/to-text, /pptx/to-pdf, /pptx/to-images","title":"Endpoint"},"description":"Get docs for a single endpoint only (reduces response size). Valid values: /docx/to-text, /docx/to-pdf, /xlsx/to-text, /xlsx/to-pdf, /xlsx/to-csv, /pptx/to-text, /pptx/to-pdf, /pptx/to-images"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Filegraph Office Documents Docs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/context/html-processing":{"get":{"tags":["Context"],"summary":"HTML processing endpoint documentation","description":"Docs for /html/to-text, /html/to-pdf, /html/to-image — extract html text, render to pdf, capture html screenshots.","operationId":"filegraph_html_processing_docs","parameters":[{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Language for code examples (e.g. 'go_native', 'shell_curl'). Defaults to Python HTTPX.","title":"Language"},"description":"Language for code examples (e.g. 'go_native', 'shell_curl'). Defaults to Python HTTPX."},{"name":"endpoint","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Get docs for a single endpoint only (reduces response size). Valid values: /html/to-text, /html/to-pdf, /html/to-image","title":"Endpoint"},"description":"Get docs for a single endpoint only (reduces response size). Valid values: /html/to-text, /html/to-pdf, /html/to-image"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Filegraph Html Processing Docs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/context/security":{"get":{"tags":["Context"],"summary":"Security endpoint documentation","description":"Docs for /security/pdf/redact, /security/text/redact, /security/pdf/lock, /security/pdf/unlock, /security/detect-tracking — redact sensitive pdf content, redact PII from extracted text, lock/unlock pdfs, detect/remove tracking pixels.","operationId":"filegraph_security_docs","parameters":[{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Language for code examples (e.g. 'go_native', 'shell_curl'). Defaults to Python HTTPX.","title":"Language"},"description":"Language for code examples (e.g. 'go_native', 'shell_curl'). Defaults to Python HTTPX."},{"name":"endpoint","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Get docs for a single endpoint only (reduces response size). Valid values: /security/pdf/redact, /security/text/redact, /security/pdf/lock, /security/pdf/unlock, /security/detect-tracking","title":"Endpoint"},"description":"Get docs for a single endpoint only (reduces response size). Valid values: /security/pdf/redact, /security/text/redact, /security/pdf/lock, /security/pdf/unlock, /security/detect-tracking"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Filegraph Security Docs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/any/to-text":{"post":{"tags":["Smart Conversion"],"summary":"Extract text from any document","description":"Smart text extraction that automatically detects the input format and uses\nthe appropriate extraction method.\n\n## Supported Formats\n- **PDF**: Native text extraction, falls back to OCR for scanned PDFs\n- **DOCX**: Microsoft Word documents\n- **XLSX**: Microsoft Excel (extracts cell contents)\n- **PPTX**: Microsoft PowerPoint (extracts slide text)\n- **Images**: PNG, JPEG, TIFF, BMP (uses OCR)\n- **HTML**: Extracts visible text content\n\n## How It Works\n1. Detects file format from content (not just extension)\n2. Routes to appropriate extraction module\n3. For PDFs: tries native extraction first, falls back to OCR if no text found\n4. Returns extracted text with metadata about source format\n\n## Example Usage\n\n```python\nimport httpx\n\nwith open(\"document.pdf\", \"rb\") as f:\n    response = httpx.post(\n        \"https://api.filegraph.ai/any/to-text\",\n        headers={\"X-API-Key\": \"your-api-key\"},\n        files={\"file\": f},\n    )\nprint(response.json()[\"text\"])\n```","operationId":"any_to_text_any_to_text_post","parameters":[{"name":"ocr_language","in":"query","required":false,"schema":{"type":"string","default":"eng","title":"Ocr Language"}},{"name":"ocr_fallback","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Ocr Fallback"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_any_to_text_any_to_text_post"}}}},"responses":{"200":{"description":"Text successfully extracted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextExtractionResponse"}}}},"400":{"description":"File format not supported","content":{"application/json":{"example":{"error":"UnsupportedFormatError","message":"Unsupported file format: application/zip","trace_id":"a1b2c3d4"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"File exceeds size limit","content":{"application/json":{"example":{"error":"FileTooLargeError","message":"File size (150.0MB) exceeds maximum allowed (100MB)","trace_id":"a1b2c3d4"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"File processing failed","content":{"application/json":{"example":{"error":"FileProcessingError","message":"Failed to process file: corrupted or invalid format","trace_id":"a1b2c3d4"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"example":{"error":"InvalidApiKeyError","message":"Invalid API key. Check your API key and try again.","trace_id":"a1b2c3d4"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Insufficient credits for this operation","content":{"application/json":{"example":{"error":"InsufficientCreditsError","message":"Insufficient credits. Available: 5, Required: 10","trace_id":"a1b2c3d4"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal error","content":{"application/json":{"example":{"error":"InternalServerError","message":"An unexpected error occurred. Please try again or contact support.","trace_id":"a1b2c3d4"},"schema":{"$ref":"#/components/schemas/InternalErrorResponse"}}}}}}},"/any/info":{"post":{"tags":["Smart Conversion"],"summary":"Get file information","description":"Analyze a file and return information about its format, size, and contents.\n\n## Returned Information\n- Detected MIME type and format name\n- File size\n- Page count (for PDFs, PPTX)\n- Image dimensions (for images)\n- Sheet names (for XLSX)","operationId":"any_info_any_info_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_any_info_any_info_post"}}},"required":true},"responses":{"200":{"description":"File information retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileInfoResponse"}}}},"400":{"description":"File format not supported","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"UnsupportedFormatError","message":"Unsupported file format: application/zip","trace_id":"a1b2c3d4"}}}},"413":{"description":"File exceeds size limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"FileTooLargeError","message":"File size (150.0MB) exceeds maximum allowed (100MB)","trace_id":"a1b2c3d4"}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"InvalidApiKeyError","message":"Invalid API key. Check your API key and try again.","trace_id":"a1b2c3d4"}}}},"402":{"description":"Insufficient credits for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"InsufficientCreditsError","message":"Insufficient credits. Available: 5, Required: 10","trace_id":"a1b2c3d4"}}}},"500":{"description":"Unexpected internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalErrorResponse"},"example":{"error":"InternalServerError","message":"An unexpected error occurred. Please try again or contact support.","trace_id":"a1b2c3d4"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/any/to-struct":{"post":{"tags":["Smart Conversion"],"summary":"Extract structured data from any document","description":"Extract structured data from documents into JSON that matches your data structures.\n\n## The Pattern\n\n1. Define your data structure with descriptions (Pydantic model, Go struct, TypeScript interface)\n2. Generate JSON Schema from your model (e.g., `model_json_schema()` in Pydantic)\n3. Flatten the schema to remove `$ref`/`$defs` (required by this API)\n4. Upload a document\n5. Parse `extracted_data` directly into your type\n\n## Example (Python with Pydantic)\n\n```python\nimport httpx\nimport json\nfrom pydantic import BaseModel, Field\n\n# 1. Define your type with descriptions (required for LLM extraction)\nclass ContactInfo(BaseModel):\n    name: str | None = Field(None, description=\"Person's full name\")\n    email: str | None = Field(None, description=\"Email address\")\n\n# 2. Helper to flatten Pydantic's JSON Schema for API compatibility\ndef flatten_schema(schema: dict) -> dict:\n    \"\"\"Convert model_json_schema() output to API-compatible format.\n\n    Resolves $ref/$defs and simplifies anyOf[T, null] to T.\n    \"\"\"\n    defs = schema.pop(\"$defs\", {})\n\n    def resolve(obj):\n        if isinstance(obj, dict):\n            if \"$ref\" in obj:\n                ref_name = obj[\"$ref\"].split(\"/\")[-1]\n                return resolve(defs[ref_name])\n            if \"anyOf\" in obj:\n                non_null = [t for t in obj[\"anyOf\"] if t.get(\"type\") != \"null\"]\n                if len(non_null) == 1:\n                    result = {k: v for k, v in obj.items() if k not in (\"anyOf\", \"default\")}\n                    result.update(resolve(non_null[0]))\n                    return result\n            return {k: resolve(v) for k, v in obj.items()}\n        if isinstance(obj, list):\n            return [resolve(i) for i in obj]\n        return obj\n\n    result = resolve(schema)\n    result.pop(\"title\", None)\n    result.pop(\"required\", None)\n    return result\n\n# 3. Generate flattened schema from your model\nschema = flatten_schema(ContactInfo.model_json_schema())\n\n# 4. Call the API\nwith open(\"business_card.png\", \"rb\") as f:\n    response = httpx.post(\n        \"https://api.filegraph.ai/any/to-struct\",\n        headers={\"X-API-Key\": \"your-api-key\"},\n        files={\"file\": f},\n        data={\"schema\": json.dumps(schema)},\n    )\n\n# 5. Parse directly into your type\ncontact = ContactInfo(**response.json()[\"extracted_data\"])\n```\n\n## Why flatten_schema?\n\nPydantic's `model_json_schema()` produces schemas with `$ref` and `$defs` for nested models,\nand `anyOf[T, null]` for optional fields. This API requires a flat schema without these.\nThe helper resolves references and simplifies optional types.\n\n## Supported JSON Schema Types\n- **Primitives**: `string`, `integer`, `number`, `boolean`\n- **Formats**: `email`, `uri`, `date`, `date-time`, `phone`\n- **Collections**: `array` (with `items`)\n- **Nested**: `object` with `properties` (max 3 levels deep)\n- **Enums**: `enum` for fixed value lists\n\n## Rate Limiting\nThis endpoint has 3x rate limit weight due to LLM processing costs.","operationId":"any_to_struct_any_to_struct_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_any_to_struct_any_to_struct_post"}}},"required":true},"responses":{"200":{"description":"Structured data successfully extracted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StructuredExtractionResponse"}}}},"400":{"description":"Invalid schema","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"InvalidSchemaError","message":"Invalid schema: Field 'foo' has unknown type 'bar'","trace_id":"abc123..."}}}},"413":{"description":"File exceeds size limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"FileTooLargeError","message":"File size (150.0MB) exceeds maximum allowed (100MB)","trace_id":"a1b2c3d4"}}}},"422":{"description":"LLM extraction failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"LLMExtractionError","message":"LLM extraction failed: OpenAI API error after 3 retries","trace_id":"abc123..."}}}},"503":{"description":"LLM not configured","content":{"application/json":{"example":{"error":"LLMConfigurationError","message":"LLM extraction is not configured. Contact support.","trace_id":"abc123..."}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"InvalidApiKeyError","message":"Invalid API key. Check your API key and try again.","trace_id":"a1b2c3d4"}}}},"402":{"description":"Insufficient credits for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"InsufficientCreditsError","message":"Insufficient credits. Available: 5, Required: 10","trace_id":"a1b2c3d4"}}}},"500":{"description":"Unexpected internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalErrorResponse"},"example":{"error":"InternalServerError","message":"An unexpected error occurred. Please try again or contact support.","trace_id":"a1b2c3d4"}}}}}}},"/txt/to-struct":{"post":{"tags":["Smart Conversion"],"summary":"Extract structured data from text","description":"Extract structured data from text into JSON that matches your data structures.\n\nUse this endpoint when you already have text content and don't need file upload.\nFor file uploads, use `/any/to-struct` instead.\n\n## Request Body\n\n```json\n{\n  \"text\": \"John Doe\\njohn@example.com\\nSkills: Python, FastAPI...\",\n  \"schema\": {\n    \"type\": \"object\",\n    \"properties\": {\n      \"name\": {\"type\": \"string\", \"description\": \"Full name\"},\n      \"email\": {\"type\": \"string\", \"format\": \"email\", \"description\": \"Email address\"}\n    }\n  }\n}\n```\n\n## Schema Requirements\n\nAll fields must include a `description` to help the LLM understand what to extract.\n\n## Rate Limiting\nThis endpoint has 3x rate limit weight due to LLM processing costs.","operationId":"txt_to_struct_txt_to_struct_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextToStructRequest"}}},"required":true},"responses":{"200":{"description":"Structured data successfully extracted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextStructuredExtractionResponse"}}}},"400":{"description":"Invalid schema","content":{"application/json":{"example":{"error":"InvalidSchemaError","message":"Invalid schema: Field 'foo' has unknown type 'bar'","trace_id":"abc123..."}}}},"422":{"description":"LLM extraction failed","content":{"application/json":{"example":{"error":"LLMExtractionError","message":"LLM extraction failed: OpenAI API error after 3 retries","trace_id":"abc123..."}}}},"503":{"description":"LLM not configured","content":{"application/json":{"example":{"error":"LLMConfigurationError","message":"LLM extraction is not configured. Contact support.","trace_id":"abc123..."}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"InvalidApiKeyError","message":"Invalid API key. Check your API key and try again.","trace_id":"a1b2c3d4"}}}},"402":{"description":"Insufficient credits for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"InsufficientCreditsError","message":"Insufficient credits. Available: 5, Required: 10","trace_id":"a1b2c3d4"}}}},"500":{"description":"Unexpected internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalErrorResponse"},"example":{"error":"InternalServerError","message":"An unexpected error occurred. Please try again or contact support.","trace_id":"a1b2c3d4"}}}}}}},"/pdf/to-text":{"post":{"tags":["PDF"],"summary":"Extract text from PDF","description":"Extract text content from a PDF document.\n\nFor native PDFs (created digitally), text is extracted directly.\nFor scanned PDFs, OCR is used automatically when `ocr_fallback` is enabled.\n\n## Options\n- **ocr_language**: Language code for OCR (default: \"eng\")\n- **ocr_fallback**: Whether to use OCR if no text found (default: true)","operationId":"pdf_to_text_pdf_to_text_post","parameters":[{"name":"ocr_language","in":"query","required":false,"schema":{"type":"string","default":"eng","title":"Ocr Language"}},{"name":"ocr_fallback","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Ocr Fallback"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_pdf_to_text_pdf_to_text_post"}}}},"responses":{"200":{"description":"Text successfully extracted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextExtractionResponse"}}}},"400":{"description":"File format not supported","content":{"application/json":{"example":{"error":"UnsupportedFormatError","message":"Unsupported file format: application/zip","trace_id":"a1b2c3d4"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"File exceeds size limit","content":{"application/json":{"example":{"error":"FileTooLargeError","message":"File size (150.0MB) exceeds maximum allowed (100MB)","trace_id":"a1b2c3d4"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"File processing failed","content":{"application/json":{"example":{"error":"FileProcessingError","message":"Failed to process file: corrupted or invalid format","trace_id":"a1b2c3d4"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"example":{"error":"InvalidApiKeyError","message":"Invalid API key. Check your API key and try again.","trace_id":"a1b2c3d4"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Insufficient credits for this operation","content":{"application/json":{"example":{"error":"InsufficientCreditsError","message":"Insufficient credits. Available: 5, Required: 10","trace_id":"a1b2c3d4"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected internal error","content":{"application/json":{"example":{"error":"InternalServerError","message":"An unexpected error occurred. Please try again or contact support.","trace_id":"a1b2c3d4"},"schema":{"$ref":"#/components/schemas/InternalErrorResponse"}}}}}}},"/pdf/to-docx":{"post":{"tags":["PDF"],"summary":"Convert PDF to Word","description":"Convert a PDF document to Microsoft Word (DOCX) format.","operationId":"pdf_to_docx_pdf_to_docx_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_pdf_to_docx_pdf_to_docx_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pdf/to-image":{"post":{"tags":["PDF"],"summary":"Convert PDF to images","description":"Convert PDF pages to images.\n\n## Options\n- **format**: Output image format (png, jpeg, tiff)\n- **dpi**: Resolution in dots per inch (default: 150)\n- **pages**: Page range to convert (default: all)","operationId":"pdf_to_image_pdf_to_image_post","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"png","title":"Format"}},{"name":"dpi","in":"query","required":false,"schema":{"type":"integer","default":150,"title":"Dpi"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_pdf_to_image_pdf_to_image_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pdf/merge":{"post":{"tags":["PDF"],"summary":"Merge multiple PDFs","description":"Merge multiple PDF files into a single PDF.\n\nFiles are merged in the order they are provided.","operationId":"pdf_merge_pdf_merge_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_pdf_merge_pdf_merge_post"}}},"required":true},"responses":{"200":{"description":"PDFs successfully merged","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeResponse"}}}},"400":{"description":"File format not supported","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"UnsupportedFormatError","message":"Unsupported file format: application/zip","trace_id":"a1b2c3d4"}}}},"413":{"description":"File exceeds size limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"FileTooLargeError","message":"File size (150.0MB) exceeds maximum allowed (100MB)","trace_id":"a1b2c3d4"}}}},"422":{"description":"File processing failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"FileProcessingError","message":"Failed to process file: corrupted or invalid format","trace_id":"a1b2c3d4"}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"InvalidApiKeyError","message":"Invalid API key. Check your API key and try again.","trace_id":"a1b2c3d4"}}}},"402":{"description":"Insufficient credits for this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"InsufficientCreditsError","message":"Insufficient credits. Available: 5, Required: 10","trace_id":"a1b2c3d4"}}}},"500":{"description":"Unexpected internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalErrorResponse"},"example":{"error":"InternalServerError","message":"An unexpected error occurred. Please try again or contact support.","trace_id":"a1b2c3d4"}}}}}}},"/pdf/split":{"post":{"tags":["PDF"],"summary":"Split PDF by pages","description":"Split a PDF into multiple files based on page ranges.\n\n## Page Range Syntax\n- Single page: `5`\n- Range: `1-10`\n- Multiple ranges: `1-5,10-15,20`\n- From page to end: `10-`","operationId":"pdf_split_pdf_split_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_pdf_split_pdf_split_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pdf/compress":{"post":{"tags":["PDF"],"summary":"Compress PDF","description":"Reduce PDF file size by compressing images and removing unnecessary data.\n\n## Compression Levels\n- **low**: Minimal compression, best quality\n- **medium**: Balanced compression (default)\n- **high**: Maximum compression, reduced quality","operationId":"pdf_compress_pdf_compress_post","parameters":[{"name":"level","in":"query","required":false,"schema":{"type":"string","default":"medium","title":"Level"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_pdf_compress_pdf_compress_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompressResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pdf/rotate":{"post":{"tags":["PDF"],"summary":"Rotate PDF pages","description":"Rotate pages in a PDF document.\n\n## Rotation Options\n- **angle**: Rotation angle (90, 180, 270)\n- **pages**: Page range to rotate (default: all)","operationId":"pdf_rotate_pdf_rotate_post","parameters":[{"name":"angle","in":"query","required":false,"schema":{"type":"integer","default":90,"title":"Angle"}},{"name":"pages","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pages"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_pdf_rotate_pdf_rotate_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pdf/encrypt":{"post":{"tags":["PDF"],"summary":"Password protect PDF","description":"Add password protection and encryption to a PDF.\n\n## Encryption Options\n- **user_password**: Password required to open the PDF\n- **owner_password**: Password required to change permissions\n- **permissions**: List of allowed actions (print, copy, modify)","operationId":"pdf_encrypt_pdf_encrypt_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_pdf_encrypt_pdf_encrypt_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pdf/decrypt":{"post":{"tags":["PDF"],"summary":"Remove PDF password","description":"Remove password protection from a PDF (requires the password).","operationId":"pdf_decrypt_pdf_decrypt_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_pdf_decrypt_pdf_decrypt_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/image/to-text":{"post":{"tags":["Image"],"summary":"OCR - Extract text from image","description":"Extract text from an image using Optical Character Recognition (OCR).\n\n## Supported Formats\n- PNG, JPEG, TIFF, BMP, GIF, WebP\n\n## Language Support\nUse ISO 639-3 language codes. Multiple languages can be combined with '+'.\n\nExamples:\n- `eng` - English\n- `deu` - German\n- `fra` - French\n- `eng+fra` - English and French\n\n## Example Usage\n\n```python\nimport httpx\n\nwith open(\"scan.png\", \"rb\") as f:\n    response = httpx.post(\n        \"https://api.filegraph.ai/image/to-text\",\n        headers={\"X-API-Key\": \"your-api-key\"},\n        files={\"file\": f},\n        data={\"language\": \"eng\"}\n    )\nprint(response.json()[\"text\"])\n```","operationId":"image_to_text_image_to_text_post","parameters":[{"name":"language","in":"query","required":false,"schema":{"type":"string","default":"eng","title":"Language"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_image_to_text_image_to_text_post"}}}},"responses":{"200":{"description":"Text successfully extracted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextExtractionResponse"}}}},"400":{"description":"Invalid image format"},"422":{"description":"OCR processing failed"}}}},"/image/to-pdf":{"post":{"tags":["Image"],"summary":"Convert image(s) to PDF","description":"Convert one or more images to a PDF document.\n\nEach image becomes one page in the PDF.\nImages are added in the order provided.","operationId":"image_to_pdf_image_to_pdf_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_image_to_pdf_image_to_pdf_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/image/resize":{"post":{"tags":["Image"],"summary":"Resize image","description":"Resize an image to specified dimensions.\n\n## Options\n- **width**: Target width in pixels\n- **height**: Target height in pixels\n- **maintain_aspect**: Keep aspect ratio (default: true)\n- **quality**: JPEG quality 1-100 (default: 85)","operationId":"image_resize_image_resize_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_image_resize_image_resize_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/docx/to-text":{"post":{"tags":["Word"],"summary":"Extract text from Word document","description":"Extract all text content from a Microsoft Word document.\n\nExtracts text from:\n- Document body\n- Headers and footers\n- Tables\n- Text boxes\n\n## Example Usage\n\n```python\nimport httpx\n\nwith open(\"report.docx\", \"rb\") as f:\n    response = httpx.post(\n        \"https://api.filegraph.ai/docx/to-text\",\n        headers={\"X-API-Key\": \"your-api-key\"},\n        files={\"file\": f},\n    )\nprint(response.json()[\"text\"])\n```","operationId":"docx_to_text_docx_to_text_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_docx_to_text_docx_to_text_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextExtractionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/docx/to-pdf":{"post":{"tags":["Word"],"summary":"Convert Word to PDF","description":"Convert a Microsoft Word document to PDF format.\n\nPreserves:\n- Text formatting\n- Images\n- Tables\n- Page layout","operationId":"docx_to_pdf_docx_to_pdf_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_docx_to_pdf_docx_to_pdf_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/xlsx/to-text":{"post":{"tags":["Excel"],"summary":"Extract text from Excel","description":"Extract all text and data from an Excel spreadsheet.\n\nExtracts data from all sheets, preserving structure where possible.\n\n## Options\n- **sheet**: Specific sheet name to extract (default: all sheets)\n- **include_headers**: Include column headers (default: true)","operationId":"xlsx_to_text_xlsx_to_text_post","parameters":[{"name":"sheet","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sheet"}},{"name":"include_headers","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Headers"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_xlsx_to_text_xlsx_to_text_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextExtractionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/xlsx/to-pdf":{"post":{"tags":["Excel"],"summary":"Convert Excel to PDF","description":"Convert an Excel spreadsheet to PDF format.","operationId":"xlsx_to_pdf_xlsx_to_pdf_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_xlsx_to_pdf_xlsx_to_pdf_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/xlsx/to-csv":{"post":{"tags":["Excel"],"summary":"Convert Excel to CSV","description":"Convert an Excel spreadsheet to CSV format.\n\nFor multi-sheet workbooks, returns a ZIP file containing one CSV per sheet.","operationId":"xlsx_to_csv_xlsx_to_csv_post","parameters":[{"name":"sheet","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sheet"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_xlsx_to_csv_xlsx_to_csv_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pptx/to-text":{"post":{"tags":["PowerPoint"],"summary":"Extract text from PowerPoint","description":"Extract all text content from a PowerPoint presentation.\n\nExtracts text from:\n- Slide titles and content\n- Text boxes\n- Tables\n- Speaker notes (optional)","operationId":"pptx_to_text_pptx_to_text_post","parameters":[{"name":"include_notes","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Notes"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_pptx_to_text_pptx_to_text_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextExtractionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pptx/to-pdf":{"post":{"tags":["PowerPoint"],"summary":"Convert PowerPoint to PDF","description":"Convert a PowerPoint presentation to PDF format.","operationId":"pptx_to_pdf_pptx_to_pdf_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_pptx_to_pdf_pptx_to_pdf_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pptx/to-images":{"post":{"tags":["PowerPoint"],"summary":"Convert slides to images","description":"Convert PowerPoint slides to images.\n\nEach slide becomes one image. Returns a ZIP file containing all images.\n\n## Options\n- **format**: Output image format (png, jpeg)\n- **dpi**: Resolution in dots per inch (default: 150)","operationId":"pptx_to_images_pptx_to_images_post","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"png","title":"Format"}},{"name":"dpi","in":"query","required":false,"schema":{"type":"integer","default":150,"title":"Dpi"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_pptx_to_images_pptx_to_images_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/html/to-text":{"post":{"tags":["HTML"],"summary":"Extract text from HTML","description":"Extract visible text content from an HTML document.\n\nRemoves:\n- HTML tags\n- Scripts and styles\n- Comments\n\nPreserves:\n- Text structure (paragraphs, lists)\n- Basic formatting indication","operationId":"html_to_text_html_to_text_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_html_to_text_html_to_text_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextExtractionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/html/to-pdf":{"post":{"tags":["HTML"],"summary":"Render HTML to PDF","description":"Render an HTML document to PDF format.\n\nUses a headless browser to render the HTML with:\n- CSS styling\n- Images\n- JavaScript execution (optional)\n\n## Options\n- **page_size**: Paper size (A4, Letter, etc.)\n- **landscape**: Landscape orientation\n- **print_background**: Include background colors/images","operationId":"html_to_pdf_html_to_pdf_post","parameters":[{"name":"page_size","in":"query","required":false,"schema":{"type":"string","default":"A4","title":"Page Size"}},{"name":"landscape","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Landscape"}},{"name":"print_background","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Print Background"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_html_to_pdf_html_to_pdf_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/html/to-image":{"post":{"tags":["HTML"],"summary":"Screenshot HTML to image","description":"Capture a screenshot of an HTML document.\n\n## Options\n- **format**: Output image format (png, jpeg)\n- **width**: Viewport width in pixels (default: 1920)\n- **full_page**: Capture full scrollable page (default: false)","operationId":"html_to_image_html_to_image_post","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"png","title":"Format"}},{"name":"width","in":"query","required":false,"schema":{"type":"integer","default":1920,"title":"Width"}},{"name":"full_page","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Full Page"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_html_to_image_html_to_image_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/security/pdf/redact":{"post":{"tags":["Security"],"summary":"Redact sensitive data from PDF","description":"Automatically detect and redact sensitive information from PDF documents using AI.\n\n## Compliance Presets\n\nChoose a preset to match your regulatory requirements:\n\n| Preset | Use Case |\n|--------|----------|\n| **auto** | General redaction - detects PII, financial, healthcare, legal data |\n| **gdpr** | EU data protection - names, emails, IPs, phone numbers, national IDs |\n| **hipaa** | Healthcare - patient names, medical records, insurance, prescriptions |\n| **ferpa** | Education - student names, school records, educational IDs |\n| **foia** | Government - classified content, addresses, government IDs |\n| **glba** | Financial services - bank accounts, credit cards, loan records |\n| **ccpa** | California privacy - purchase history, geolocation, online identifiers |\n| **manual** | Custom rules only - use with `redaction_rules` parameter |\n\n## Detection Categories\n\nEnable specific detection types using boolean parameters (combine with presets for finer control):\n\n| Parameter | Set to `true` to detect | Example data detected |\n|-----------|------------------------|----------------------|\n| `pii` | Personally identifiable information | Names, emails, phone numbers, addresses, birthdates |\n| `phi` | Patient health information | Medical records, prescriptions, insurance info |\n| `financial` | Financial data | Credit cards, bank accounts, transactions |\n| `legal` | Legal/contractual data | Case numbers, contracts, legal clauses |\n| `confidential` | Confidential business data | Trade secrets, internal communications, IP |\n\n**Usage**: Pass each as a separate form field: `pii=true`, `phi=true`, etc.\n\n## Custom Redaction Rules\n\nFor precise control, pass `redaction_rules` as JSON:\n\n```json\n[\n  {\"text\": \"john@domain.com\"},\n  {\"detect\": \"Bank account number\"},\n  {\"regex\": \"\\\\b\\\\d{3}-\\\\d{2}-\\\\d{4}\\\\b\"}\n]\n```\n\n## Example\n\n```python\nimport httpx\nimport base64\n\nresponse = httpx.post(\n    \"https://api.filegraph.ai/security/pdf/redact\",\n    headers={\"X-API-Key\": \"your-api-key\"},\n    files={\"file\": open(\"sensitive.pdf\", \"rb\")},\n    data={\n        \"preset\": \"hipaa\",\n        \"minimum_confidence\": \"0.7\",\n        \"pii\": \"true\",       # Enable PII detection\n        \"financial\": \"true\"  # Also detect financial data\n    }\n)\n\nresult = response.json()\nprint(f\"Redacted {result['redactions_found']} items\")\n\n# Save the redacted PDF\noutput = base64.b64decode(result[\"content_base64\"])\nwith open(\"redacted.pdf\", \"wb\") as f:\n    f.write(output)\n```\n\n> **Note**: This endpoint applies visual redactions (black boxes) to PDFs.\n> If you need text output with category tags like `[SSN]` or `[EMAIL]`,\n> use `/security/text/redact` instead.","operationId":"redact_pdf_security_pdf_redact_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_redact_pdf_security_pdf_redact_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedactResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/security/pdf/lock":{"post":{"tags":["Security"],"summary":"Password protect and encrypt PDF","description":"Add password protection and set permissions on a PDF document.\n\n## Password Types\n\n- **User Password** (document open password): Required to open and view the PDF\n- **Owner Password** (permissions password): Required to change restrictions\n\nRecipients don't need the owner password to open the document, only to modify permissions.\n\n## Encryption Algorithms\n\n| Algorithm | Security Level | Compatibility |\n|-----------|---------------|---------------|\n| `Standard40Bit` | Low | Acrobat 3+ |\n| `Standard128Bit` | Medium | Acrobat 5+ |\n| `Aes128Bit` | High | Acrobat 7+ |\n| `Aes256Bit` | Highest | Acrobat 9+ (recommended) |\n\n## Permissions\n\nControl what users can do with the document:\n\n| Permission | Description |\n|------------|-------------|\n| `print_document` | Allow printing |\n| `print_faithful_copy` | Allow high-quality printing |\n| `copy_contents` | Allow copy/paste of text and graphics |\n| `modify_contents` | Allow editing document content |\n| `modify_annotations` | Allow adding comments and form fields |\n| `fill_form_fields` | Allow filling forms and signing |\n| `extract_contents` | Allow text/graphic extraction |\n| `assemble_document` | Allow page manipulation (insert, delete, rotate) |\n\n## Example\n\n```python\nimport httpx\n\nresponse = httpx.post(\n    \"https://api.filegraph.ai/security/pdf/lock\",\n    headers={\"X-API-Key\": \"your-api-key\"},\n    files={\"file\": open(\"document.pdf\", \"rb\")},\n    data={\n        \"user_password\": \"openme123\",\n        \"owner_password\": \"admin456\",\n        \"encryption_algorithm\": \"Aes256Bit\",\n        \"print_document\": \"true\",\n        \"copy_contents\": \"false\"\n    }\n)\n```","operationId":"lock_pdf_security_pdf_lock_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_lock_pdf_security_pdf_lock_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LockResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/security/pdf/unlock":{"post":{"tags":["Security"],"summary":"Remove password protection from PDF","description":"Remove password protection from a PDF document.\n\n## How It Works\n\n- **With password**: Removes user (open) password protection. The document will open without a password.\n- **Without password**: Removes only owner (permissions) password. The document keeps any user password but restrictions are lifted.\n\n## Common Use Cases\n\n1. **Unlock a PDF you can open but can't edit**:\n   - Leave `password` empty\n   - Owner restrictions will be removed\n\n2. **Fully unlock a password-protected PDF**:\n   - Provide the user password\n   - Both user and owner protection removed\n\n## Example\n\n```python\nimport httpx\n\n# Remove all protection (requires the open password)\nresponse = httpx.post(\n    \"https://api.filegraph.ai/security/pdf/unlock\",\n    headers={\"X-API-Key\": \"your-api-key\"},\n    files={\"file\": open(\"protected.pdf\", \"rb\")},\n    data={\"password\": \"openme123\"}\n)\n\n# Remove only owner restrictions (no password needed if document opens)\nresponse = httpx.post(\n    \"https://api.filegraph.ai/security/pdf/unlock\",\n    headers={\"X-API-Key\": \"your-api-key\"},\n    files={\"file\": open(\"restricted.pdf\", \"rb\")}\n)\n```","operationId":"unlock_pdf_security_pdf_unlock_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_unlock_pdf_security_pdf_unlock_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnlockResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/security/detect-tracking":{"post":{"tags":["Security"],"summary":"Detect and remove tracking pixels","description":"Detect and optionally remove tracking pixels from HTML emails and documents.\n\n## What Are Tracking Pixels?\n\nTracking pixels are invisible elements embedded in emails and documents to monitor:\n- When and where the document is opened\n- How many times it's viewed\n- Geographic location and device information\n\n## Detection Capabilities\n\n### Known Tracking Services\nAutomatically identifies pixels from major email marketing and analytics platforms:\n- **Email Marketing**: Mailchimp, SendGrid, HubSpot, ConvertKit, Mandrill, Mailgun\n- **Social Media**: Facebook, LinkedIn, Twitter/X, Pinterest\n- **Analytics**: Google Analytics, Bing, Quantcast, ComScore\n\n### Detection Indicators\n- **1x1 pixel dimensions** - Classic tracking pixel signature\n- **Hidden elements** - CSS hiding (display:none, visibility:hidden, opacity:0)\n- **Tracking URLs** - Paths containing /track/, /pixel/, /beacon/, /open/\n- **Query parameters** - UTM parameters, subscriber IDs, campaign IDs\n- **Encoded paths** - Long base64-encoded tracking identifiers\n\n## Response\n\nReturns a list of all detected tracking pixels with:\n- URL and type (image, iframe, beacon)\n- Confidence score (0.0 - 1.0)\n- Known source identification (if recognized)\n- Reasons why it was flagged\n\nWhen `remove=true`, the response includes the cleaned file content.\n\n## Example\n\n```python\nimport httpx\nimport base64\n\n# Detect tracking pixels\nresponse = httpx.post(\n    \"https://api.filegraph.ai/security/detect-tracking\",\n    headers={\"X-API-Key\": \"your-api-key\"},\n    files={\"file\": open(\"email.html\", \"rb\")},\n    data={\"remove\": \"false\"}\n)\n\nresult = response.json()\nprint(f\"Found {len(result['pixels_found'])} tracking pixels\")\n\n# Remove tracking pixels\nresponse = httpx.post(\n    \"https://api.filegraph.ai/security/detect-tracking\",\n    headers={\"X-API-Key\": \"your-api-key\"},\n    files={\"file\": open(\"email.html\", \"rb\")},\n    data={\"remove\": \"true\"}\n)\n\nresult = response.json()\nif result[\"was_modified\"]:\n    cleaned = base64.b64decode(result[\"content_base64\"])\n    with open(\"email_cleaned.html\", \"wb\") as f:\n        f.write(cleaned)\n```","operationId":"detect_tracking_security_detect_tracking_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_detect_tracking_security_detect_tracking_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackingPixelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/security/text/redact":{"post":{"tags":["Security"],"summary":"Redact PII from extracted text","description":"Extract text from any document and redact PII with category tags.\n\n## How It Works\n\n1. **Extract text** from any supported format (PDF, DOCX, XLSX, PPTX, images, HTML, etc.)\n2. **Detect PII** using pattern matching and intelligent entity recognition\n3. **Redact** by replacing PII with category tags like `[SSN]`, `[EMAIL]`, `[NAME]`\n4. **Return** redacted text with audit metadata\n\n## PII Types Detected\n\n| Type | Example Output | Confidence |\n|------|----------------|------------|\n| `ssn` | [SSN] | 0.90 |\n| `credit_card` | [CREDIT_CARD] | 0.95 |\n| `email` | [EMAIL] | 0.98 |\n| `phone` | [PHONE] | 0.85 |\n| `ip_address` | [IP_ADDRESS] | 0.95 |\n| `date_of_birth` | [DATE_OF_BIRTH] | 0.70 |\n| `name` | [NAME] | 0.85 |\n| `address` | [ADDRESS] | 0.85 |\n| `organization` | [ORGANIZATION] | 0.85 |\n\n## Parameters\n\n- `pii_types`: Comma-separated list of types to detect, or \"all\" (default)\n- `use_ner`: Enable intelligent name/address/organization detection (default: true)\n- `minimum_confidence`: Threshold 0.0-1.0 (default: 0.8)\n- `ocr_language`: OCR language if needed (default: \"eng\")\n- `ocr_fallback`: Use OCR if text extraction fails (default: true)\n\n## Audit Metadata\n\nThe response includes masked values for compliance logging:\n- SSN: `***-**-6789`\n- Email: `j***@example.com`\n- Phone: `***-***-7890`\n- Credit Card: `************1234`\n\n## Example\n\n```python\nimport httpx\n\nresponse = httpx.post(\n    \"https://api.filegraph.ai/security/text/redact\",\n    headers={\"X-API-Key\": \"your-api-key\"},\n    files={\"file\": open(\"document.pdf\", \"rb\")},\n    data={\n        \"pii_types\": \"ssn,email,phone,name\",\n        \"use_ner\": \"true\",\n        \"minimum_confidence\": \"0.8\"\n    }\n)\n\nresult = response.json()\nprint(f\"Found {result['pii_found']} PII instances\")\nprint(result['redacted_text'])\n\n# Audit log\nfor match in result['matches']:\n    print(f\"{match['pii_type']}: {match['masked_value']}\")\n```","operationId":"redact_text_pii_security_text_redact_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_redact_text_pii_security_text_redact_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextRedactResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_any_info_any_info_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"File to analyze"}},"type":"object","required":["file"],"title":"Body_any_info_any_info_post"},"Body_any_to_struct_any_to_struct_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Document to extract structured data from"},"schema":{"type":"string","title":"Schema","description":"JSON Schema defining fields to extract. See ENDPOINT.md for details."},"ocr_language":{"type":"string","title":"Ocr Language","description":"OCR language code (e.g., 'eng', 'fra', 'deu')","default":"eng"},"ocr_fallback":{"type":"boolean","title":"Ocr Fallback","description":"Whether to use OCR if native text extraction yields no text","default":true},"include_tables":{"type":"boolean","title":"Include Tables","description":"Extract tables from the document as structured JSON (array of row objects)","default":false}},"type":"object","required":["file","schema"],"title":"Body_any_to_struct_any_to_struct_post"},"Body_any_to_text_any_to_text_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Document to extract text from"}},"type":"object","required":["file"],"title":"Body_any_to_text_any_to_text_post"},"Body_detect_tracking_security_detect_tracking_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"HTML email or document to scan for tracking pixels"},"remove":{"type":"boolean","title":"Remove","description":"Remove detected tracking pixels and return cleaned file","default":false},"include_suspicious":{"type":"boolean","title":"Include Suspicious","description":"Include lower-confidence detections (confidence < 0.5)","default":true},"min_confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Min Confidence","description":"Minimum confidence threshold for detection (0.0-1.0)","default":0.3}},"type":"object","required":["file"],"title":"Body_detect_tracking_security_detect_tracking_post"},"Body_docx_to_pdf_docx_to_pdf_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Word document to convert"}},"type":"object","required":["file"],"title":"Body_docx_to_pdf_docx_to_pdf_post"},"Body_docx_to_text_docx_to_text_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Word document to extract text from"}},"type":"object","required":["file"],"title":"Body_docx_to_text_docx_to_text_post"},"Body_html_to_image_html_to_image_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"HTML file to capture"}},"type":"object","required":["file"],"title":"Body_html_to_image_html_to_image_post"},"Body_html_to_pdf_html_to_pdf_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"HTML file to render"}},"type":"object","required":["file"],"title":"Body_html_to_pdf_html_to_pdf_post"},"Body_html_to_text_html_to_text_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"HTML file to extract text from"}},"type":"object","required":["file"],"title":"Body_html_to_text_html_to_text_post"},"Body_image_resize_image_resize_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Image file to resize"},"width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Width","description":"Target width in pixels"},"height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Height","description":"Target height in pixels"},"maintain_aspect":{"type":"boolean","title":"Maintain Aspect","description":"Maintain aspect ratio","default":true},"quality":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Quality","description":"Output quality (1-100)","default":85}},"type":"object","required":["file"],"title":"Body_image_resize_image_resize_post"},"Body_image_to_pdf_image_to_pdf_post":{"properties":{"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","description":"Image files to convert"}},"type":"object","required":["files"],"title":"Body_image_to_pdf_image_to_pdf_post"},"Body_image_to_text_image_to_text_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Image file to process"}},"type":"object","required":["file"],"title":"Body_image_to_text_image_to_text_post"},"Body_lock_pdf_security_pdf_lock_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"PDF file to protect"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password","description":"Password to open existing protected document"},"encryption_algorithm":{"$ref":"#/components/schemas/EncryptionAlgorithm","description":"Encryption algorithm strength","default":"Aes256Bit"},"encrypt_metadata":{"type":"boolean","title":"Encrypt Metadata","description":"Also encrypt PDF metadata","default":false},"user_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Password","description":"Password required to open the PDF"},"owner_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Password","description":"Password for full permissions (to change restrictions)"},"respect_owner_password":{"type":"boolean","title":"Respect Owner Password","description":"Preserve existing owner password and permissions","default":false},"preserve_permissions":{"type":"boolean","title":"Preserve Permissions","description":"Keep existing permissions unchanged (requires owner_password)","default":false},"allow_everything":{"type":"boolean","title":"Allow Everything","description":"Enable all permissions (overridden by specific settings below)","default":false},"assemble_document":{"type":"boolean","title":"Assemble Document","description":"Allow insert, rotate, delete pages and bookmarks","default":false},"copy_contents":{"type":"boolean","title":"Copy Contents","description":"Allow copy/extract text and graphics","default":false},"modify_contents":{"type":"boolean","title":"Modify Contents","description":"Allow changing document contents","default":false},"extract_contents":{"type":"boolean","title":"Extract Contents","description":"Allow extracting text and graphics","default":false},"modify_annotations":{"type":"boolean","title":"Modify Annotations","description":"Allow adding/modifying annotations and form fields","default":false},"fill_form_fields":{"type":"boolean","title":"Fill Form Fields","description":"Allow filling forms including signatures","default":false},"print_document":{"type":"boolean","title":"Print Document","description":"Allow printing","default":false},"print_faithful_copy":{"type":"boolean","title":"Print Faithful Copy","description":"Allow high-quality printing for faithful reproduction","default":false}},"type":"object","required":["file"],"title":"Body_lock_pdf_security_pdf_lock_post"},"Body_pdf_compress_pdf_compress_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"PDF file to compress"}},"type":"object","required":["file"],"title":"Body_pdf_compress_pdf_compress_post"},"Body_pdf_decrypt_pdf_decrypt_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Password-protected PDF"},"password":{"type":"string","title":"Password","description":"PDF password"}},"type":"object","required":["file","password"],"title":"Body_pdf_decrypt_pdf_decrypt_post"},"Body_pdf_encrypt_pdf_encrypt_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"PDF file to encrypt"},"user_password":{"type":"string","title":"User Password","description":"Password to open PDF"},"owner_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Password"}},"type":"object","required":["file","user_password"],"title":"Body_pdf_encrypt_pdf_encrypt_post"},"Body_pdf_merge_pdf_merge_post":{"properties":{"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","description":"PDF files to merge (in order)"}},"type":"object","required":["files"],"title":"Body_pdf_merge_pdf_merge_post"},"Body_pdf_rotate_pdf_rotate_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"PDF file to rotate"}},"type":"object","required":["file"],"title":"Body_pdf_rotate_pdf_rotate_post"},"Body_pdf_split_pdf_split_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"PDF file to split"},"pages":{"type":"string","title":"Pages","description":"Page ranges to extract"}},"type":"object","required":["file","pages"],"title":"Body_pdf_split_pdf_split_post"},"Body_pdf_to_docx_pdf_to_docx_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"PDF file to convert"}},"type":"object","required":["file"],"title":"Body_pdf_to_docx_pdf_to_docx_post"},"Body_pdf_to_image_pdf_to_image_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"PDF file to convert"}},"type":"object","required":["file"],"title":"Body_pdf_to_image_pdf_to_image_post"},"Body_pdf_to_text_pdf_to_text_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"PDF file to extract text from"}},"type":"object","required":["file"],"title":"Body_pdf_to_text_pdf_to_text_post"},"Body_pptx_to_images_pptx_to_images_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"PowerPoint file to convert"}},"type":"object","required":["file"],"title":"Body_pptx_to_images_pptx_to_images_post"},"Body_pptx_to_pdf_pptx_to_pdf_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"PowerPoint file to convert"}},"type":"object","required":["file"],"title":"Body_pptx_to_pdf_pptx_to_pdf_post"},"Body_pptx_to_text_pptx_to_text_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"PowerPoint file to extract text from"}},"type":"object","required":["file"],"title":"Body_pptx_to_text_pptx_to_text_post"},"Body_redact_pdf_security_pdf_redact_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"PDF file to redact"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password","description":"Password if PDF is protected"},"preset":{"$ref":"#/components/schemas/RedactionPreset","description":"Compliance preset for AI detection","default":"auto"},"minimum_confidence":{"type":"number","maximum":0.99,"minimum":0.01,"title":"Minimum Confidence","description":"AI confidence threshold (higher = fewer false positives)","default":0.5},"context_size":{"$ref":"#/components/schemas/ContextSize","description":"AI context mode: 'balanced' for multi-page, 'page' for independent pages","default":"balanced"},"redaction_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redaction Color","description":"Redaction color (hex: #000000, rgb: 0,0,0, or name: black)"},"redaction_thickness":{"type":"number","maximum":2.0,"minimum":0.5,"title":"Redaction Thickness","description":"Redaction mark thickness multiplier","default":1.0},"pii":{"type":"boolean","title":"Pii","description":"Detect personally identifiable information","default":false},"phi":{"type":"boolean","title":"Phi","description":"Detect patient health information","default":false},"financial":{"type":"boolean","title":"Financial","description":"Detect financial data","default":false},"legal":{"type":"boolean","title":"Legal","description":"Detect legal/contractual data","default":false},"confidential":{"type":"boolean","title":"Confidential","description":"Detect confidential business data","default":false},"redaction_rules":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redaction Rules","description":"Custom redaction rules as JSON array"},"page_range":{"type":"string","title":"Page Range","description":"Page range to process (e.g., '1-10' or '1,3,5')","default":"1-2000"}},"type":"object","required":["file"],"title":"Body_redact_pdf_security_pdf_redact_post"},"Body_redact_text_pii_security_text_redact_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Document to extract text from and redact PII"},"ocr_language":{"type":"string","title":"Ocr Language","description":"OCR language code (e.g., 'eng', 'deu', 'fra')","default":"eng"},"ocr_fallback":{"type":"boolean","title":"Ocr Fallback","description":"Use OCR if text extraction yields no content","default":true},"pii_types":{"type":"string","title":"Pii Types","description":"Comma-separated PII types to detect, or 'all'. Types: ssn, credit_card, email, phone, ip_address, date_of_birth, name, address, organization","default":"all"},"use_ner":{"type":"boolean","title":"Use Ner","description":"Enable intelligent name/address/organization detection","default":true},"minimum_confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Minimum Confidence","description":"Minimum confidence threshold for PII detection (0.0-1.0)","default":0.8}},"type":"object","required":["file"],"title":"Body_redact_text_pii_security_text_redact_post"},"Body_unlock_pdf_security_pdf_unlock_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Protected PDF file to unlock"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password","description":"User password to remove full protection. Leave empty to only remove owner restrictions."}},"type":"object","required":["file"],"title":"Body_unlock_pdf_security_pdf_unlock_post"},"Body_xlsx_to_csv_xlsx_to_csv_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Excel file to convert"}},"type":"object","required":["file"],"title":"Body_xlsx_to_csv_xlsx_to_csv_post"},"Body_xlsx_to_pdf_xlsx_to_pdf_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Excel file to convert"}},"type":"object","required":["file"],"title":"Body_xlsx_to_pdf_xlsx_to_pdf_post"},"Body_xlsx_to_text_xlsx_to_text_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Excel file to extract text from"}},"type":"object","required":["file"],"title":"Body_xlsx_to_text_xlsx_to_text_post"},"CompressResponse":{"properties":{"filename":{"type":"string","title":"Filename","description":"Output filename"},"content_type":{"type":"string","title":"Content Type","description":"MIME type of the file"},"size_bytes":{"type":"integer","title":"Size Bytes","description":"File size in bytes"},"content_base64":{"type":"string","title":"Content Base64","description":"Base64-encoded file content"},"input_size_bytes":{"type":"integer","title":"Input Size Bytes","description":"Original file size"},"output_size_bytes":{"type":"integer","title":"Output Size Bytes","description":"Compressed file size"},"compression_ratio":{"type":"number","title":"Compression Ratio","description":"Compression ratio (output/input)","examples":[0.65]}},"type":"object","required":["filename","content_type","size_bytes","content_base64","input_size_bytes","output_size_bytes","compression_ratio"],"title":"CompressResponse","description":"Response for PDF compression.","examples":[{"content_base64":"JVBERi0xLjQK...","content_type":"application/pdf","filename":"output.pdf","size_bytes":102400}]},"ContextSize":{"type":"string","enum":["balanced","page"],"title":"ContextSize","description":"Context size for AI processing."},"EncryptionAlgorithm":{"type":"string","enum":["Standard40Bit","Standard128Bit","Aes128Bit","Aes256Bit"],"title":"EncryptionAlgorithm","description":"PDF encryption algorithm strength."},"ErrorResponse":{"properties":{"error":{"type":"string","title":"Error","description":"Error type identifier (e.g., 'UnsupportedFormatError')"},"message":{"type":"string","title":"Message","description":"Human-readable error message with details"},"trace_id":{"type":"string","title":"Trace Id","description":"Unique request trace ID for support correlation"}},"type":"object","required":["error","message","trace_id"],"title":"ErrorResponse","description":"Standard error response for expected/documented errors.\n\nThese errors are anticipated and handled gracefully. The message\nprovides actionable information to help the user resolve the issue."},"ExtractedTable":{"properties":{"table_index":{"type":"integer","title":"Table Index","description":"Zero-indexed position of this table in the document"},"page":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page","description":"Page number (1-indexed) where table appears"},"caption":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caption","description":"Table caption or title if detected"},"columns":{"items":{"$ref":"#/components/schemas/TableColumn"},"type":"array","title":"Columns","description":"Column metadata with names and inferred types"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows","description":"Table data as array of row objects, keys are column names"},"row_count":{"type":"integer","title":"Row Count","description":"Number of data rows"},"truncated":{"type":"boolean","title":"Truncated","description":"Whether the table was truncated due to size limits","default":false},"truncation_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Truncation Reason","description":"Reason for truncation if applicable"},"original_row_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Original Row Count","description":"Original row count before truncation"},"original_column_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Original Column Count","description":"Original column count before truncation"}},"type":"object","required":["table_index","columns","rows","row_count"],"title":"ExtractedTable","description":"A table extracted from a document.","examples":[{"caption":"Table 1: Quarterly Results","columns":[{"inferred_type":"string","name":"Quarter"},{"inferred_type":"number","name":"Revenue"}],"page":1,"row_count":2,"rows":[{"Quarter":"Q1","Revenue":150000},{"Quarter":"Q2","Revenue":175000}],"table_index":0,"truncated":false}]},"FileInfoResponse":{"properties":{"filename":{"type":"string","title":"Filename","description":"Original filename"},"mime_type":{"type":"string","title":"Mime Type","description":"Detected MIME type"},"format_name":{"type":"string","title":"Format Name","description":"Human-readable format name"},"size_bytes":{"type":"integer","title":"Size Bytes","description":"File size in bytes"},"page_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Count","description":"Number of pages (for PDFs, PPTX)"},"dimensions":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Dimensions","description":"Image dimensions (width, height)"},"sheet_names":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Sheet Names","description":"Sheet names (for XLSX)"}},"type":"object","required":["filename","mime_type","format_name","size_bytes"],"title":"FileInfoResponse","description":"Response for file info endpoint.","examples":[{"filename":"report.pdf","format_name":"PDF Document","mime_type":"application/pdf","page_count":10,"size_bytes":1024000}]},"FileResponse":{"properties":{"filename":{"type":"string","title":"Filename","description":"Output filename"},"content_type":{"type":"string","title":"Content Type","description":"MIME type of the file"},"size_bytes":{"type":"integer","title":"Size Bytes","description":"File size in bytes"},"content_base64":{"type":"string","title":"Content Base64","description":"Base64-encoded file content"}},"type":"object","required":["filename","content_type","size_bytes","content_base64"],"title":"FileResponse","description":"Response containing a file.","examples":[{"content_base64":"JVBERi0xLjQK...","content_type":"application/pdf","filename":"output.pdf","size_bytes":102400}]},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InternalErrorResponse":{"properties":{"error":{"type":"string","title":"Error","description":"Always 'InternalServerError' for unexpected errors","default":"InternalServerError"},"message":{"type":"string","title":"Message","description":"Generic message that doesn't expose internal details","default":"An unexpected error occurred. Please try again or contact support."},"trace_id":{"type":"string","title":"Trace Id","description":"Unique request trace ID - provide this to support for investigation"}},"type":"object","required":["trace_id"],"title":"InternalErrorResponse","description":"Opaque error response for unexpected/internal errors.\n\nThese errors are not anticipated and may indicate bugs or infrastructure\nissues. The message is intentionally vague for security reasons.\nUsers should contact support with the trace_id for investigation."},"LockResponse":{"properties":{"filename":{"type":"string","title":"Filename","description":"Output filename"},"content_type":{"type":"string","title":"Content Type","description":"MIME type of the file"},"size_bytes":{"type":"integer","title":"Size Bytes","description":"File size in bytes"},"content_base64":{"type":"string","title":"Content Base64","description":"Base64-encoded file content"},"encryption_algorithm":{"type":"string","title":"Encryption Algorithm","description":"Encryption algorithm used"},"has_user_password":{"type":"boolean","title":"Has User Password","description":"Whether a user (open) password was set"},"has_owner_password":{"type":"boolean","title":"Has Owner Password","description":"Whether an owner (permissions) password was set"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions","description":"List of permissions enabled on the document"}},"type":"object","required":["filename","content_type","size_bytes","content_base64","encryption_algorithm","has_user_password","has_owner_password","permissions"],"title":"LockResponse","description":"Response for PDF lock/protect operation.","examples":[{"content_base64":"JVBERi0xLjQK...","content_type":"application/pdf","encryption_algorithm":"Aes256Bit","filename":"protected.pdf","has_owner_password":true,"has_user_password":true,"permissions":["print","copy"],"size_bytes":102400}]},"MergeResponse":{"properties":{"filename":{"type":"string","title":"Filename","description":"Output filename"},"content_type":{"type":"string","title":"Content Type","description":"MIME type of the file"},"size_bytes":{"type":"integer","title":"Size Bytes","description":"File size in bytes"},"content_base64":{"type":"string","title":"Content Base64","description":"Base64-encoded file content"},"input_count":{"type":"integer","title":"Input Count","description":"Number of input PDFs merged"},"total_pages":{"type":"integer","title":"Total Pages","description":"Total pages in output PDF"}},"type":"object","required":["filename","content_type","size_bytes","content_base64","input_count","total_pages"],"title":"MergeResponse","description":"Response for PDF merge operation.","examples":[{"content_base64":"JVBERi0xLjQK...","content_type":"application/pdf","filename":"output.pdf","size_bytes":102400}]},"PIIMatch":{"properties":{"pii_type":{"$ref":"#/components/schemas/PIIType","description":"Type of PII detected"},"masked_value":{"type":"string","title":"Masked Value","description":"Partially masked value for audit: ***-**-6789, j***@example.com"},"redacted_tag":{"type":"string","title":"Redacted Tag","description":"Tag used in redacted text: [SSN], [EMAIL]"},"start_position":{"type":"integer","title":"Start Position","description":"Start position in original text"},"end_position":{"type":"integer","title":"End Position","description":"End position in original text"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"Detection confidence score"}},"type":"object","required":["pii_type","masked_value","redacted_tag","start_position","end_position","confidence"],"title":"PIIMatch","description":"Information about a detected and redacted PII instance.","examples":[{"confidence":0.95,"end_position":56,"masked_value":"***-**-6789","pii_type":"ssn","redacted_tag":"[SSN]","start_position":45}]},"PIIType":{"type":"string","enum":["ssn","credit_card","phone","email","ip_address","date_of_birth","name","address","organization"],"title":"PIIType","description":"Types of PII that can be detected."},"RedactResponse":{"properties":{"filename":{"type":"string","title":"Filename","description":"Output filename"},"content_type":{"type":"string","title":"Content Type","description":"MIME type of the file"},"size_bytes":{"type":"integer","title":"Size Bytes","description":"File size in bytes"},"content_base64":{"type":"string","title":"Content Base64","description":"Base64-encoded file content"},"redactions_found":{"type":"integer","title":"Redactions Found","description":"Number of redactions applied to the document"},"pages_processed":{"type":"integer","title":"Pages Processed","description":"Number of pages processed"},"preset_used":{"type":"string","title":"Preset Used","description":"Redaction preset that was applied"}},"type":"object","required":["filename","content_type","size_bytes","content_base64","redactions_found","pages_processed","preset_used"],"title":"RedactResponse","description":"Response for PDF redaction operation.","examples":[{"content_base64":"JVBERi0xLjQK...","content_type":"application/pdf","filename":"redacted.pdf","pages_processed":5,"preset_used":"auto","redactions_found":15,"size_bytes":102400}]},"RedactionPreset":{"type":"string","enum":["auto","gdpr","hipaa","ferpa","foia","glba","ccpa","manual"],"title":"RedactionPreset","description":"Preset for AI-based sensitive data detection."},"SplitResponse":{"properties":{"files":{"items":{"$ref":"#/components/schemas/FileResponse"},"type":"array","title":"Files","description":"List of split PDF files"},"input_pages":{"type":"integer","title":"Input Pages","description":"Total pages in input PDF"},"output_count":{"type":"integer","title":"Output Count","description":"Number of output files created"}},"type":"object","required":["files","input_pages","output_count"],"title":"SplitResponse","description":"Response for PDF split operation."},"StructuredExtractionResponse":{"properties":{"extracted_data":{"additionalProperties":true,"type":"object","title":"Extracted Data","description":"Extracted data matching the provided schema"},"raw_text":{"type":"string","title":"Raw Text","description":"Raw text extracted from the document before LLM processing"},"format_detected":{"type":"string","title":"Format Detected","description":"Detected input format (e.g., 'pdf', 'docx', 'image')"},"used_ocr":{"type":"boolean","title":"Used Ocr","description":"Whether OCR was used for text extraction"},"model_used":{"type":"string","title":"Model Used","description":"LLM model used for extraction"},"processing_time_ms":{"type":"integer","title":"Processing Time Ms","description":"Total processing time in milliseconds"},"tables":{"anyOf":[{"items":{"$ref":"#/components/schemas/ExtractedTable"},"type":"array"},{"type":"null"}],"title":"Tables","description":"Extracted tables from the document (only included if include_tables=true)"},"table_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Table Count","description":"Number of tables extracted (only included if include_tables=true)"}},"type":"object","required":["extracted_data","raw_text","format_detected","used_ocr","model_used","processing_time_ms"],"title":"StructuredExtractionResponse","description":"Response for structured data extraction endpoint.","examples":[{"extracted_data":{"email":"john@example.com","name":"John Doe","skills":["Python","FastAPI","Docker"]},"format_detected":"pdf","model_used":"gpt-4o-mini","processing_time_ms":1234,"raw_text":"John Doe\njohn@example.com\n\nSkills: Python, FastAPI, Docker...","used_ocr":false},{"extracted_data":{"date":"2024-12-31","title":"Q4 Financial Report"},"format_detected":"pdf","model_used":"gpt-4o-mini","processing_time_ms":2500,"raw_text":"Q4 Financial Report...","table_count":1,"tables":[{"columns":[{"inferred_type":"string","name":"Quarter"},{"inferred_type":"number","name":"Revenue"}],"row_count":1,"rows":[{"Quarter":"Q4","Revenue":500000}],"table_index":0}],"used_ocr":false}]},"TableColumn":{"properties":{"name":{"type":"string","title":"Name","description":"Column header name"},"inferred_type":{"type":"string","enum":["string","number","boolean","date","mixed"],"title":"Inferred Type","description":"Inferred data type based on column values"}},"type":"object","required":["name","inferred_type"],"title":"TableColumn","description":"Column metadata for an extracted table."},"TextExtractionResponse":{"properties":{"text":{"type":"string","title":"Text","description":"Extracted text content"},"format_detected":{"type":"string","title":"Format Detected","description":"Detected input format (e.g., 'pdf', 'docx', 'image')"},"word_count":{"type":"integer","title":"Word Count","description":"Number of words extracted"},"char_count":{"type":"integer","title":"Char Count","description":"Number of characters extracted"},"used_ocr":{"type":"boolean","title":"Used Ocr","description":"Whether OCR was used for extraction"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Additional format-specific metadata"}},"type":"object","required":["text","format_detected","word_count","char_count","used_ocr"],"title":"TextExtractionResponse","description":"Response for text extraction endpoints.","examples":[{"char_count":892,"format_detected":"pdf","metadata":{"page_count":3},"text":"This is the extracted text from the document...","used_ocr":false,"word_count":150}]},"TextRedactResponse":{"properties":{"redacted_text":{"type":"string","title":"Redacted Text","description":"Text with PII replaced by category tags"},"format_detected":{"type":"string","title":"Format Detected","description":"Detected input format (pdf, docx, image, etc.)"},"word_count":{"type":"integer","title":"Word Count","description":"Number of words in extracted text"},"char_count":{"type":"integer","title":"Char Count","description":"Number of characters in extracted text"},"used_ocr":{"type":"boolean","title":"Used Ocr","description":"Whether OCR was used for text extraction"},"pii_found":{"type":"integer","title":"Pii Found","description":"Total number of PII instances detected and redacted"},"pii_by_type":{"additionalProperties":{"type":"integer"},"type":"object","title":"Pii By Type","description":"Count of PII by type: {'ssn': 3, 'email': 5}"},"matches":{"items":{"$ref":"#/components/schemas/PIIMatch"},"type":"array","title":"Matches","description":"Detailed info about each redacted PII instance"},"processing_time_ms":{"type":"integer","title":"Processing Time Ms","description":"Total processing time in milliseconds"},"ner_enabled":{"type":"boolean","title":"Ner Enabled","description":"Whether intelligent entity detection was used for names/addresses"}},"type":"object","required":["redacted_text","format_detected","word_count","char_count","used_ocr","pii_found","pii_by_type","matches","processing_time_ms","ner_enabled"],"title":"TextRedactResponse","description":"Response for text PII redaction operation.","examples":[{"char_count":892,"format_detected":"pdf","matches":[{"confidence":0.85,"end_position":16,"masked_value":"J*** D***","pii_type":"name","redacted_tag":"[NAME]","start_position":8},{"confidence":0.98,"end_position":36,"masked_value":"j***@example.com","pii_type":"email","redacted_tag":"[EMAIL]","start_position":20}],"ner_enabled":true,"pii_by_type":{"email":1,"name":1,"phone":1,"ssn":1},"pii_found":4,"processing_time_ms":245,"redacted_text":"Contact [NAME] at [EMAIL] or [PHONE]. SSN: [SSN]","used_ocr":false,"word_count":150}]},"TextStructuredExtractionResponse":{"properties":{"extracted_data":{"additionalProperties":true,"type":"object","title":"Extracted Data","description":"Extracted data matching the provided schema"},"model_used":{"type":"string","title":"Model Used","description":"LLM model used for extraction"},"processing_time_ms":{"type":"integer","title":"Processing Time Ms","description":"Total processing time in milliseconds"}},"type":"object","required":["extracted_data","model_used","processing_time_ms"],"title":"TextStructuredExtractionResponse","description":"Response for text-to-struct extraction endpoint.\n\nSimilar to StructuredExtractionResponse but without file-specific fields\nlike format_detected, raw_text, and used_ocr.","examples":[{"extracted_data":{"email":"john@example.com","name":"John Doe","skills":["Python","FastAPI","Docker"]},"model_used":"gpt-4o-mini","processing_time_ms":450}]},"TextToStructRequest":{"properties":{"text":{"type":"string","minLength":1,"title":"Text","description":"Text content to extract structured data from"},"schema":{"additionalProperties":true,"type":"object","title":"Schema","description":"JSON Schema defining fields to extract"}},"type":"object","required":["text","schema"],"title":"TextToStructRequest","description":"Request body for /txt/to-struct endpoint.","examples":[{"schema":{"properties":{"name":{"description":"Full name","type":"string"},"email":{"description":"Email address","format":"email","type":"string"}},"type":"object"},"text":"John Doe\njohn@example.com\nSkills: Python, FastAPI..."}]},"TrackingPixelInfo":{"properties":{"url":{"type":"string","title":"Url","description":"URL of the tracking pixel"},"type":{"$ref":"#/components/schemas/TrackingPixelType","description":"Type of tracking element"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Known tracker source if identified (e.g., 'mailchimp', 'facebook')"},"location":{"type":"string","title":"Location","description":"Where in document the pixel was found (e.g., 'img[3]', 'iframe[0]')"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"Detection confidence score from 0.0 to 1.0"},"reasons":{"items":{"type":"string"},"type":"array","title":"Reasons","description":"List of reasons why this was flagged as a tracker"}},"type":"object","required":["url","type","location","confidence","reasons"],"title":"TrackingPixelInfo","description":"Information about a detected tracking pixel.","examples":[{"confidence":0.95,"location":"img[2]","reasons":["Known tracking domain: track.mailchimp.com","1x1 pixel dimensions"],"source":"mailchimp","type":"image","url":"https://track.mailchimp.com/open.php?u=abc123"}]},"TrackingPixelResponse":{"properties":{"pixels_found":{"items":{"$ref":"#/components/schemas/TrackingPixelInfo"},"type":"array","title":"Pixels Found","description":"List of tracking pixels detected in the document"},"pixels_removed":{"type":"integer","title":"Pixels Removed","description":"Number of tracking pixels that were removed (0 if remove=false)"},"document_type":{"type":"string","title":"Document Type","description":"Detected document type (e.g., 'text/html', 'message/rfc822')"},"was_modified":{"type":"boolean","title":"Was Modified","description":"Whether the document was modified (pixels were removed)"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Output filename (only when modified)"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type","description":"MIME type of the output file (only when modified)"},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes","description":"Size of cleaned file in bytes (only when modified)"},"content_base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Base64","description":"Base64-encoded cleaned file content (only when modified)"}},"type":"object","required":["pixels_found","pixels_removed","document_type","was_modified"],"title":"TrackingPixelResponse","description":"Response for tracking pixel detection/removal operation.","examples":[{"content_base64":"PCFET0NUWVBFIGh0bWw+...","content_type":"text/html","document_type":"text/html","filename":"cleaned_email.html","pixels_found":[{"confidence":0.95,"location":"img[2]","reasons":["Known tracking domain: track.mailchimp.com","1x1 pixel dimensions"],"source":"mailchimp","type":"image","url":"https://track.mailchimp.com/open.php?u=abc123"}],"pixels_removed":1,"size_bytes":4521,"was_modified":true}]},"TrackingPixelType":{"type":"string","enum":["image","iframe","beacon"],"title":"TrackingPixelType","description":"Type of tracking pixel detected."},"UnlockResponse":{"properties":{"filename":{"type":"string","title":"Filename","description":"Output filename"},"content_type":{"type":"string","title":"Content Type","description":"MIME type of the file"},"size_bytes":{"type":"integer","title":"Size Bytes","description":"File size in bytes"},"content_base64":{"type":"string","title":"Content Base64","description":"Base64-encoded file content"},"was_user_protected":{"type":"boolean","title":"Was User Protected","description":"Whether the document had user (open) password protection"},"was_owner_protected":{"type":"boolean","title":"Was Owner Protected","description":"Whether the document had owner (permissions) password protection"}},"type":"object","required":["filename","content_type","size_bytes","content_base64","was_user_protected","was_owner_protected"],"title":"UnlockResponse","description":"Response for PDF unlock operation.","examples":[{"content_base64":"JVBERi0xLjQK...","content_type":"application/pdf","filename":"unlocked.pdf","size_bytes":102400,"was_owner_protected":true,"was_user_protected":true}]},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key for authentication. Required for all endpoints except health checks."}}},"tags":[{"name":"Smart Conversion","description":"\n**Start here!** These endpoints auto-detect your file format and route to the appropriate processor.\n\n- **`/any/to-text`** - Extract text from any supported document (PDF, DOCX, images, etc.)\n- **`/any/info`** - Get file metadata without processing\n\nPerfect for when you don't know the input format ahead of time, or want a single integration point.\n            "},{"name":"PDF","description":"\nPDF document operations - extract content, convert formats, and manipulate pages.\n\n**Extract & Convert:**\n- `/pdf/to-text` - Extract text content\n- `/pdf/to-docx` - Convert to Word document\n- `/pdf/to-image` - Render pages as images\n\n**Manipulate:**\n- `/pdf/merge` - Combine multiple PDFs\n- `/pdf/split` - Split by page ranges\n- `/pdf/compress` - Reduce file size\n- `/pdf/rotate` - Rotate pages\n\n**Security:**\n- `/pdf/encrypt` - Add password protection\n- `/pdf/decrypt` - Remove password protection\n            "},{"name":"Image","description":"\nImage processing with OCR (Optical Character Recognition) support.\n\n- `/image/to-text` - Extract text using OCR (supports PNG, JPEG, TIFF, BMP)\n- `/image/to-pdf` - Convert image(s) to PDF document\n- `/image/resize` - Resize and compress images\n            "},{"name":"Word","description":"\nMicrosoft Word (DOCX) document operations.\n\n- `/docx/to-text` - Extract text content from Word documents\n- `/docx/to-pdf` - Convert Word documents to PDF\n            "},{"name":"Excel","description":"\nMicrosoft Excel (XLSX) spreadsheet operations.\n\n- `/xlsx/to-text` - Extract text and cell data\n- `/xlsx/to-pdf` - Convert spreadsheets to PDF\n- `/xlsx/to-csv` - Export to CSV format\n            "},{"name":"PowerPoint","description":"\nMicrosoft PowerPoint (PPTX) presentation operations.\n\n- `/pptx/to-text` - Extract text from all slides\n- `/pptx/to-pdf` - Convert presentations to PDF\n- `/pptx/to-images` - Export slides as individual images\n            "},{"name":"HTML","description":"\nHTML content rendering and conversion.\n\n- `/html/to-text` - Extract visible text content\n- `/html/to-pdf` - Render HTML to PDF (with CSS support)\n- `/html/to-image` - Screenshot HTML as image\n            "},{"name":"Security","description":"\nDocument security, redaction, and data protection operations.\n\n**Redaction:**\n- `/security/pdf/redact` - AI-powered sensitive data detection and redaction\n\n**Password Protection:**\n- `/security/pdf/lock` - Add password protection and set permissions\n- `/security/pdf/unlock` - Remove password protection\n\n**Compliance Presets (for redaction):**\n- **GDPR** - EU personal data protection\n- **HIPAA** - Healthcare information\n- **CCPA** - California consumer privacy\n- **FERPA** - Student education records\n- **FOIA** - Government document release\n- **GLBA** - Financial services data\n\n**Encryption:** AES-256 (recommended), AES-128, Standard 128-bit, Standard 40-bit\n            "}],"security":[{"ApiKeyAuth":[]}],"x-tagGroups":[{"name":"Getting Started","tags":["Smart Conversion"]},{"name":"Document Processors","tags":["PDF","Image","Word","Excel","PowerPoint","HTML"]},{"name":"Security & Compliance","tags":["Security"]}]}