Skip to content
Fieldwork
Esc
↑↓navigate↵open⌘Jpreview

parse_document

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
Authorization
AuthorizationBearer token · headerrequired

A Fieldwork gateway key, issued per agent by the operator. Send it as Authorization: Bearer <key>.

Request body
requiredapplication/json
providerstring
Allowed:firecrawlllamaparsereducto
timeoutinteger

Maximum wait in milliseconds. Resume a returned jobId to collect a long job.

min 1 · max 45000
One of:
object
namestringrequired

The file name with its extension, such as spec-sheet.pdf. The extension tells the provider the type.

contentBase64stringrequired

The file's bytes, base64-encoded.

pagesboolean

Also return the Markdown of each page separately.

maxCharactersinteger

Shared long-text budget for this call; defaults to 20000. Never sent to the provider.

min 1 · max 200000
timeoutinteger

Maximum wait in milliseconds. Resume a returned jobId to collect a long job.

min 1 · max 45000
object
namestringrequired

The file name with its extension, such as spec-sheet.pdf. The extension tells the provider the type.

contentBase64stringrequired

The file's bytes, base64-encoded.

pagesboolean

Also return the Markdown of each page separately.

maxCharactersinteger

Shared long-text budget for this call; defaults to 20000. Never sent to the provider.

min 1 · max 200000
timeoutinteger

Maximum wait in milliseconds. Resume a returned jobId to collect a long job.

min 1 · max 45000
providerstringrequired
any
namestring

The file name with its extension, such as spec-sheet.pdf. The extension tells the provider the type.

contentBase64string

The file's bytes, base64-encoded.

urlstring<uri>

Public HTTP or HTTPS document URL; the provider fetches it. Use instead of name and contentBase64 for large files.

resumestring

The jobId from an earlier call's error, when that call timed out or was cancelled. Waits for that job instead of starting and paying for a new one.

maxCharactersinteger

Shared long-text budget for this call; defaults to 20000. Never sent to the provider.

min 1 · max 200000
timeoutinteger

Maximum wait in milliseconds. Resume a returned jobId to collect a long job.

min 1 · max 45000
providerstringrequired
One of:
any
any
any
any
any
namestring

The file name with its extension, such as spec-sheet.pdf. The extension tells the provider the type.

contentBase64string

The file's bytes, base64-encoded.

urlstring<uri>

Public HTTP or HTTPS document URL; the provider fetches it. Use instead of name and contentBase64 for large files.

resumestring

The jobId from an earlier call's error, when that call timed out or was cancelled. Waits for that job instead of starting and paying for a new one.

maxCharactersinteger

Shared long-text budget for this call; defaults to 20000. Never sent to the provider.

min 1 · max 200000
timeoutinteger

Maximum wait in milliseconds. Resume a returned jobId to collect a long job.

min 1 · max 45000
providerstringrequired
One of:
any
any
any
any
Responses
200

The provider that ran the call and its normalized result.

providerstringrequired
Allowed:firecrawlllamaparsereducto
requestIdstringrequired
resultobjectrequired
Show properties
blocksobject[]
Show properties
Array of object
boxobject

Where it sits on the page, as fractions of the page's width and height from its top-left corner.

Show properties
heightnumberrequired
leftnumberrequired
topnumberrequired
widthnumberrequired
cellsobject[]
Show properties
Array of object
boxobject

Where it sits on the page, as fractions of the page's width and height from its top-left corner.

Show properties
heightnumberrequired
leftnumberrequired
topnumberrequired
widthnumberrequired
boxesobject[]

Each box the cell sits in, when the provider gives them one by one; box encloses them.

Show properties
Array of object
heightnumberrequired
leftnumberrequired
topnumberrequired
widthnumberrequired
columnintegerrequired

The column, from 0.

min 0
columnSpaninteger

Columns the cell spans.

min 1
linesobject[]
Show properties
Array of object
boxobjectrequired

Where it sits on the page, as fractions of the page's width and height from its top-left corner.

Show properties
heightnumberrequired
leftnumberrequired
topnumberrequired
widthnumberrequired
textstringrequired
rowintegerrequired

The row, from 0.

min 0
rowSpaninteger

Rows the cell spans.

min 1
textstringrequired
containerstring

The page header or footer the block was read out of.

Allowed:headerfooter
linesobject[]
Show properties
Array of object
boxobjectrequired

Where it sits on the page, as fractions of the page's width and height from its top-left corner.

Show properties
heightnumberrequired
leftnumberrequired
topnumberrequired
widthnumberrequired
textstringrequired
pageintegerrequired

The physical page number, starting at 1.

min 1
textstringrequired
typestringrequired
wordsobject[]
Show properties
Array of object
boxobjectrequired

Where it sits on the page, as fractions of the page's width and height from its top-left corner.

Show properties
heightnumberrequired
leftnumberrequired
topnumberrequired
widthnumberrequired
textstringrequired
idstring
markdownstringrequired
metaobject

Request details from the provider: its request id, what it charged and any warnings.

Show properties
requestIdstring
usageobject
Show properties
costUsdnumber
creditsnumber
unitsobject
warningsstring[]
pageCountinteger

Pages in the file.

min 0
pagesobject[]
Show properties
Array of object
heightnumber

The page's height in points.

markdownstringrequired
pageNumberintegerrequired

The physical page number, starting at 1.

min 1
widthnumber

The page's width in points.

truncatedobject[]

One entry for each cut text field; absent when nothing was cut.

Show properties
Array of object
lengthintegerrequired

Original character length.

min 0
pathstringrequired
shownintegerrequired

Characters shown before the inline cut note.

min 0
default

A refusal or a failed call. Branch on error.code; never parse the message.

errorobjectrequired
Show properties
codestringrequired
Allowed:AbortedInvalidRequestJobFailedNotAFileNotFoundProviderErrorRateLimitedTimeoutTooLargeUnauthorizedUnsupported
jobIdstring

A job that was already started. Pass it as resume instead of repeating the call.

messagestringrequired
providerstring
retryAfternumber

Seconds to wait.

retryablebooleanrequired

Whether repeating the same call can succeed.

requestIdstring
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST '/api/v1/tools/parse_document' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "provider": "firecrawl",
  "timeout": 1,
  "name": "string",
  "contentBase64": "string",
  "pages": true,
  "maxCharacters": 1
}'
Response
{
  "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
      }
    ]
  }
}

Was this page helpful?