Reformat API Documentation
Programmatically format Word documents with the same templates used in Reformat. Use the endpoints below to list templates, process documents, and monitor credit usage.
Overview
Everything you need to authenticate, send requests, and safely retry.
https://web.reformatword.com/api/v1Authorization: Bearer rf_sk_your_api_keyIdempotency-Key: uuid-v4Request hashes are stored for 24 hours. Retries return the existing job state, but not the original decryption key.
Use GET /usage to monitor balances.
Submitted documents are stored encrypted at rest. The encryption key is generated per request and returned to you in the decryptionKey field of the initial response; Reformat never persists the key, so once the response has been delivered we cannot decrypt the stored ciphertext. Send the key back in the X-Document-Key header when polling the GET endpoint to retrieve the processed document. Any encrypted documents are automatically deleted within 24 hours of submission.
Endpoints
Core routes for templates, processing, and credit usage.
Example Request
curl -X POST "https://web.reformatword.com/api/v1/documents/process" \
-H "Authorization: Bearer rf_sk_your_api_key" \
-H "Idempotency-Key: 35b9fe15-0b4a-4c9a-86a6-0b4b9e1d1f8a" \
-F "document=@./brief.docx" \
-F "templateId=template_123" \
-F "checkRequirements=true" \
-F "runFinalCheck=true"Example Response
{
"success": true,
"requestId": "req_abc123",
"data": {
"jobId": "clxyz123abc",
"decryptionKey": "a1b2c3d4e5f6...",
"status": "processing"
}
}Example Request
curl "https://web.reformatword.com/api/v1/documents/process/clxyz123abc" \
-H "Authorization: Bearer rf_sk_your_api_key" \
-H "X-Document-Key: a1b2c3d4e5f6..."Example Response
{
"success": true,
"requestId": "req_def456",
"data": {
"jobId": "clxyz123abc",
"status": "completed",
"document": "BASE64_DOCX",
"filename": "brief_reformatted.docx",
"results": {
"templateApplied": {
"templateId": "template_123",
"templateName": "Litigation Brief",
"commandExecutions": [{ "name": "Heading 1", "status": "success", "affectedCount": 14 }],
"paragraphsFormatted": 42
},
"requirementsCheck": { "passed": true, "requirements": [] },
"finalDraftCheck": { "passed": true, "checks": [] }
},
"usage": { "creditsUsed": 1, "creditsRemaining": 118 }
}
}Example Request
curl "https://web.reformatword.com/api/v1/templates" \
-H "Authorization: Bearer rf_sk_your_api_key"Example Response
{
"success": true,
"requestId": "req_456",
"data": {
"templates": [
{
"id": "template_123",
"name": "Litigation Brief",
"type": "legal",
"isDefault": true,
"isCustom": false,
"commandCount": 12
}
]
}
}Example Request
curl "https://web.reformatword.com/api/v1/templates/template_123" \
-H "Authorization: Bearer rf_sk_your_api_key"Example Response
{
"success": true,
"requestId": "req_789",
"data": {
"template": {
"id": "template_123",
"styles": { "Heading 1": { "font": "Times New Roman" } },
"template": "Litigation Brief",
"type": "legal",
"isDefault": true
}
}
}Example Request
curl "https://web.reformatword.com/api/v1/usage" \
-H "Authorization: Bearer rf_sk_your_api_key"Example Response
{
"success": true,
"requestId": "req_102",
"data": {
"organisation": { "id": "org_01", "name": "Cleveland R&D Limited" },
"credits": {
"available": 118,
"breakdown": { "monthly": 80, "total": 30, "referral": 8 },
"resetDate": "2026-03-01T00:00:00.000Z"
}
}
}Use Cases
Copy-ready snippets in Python, Next.js, and curl.
# 1. Submit
RESP=$(curl -s -X POST "https://web.reformatword.com/api/v1/documents/process" \
-H "Authorization: Bearer rf_sk_your_api_key" \
-F "document=@./brief.docx" \
-F "templateId=template_123")
JOB_ID=$(echo $RESP | jq -r '.data.jobId')
KEY=$(echo $RESP | jq -r '.data.decryptionKey')
# 2. Poll every 10s until completed
while true; do
sleep 10
POLL=$(curl -s "https://web.reformatword.com/api/v1/documents/process/$JOB_ID" \
-H "Authorization: Bearer rf_sk_your_api_key" \
-H "X-Document-Key: $KEY")
STATUS=$(echo $POLL | jq -r '.data.status')
[ "$STATUS" = "completed" ] && break
[ "$STATUS" = "failed" ] && exit 1
done
# 3. Save the document
echo $POLL | jq -r '.data.document' | base64 -d > brief_reformatted.docxcurl "https://web.reformatword.com/api/v1/templates" \
-H "Authorization: Bearer rf_sk_your_api_key"curl "https://web.reformatword.com/api/v1/usage" \
-H "Authorization: Bearer rf_sk_your_api_key"Interactive Swagger UI
Explore the full OpenAPI schema and try requests in your browser.