Markdown Endpoints
Endpoints
The Markdown Converter service provides several endpoints for document conversion and service monitoring.
Service Information
GET /
Returns service health status and usage information.
Response
{ "status": "healthy", "service": "MarkItDown Converter", "version": { "python": "3.x.x", "flask": "x.x.x" }, "components": { "markitdown": "up" }, "server_time": "2024-01-21T12:00:00Z", "deployment_time": "2024-01-21T00:00:00Z", "region": "us-east", "allowed_origins": "https://md.genstack.app,http://localhost:5173", "usage": { "description": "Convert documents to Markdown format", "web_interface": "https://md.genstack.app/ui", "example_curl": "curl -L -X POST -F 'file=@your_document.docx' https://md.genstack.app/", "supported_methods": { "GET": "Get health status and usage information", "POST": "Convert a document to Markdown (multipart/form-data with 'file' field)" } }}
Status Codes
200
- Service is healthy503
- Service is degraded (MarkItDown component is down)
Document Conversion
POST /
Converts an uploaded document to Markdown format.
Request
Content-Type: multipart/form-data
Parameters:
Name | Type | Required | Description |
---|---|---|---|
file | File | Yes | The document file to convert |
Response
{ "markdown": "# Converted Document Content\n\nYour markdown content here...", "original_filename": "input.docx"}
Status Codes
200
- Successful conversion400
- Bad Request (missing file or empty selection)500
- Internal Server Error (conversion failure)
Web Interface
GET /ui
Provides a web-based interface for manual file uploads and conversion.
Response
Returns an HTML page with a file upload form for manual document conversion.
Error Responses
All error responses follow this format:
{ "error": "Description of what went wrong"}
Common error messages include:
- “No file provided”
- “No file selected”
- Various conversion-related errors