cURL example for file URL uploads
cURL is the fastest way to validate that your API key, multipart request, expiry value, and JSON response mapping work before adding application code.
Start with cURL when you need a clean baseline.
A terminal request removes browser, framework, and automation platform behavior from the first test.
Validate auth
Confirm the bearer key works before wiring it into an application or automation credential store.
Inspect JSON
Verify that `url`, `file_id`, `content_type`, and `expires_at` are present before mapping fields onward.
Reproduce errors
Use cURL to reproduce unsupported type, file size, expiry, and auth issues without hidden client code.
Move the same request shape into the runtime that owns the workflow.
After cURL works, keep the field names the same and move the request into a backend, worker, script, or automation HTTP module.
Keep key secret
Use environment variables, worker secrets, or automation credentials instead of hard-coded keys.
Pass only url onward
Most destination APIs need only the direct file URL, not the entire response object.
Store cleanup data
Keep `file_id` and `expires_at` near the job record for delete and retry branches.
Copy the same upload shape into code or workflow steps
Use the same endpoint from a shell, backend route, worker, or automation code step. Upload the file, set expiry, then map the returned URL.
cURL
upload examplecurl -X POST https://api.getfileurl.com/v1/files \
-H 'Authorization: Bearer $GETFILEURL_KEY' \
-F 'file=@invoice.pdf' \
-F 'expires_in=24h'Answers before the workflow breaks
What does the cURL example return?
It returns JSON fields including the direct public URL, file ID, content type, and expiry metadata when a retention window is set.
Where should I store the API key?
Store the key in a server environment variable, worker secret, script secret manager, or trusted automation credential store.
What should I do after getting the URL?
Pass `url` to the next API and store `file_id` if the workflow should delete or inspect the file later.