Skip to main content
POST
Extract rich content from a document

Overview

Pipeline Step 1 — Extract is where document processing begins: every downstream step consumes its extraction_id. After extraction, you can optionally split the document into topics, apply schema extraction to get structured data, or use tables for span-aware table extraction.Handling mixed document types? /classify can run before Extract to route each raw document to the right pipeline — it only chooses which pipeline runs, so extraction still happens here.
Extract content from documents. Returns markdown or HTML formatted content with optional structured data extraction. For large results (typically documents over 70 pages, spreadsheet extractions, or any response above 5 MB), the API returns a one-time download link at https://api.runpulse.com/results/{job_id} instead of inlining the payload. Fetching that URL returns the same complete extraction result JSON you would receive inline. See Large Result Response below.
For large documents or batch processing workflows, set async: true to process asynchronously and poll for results via GET /job/jobId.
To process many files at once, use Batch Extract. It accepts an S3 prefix, local directory, or list of URLs and runs /extract on each file in parallel.

Async Mode

Set async: true to return immediately with a job ID for polling:
Async Response (200):
Use GET /job/{job_id} to poll for completion.

Request

Document Source

Provide the document using one of these methods:

Extraction Options

Figure Processing

Settings under figure_processing control how figures (images, charts, diagrams) and embedded visuals are processed. Applies to both PDFs/images (figures detected from layout) and spreadsheets (charts and embedded images read directly from the workbook). Affects the markdown output and the bounding_boxes.Images[] array.
For spreadsheets specifically, show_images: true collects every embedded chart and image in the workbook and emits one entry per visual under bounding_boxes.Images, with chart-specific fields like chart_type, chart_title, and source_ranges populated. See Bounding Boxes for the full field list.

Spreadsheet Options

Settings under spreadsheet control how Excel workbooks (.xlsx, .xlsm, .xls) are processed. By default, hidden rows, columns, and sheets are excluded from extraction output, cell values are rendered the way Excel displays them, and table cell metadata is included. Phantom-cell trimming is opt-in. Spreadsheet responses are returned as full-result URLs by default because workbook cell_data can make the payload large even for modest .xlsx files.
These settings accept both camelCase (includeHiddenRows, onlyDataRows, cellData) and snake_case (include_hidden_rows, only_data_rows, cell_data) formats.

Phantom-cell trimming (only_data_rows / only_data_cols)

Excel files exported from claims systems, ERPs, and other automated pipelines routinely declare a “used range” that extends hundreds of thousands of rows past where the data actually ends. A typical case: a 57 MB workbook with only ~500 rows of real data, where the other ~1,000,000 rows are empty cells that exist only because they were once selected and styled. These phantom cells inflate file size by orders of magnitude and can exhaust parser memory on the extraction pipeline. Set only_data_rows: true and only_data_cols: true to have Pulse scan each sheet once before parsing, find the largest row and column containing a value or formula, and ignore everything beyond that extent. Surviving cells keep their original A1 coordinates (e.g., a value at B7 in the source is still B7 in the output), so any citation or bounding box that references a specific cell remains stable. The trim only kicks in on large sheets (≥5 MB of XML per sheet), so small, well-formed workbooks pay no overhead either way. Both flags default to false.

Pulse Ultra 2 Options

These options are available only when model: pulse-ultra-2 is set. Passing any of them with the default model returns a 400 error listing the offending fields.

Selection mark detection

Use detect_selections: true with model: pulse-ultra-2 when a document contains forms, checkboxes, radio buttons, handwritten selection marks, or other marked-choice controls. Pulse runs a specialized detection pass for these marks so selected/unselected states are less likely to be missed or confused with nearby text, boxes, or handwriting. When available, the detected state is returned on the relevant bounding-box items as selected.

Markdown output additions

When extract_figure or figure_description is enabled, figures in response.markdown include additional tags:
When refine (or refine_options) is set, markdown content is post-processed page-by-page; output is cleaner but typically grows ~1.5–3x in size for dense documents. No new tags are introduced.

