Skip to content
Documentation/Documents

Upload a public URL

Store the original bytes of a publicly accessible HTTPS file for review or extraction.

Last updated

Markdown
POST/api/v1/upload/urlhttps://api.webcite.co

URL and file limits

Send a public HTTPS URL, not a local file path or a private chat attachment. The fetch forwards no caller credentials or headers and checks every redirect for unsafe addresses. Private, loopback, link-local, metadata and reserved addresses are refused. The streamed body is limited to 100 MB and the fetch deadline is 30 seconds.

Supported bytes: PDF, PNG, JPEG, WebP, DOCX, PPTX, XLSX, XLSM, XLSB, XLS, ODS, CSV, TSV, TXT and MD. An optional display filename must have an extension matching the fetched bytes. Hosted MCP upload_url uses this workflow; hosted base64 upload_file retains its separate 20 MB limit.

Request

Free. Uploading from a URL costs 0 credits.

Examples run on your server. Set WEBCITE_API_KEY first. Python examples use the requests package.

curl
curl --fail-with-body -X POST 'https://api.webcite.co/api/v1/upload/url' \
  -H "x-api-key: $WEBCITE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "url": "https://example.com/report.pdf"
}'

Request body

filenamestring

Display filename. Its extension must match the fetched bytes.

urlstringrequired

Public HTTPS URL of the file. Fetched server-side with no caller credentials or headers; private, loopback, link-local and metadata addresses are refused on every redirect.

Response

HTTP 200 returns the same body as Upload a file: data.asset_id and data.source_version_id with operation_id, usage.credits and credit_usage. Keep these owned identifiers for later review and extraction.

200 response

application/json

credit_usageobject

The charge with a snapshot of the account balance.

Show credit_usage fields
credits_remainingnumber | nullrequired

Credits left in the current billing period after this request.

credits_usednumber | nullrequired

Credits this request deducted. Null when the charge was not recorded.

monthly_allocationnumber | nullrequired

Credits the plan grants each billing period.

operation_idstring | nullrequired

The same identifier as the top-level operation_id.

overage_enabledboolean | nullrequired

Whether the account continues past its allocation on overage billing.

dataobjectrequired
Show data fields
asset_idstringrequired

Identifier to pass to POST /extract and the other document endpoints.

asset_urlstringrequired

Private storage address of the stored bytes. Not a public web address.

filenamestringrequired

The filename sent with the upload.

sizenumberrequired

Size of the stored file in bytes.

source_version_idstringrequired

Immutable identifier of exactly these bytes.

messagestringrequired
operation_idstring | nullrequired

Identifier of this billed operation.

successCodenumberrequired

The HTTP status repeated in the body.

usageobjectrequired

What the upload was charged: 0 credits. Uploading is free.

Show usage fields
creditsnumber | nullrequired

Credits actually deducted; null when a priced operation was not metered. Zero denotes a genuinely free operation.

Errors

400: unsafe or invalid URL or redirect. 413: more than 100 MB. 415: unsupported bytes or filename mismatch. 422: upstream non-2xx or empty body. 504: fetch timeout. An uncertain outcome is not proof that no upload occurred; retain any operation receipt before retrying.

400
URL not allowed (non-https, private address, credentials, bad redirect)
413
File larger than 100 MB
415
Bytes are not a supported format
422
URL returned a non-2xx status or an empty body
504
Fetch timed out
Error handling and retry guidance