apyhub
FILE CONVERSION

Convert HTML to Word API

Hosted on ApyHub

What it does

HTML to DOCX Converter turns an HTML page or file into a downloadable .docx document. Send a public HTML URL or upload an .html/.htm file, and get back either a DOCX file or an S3 URL to the converted document.

Use the URL endpoints when your content already lives online, or the file endpoints when you need to convert an uploaded HTML asset. The output options cover two common workflows: stream the DOCX directly to the client, or receive a hosted URL that you can store, forward, or process later.

This is a good fit for document generation pipelines, report export flows, and teams that need to preserve HTML content in Word format for sharing or editing. If you're building a CMS, invoice builder, or content publishing workflow, you can convert rendered HTML into a format that business users can open in Microsoft Word without manual reformatting.

▣ ENDPOINT 01 / 04
POST
Convert HTML to DOCX (URL → S3 URL)
http://localhost:8080/apyhub/convert-html-to-docx/url/url
QUICKSTARTGUIDE

Quickstart

Convert a publicly accessible HTML page URL into a DOCX file.

curl -X POST "http://localhost:8080/apyhub/convert-html-to-docx/url/url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.html"}'

What you'll get back

Returns a JSON object with an optional url string field containing the generated DOCX file URL.

{
  "url": "https://s3.amazonaws.com/bucket/converted.docx"
}
TRY ITLIVE · 120 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Publicly accessible HTML page URL.

About this endpoint

What it does

Converts a publicly accessible HTML page at the provided URL into a DOCX file and returns the resulting file URL.

Request Body

ParameterTypeMandatoryDescription
urlStringYesPublicly accessible HTML page URL. Must be a URI.

Response

Returns a JSON object with a url string field containing the DOCX file URL.

ParameterTypeMandatoryDescription
urlStringNoURI of the generated DOCX file.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 04
POST
Convert HTML to DOCX (file upload → download)
http://localhost:8080/apyhub/convert-html-to-docx/file/download
QUICKSTARTGUIDE

Quickstart

Upload an HTML file to convert it to a DOCX download.

curl -X POST "http://localhost:8080/apyhub/convert-html-to-docx/file/download" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/file.html"

What you'll get back

Returns a binary file containing the converted DOCX document.

TRY ITLIVE · 120 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
HTML file to convert (.html or .htm).
Output filename stem (without extension). Defaults to `converted`.

About this endpoint

What it does

Converts an uploaded HTML file into a DOCX file and returns the generated document as a binary download. The request body accepts the source HTML file and an optional output filename stem.

Request Body

ParameterTypeMandatoryDescription
fileStringYesHTML file to convert. Accepts .html or .htm input.
outputStringNoOutput filename stem without extension. Defaults to converted.

Response

Returns a binary file download containing the converted DOCX document.

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 03 / 04
POST
Convert HTML to DOCX (file upload → S3 URL)
http://localhost:8080/apyhub/convert-html-to-docx/file/url
QUICKSTARTGUIDE

Quickstart

Upload an HTML file to convert it to DOCX.

curl -X POST "http://localhost:8080/apyhub/convert-html-to-docx/file/url" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/file.html"

What you'll get back

Returns a JSON object with an optional url string field containing the download URL of the converted DOCX file.

{
  "url": "https://s3.amazonaws.com/bucket/converted.docx"
}
TRY ITLIVE · 120 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
HTML file to convert (.html or .htm).

About this endpoint

What it does

Converts an uploaded HTML file into a DOCX file and returns a JSON object containing the generated file URL.

Request Body

ParameterTypeMandatoryDescription
fileStringYesHTML file to convert. Must be a binary upload of a .html or .htm file.

Response

Returns a JSON object with a url string field containing the URI of the generated DOCX file.

ParameterTypeMandatoryDescription
urlStringNoThe URI of the converted DOCX file.

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 04 / 04
POST
Convert HTML to DOCX (URL → download)
http://localhost:8080/apyhub/convert-html-to-docx/url/download
QUICKSTARTGUIDE

Quickstart

Convert a publicly accessible HTML page into a DOCX file by sending its URL.

curl -X POST "http://localhost:8080/apyhub/convert-html-to-docx/url/download" \
  -H "apy-token: $APY_TOKEN" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.html"}'

What you'll get back

Returns a binary DOCX file as the response body.

TRY ITLIVE · 120 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Publicly accessible HTML page URL.

About this endpoint

What it does

Downloads an HTML document from a publicly accessible URL and converts it to a DOCX file.

Request Body

ParameterTypeMandatoryDescription
urlStringYesPublicly accessible HTML page URL. Must be a valid URI.

Response

Returns a binary response containing the generated DOCX file. The output schema is a single binary string, so there is no JSON wrapper or named response field to document.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.