Extensions

Settings under extensions enable additional processing passes or alternate output formats. Each enabled extension produces a corresponding output field under response.extensions.*. For example, enabling extensions.chunking produces response.extensions.chunking, and enabling extensions.alt_outputs.return_html produces response.extensions.alt_outputs.html.

pulse-ultra-2 Rate Limits

Requests made with model: pulse-ultra-2 are subject to dedicated rate limits, separate from standard extraction: The concurrent limit is the one that most commonly applies in practice — long-running extractions held open while new requests arrive will trip it first.

Storage Options

Control whether extractions are saved to your extraction library:

Deprecated Fields

The following input fields are deprecated and will be removed in a future version. They are still accepted for backward compatibility.
When legacy input fields are used, the API returns a deprecation warning in the warnings array directing you to the updated field names. See the latest documentation for details.

Response

The response structure varies based on document size to optimize for different use cases.

Standard Inline Response

For non-spreadsheet documents under 70 pages whose response payload stays below the inline threshold, results are returned directly in the response body:

Response Fields

Deprecated Response Fields

Large Result Response

For documents with 70 or more pages, spreadsheet extractions, or any response payload above the 5 MB inline threshold, the API returns a one-time download link to /results/{job_id} instead of inlining the payload. This prevents timeout issues and keeps the immediate response small. The downloaded JSON is the complete extraction result with the normal response shape.

Large Result Response Fields

/results/{job_id} links are single-use and expire 1 hour after the job completes. Download and persist the payload immediately — do not pass the URL through queues or share it across workers.

Handling Large Document Responses

Because /results/{job_id} is one-time use, persist the result to your own storage on first download. If you need to access the result later, enable storage.enabled and retrieve it from your extraction library on the Pulse Platform.

Example Usage

Basic Extraction

File Upload

Structured Data (Extract → Schema)

The structured_output parameter on /extract is deprecated. Use the /schema endpoint after extraction instead. This gives you better control, re-runnability, and support for split-mode schemas.
Recommended two-step approach:

Document Metadata

Enable extensions.document_metadata to read native properties from the original file before conversion, rendering, or OCR. The option is a single boolean; Pulse returns every safely recoverable field for the detected format.
Absent metadata fields are omitted rather than returned as null. Metadata is evidence declared by the source file and is not independently verified. Original camera files may contain sensitive capture timestamps or GPS coordinates. See Document Metadata for format-specific behavior and implementation guidance.

Page Range and Chunking

Footnote References

Enable extensions.footnote_references to detect footnote markers (e.g. *, , 1) in body text and link them to the footnote explanation paragraphs at the bottom of the page. Each result item includes the marker symbol, the bounding-box text ID of the footnote, and the bounding-box text IDs of all body-text paragraphs that reference it.

Example Response

Footnote Reference Fields

Footnote reference detection uses Azure Document Intelligence for paragraph classification, supplemented by PyMuPDF native text extraction for accurate symbol identification. This handles common OCR confusion between visually similar symbols like /+ and /#. Supported marker types include numbered (1, 2, 3), symbolic (*, , , §, #), and lettered (a, b, c) footnotes.

Excel Spreadsheet Options

Spreadsheet responses are URL-backed by default: the immediate response is is_url: true with a one-time /results/{job_id} link. Fetch that URL to receive the complete extraction result. The result shape is unchanged: table metadata remains under bounding_boxes.Tables[].cell_data when spreadsheet.cell_data is true (the default). Set top-level force_url: false only if you need the full result inline.
Workbooks exported from claims systems, ERPs, and other automated pipelines often declare a “used range” that extends hundreds of thousands of rows past where the data actually ends. Set spreadsheet.only_data_rows: true and spreadsheet.only_data_cols: true to have Pulse trim those trailing empty “phantom” rows and columns before parsing. Surviving cells keep their original A1 coordinates, so any citation or bounding box that references a specific cell remains stable. Both flags default to false. See the extraction options above for the full reference.

