ReformatReformat
Developer API

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.

Base URL
All requests are scoped to v1.
https://web.reformatword.com/api/v1
Authentication
Create API keys at web.reformatword.com/api-keys.
Authorization: Bearer rf_sk_your_api_key
Idempotency
Safe retries with a unique key.
Idempotency-Key: uuid-v4

Request hashes are stored for 24 hours. Retries return the existing job state, but not the original decryption key.

Credits
1 credit per document processing run.

Use GET /usage to monitor balances.

Data handling
How submitted documents are stored, decrypted and deleted.

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.

POST
/documents/process
Upload a .docx file and start async processing. Returns a jobId and decryptionKey immediately on the initial submission. Poll the GET endpoint for results.

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"
  }
}
GET
/documents/process/{jobId}
Check processing status. Send X-Document-Key header to retrieve the decrypted document when completed.

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 }
  }
}
GET
/templates
Returns templates available to your organisation and user.

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
      }
    ]
  }
}
GET
/templates/{id}
Fetch a specific template and its style settings.

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
    }
  }
}
GET
/usage
Retrieve the credit balance for your organisation.

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.

Process a document (submit + poll)
Submit a .docx file for async processing, then poll until the result is ready.
# 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.docx
Pick a template before processing
List available templates, then use the chosen templateId for processing.
curl "https://web.reformatword.com/api/v1/templates" \
  -H "Authorization: Bearer rf_sk_your_api_key"
Check credits before a batch run
Inspect remaining credits and plan a batch of document runs.
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.