> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Context.dev: Contextdev Post Parse

> Convert a PDF, Office document, image, code, or other file into clean Markdown text. Includes inputs, outputs, SDK V2 examples, and Deepline cost.

Convert a PDF, Office document, image, code, or other file into clean Markdown text.

> [!NOTE]
>
> Tool ID: `contextdev_post_parse`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'contextdev_post_parse',
  {
    "content_base64": "example"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline run contextdev_post_parse --input '{
  "content_base64": "example"
}'
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "success": true,
    "markdown": "example",
    "type": "warc",
    "request_id": "123e4567-e89b-42d3-a456-426614174000"
  }
}
```

Use `deepline describe contextdev_post_parse --json` for the latest machine-readable contract.

## Input reference

Convert uploaded file bytes into Markdown and optional HTML. WARC and WARC.GZ archives combine HTTP response, resource, and conversion records in archive order. Revisit and segmented records are skipped. Decoded WARC content is limited to 50 MiB.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.extension` | `"warc" \| "warc.gz" \| "txt" \| "text" \| "md" \| "markdown" \| "html" \| "htm" \| "xhtml" \| "xml" \| "rss" \| "atom" \| "csv" \| "tsv" \| "yaml" \| "yml" \| "py" \| "java" \| "js" \| "jsx" \| "mjs" \| "cjs" \| "json" \| "jsonl" \| "ndjson" \| "php" \| "sh" \| "bash" \| "zsh" \| "fish" \| "rb" \| "ts" \| "tsx" \| "rtf" \| "srt" \| "css" \| "scss" \| "less" \| "styl" \| "sass" \| "svg" \| "pdf" \| "docx" \| "doc" \| "xlsx" \| "xlsm" \| "xlsb" \| "xltx" \| "xltm" \| "xls" \| "pptx" \| "pptm" \| "ppsx" \| "ppsm" \| "potx" \| "potm" \| "ppt" \| "pps" \| "pot" \| "jpg" \| "jpeg" \| "jpe" \| "png" \| "gif" \| "bmp" \| "tiff" \| "tif" \| "webp" \| "ppm" \| "pbm" \| "pgm" \| "pnm"` | No | — | Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, md, py, rtf, jpg, png, txt, warc, or warc.gz. Allowed: `warc`, `warc.gz`, `txt`, `text`, `md`, `markdown`, `html`, `htm`, `xhtml`, `xml`, `rss`, `atom`, `csv`, `tsv`, `yaml`, `yml`, `py`, `java`, `js`, `jsx`, `mjs`, `cjs`, `json`, `jsonl`, `ndjson`, `php`, `sh`, `bash`, `zsh`, `fish`, `rb`, `ts`, `tsx`, `rtf`, `srt`, `css`, `scss`, `less`, `styl`, `sass`, `svg`, `pdf`, `docx`, `doc`, `xlsx`, `xlsm`, `xlsb`, `xltx`, See the live schema for the complete constraint. |
| `payload.includeLinks` | `boolean` | No | `true` | Preserve hyperlinks in Markdown output |
| `payload.includeImages` | `boolean` | No | `false` | Include image references in Markdown output |
| `payload.shortenBase64Images` | `boolean` | No | `true` | Shorten base64-encoded image data in the Markdown output |
| `payload.useMainContentOnly` | `boolean` | No | `false` | Extract only the main content from HTML-like inputs |
| `payload.ocr` | `boolean` | No | `false` | Read text from images and scanned PDF pages. PDF page ranges still apply. |
| `payload.includeNumberedPages` | `boolean` | No | `false` | Start each PDF page in the Markdown with a ` ` line, where N is the original 1-based page number. |
| `payload.pdf` | `object` | No | — | PDF page-range options as a JSON object, e.g. \{"start": 2, "end": 5}. |
| `payload.client` | `string` | No | — | Optional client identifier used for usage attribution. Minimum length: 1. Maximum length: 100. |
| `payload.zdr` | `"enabled" \| "disabled"` | No | `"disabled"` | `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR. Allowed: `enabled`, `disabled`. |
| `payload.tags` | `array` | No | — | Comma-separated labels for filtering usage, e.g. `production,team-alpha`. Maximum items: 20. |
| `payload.content_base64` | `string` | Yes | — | Base64-encoded file bytes to parse. Minimum length: 1. |
| `payload.content_type` | `string` | No | — | Optional MIME type sent upstream. Defaults to application/octet-stream. Minimum length: 1. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Convert uploaded file bytes into Markdown and optional HTML. WARC and WARC.GZ archives combine HTTP response, resource, and conversion records in archive order. Revisit and segmented records are skipped. Decoded WARC content is limited to 50 MiB.",
    "properties": {
      "extension": {
        "type": "string",
        "description": "Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, md, py, rtf, jpg, png, txt, warc, or warc.gz.",
        "enum": [
          "warc",
          "warc.gz",
          "txt",
          "text",
          "md",
          "markdown",
          "html",
          "htm",
          "xhtml",
          "xml",
          "rss",
          "atom",
          "csv",
          "tsv",
          "yaml",
          "yml",
          "py",
          "java",
          "js",
          "jsx",
          "mjs",
          "cjs",
          "json",
          "jsonl",
          "ndjson",
          "php",
          "sh",
          "bash",
          "zsh",
          "fish",
          "rb",
          "ts",
          "tsx",
          "rtf",
          "srt",
          "css",
          "scss",
          "less",
          "styl",
          "sass",
          "svg",
          "pdf",
          "docx",
          "doc",
          "xlsx",
          "xlsm",
          "xlsb",
          "xltx",
          "xltm",
          "xls",
          "pptx",
          "pptm",
          "ppsx",
          "ppsm",
          "potx",
          "potm",
          "ppt",
          "pps",
          "pot",
          "jpg",
          "jpeg",
          "jpe",
          "png",
          "gif",
          "bmp",
          "tiff",
          "tif",
          "webp",
          "ppm",
          "pbm",
          "pgm",
          "pnm"
        ]
      },
      "includeLinks": {
        "type": "boolean",
        "description": "Preserve hyperlinks in Markdown output",
        "default": true
      },
      "includeImages": {
        "type": "boolean",
        "description": "Include image references in Markdown output",
        "default": false
      },
      "shortenBase64Images": {
        "type": "boolean",
        "description": "Shorten base64-encoded image data in the Markdown output",
        "default": true
      },
      "useMainContentOnly": {
        "type": "boolean",
        "description": "Extract only the main content from HTML-like inputs",
        "default": false
      },
      "ocr": {
        "type": "boolean",
        "description": "Read text from images and scanned PDF pages. PDF page ranges still apply.",
        "default": false
      },
      "includeNumberedPages": {
        "type": "boolean",
        "description": "Start each PDF page in the Markdown with a ` ` line, where N is the original 1-based page number.",
        "default": false
      },
      "pdf": {
        "type": "object",
        "description": "PDF page-range options as a JSON object, e.g. {\"start\": 2, \"end\": 5}.",
        "properties": {
          "start": {
            "type": "integer",
            "description": "First 1-based PDF page to parse.",
            "minimum": 1
          },
          "end": {
            "type": "integer",
            "description": "Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must be >= start.",
            "minimum": 1
          }
        },
        "additionalProperties": false
      },
      "client": {
        "type": "string",
        "description": "Optional client identifier used for usage attribution.",
        "minLength": 1,
        "maxLength": 100
      },
      "zdr": {
        "type": "string",
        "description": "`enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR.",
        "default": "disabled",
        "enum": [
          "enabled",
          "disabled"
        ]
      },
      "tags": {
        "type": "array",
        "description": "Comma-separated labels for filtering usage, e.g. `production,team-alpha`.",
        "maxItems": 20,
        "items": {
          "type": "string",
          "minLength": 1,
          "maxLength": 50
        }
      },
      "content_base64": {
        "type": "string",
        "description": "Base64-encoded file bytes to parse.",
        "minLength": 1
      },
      "content_type": {
        "type": "string",
        "description": "Optional MIME type sent upstream. Defaults to application/octet-stream.",
        "minLength": 1
      }
    },
    "required": [
      "content_base64"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | — |
| `result.data.success` | `true` | Yes | — | Allowed: `true`. |
| `result.data.markdown` | `string` | Yes | — | — |
| `result.data.type` | `"warc" \| "html" \| "xml" \| "json" \| "jsonl" \| "text" \| "csv" \| "tsv" \| "markdown" \| "yaml" \| "python" \| "java" \| "javascript" \| "php" \| "shell" \| "ruby" \| "typescript" \| "rtf" \| "srt" \| "css" \| "scss" \| "less" \| "stylus" \| "sass" \| "svg" \| "pdf" \| "docx" \| "doc" \| "xlsx" \| "xls" \| "pptx" \| "ppt" \| "jpg" \| "png" \| "gif" \| "bmp" \| "tiff" \| "webp" \| "ppm" \| "pbm" \| "pgm" \| "pnm"` | Yes | — | Allowed: `warc`, `html`, `xml`, `json`, `jsonl`, `text`, `csv`, `tsv`, `markdown`, `yaml`, `python`, `java`, `javascript`, `php`, `shell`, `ruby`, `typescript`, `rtf`, `srt`, `css`, `scss`, `less`, `stylus`, `sass`, `svg`, `pdf`, `docx`, `doc`, `xlsx`, `xls`, `pptx`, `ppt`, `jpg`, `png`, `gif`, `bmp`, `tiff`, `webp`, `ppm`, `pbm`, `pgm`, `pnm`. |
| `result.data.key_metadata` | `object` | No | — | — |
| `result.data.request_id` | `string` | Yes | — | Format: `uuid`. |
| `result.meta` | `object` | No | — | — |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "properties": {
      "data": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "markdown": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "warc",
              "html",
              "xml",
              "json",
              "jsonl",
              "text",
              "csv",
              "tsv",
              "markdown",
              "yaml",
              "python",
              "java",
              "javascript",
              "php",
              "shell",
              "ruby",
              "typescript",
              "rtf",
              "srt",
              "css",
              "scss",
              "less",
              "stylus",
              "sass",
              "svg",
              "pdf",
              "docx",
              "doc",
              "xlsx",
              "xls",
              "pptx",
              "ppt",
              "jpg",
              "png",
              "gif",
              "bmp",
              "tiff",
              "webp",
              "ppm",
              "pbm",
              "pgm",
              "pnm"
            ]
          },
          "key_metadata": {
            "type": "object",
            "properties": {},
            "required": [],
            "additionalProperties": false
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "success",
          "markdown",
          "type",
          "request_id"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `provider_usage` (provider usage).
* Estimated Deepline credits: `0.01` per pricing unit.

## Related documentation

* [Connect integrations](https://deepline.com/docs/integrations.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.