Excel Charts and Embedded Images

When you set figure_processing.show_images: true on an Excel workbook, every embedded chart and image is collected from the workbook directly and returned under bounding_boxes.Images[]. Each entry carries a Pulse-hosted image_url you can fetch via results.getImage (or any HTTP client with your API key) to get the raw PNG/JPEG bytes.

Example bounding_boxes.Images Entry

See Bounding Boxes — Images Array for the full field reference and Get Result Image for the auth requirement on image_url.

Disable Storage

Authorizations

x-api-key
string
header
required

Body

multipart/form-data

Input schema for extraction requests. Provide either file (direct upload) or fileUrl (remote URL).

file
file

Document to upload directly. Required unless fileUrl is provided.

fileUrl
string<uri>

Public or pre-signed URL that Pulse will download and extract. Required unless file is provided.

model
enum<string>

Extraction model to use. When set to pulse-ultra-2, routes the request through Pulse Ultra 2 (self-hosted VPC model) instead of the default cloud-based service. If omitted or set to default, the default model is used.

Available options:
default,
pulse-ultra-2
detectSelections
boolean

Pulse Ultra 2 only. Enables a specialized selection-mark detection pass that improves selected/unselected state accuracy for forms, checkboxes, radio buttons, handwritten checkmarks, X marks, and similar controls. Enabled by default when model is pulse-ultra-2; set to false to skip this pass. Passing true without model: pulse-ultra-2 returns a validation error.

extractionConfigId
string<uuid>

UUID of a saved extraction configuration (a "preset"). When provided, the server loads the saved configuration and applies its options on top of any inline parameters supplied in this request. Inline parameters always take precedence over preset values for the same field. Saved configs are managed via the platform UI or the input_extractions admin endpoints.

pages
string

Page range filter supporting segments such as 1-2 or mixed ranges like 1-2,5.

Pattern: ^[0-9]+(-[0-9]+)?(,[0-9]+(-[0-9]+)?)*$
forceUrl
boolean
default:false

When true, return the complete extraction result as a URL even if it is small. Spreadsheet extractions use URL delivery by default; set force_url: false to request inline spreadsheet output. URL delivery changes only the transport, not the result shape.

figureProcessing
object

Settings that control how figures and embedded visuals are processed. Applies to both PDFs/images (where figures are detected from layout) and spreadsheets (where charts and embedded images are read directly from the workbook). These options affect the markdown output and the bounding_boxes.Images[] array; they do not produce additional output fields elsewhere in the response.

extensions
object

Settings that enable additional processing passes or alternate output formats. Each enabled extension produces a corresponding output field under response.extensions.*.

spreadsheet
object

Settings for Excel/spreadsheet extraction. Controls handling of hidden rows, columns, and sheets, whether numeric cells are rendered using their display format or underlying raw value, whether table cell metadata is captured, and optional trimming of empty phantom rows/columns past the last data-bearing cell. Applies to .xlsx, .xlsm, and .xls files. Accepts both camelCase and snake_case field names.

storage
object

Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created.

async
boolean
default:false

If true, returns immediately with a job_id for polling via GET /job/{jobId}. Otherwise processes synchronously.

structuredOutput
object
deprecated

⚠️ DEPRECATED — Use the /schema endpoint after extraction instead. Pass the extraction_id from the extract response to /schema with your schema_config. This parameter still works for backward compatibility but will be removed in a future version.

schema
deprecated

(Deprecated) JSON schema describing structured data to extract. Use structuredOutput instead. Accepts either a JSON object or a stringified JSON representation.

schemaPrompt
string
deprecated

(Deprecated) Natural language prompt for schema-guided extraction. Use structuredOutput.schemaPrompt instead.

customPrompt
string
deprecated

