ForHosting KIT · Documents & PDF

Generate a Word doc

The JSON to Word API turns structured data — headings, paragraphs, tables, lists — into a genuine .docx file, the kind Word opens and lets a person edit like they typed it themselves. It's for systems that hold the content but not the document: a form, a database record, a generated report that needs to leave your pipeline dressed as a real Word file.

Temporarily withdrawnPer request + per document$0.002

This task is not available right now, so it cannot be purchased. Nothing is charged for it.

How it works & API
Use it from WebAPIEmailApp soonTelegram soon

The gap between data and a document

Most business content starts as data: a row in a database, a filled-out form, an object returned by another service. Turning that into something a human reads as a document — properly headed, spaced, tabled — usually means someone opens Word and formats it by hand, every single time. The generate word document api closes that gap: you describe the structure once in JSON, and every subsequent document is generated the same way, correctly, without a person touching a keyboard.

What structured input looks like

You send JSON describing the document's content and structure — sections, headings, paragraphs, tables, lists — and the service lays it out as a proper .docx: real Word styles, real tables with real cells, not an image pretending to be a document. That distinction matters because a genuine .docx stays editable, searchable, and accessible; the recipient can change a sentence, resize a column, or run it through a screen reader exactly as they would any Word file someone typed by hand.

How the generation runs

Call POST /doc/generate-docx with your structured payload and you receive a task_id immediately. Generation happens asynchronously on our global edge, so a batch of a thousand documents doesn't block your application for a second of it. When each file is ready, you're notified by a signed webhook — the natural choice when you're generating documents in volume — or by a signed link valid for 24 hours if a person just needs to grab one file.

Where it replaces manual formatting

This is built for the moment a document needs to exist because a process finished, not because someone decided to write it: a contract template filled from CRM data, a policy document assembled from a compliance database, a personalized offer letter generated per applicant, an internal report compiled from analytics output. Wherever the content is already structured somewhere in your system, this endpoint turns it into the document format the recipient actually expects, as one more automated step rather than a manual chore.

Straightforward pricing, safe by default

Generation is billed at a flat $0.002 per request — a single published rate, no tokens, no invented credits, no surprise line items. A task that fails is never charged; we retry three times and, if the document still can't be built, you get a clear error explaining why. Access requires prepaid balance, which is what keeps the service fast and abuse-free — there is no free tier or trial, and requests without balance return a 402. Your input data and the generated file are deleted after the retention window and never used to train anything.

Contracts filled from CRM data

A sales platform generates a ready-to-sign contract .docx for each closed deal, populating clauses and terms straight from the CRM record.

Personalized offer letters

An HR system produces a properly formatted offer letter for every accepted candidate, pulling role, salary, and start date from the applicant record.

Policy documents from a compliance database

A compliance tool assembles a formatted policy document with numbered sections and tables directly from the rules stored in its database.

Reports compiled from analytics

An internal dashboard exports a weekly summary — headings, tables of figures, notes — as an editable Word document for teams that prefer to annotate offline.

How do I generate a Word document with an API?

Send structured JSON describing headings, paragraphs, and tables to POST /doc/generate-docx and you get a task_id back. The generate word document api builds the .docx asynchronously and delivers it by signed webhook or a signed link valid for 24 hours.

Is this API free to use?

There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.

Is the output a real, editable .docx?

Yes. The service produces a genuine Word document with real styles, tables, and text — fully editable, searchable, and accessible — not an image or a flattened PDF renamed to .docx.

What structure can I include: tables, lists, headings?

Yes to all three. You describe sections, headings, paragraphs, tables, and lists in JSON and they're laid out as native Word elements in the generated file.

Can I generate documents in bulk?

Yes. Because the endpoint is asynchronous and returns a task_id per request, you can fire many document generations in parallel from a queue or batch job without blocking.

What happens if generation fails?

A failed task is never charged. We retry three times with backoff, and if the document still cannot be built you get a clear error instead of a silent failure or a charge.

How is this different from filling a Word template by hand?

There's no template to open or maintain in a desktop app. You send structured data once and the API builds the .docx programmatically, so document generation becomes a step your own systems trigger, not a task assigned to a person.

How long can I access the generated file?

The signed link stays valid for 24 hours, or you can receive the file immediately by signed webhook. After the retention window it's deleted and never used for training.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/doc/generate-docx

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/doc/generate-docx \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":"…"}'
{
  "input": "…"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "doc.generate_docx",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb25
max_pages200
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →