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"}'
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"])
{
"run_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4fa",
"document_packet_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e1",
"workflow_id": "0686bb97-8c30-70f0-8000-97669e000eb8",
"status": "queued"
}
{
"error": "Remote fetch failed",
"detail": "Remote server returned 404",
"error_code": "VALIDATION_ERROR",
"retryable": false,
"request_id": "a1b2c3d4e5f67890abcdef1234567890"
}
Parse a Document from a URL
Parse one document fetched from a URL with the platform’s fast lite parse
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"}'
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"])
{
"run_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4fa",
"document_packet_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e1",
"workflow_id": "0686bb97-8c30-70f0-8000-97669e000eb8",
"status": "queued"
}
{
"error": "Remote fetch failed",
"detail": "Remote server returned 404",
"error_code": "VALIDATION_ERROR",
"retryable": false,
"request_id": "a1b2c3d4e5f67890abcdef1234567890"
}
POST /v3/parse/. It runs on your organization’s system parse workflow, which the platform provisions on first use.
Provide one HTTPS URL. The response’s Content-Disposition names the file, and the URL’s path names it otherwise. See File names. The response references a run. Poll GET /v3/runs/{run_id}/ until status is processed. The parsed markdown sits at results.parse.markdown. A failed, non-2xx, or timed-out fetch returns 422 with the reason in detail.
The results envelope carries the first file’s parse output. To import several URLs into one packet, use upload from URL and document-packets/run directly.
File names
The response names a from-url file, not the request. The name matters twice. It carries the extension the import requires, and a URL whose path is an opaque key carries none. It is also the name you and your users see wherever the file is listed. The precedence is:- The
Content-Dispositionfilename on the response, per RFC 6266.filename*=UTF-8''…wins overfilename=, and any path is cut to its last segment. - Else the URL path’s last segment:
https://example.com/invoices/april.pdfimports asapril.pdf. - Else the import fails with
422.
urls in length and order. On S3, ResponseContentDisposition signs it in:
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,
)
response-content-disposition on a V4 signed URL, and Azure through rscd on a SAS.
Whichever name applies must end in a supported extension, such as .pdf, .docx or .png. A bare key such as uploads/7c1f3e9a names the file 7c1f3e9a, which has no extension, so the import fails with 422. A name that collides with a file already in the parse workflow is renamed: april.pdf becomes april (1).pdf.
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"}'
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"])
{
"run_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4fa",
"document_packet_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e1",
"workflow_id": "0686bb97-8c30-70f0-8000-97669e000eb8",
"status": "queued"
}
{
"error": "Remote fetch failed",
"detail": "Remote server returned 404",
"error_code": "VALIDATION_ERROR",
"retryable": false,
"request_id": "a1b2c3d4e5f67890abcdef1234567890"
}
Authorizations
API key issued from app.anyformat.ai/api-key. Send as Authorization: Bearer <key>.
Body
Body for POST /v3/parse/from-url/.
The document arrives one of two ways: a fetchable HTTPS url, or the
object_id of a file staged via POST /v3/blobs/slots/ — the id is a
few characters where the staged file's presigned read_url is kilobytes,
so an id-carrying caller (an MCP agent spending a context window) never has
to round-trip the long URL.
HTTPS URL the backend fetches server-side. The file is named by the response's Content-Disposition filename when present, else by the last segment of the URL's path. Pass exactly one of url or object_id.
"https://example.com/invoices/april.pdf"
object_id of a file staged via POST /v3/blobs/slots/, uploaded already. Resolved server-side to the staged bytes, so the long presigned read_url never needs to be passed around. Requires filename. Pass exactly one of url or object_id.
"06a953d9792572568000f838b051ca9b"
Name for the staged file — required with object_id (a staged blob carries no name of its own) and not accepted with url.
255"april.pdf"
Response
Successful Response
202 response for both run triggers (upload/run/ and
document-packets/{id}/run/).
Unique identifier of the new run (hyphenated UUID).
"069dcc2c-e14c-7606-8000-2ee4fb17b4f9"
The document packet the run executes on (hyphenated UUID).
"069dcc2c-e14c-7606-8000-2ee4fb17b4e1"
The workflow being run (hyphenated UUID).
"0686bb97-8c30-70f0-8000-97669e000eb8"
Status at acceptance time — normally queued.
queued, in_progress, processed, error, cancelled "queued"