(Deprecated) Custom instructions that augment the default extraction behaviour. Use figureProcessing or extensions instead.

chunking
string
deprecated

⚠️ DEPRECATED — Use extensions.chunking.chunkTypes instead. Comma-separated list of chunking strategies to apply (for example semantic,header,page,recursive). Still accepted for backward compatibility.

chunkSize
integer
deprecated

⚠️ DEPRECATED — Use extensions.chunking.chunkSize instead. Override for maximum characters per chunk when chunking is enabled.

Required range: x >= 1
extractFigure
boolean
default:false
deprecated

⚠️ DEPRECATED — Toggle to enable figure extraction in results.

figureDescription
boolean
default:false
deprecated

⚠️ DEPRECATED — Use figureProcessing.description instead. Toggle to generate descriptive captions for extracted figures.

showImages
boolean
default:false
deprecated

⚠️ DEPRECATED — Use figureProcessing.showImages instead. Embed base64-encoded images inline in figure tags in the output. Increases response size.

returnHtml
boolean
default:false
deprecated

⚠️ DEPRECATED — Use extensions.altOutputs.returnHtml instead. Whether to include HTML representation alongside markdown in the response.

thinking
boolean
default:false
deprecated

(Deprecated) Enables expanded rationale output for debugging.

Response

Extraction result. For documents under 70 pages the full result is returned inline. For larger documents and spreadsheet extractions the response can contain is_url: true and a single-use url to download the full result via GET /results/{jobId}.

Full extraction result returned by the synchronous /extract endpoint. Inherits all core fields and adds deprecated backward-compatibility fields.

markdown
string

Primary markdown content extracted from the document. Always present in the new format.

extensions
object

Output from enabled extensions. Each key corresponds to an extension that was enabled in the request under extensions.*. Only keys for enabled extensions are present.

bounding_boxes
object

Positional bounding-box data for text, titles, headers, footers, images, and tables. Images carries chart/image visuals (with image_url when figure_processing.show_images is enabled), Tables the detected tables, and Text/Title/Footer the paragraph/title/footer regions. Additional keys (e.g. markdown_with_ids, defined_names) round-trip without being typed.

extraction_id
string<uuid>

Persisted extraction ID. Present when storage is enabled (default). Use this ID with /split and /schema endpoints.

extraction_url
string

URL to view the extraction on the Pulse platform. Present when storage is enabled.

page_count
integer

Number of pages processed.

Required range: x >= 1
plan_info
object

Billing tier and cumulative usage information. Includes total_credits_used (primary billing metric) and pages_used (legacy compatibility).

warnings
string[]

Non-fatal warnings generated during extraction. Includes deprecation notices when legacy input parameters are used, as well as processing warnings (e.g. word-level bounding box limitations).

credits_used
number<float> | null

Number of credits consumed by this request. Only present when the organization has the credit billing system enabled.

html
string
deprecated

Deprecated — Use extensions.altOutputs.html instead. HTML representation of the extracted content. Present when the legacy returnHtml input was used.

chunks
object
deprecated

Deprecated — Use extensions.chunking instead. Document content split into chunks. Present when the legacy chunking input was used.

structured_output
object
deprecated

Deprecated — Only present when the deprecated structuredOutput input parameter was used. Use the /schema endpoint after extraction instead.

input_schema
object
deprecated

Deprecated — Echo of the schema that was applied. Only present when the deprecated structuredOutput input parameter was used.

schema_error
string
deprecated

Deprecated — Error message if schema processing failed via the deprecated structuredOutput input parameter.

content
string
deprecated

Deprecated — Alias for markdown. Included for backward compatibility with older SDK versions. Prefer markdown.

job_id
string
deprecated

Deprecated — Identifier assigned to the extraction job. Retained for backward compatibility.

metadata
object
deprecated

Deprecated — Additional metadata supplied by the backend. Retained for backward compatibility.