REST API v1
The AI Markdown Workspace REST API provides programmatic access to our Markdown conversion engine. Use it to integrate conversion capabilities into your applications, CI/CD pipelines, or automation workflows.
Base URL: /api/v1
Authentication
All API requests require authentication via an API key passed in the X-API-Key header.
curl -X GET "https://adoneinu.com/api/v1/themes" \
-H "X-API-Key: your-api-key-here"
Generating API Keys
API keys are managed server-side. Contact Adoneinu to obtain an API key for your application.
In production, API keys are stored as SHA-256 hashes. Set the MD_CONVERTER_API_KEYS environment variable with comma-separated hashes.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/themes |
List all available themes |
| POST | /api/v1/convert |
Convert Markdown content |
| POST | /api/v1/convert/file |
Upload & convert a file |
| POST | /api/v1/batch |
Batch convert multiple files |
List Themes
Retrieve all available conversion themes with their color palettes.
Request
GET /api/v1/themes
Authorization: X-API-Key your-api-key
Response
{
"status": "success",
"themes": [
{
"id": "corporate",
"name": "Corporate Blue",
"description": "Professional blue theme for business documents",
"colors": {
"heading": "#1e3a5f",
"text": "#333333",
"bg": "#ffffff",
"link": "#0066cc",
"accent": "#4a90d9"
}
},
...
]
}
Convert Content
Convert Markdown content to HTML, DOCX, or PDF format.
Request
POST /api/v1/convert
Content-Type: application/json
Authorization: X-API-Key your-api-key
{
"content": "# Hello World\n\nThis is **Markdown** content.",
"format": "pdf",
"theme": "corporate",
"filename": "my-document",
"custom_overrides": {
"bg": "#fdf6e3",
"heading": "#2c3e50"
}
}
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
content |
string | Yes | Markdown content to convert |
format |
string | No | Output format: html, docx, or pdf. Default: html |
theme |
string | No | Theme ID. Use List Themes for available options. Default: corporate |
filename |
string | No | Base filename for the output. Default: document |
custom_overrides |
object | No | Custom color overrides (hex colors) |
Response
{
"status": "success",
"filename": "my-document.pdf",
"content_base64": "JVBERi0xLjQKJeLjz9M...",
"content_type": "application/pdf",
"size_bytes": 38912
}
Convert File
Upload a Markdown file and convert it to the desired format.
Request
POST /api/v1/convert/file
Content-Type: multipart/form-data
Authorization: X-API-Key your-api-key
file: (binary markdown file)
format: pdf
theme: corporate
custom_overrides: '{"bg": "#fdf6e3"}'
Form Parameters
| Field | Type | Required | Description |
|---|---|---|---|
file |
file | Yes | Markdown file (.md, .markdown, .txt) |
format |
string | No | Output format. Default: html |
theme |
string | No | Theme ID. Default: corporate |
custom_overrides |
string | No | JSON string of color overrides |
Batch Convert
Convert multiple Markdown documents at once. Results are returned as a ZIP archive.
Request
POST /api/v1/batch
Content-Type: application/json
Authorization: X-API-Key your-api-key
{
"files": [
{
"content": "# Document 1\n\nContent here...",
"filename": "doc1"
},
{
"content": "# Document 2\n\nMore content...",
"filename": "doc2"
}
],
"format": "pdf",
"theme": "corporate",
"custom_overrides": null
}
Response
{
"status": "success",
"filename": "batch_output.zip",
"content_base64": "UEsDBBQAAAAIAGl...",
"content_type": "application/zip",
"file_count": 2
}
Error Codes
| HTTP Status | Code | Description |
|---|---|---|
| 400 | INVALID_REQUEST | Malformed JSON or missing required fields |
| 400 | MISSING_CONTENT | No content provided for conversion |
| 400 | INVALID_FORMAT | Unsupported output format |
| 400 | INVALID_THEME | Unknown theme ID |
| 401 | MISSING_API_KEY | X-API-Key header is required |
| 403 | INVALID_API_KEY | Invalid or expired API key |
| 404 | FILE_NOT_FOUND | Uploaded file not found |
Rate Limits
API rate limits depend on your subscription tier. Contact Adoneinu for higher limits.
| Tier | Limit |
|---|---|
| Default | 60 requests/minute |
| Premium | 300 requests/minute |