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

# POST /convert/from-url

> Convert documents from a signed URL.

# POST /convert/from-url

Converts a document from a signed URL. This is the recommended path for large files and for documents already stored in S3, R2, Supabase Storage, GCS, Azure Blob, or another storage service that can generate short-lived HTTPS URLs.

## JSON body

```json theme={null}
{
  "url": "https://storage.example.com/signed/report.pdf",
  "filename": "report.pdf",
  "input_format": "auto",
  "mode": "fast",
  "clean": true,
  "response_format": "markdown"
}
```

<ParamField body="url" type="string" required>
  Short-lived signed HTTPS URL for the source document.
</ParamField>

<ParamField body="filename" type="string" default="document.pdf">
  Document name. It helps detect the format.
</ParamField>

<ParamField body="input_format" type="enum" default="auto">
  `pdf`, `docx`, `csv`, `txt`, `html`, `xlsx`, `pptx`, `zip`, or `auto`.
</ParamField>

<ParamField body="mode" type="enum" default="fast">
  `fast`, `balanced`, `quality`, or `auto`. See [Modes](/docs/concepts/modes).
</ParamField>

<ParamField body="clean" type="boolean" default="true">
  Clean up the output Markdown.
</ParamField>

<ParamField body="response_format" type="enum" default="markdown">
  `markdown` or `json`.
</ParamField>

<ParamField body="output_url" type="string">
  Pre-signed `PUT` URL from your storage. If provided, the API uploads the converted Markdown there and responds with a small JSON body.
</ParamField>

<ParamField body="output_encoding" type="enum" default="identity">
  Compression for Markdown uploaded to `output_url`: `identity`, `gzip`, or `zstd`.
</ParamField>

## Size: no raw upload limit

Unlike [`/convert/raw`](/docs/api/convert-raw), `from-url` does not require your app server to send the full file body. The API downloads the document directly from your signed URL, which is better for large files and serverless apps.

## Examples

<CodeGroup>
  ```bash curl (JSON) theme={null}
  curl -X POST "https://api.markpdf.tech/convert/from-url" \
    -H "x-api-key: YOUR_API_KEY" \
    -H "content-type: application/json" \
    -d @payload.json
  ```

  ```bash curl (query) theme={null}
  curl -X POST "https://api.markpdf.tech/convert/from-url?url=https%3A%2F%2Fstorage.example.com%2Fsigned.pdf&filename=report.pdf" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import httpx

  r = httpx.post(
      "https://api.markpdf.tech/convert/from-url",
      headers={"x-api-key": "YOUR_API_KEY"},
      json={
          "url": "https://storage.example.com/signed/report.pdf",
          "filename": "report.pdf",
          "mode": "fast",
      },
      timeout=300,
  )
  print(r.text)
  ```
</CodeGroup>

<Note>
  If a parameter arrives through query and body at the same time, the query parameter wins. See [Parameters](/docs/api/parameters).
</Note>

## Security

Always use short-lived signed HTTPS URLs. The API rejects unsafe targets such as private network addresses, loopback hosts, credentials embedded in URLs, and non-standard destinations.
