Documentation
Everything you need to integrate DocumenTo.MD
Quickstart
-
1
Create an account on documento.md and go to the dashboard.
-
2
Generate an API Key from Dashboard → API Keys. Copy the full value (shown only once).
-
3
Make your first call using the header
Authorization: Bearer dtmd_live_...
Authentication
All requests to /v1/* require an API Key. Use Bearer token (preferred) or the header X-API-Key:
# Preferido Authorization: Bearer dtmd_live_xxxxxxxxxxxxx # Alternativa X-API-Key: dtmd_live_xxxxxxxxxxxxx
⚠️ Requests without an API Key receive 401 missing_api_key.
POST /v1/convert
Convert a document to Markdown. Upload the file as multipart/form-data.
cURL
curl -X POST "https://documento.md/v1/convert" \ -H "Authorization: Bearer dtmd_live_xxxxx" \ -F "file=@documento.pdf" \ -F "wait=true"
Python
import requests with open("documento.pdf", "rb") as f: resp = requests.post( "https://documento.md/v1/convert", headers={"Authorization": "Bearer dtmd_live_xxxxx"}, files={"file": f}, data={"wait": "true"}, ) print(resp.json()["markdown"])
Node.js
const form = new FormData(); form.append("file", fs.createReadStream("documento.pdf")); form.append("wait", "true"); const resp = await fetch("https://documento.md/v1/convert", { method: "POST", headers: { Authorization: "Bearer dtmd_live_xxxxx" }, body: form, });
Parameters: file (required), output=markdown, wait=true|false.
GET /v1/conversions/{id}
Check the status of an async conversion:
curl "https://documento.md/v1/conversions/{id}" \ -H "Authorization: Bearer dtmd_live_xxxxx"
Response
{
"id": "conv_123",
"status": "completed",
"markdown": "# Resultado...",
"download_url": "https://documento.md/v1/conversions/conv_123/download"
}
GET /v1/me
Inspect your key, plan and current usage:
{
"user_id": "usr_123",
"plan": "free",
"limits": { "rate_limit_per_minute": 5, "daily_conversions": 50 },
"usage": { "conversions_today": 12, "remaining_today": 38 }
}
Supported formats
csv
docx
html
md
pdf
pptx
rtf
txt
xlsx
Rate limiting
Each response includes these headers:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 42
X-RateLimit-Reset: 1710000000
# Solo cuando se excede:
Retry-After: 30
| Plan | Per minute | Per day | Max file |
|---|---|---|---|
| Free | 5 | 50 | 10 MB |
| Pro | 60 | 5.000 | 50 MB |
| Enterprise | 300 | 50.000 | 200 MB |
Error codes
All errors use the same JSON format:
{
"error": {
"code": "invalid_file_type",
"message": "File type not allowed.",
"details": { "allowed_extensions": ["pdf", "docx", ...] }
}
}
missing_api_key
401
invalid_api_key
401
revoked_api_key
401
disabled_api_key
401
email_not_verified
403
forbidden
403
user_suspended
403
ip_not_allowed
403
origin_not_allowed
403
rate_limit_exceeded
429
daily_limit_exceeded
429
monthly_limit_exceeded
429
missing_file
400
file_too_large
413
invalid_file_type
415
invalid_mime_type
415
conversion_failed
422
conversion_timeout
504
conversion_not_found
404
result_expired
410
api_disabled
503
internal_error
500
not_implemented
501
validation_error
422
Privacy and retention
- ✓ Original files are not stored after conversion.
- ✓ Results are retained for 24 hours and then expire.
- ✓ You can delete a result at any time with
DELETE /v1/conversions/{id}. - ✓ API Keys are stored hashed (sha256), never in plaintext.