API documentation
DocConvert is a REST API for converting documents between Markdown, HTML, PDF, and DOCX. Send content in one format, receive the converted file in the response body.
Base URL:
https://api-production-7d714.up.railway.app/v1
Overview
The API is JSON-first. Authenticated endpoints require an X-API-Key header. Successful conversions return the raw file bytes with appropriate Content-Type and Content-Disposition headers.
What you can do
- Convert Markdown, HTML, DOCX, and PDF in a single synchronous request
- Capture any public URL as a PDF (visual or article text mode)
- Register API keys and manage billing through Stripe
- Apply PDF themes, page sizes, margins, and watermarks on supported conversions
Limits
- Synchronous uploads: 1 MB maximum per request
- Rate limit: 60 requests per minute per API key (or IP when unauthenticated)
- Monthly conversion quotas depend on your plan
Quick start
Register for an API key, complete Stripe checkout to activate it, then call POST /v1/convert.
1. Register
curl -X POST https://api-production-7d714.up.railway.app/v1/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"you@company.com","name":"My App"}'
Response includes api_key (save it immediately) and checkout_url. Your key stays inactive until checkout completes.
2. Convert Markdown to PDF
curl -X POST https://api-production-7d714.up.railway.app/v1/convert \
-H "Content-Type: application/json" \
-H "X-API-Key: dc_live_YOUR_KEY_HERE" \
-d '{
"input_format": "markdown",
"output_format": "pdf",
"content": "# Hello World\n\nThis is **DocConvert**."
}' \
--output hello.pdf
3. Check API health
curl https://api-production-7d714.up.railway.app/health
Endpoints at a glance
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /v1/convert | Yes | Convert a document (sync) |
| POST | /v1/auth/register | No | Create API key + Stripe checkout |
| POST | /v1/billing/checkout | Yes | Upgrade plan via Stripe |
| POST | /v1/billing/portal | Yes | Stripe customer portal URL |
| GET | /health | No | Service health check |
See POST /convert for full request formats, supported conversions, and error codes.