---
search:
  tags:
    - parse
    - POST
seo:
  description: >-
    Convert a document file (PDF, DOCX, XLSX, PPTX, HTML or CSV) to… Reference
    for the POST /api/v1/tools/parse_document endpoint in the Fieldwork gateway
    API.
sidebar:
  label: parse_document
  badge: POST
title: parse_document
type: openapi-operation
---
Convert a document file (PDF, DOCX, XLSX, PPTX, HTML or CSV) to Markdown. Use name and contentBase64 for bytes, or a public url with LlamaParse or Reducto. Firecrawl accepts bytes here; use read_page for a public URL. Defaults to firecrawl. Set provider to choose another supported provider; Fieldwork never switches providers after an error.

`POST /api/v1/tools/parse_document`

**Request body** (`application/json`, required)

- `provider` (string)
- `timeout` (integer) — Maximum wait in milliseconds. Resume a returned jobId to collect a long job.

Request body example:

```json
{
  "provider": "firecrawl",
  "timeout": 1,
  "name": "string",
  "contentBase64": "string",
  "pages": true,
  "maxCharacters": 1
}
```

**Responses**

- `200` — The provider that ran the call and its normalized result.
- `default` — A refusal or a failed call. Branch on error.code; never parse the message.

Response example, 200:

```json
{
  "provider": "firecrawl",
  "requestId": "string",
  "result": {
    "blocks": [
      {
        "box": {
          "height": 0,
          "left": 0,
          "top": 0,
          "width": 0
        },
        "cells": [
          {
            "box": {
              "height": 0,
              "left": 0,
              "top": 0,
              "width": 0
            },
            "boxes": [
              {
                "height": 0,
                "left": 0,
                "top": 0,
                "width": 0
              }
            ],
            "column": 0,
            "columnSpan": 1,
            "lines": [
              {
                "box": {
                  "height": 0,
                  "left": 0,
                  "top": 0,
                  "width": 0
                },
                "text": "string"
              }
            ],
            "row": 0,
            "rowSpan": 1,
            "text": "string"
          }
        ],
        "container": "header",
        "lines": [
          {
            "box": {
              "height": 0,
              "left": 0,
              "top": 0,
              "width": 0
            },
            "text": "string"
          }
        ],
        "page": 1,
        "text": "string",
        "type": "string",
        "words": [
          {
            "box": {
              "height": 0,
              "left": 0,
              "top": 0,
              "width": 0
            },
            "text": "string"
          }
        ]
      }
    ],
    "id": "string",
    "markdown": "string",
    "meta": {
      "requestId": "string",
      "usage": {
        "costUsd": 0,
        "credits": 0,
        "units": {
          "property1": 0,
          "property2": 0
        }
      },
      "warnings": [
        "string"
      ]
    },
    "pageCount": 0,
    "pages": [
      {
        "height": 0,
        "markdown": "string",
        "pageNumber": 1,
        "width": 0
      }
    ],
    "truncated": [
      {
        "length": 0,
        "path": "string",
        "shown": 0
      }
    ]
  }
}
```
