How an AI agent uploads a generated file and passes the URL downstream
AI and automation steps often handle JSON better than files. FilePost is the small storage boundary between the step that creates or receives the bytes and the API, browser, or tool that needs a URL.
Generated base64
Send an image, PDF, CSV, or other encoded artifact as JSON and receive a normal public URL response.
Temporary source URL
Copy a public attachment into FilePost before the upstream URL expires, with SSRF-safe URL ingestion.
Downstream handoff
Pass url, file_id, size, and content_type to the next tool or agent.
Upload generated base64 content
curl -X POST https://upload.filepost.dev/v1/upload/base64 \
-H "X-API-Key: fh_your_server_side_key" \
-H "Content-Type: application/json" \
-d '{
"filename": "agent-report.pdf",
"content_type": "application/pdf",
"data_base64": "JVBERi0xLjQK...",
"expires_in": "7d"
}'
Use /v1/upload when the agent already has binary data. Use /v1/upload/url when it has a public HTTP source. Each successful response includes the public URL and file metadata.
Choose permanent or temporary deliberately
Generated previews, intermediate screenshots, and review artifacts should usually have an explicit expiry. Assets that a website, API record, or customer workflow needs to reference later should omit expiry and keep the returned URL.
FilePost public URLs are public by link. Keep API keys in a server-side worker or an automation platform's secret store, and do not use a public URL as an access-control mechanism for sensitive data.
Use it where the workflow already lives
For ready-made paths, import the n8n starters, use the Pipedream recipe, or map the Zapier upload action. For an HTTP-only agent, the API reference is the complete contract.