Skip to content
Documentation/Documents

Upload a file

Upload a file and keep the returned asset ID for extraction, preview, or document analysis.

Markdown
POST/api/v1/uploadhttps://api.webcite.co

When to use it

Send multipart/form-data with one file field. Let the HTTP client set the multipart boundary. Do not send a local file path as JSON.

The hosted MCP upload tool uses filename and base64 content with a 20 MB limit; that is a separate transport from this HTTP endpoint.

Request

1 credit for a successful upload.

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' \
  -H "x-api-key: $WEBCITE_API_KEY" \
  -F "file=@./report.pdf"

Multipart form

filestringrequired

File to upload

Response

Returns the storage upload result. Keep the asset ID from the response. The public OpenAPI does not yet provide a complete upload response schema. Upload billing is recorded separately and does not add a top-level usage object.

200 response

See the response guidance above. A complete JSON schema is not published for this response.

Errors

An unsuccessful upload uses a non-success HTTP status. A 503 can mean private evidence storage is unavailable. Check the response before starting extraction; an upload failure does not provide a usable asset.

401
Unauthorized - API key required
503
Private evidence storage required: set EVIDENCE_STORAGE_ROOT or EVIDENCE_BUCKET_NAME (I1; never public-first)
Error handling and retry guidance