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

# Parse a Document from a URL

> Parse one document fetched from a URL with the platform's fast lite parse

*Rate limit tier: **submission** (60 req/min) — see [Rate limits](/api-reference-v3/introduction#rate-limits).*

Parses **one document** fetched server-side from a URL with the platform's fast lite parse — the URL analogue of [`POST /v3/parse/`](/api-reference-v3/parse/parse), backed by your organization's system parse workflow (provisioned automatically on first use).

Provide one **HTTPS** URL. The file is named by the response's `Content-Disposition`, else by the URL's path — see [File names](#file-names). The response is a [run](/concepts/runs-and-results) reference — poll [`GET /v3/runs/{run_id}/`](/api-reference-v3/runs/get) until `status` is `processed`; the parsed markdown is at `results.parse.markdown`. A failed, non-2xx, or timed-out fetch surfaces as `422` with the failure reason in `detail`.

<Note>
  Parse is single-file per call — the results envelope carries the **first** file's parse output. To import multiple URLs into one packet, use [upload from URL](/api-reference-v3/workflows/upload-from-url) and [document-packets/run](/api-reference-v3/document-packets/run) directly.
</Note>

## File names

A from-url file is named from the response, not from the request. The name matters twice: it carries the extension the import requires (a URL whose path is an opaque key, such as a presigned object GET, has none), and it is the name you and your users see everywhere the file is listed, so a file called by its storage key is a poor experience. Precedence:

1. The `Content-Disposition` filename on the response ([RFC 6266](https://www.rfc-editor.org/rfc/rfc6266); `filename*=UTF-8''…` wins over `filename=`, and any path is cut to its last segment).
2. Else the URL path's last segment: `https://example.com/invoices/april.pdf` imports as `april.pdf`.
3. Else the slot mint's extension error, as today: the import fails with `422`.

The header rather than a request field, because HTTP already names a downloaded file there, every object store signs it into a presigned URL, the API stays URL-only, and the name travels with its URL instead of in a parallel list that must match `urls` in length and order. On S3, `ResponseContentDisposition` signs it in:

```python boto3 theme={null}
import boto3

s3 = boto3.client("s3")
url = s3.generate_presigned_url(
    "get_object",
    Params={
        "Bucket": "my-bucket",
        "Key": "uploads/7c1f3e9a",
        "ResponseContentDisposition": 'attachment; filename="april-invoice.pdf"',
    },
    ExpiresIn=900,
)
```

GCS (`response-content-disposition` on a V4 signed URL) and Azure (`rscd` on a SAS) offer the same override.

Whichever name applies must end in a supported extension (`.pdf`, `.docx`, `.png`, …): a bare key such as `uploads/7c1f3e9a` names the file `7c1f3e9a`, which has none, and the import fails with `422`. A name that collides with a file already in the parse workflow is auto-renamed (`april.pdf` → `april (1).pdf`).

<RequestExample>
  ```bash curl theme={null}
  curl -X POST 'https://api.anyformat.ai/v3/parse/from-url/' \
    -H 'Authorization: Bearer YOUR_API_KEY' \
    -H 'Content-Type: application/json' \
    -d '{"url": "https://example.com/invoices/april.pdf"}'
  ```

  ```python Python (requests) theme={null}
  import requests

  url = "https://api.anyformat.ai/v3/parse/from-url/"
  headers = {"Authorization": "Bearer YOUR_API_KEY"}
  body = {"url": "https://example.com/invoices/april.pdf"}

  triggered = requests.post(url, headers=headers, json=body).json()
  print(triggered["run_id"])
  ```
</RequestExample>

<ResponseExample>
  ```json Response (202 Accepted) theme={null}
  {
    "run_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4fa",
    "document_packet_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e1",
    "workflow_id": "0686bb97-8c30-70f0-8000-97669e000eb8",
    "status": "queued"
  }
  ```

  ```json Response (422 — fetch failed) theme={null}
  {
    "error": "Remote fetch failed",
    "detail": "Remote server returned 404",
    "error_code": "VALIDATION_ERROR",
    "retryable": false,
    "request_id": "a1b2c3d4e5f67890abcdef1234567890"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml POST /v3/parse/from-url/
openapi: 3.1.0
info:
  title: anyformat API
  description: >
    Document extraction and workflow automation API.


    AnyFormat lets you define extraction workflows that pull structured data
    from any document — PDFs, images, scanned files, or plain text. Upload a
    file, run it through a workflow, and get back structured fields with
    confidence scores and source evidence.


    ## Quick start


    See the [Quick start
    guide](https://docs.anyformat.ai/api-reference/introduction) for a
    walkthrough.


    ## Authentication


    All endpoints (except `/health/`) require a Bearer token in the
    `Authorization` header:


    ```

    Authorization: Bearer <your-api-key>

    ```


    Get your API key from
    [app.anyformat.ai/api-key](https://app.anyformat.ai/api-key).


    ## Versioning


    Endpoints are versioned by path prefix (`/v2/`, `/v3/`). Every response
    under

    a versioned prefix includes `X-API-Version`.
  version: 2.0.0
servers:
  - url: https://api.anyformat.ai
    description: API server
security: []
tags:
  - name: workflows
    description: >-
      Workflows define extraction templates — what fields to extract from
      documents. Create workflows, upload files, run extractions, and fetch
      results.
  - name: files
    description: >-
      File collections group uploaded documents and track their extraction
      progress. Upload files, check status, and retrieve extraction results.
  - name: suggestions
    description: >-
      AI-powered schema and workflow suggestion endpoints for the AnyFormat
      webapp. Authenticated with a Cognito JWT rather than an API key.
  - name: document-packets
    description: >-
      Document packets group uploaded documents for a workflow (v3). Address a
      packet directly to (re-)run its workflow.
  - name: runs
    description: >-
      Extraction runs — the v3 first-class result entity. Each run is a single
      execution of a workflow against a document packet; fetch its status and
      results flat by run id.
  - name: parse
    description: >-
      Parse a single document with the platform's fast lite parse — a one-call
      shortcut over the workflow upload + run primitives, backed by your
      organization's system parse workflow.
  - name: health
    description: Health check endpoints to verify API availability.
paths:
  /v3/parse/from-url/:
    post:
      tags:
        - parse
      summary: Parse a document from a URL
      description: >-
        Parse one document fetched from a URL with the platform's fast lite

        parse (atomic).


        One HTTPS URL per call. The upload runs against your organization's

        system parse workflow, provisioned automatically on first use. Poll

        `GET /v3/runs/{run_id}/` until `status` is `processed`; the markdown is

        at `results.parse.markdown`.


        Not idempotent: every call fetches the URL, creates a packet and starts

        a new run. For a retry-safe flow use `POST
        /v3/workflows/{id}/upload/from-url/`

        and then `POST /v3/document-packets/{id}/run/` with an
        `Idempotency-Key`.
      operationId: v3_parse_from_url
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ParseFromUrlRequest'
        required: true
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunTriggeredV3'
          headers:
            X-RateLimit-Limit:
              description: Requests allowed per window (60s).
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests remaining in the current window.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Seconds until the current window resets.
              schema:
                type: integer
        '401':
          description: Authentication failed — missing, invalid, or expired API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                AUTH_FAILED:
                  value:
                    error: Authentication failed.
                    detail: Authentication failed.
                    error_code: AUTH_FAILED
                    retryable: false
                    request_id: req_abc123
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: >-
            Rate limited — retry after the `Retry-After` header. Default
            windows: 60 requests/minute for extraction submission, 600
            requests/minute for general endpoints.
          headers:
            Retry-After:
              description: Seconds until the next request is allowed.
              schema:
                type: integer
            X-RateLimit-Limit:
              description: Requests allowed per window (60s).
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests remaining in the current window.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Seconds until the current window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                RATE_LIMITED:
                  value:
                    error: Rate limit exceeded — retry after backoff.
                    detail: Rate limit exceeded — retry after backoff.
                    error_code: RATE_LIMITED
                    retryable: true
                    request_id: req_abc123
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ParseFromUrlRequest:
      properties:
        url:
          type: string
          title: Url
          description: >-
            HTTPS URL the backend fetches server-side. The filename is derived
            from the URL's path.
          examples:
            - https://example.com/invoices/april.pdf
      type: object
      required:
        - url
      title: ParseFromUrlRequest
      description: Body for ``POST /v3/parse/from-url/``.
      examples:
        - url: https://example.com/invoices/april.pdf
    RunTriggeredV3:
      properties:
        run_id:
          type: string
          title: Run Id
          description: Unique identifier of the new run (hyphenated UUID).
          examples:
            - 069dcc2c-e14c-7606-8000-2ee4fb17b4f9
        document_packet_id:
          type: string
          title: Document Packet Id
          description: The document packet the run executes on (hyphenated UUID).
          examples:
            - 069dcc2c-e14c-7606-8000-2ee4fb17b4e1
        workflow_id:
          type: string
          title: Workflow Id
          description: The workflow being run (hyphenated UUID).
          examples:
            - 0686bb97-8c30-70f0-8000-97669e000eb8
        status:
          $ref: '#/components/schemas/RunStatus'
          description: Status at acceptance time — normally `queued`.
          examples:
            - queued
      type: object
      required:
        - run_id
        - document_packet_id
        - workflow_id
        - status
      title: RunTriggeredV3
      description: |-
        202 response for both run triggers (`upload/run/` and
        `document-packets/{id}/run/`).
    ErrorEnvelope:
      type: object
      title: ErrorEnvelope
      description: >-
        Uniform error response. `retryable=true` means the same request may
        succeed on retry (with backoff); `retryable=false` means the caller must
        change the request before retrying.
      required:
        - error
        - detail
        - error_code
        - retryable
        - request_id
      properties:
        error:
          type: string
          description: Short human-readable summary.
        detail:
          description: >-
            Machine-readable detail. String for most errors; list of field
            errors for validation failures.
          oneOf:
            - type: string
            - type: array
              items:
                type: object
        error_code:
          type: string
          description: Stable identifier for programmatic handling.
          examples:
            - VALIDATION_ERROR
            - AUTH_FAILED
            - NOT_FOUND
            - PRECONDITION_FAILED
            - RATE_LIMITED
            - INTERNAL_ERROR
            - GATEWAY_TIMEOUT
        retryable:
          type: boolean
          description: True when the caller should retry (with backoff for 429/412/5xx).
        request_id:
          type: string
          description: Correlates this response with server logs.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RunStatus:
      type: string
      enum:
        - queued
        - in_progress
        - processed
        - error
        - cancelled
      title: RunStatus
      description: |-
        Execution lifecycle of a run. Non-terminal: ``queued``,
        ``in_progress``. Terminal: ``processed`` (success), ``error``,
        ``cancelled``.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: http
      description: >-
        API key issued from app.anyformat.ai/api-key. Send as `Authorization:
        Bearer <key>`.
      scheme: bearer

````