Copyable examples for turning files into URLs
Start with the smallest working upload request. Then move the same shape into a backend route, worker, script, or automation node.
- Reviewed by
- GetFileURL technical team
- Updated
- Input
- file plus optional visibility
- Output
- url, file_id, content_type, expires_at
- Use in
- backend routes, workers, scripts, automation HTTP nodes
What this page answers
Use cURL first because it removes application code from the request and shows whether auth, upload, and response parsing work.
- Reviewed by
- GetFileURL technical team
- Last updated
One request in, a URL and JSON out
curl -X POST https://api.getfileurl.com/v1/files \
-H 'Authorization: Bearer $GETFILEURL_KEY' \
-F 'file=@workflow-output.pdf' \
-F 'visibility=public'{
"file_id": "file_8ks41p",
"url": "https://cdn.getfileurl.com/f/file_8ks41p/workflow-output.pdf",
"content_type": "application/pdf",
"expires_at": "2026-05-29T10:30:00Z"
}Choose the example that matches where the upload runs.
Keep API keys server-side or in trusted automation credential storage. The returned URL can then be passed to OCR, AI, document, social, or webhook APIs.
cURL
Fastest way to verify auth, multipart upload, expiry, and response fields from a terminal.
JavaScript
Use FormData from a server route, worker, or trusted runtime and return only the fields your app needs.
Python
Use requests in scripts, background jobs, and data pipelines that need a direct public URL.
The same request shape maps to no-code tools.
Automation platforms usually need the same fields: file, expiry, bearer key, and a JSON response path that exposes `url`.
n8n HTTP Request
Attach the binary property as the multipart file field and map `response.url` into the next node.
Make HTTP module
Send a file part, parse the JSON response, and carry file ID into cleanup branches.
Zapier webhook
Upload the attachment field and send the returned URL to the destination action.
Connector starter kits
Inspect unpublished local action templates for Zapier and Pipedream before any marketplace release work.
Common questions
Which example is best for debugging?
Use cURL first because it removes application code from the request and shows whether auth, upload, and response parsing work.
Can I run the JavaScript example in a browser?
Keep account API keys server-side. Browser uploads need a separate scoped upload-session design before exposing credentials publicly.
What field do I map into the next API?
Map `url` to the downstream file URL field and store `file_id` when you need later delete or metadata actions.