Skip to main content
POST
/
v3
/
workflows
/
{workflow_id}
/
upload
/
from-url
/
curl -X POST 'https://api.anyformat.ai/v3/workflows/0686bb97-8c30-70f0-8000-97669e000eb8/upload/from-url/' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "urls": [
      "https://example.com/invoices/april.pdf",
      "https://example.com/invoices/april-annex.pdf"
    ]
  }'
import requests

workflow_id = "0686bb97-8c30-70f0-8000-97669e000eb8"
url = f"https://api.anyformat.ai/v3/workflows/{workflow_id}/upload/from-url/"
headers = {"Authorization": "Bearer YOUR_API_KEY"}

body = {
    "urls": [
        "https://example.com/invoices/april.pdf",
        "https://example.com/invoices/april-annex.pdf",
    ]
}

packet = requests.post(url, headers=headers, json=body).json()
print(packet["document_packet_id"])
{
  "document_packet_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e1",
  "workflow_id": "0686bb97-8c30-70f0-8000-97669e000eb8",
  "files": [
    { "id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e2", "name": "april.pdf" },
    { "id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e3", "name": "april-annex.pdf" }
  ]
}
{
  "error": "Remote fetch failed",
  "detail": "Remote server returned 404",
  "error_code": "VALIDATION_ERROR",
  "retryable": false,
  "request_id": "a1b2c3d4e5f67890abcdef1234567890"
}
Rate limit tier: submission (60 req/min) — see Rate limits. Creates a document packet by having anyformat fetch the bytes server-side — no need to stream documents through your own backend when they already live in object storage you can presign (S3, GCS, R2, …) or at a public HTTPS URL. Provide 1–10 HTTPS URLs. All of them import into a single packet, atomically: the packet is registered only after every fetch succeeded, so any failure imports nothing — no partial packet, no orphan files. Filenames are derived from each URL’s path. Each fetch is bounded by a 10-second timeout and a 20 MB per-file cap. A failed, non-2xx, or timed-out fetch surfaces as 422 with the distinct failure reasons in detail. URLs resolving to non-globally-routable addresses (loopback, private ranges, link-local, cloud-metadata) are refused before any connection opens. The response is final — the packet is fully imported when you receive 201. If the server-side import takes longer than the gateway’s 6-minute polling ceiling, the request fails with a 504 (retryable: true); it is safe to retry with the same request body. Trigger extraction with POST /v3/document-packets/{document_packet_id}/run/.
curl -X POST 'https://api.anyformat.ai/v3/workflows/0686bb97-8c30-70f0-8000-97669e000eb8/upload/from-url/' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "urls": [
      "https://example.com/invoices/april.pdf",
      "https://example.com/invoices/april-annex.pdf"
    ]
  }'
import requests

workflow_id = "0686bb97-8c30-70f0-8000-97669e000eb8"
url = f"https://api.anyformat.ai/v3/workflows/{workflow_id}/upload/from-url/"
headers = {"Authorization": "Bearer YOUR_API_KEY"}

body = {
    "urls": [
        "https://example.com/invoices/april.pdf",
        "https://example.com/invoices/april-annex.pdf",
    ]
}

packet = requests.post(url, headers=headers, json=body).json()
print(packet["document_packet_id"])
{
  "document_packet_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e1",
  "workflow_id": "0686bb97-8c30-70f0-8000-97669e000eb8",
  "files": [
    { "id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e2", "name": "april.pdf" },
    { "id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e3", "name": "april-annex.pdf" }
  ]
}
{
  "error": "Remote fetch failed",
  "detail": "Remote server returned 404",
  "error_code": "VALIDATION_ERROR",
  "retryable": false,
  "request_id": "a1b2c3d4e5f67890abcdef1234567890"
}

Authorizations

Authorization
string
header
required

API key issued from app.anyformat.ai/api-key. Send as Authorization: Bearer <key>.

Path Parameters

workflow_id
string
required

Body

application/json

Body for POST /v3/workflows/{workflow_id}/upload/from-url/.

Every URL imports into a single packet atomically — any fetch or validation failure means nothing is persisted.

urls
string[]
required

HTTPS URLs the backend fetches server-side (1..10). The filename is derived from each URL's path.

Required array length: 1 - 10 elements
Example:
["https://example.com/invoices/april.pdf"]

Response

Successful Response

Response for the packet-creating uploads (multipart and from-url).

document_packet_id
string
required

Unique identifier of the newly created document packet (hyphenated UUID).

Example:

"069dcc2c-e14c-7606-8000-2ee4fb17b4e1"

workflow_id
string
required

The workflow the packet was created under (hyphenated UUID).

Example:

"0686bb97-8c30-70f0-8000-97669e000eb8"

files
DocumentPacketFileV3 · object[]
required

Files in the packet, in the order they were provided.