{
  "openapi": "3.0.1",
  "info": {
    "title": "DOCX to Text & Markdown Converter",
    "description": "Convert Word .docx files to Markdown, plain text, HTML or JSON, with tables as rows, images, properties and RAG chunks. Use when you need Word content as text.",
    "version": "0.0",
    "x-build-id": "ptixHp6761hXjlFSg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/plainpipe~docx-to-text/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-plainpipe-docx-to-text",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/plainpipe~docx-to-text/runs": {
      "post": {
        "operationId": "runs-sync-plainpipe-docx-to-text",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/plainpipe~docx-to-text/run-sync": {
      "post": {
        "operationId": "run-sync-plainpipe-docx-to-text",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "docxUrls": {
            "title": "DOCX URLs",
            "type": "array",
            "description": "Direct links to Word .docx files, one per line. Dropbox share links ending in ?dl=0 are fixed automatically. Example: https://raw.githubusercontent.com/python-openxml/python-docx/master/tests/test_files/test.docx. Old .doc files are detected and skipped with a hint to save them as .docx.",
            "items": {
              "type": "string"
            }
          },
          "docxFile": {
            "title": "Upload a DOCX (optional)",
            "type": "string",
            "description": "Or upload one .docx file instead of (or in addition to) the links above, up to 50 MB. Leave empty when you only use DOCX URLs. Example: policy.docx."
          },
          "datasetId": {
            "title": "Dataset ID (batch input)",
            "type": "string",
            "description": "Optional. ID or name of an Apify dataset whose items hold .docx links, for example the output of another Actor. Every item's \"Dataset URL field\" is read. Example: aBcD1234efGh5678."
          },
          "datasetUrlField": {
            "title": "Dataset URL field",
            "type": "string",
            "description": "Field of each dataset item that holds the link (dot path for nested fields; a list of links also works). Default: url. Example: file.url.",
            "default": "url"
          },
          "keyValueStoreId": {
            "title": "Key-value store ID (batch input)",
            "type": "string",
            "description": "Optional. ID or name of an Apify key-value store that holds .docx files as records. Records whose key ends in .docx are converted; if none do, every record is tried. Example: my-word-files."
          },
          "keyValueStoreKeys": {
            "title": "Key-value store keys",
            "type": "array",
            "description": "Optional. Only convert these record keys from the key-value store above. Leave empty to pick the records automatically. Example: [\"contract.docx\", \"offer.docx\"].",
            "items": {
              "type": "string"
            }
          },
          "outputFormats": {
            "title": "Output formats",
            "type": "array",
            "description": "Which versions of the content each row gets: markdown (headings, lists, links, tables), text (plain text), html (mammoth HTML, whole documents only) and structure (JSON list of blocks: heading/paragraph/list/table/footnote). Default: [\"markdown\", \"text\"].",
            "items": {
              "type": "string",
              "enum": [
                "markdown",
                "text",
                "html",
                "structure"
              ],
              "enumTitles": [
                "Markdown",
                "Plain text",
                "HTML",
                "JSON block structure"
              ]
            },
            "default": [
              "markdown",
              "text"
            ]
          },
          "extractTables": {
            "title": "Tables as structured rows",
            "type": "boolean",
            "description": "Add a tables field with every Word table as rows of cell text (array of arrays; merged cells padded so columns line up). Default: true.",
            "default": true
          },
          "extractImages": {
            "title": "Save images",
            "type": "boolean",
            "description": "Save every embedded picture to the run's key-value store and link it from the Markdown as ![alt](link). The first row of each document lists them in images (key, link, type, size). Default: false.",
            "default": false
          },
          "includeMetadata": {
            "title": "Document properties",
            "type": "boolean",
            "description": "Add a metadata field from the file's own properties: title, subject, keywords, description, author, language, created and modified dates, revision, saved page and word counts, application. Off by default because author is a property of the document; turn on only if you need it. Default: false.",
            "default": false
          },
          "includeHeadersFooters": {
            "title": "Headers and footers",
            "type": "boolean",
            "description": "Add headers and footers fields with the distinct text of the page headers and footers. Default: false.",
            "default": false
          },
          "includeFootnotes": {
            "title": "Footnotes and endnotes",
            "type": "boolean",
            "description": "Keep footnotes and endnotes: references become [^1] in Markdown and [1] in text, with the notes listed at the end. Turn off to drop them. Default: true.",
            "default": true
          },
          "includeComments": {
            "title": "Review comments",
            "type": "boolean",
            "description": "Add a comments field with the text of each Word review comment and the passage it refers to (quotedText). Comment authors are never output. Default: false.",
            "default": false
          },
          "splitBy": {
            "title": "Split each document",
            "enum": [
              "document",
              "heading",
              "page"
            ],
            "type": "string",
            "description": "document = one row per file (default). heading = one row per section, cut at Heading 1-3, with section and headingPath. page = one row per page, using the page breaks Word stored in the file (manual breaks and the layout of the last save).",
            "default": "document"
          },
          "chunkWords": {
            "title": "Chunk size (words)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "0 = off (default). When set, each document (or section/page) is split into chunks of about this many words, cut between paragraphs and never right after a heading, one row per chunk with chunkIndex and headingPath. Each chunk is one billed result. Example: 300 for RAG embeddings.",
            "default": 0
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many rows in total (documents, or sections/pages/chunks when splitting). You are charged per row. Default 100. Example: 10.",
            "default": 100
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}